Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rhel8]: Switch to BindReadOnlyPaths for /var/lib/containers #3941

Merged
merged 1 commit into from Aug 16, 2022

Conversation

cgwalters
Copy link
Member

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2111817

The way systemd implements InaccessiblePaths involves
recursively traversing all mounted paths in the target root, and
unmounting them; this takes about a tenth of a second in the kernel.
Further, after each unmount, it also re-parses
/proc/self/mountinfo. The combination of these two things
makes handling mounts there O(N²) in userspace CPU time.

The implementation of BindReadOnlyPaths seems better; it just
effectively overmounts, which avoids any O(N²) behavior.

(cherry picked from commit 21c82ff)

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2111817

The way systemd implements `InaccessiblePaths` involves
recursively traversing all mounted paths in the target root, and
unmounting them; this takes about a tenth of a second in the kernel.
Further, after each unmount, it also re-parses
`/proc/self/mountinfo`.  The combination of these two things
makes handling mounts there `O(N²)` in userspace CPU time.

The implementation of `BindReadOnlyPaths` seems better; it just
effectively overmounts, which avoids any `O(N²)` behavior.

(cherry picked from commit 21c82ff)
@cgwalters cgwalters added the rhel8 Work for the rhel8 branch label Aug 16, 2022
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jmarrero jmarrero merged commit 4abaf4b into coreos:rhel8 Aug 16, 2022
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rhel8 Work for the rhel8 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants