diff options
author | NeilBrown <neilb@suse.com> | 2018-10-04 15:49:22 +1000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-12-16 12:38:40 +0100 |
commit | 89f9752ea08f516b5d77f8e577bb772073c70c01 (patch) | |
tree | ba50cc1133b37d85da63dda234971a475833ccb5 /hwdb | |
parent | Merge pull request #11143 from keszybz/enable-symlink (diff) | |
download | systemd-89f9752ea08f516b5d77f8e577bb772073c70c01.tar.gz systemd-89f9752ea08f516b5d77f8e577bb772073c70c01.tar.bz2 systemd-89f9752ea08f516b5d77f8e577bb772073c70c01.zip |
core/mount: minimize impact on mount storm.
If we create 2000 mounts (on a 1-CPU qemu VM) with
mkdir -p /MNT/{1..2000}
time for i in {1..2000}; do mount --bind /etc /MNT/$i ; done
it takes around 20 seconds to complete. Much of this time is taken up
by systemd repeatedly processing /proc/self/mountinfo.
If I disable the processing, the time drops to about 4 seconds.
I have reports that on a larger system with multiple active user sessions, each
with it's own systemd, the impact can be higher.
One particular use-case where a large number of mounts can be expected in quick
succession is when the "clearcase" SCM starts up.
This patch modifies the handling up events from /proc/self/mountinfo so
that systemd backs off when a storm is detected. Specifically the time to process
mountinfo is measured, and the process will not be repeated until 10 times
that duration has passed. This ensures systemd won't use more than 10% of
real time processing mountinfo.
With this patch, my test above takes about 5 seconds.
Diffstat (limited to 'hwdb')
0 files changed, 0 insertions, 0 deletions