]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/xfs/xfs_log_priv.h
xfs: Throttle commits on delayed background CIL push
authorDave Chinner <dchinner@redhat.com>
Wed, 25 Mar 2020 03:10:27 +0000 (20:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 27 Mar 2020 15:32:54 +0000 (08:32 -0700)
commit0e7ab7efe77451cba4cbecb6c9f5ef83cf32b36b
tree348bd3ee444acf68dcac446a3ccd0489d98dfee1
parent108a42358a05312b2128533c6462a3fdeb410bdf
xfs: Throttle commits on delayed background CIL push

In certain situations the background CIL push can be indefinitely
delayed. While we have workarounds from the obvious cases now, it
doesn't solve the underlying issue. This issue is that there is no
upper limit on the CIL where we will either force or wait for
a background push to start, hence allowing the CIL to grow without
bound until it consumes all log space.

To fix this, add a new wait queue to the CIL which allows background
pushes to wait for the CIL context to be switched out. This happens
when the push starts, so it will allow us to block incoming
transaction commit completion until the push has started. This will
only affect processes that are running modifications, and only when
the CIL threshold has been significantly overrun.

This has no apparent impact on performance, and doesn't even trigger
until over 45 million inodes had been created in a 16-way fsmark
test on a 2GB log. That was limiting at 64MB of log space used, so
the active CIL size is only about 3% of the total log in that case.
The concurrent removal of those files did not trigger the background
sleep at all.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_trace.h