]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: Implement sync_with_progress() 6598/head
authorKyle Walker <kwalker@redhat.com>
Thu, 14 Dec 2017 16:46:03 +0000 (11:46 -0500)
committerKyle Walker <kwalker@redhat.com>
Thu, 14 Dec 2017 16:46:03 +0000 (11:46 -0500)
commit73ad712fcfea5d8ba475044698d31d2c15d4180d
tree65f771cb8dd34680371eaa75c4d65dc883654b35
parentd5641e0d7e8f55937fbc3a7ecd667e42c5836d80
core: Implement sync_with_progress()

In similar fashion to the previous change, sync() operations can stall
endlessly if cache is unable to be written out. In order to avoid an
unbounded hang, the sync takes place within a child process. Every 10
seconds (SYNC_TIMEOUT_USEC), the value of /proc/meminfo "Dirty" is checked
to verify it is smaller than the last iteration. If the sync is not making
progress for 3 successive iterations (SYNC_PROGRESS_ATTEMPTS), a SIGKILL is
sent to the sync process and the shutdown continues.
src/core/shutdown.c