Re: [PATCH 3/9] xfs: expose sysfs knob to control inode inactivation delay

Darrick J. Wong
2021-06-08T02:02:55Z

On Tue, Jun 08, 2021 at 11:09:36AM +1000, Dave Chinner wrote:
> On Mon, Jun 07, 2021 at 03:25:10PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Allow administrators to control the length that we defer inode
> > inactivation. By default we'll set the delay to 2 seconds, as an
> > arbitrary choice between allowing for some batching of a deltree
> > operation, and not letting too many inodes pile up in memory.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> > Documentation/admin-guide/xfs.rst | 7 +++++++
> > fs/xfs/xfs_globals.c | 3 +++
> > fs/xfs/xfs_icache.c | 3 ++-
> > fs/xfs/xfs_linux.h | 1 +
> > fs/xfs/xfs_sysctl.c | 9 +++++++++
> > fs/xfs/xfs_sysctl.h | 1 +
> > 6 files changed, 23 insertions(+), 1 deletion(-)
> >
> >
> > diff --git a/Documentation/admin-guide/xfs.rst b/Documentation/admin-guide/xfs.rst
> > index f9b109bfc6a6..9dd62b155fda 100644
> > --- a/Documentation/admin-guide/xfs.rst
> > +++ b/Documentation/admin-guide/xfs.rst
> > @@ -277,6 +277,13 @@ The following sysctls are available for the XFS filesystem:
> > references and returns timed-out AGs back to the free stream
> > pool.
> >
> > + fs.xfs.inode_gc_delay
> > + (Units: centiseconds Min: 0 Default: 1 Max: 360000)
> > + The amount of time to delay cleanup work that happens after a file is
> > + closed by all programs. This involves clearing speculative
> > + preallocations from linked files and freeing unlinked files. A higher
> > + value here increases batching at a risk of background work storms.
>
> Can we make new timers use a sane unit of time like milliseconds?

Ok. Changing the name to inode_gc_delay_ms to make the units obvious to
userspace.

--D

>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com