kernel_optimize_test/fs/xfs
Brian Foster e0d76fa447 xfs: prevent quotacheck from overloading inode lru
Quotacheck runs at mount time in situations where quota accounting must
be recalculated. In doing so, it uses bulkstat to visit every inode in
the filesystem. Historically, every inode processed during quotacheck
was released and immediately tagged for reclaim because quotacheck runs
before the superblock is marked active by the VFS. In other words,
the final iput() lead to an immediate ->destroy_inode() call, which
allowed the XFS background reclaim worker to start reclaiming inodes.

Commit 17c12bcd3 ("xfs: when replaying bmap operations, don't let
unlinked inodes get reaped") marks the XFS superblock active sooner as
part of the mount process to support caching inodes processed during log
recovery. This occurs before quotacheck and thus means all inodes
processed by quotacheck are inserted to the LRU on release.  The
s_umount lock is held until the mount has completed and thus prevents
the shrinkers from operating on the sb. This means that quotacheck can
excessively populate the inode LRU and lead to OOM conditions on systems
without sufficient RAM.

Update the quotacheck bulkstat handler to set XFS_IGET_DONTCACHE on
inodes processed by quotacheck. This causes ->drop_inode() to return 1
and in turn causes iput_final() to evict the inode. This preserves the
original quotacheck behavior and prevents it from overloading the LRU
and running out of memory.

CC: stable@vger.kernel.org # v4.9
Reported-by: Martin Svec <martin.svec@zoner.cz>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2017-01-27 09:32:30 -08:00
..
libxfs xfs: extsize hints are not unlikely in xfs_bmap_btalloc 2017-01-25 08:59:43 -08:00
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
uuid.c
uuid.h
xfs_acl.c
xfs_acl.h
xfs_aops.c xfs: Timely free truncated dirty pages 2017-01-11 10:20:04 -08:00
xfs_aops.h
xfs_attr_inactive.c
xfs_attr_list.c
xfs_attr.h
xfs_bmap_item.c
xfs_bmap_item.h
xfs_bmap_util.c xfs: fix bmv_count confusion w/ shared extents 2017-01-26 09:50:30 -08:00
xfs_bmap_util.h
xfs_buf_item.c
xfs_buf_item.h
xfs_buf.c xfs: clear _XBF_PAGES from buffers when readahead page 2017-01-25 20:24:57 -08:00
xfs_buf.h
xfs_dir2_readdir.c
xfs_discard.c
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c xfs: don't wrap ID in xfs_dq_get_next_id 2017-01-17 11:43:38 -08:00
xfs_dquot.h
xfs_error.c
xfs_error.h
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c
xfs_filestream.c
xfs_filestream.h
xfs_fsops.c xfs: use the actual AG length when reserving blocks 2017-01-03 18:39:33 -08:00
xfs_fsops.h
xfs_globals.c
xfs_icache.c xfs: fix crash and data corruption due to removal of busy COW extents 2017-01-03 18:39:33 -08:00
xfs_icache.h
xfs_icreate_item.c
xfs_icreate_item.h
xfs_inode_item.c
xfs_inode_item.h
xfs_inode.c xfs: use per-AG reservations for the finobt 2017-01-25 07:49:35 -08:00
xfs_inode.h
xfs_ioctl32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
xfs_ioctl32.h
xfs_ioctl.c Merge uncontroversial parts of branch 'readlink' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs 2016-12-17 19:16:12 -08:00
xfs_ioctl.h
xfs_iomap.c xfs: fix COW writeback race 2017-01-23 10:55:07 -08:00
xfs_iomap.h
xfs_iops.c xfs: sanity check inode mode when creating new dentry 2017-01-17 11:42:22 -08:00
xfs_iops.h
xfs_itable.c
xfs_itable.h
xfs_linux.h xfs: make the ASSERT() condition likely 2017-01-17 11:41:41 -08:00
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c
xfs_log.c xfs: don't print warnings when xfs_log_force fails 2017-01-09 13:45:01 -08:00
xfs_log.h
xfs_message.c
xfs_message.h
xfs_mount.c
xfs_mount.h xfs: use per-AG reservations for the finobt 2017-01-25 07:49:35 -08:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_ondisk.h
xfs_pnfs.c
xfs_pnfs.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c xfs: prevent quotacheck from overloading inode lru 2017-01-27 09:32:30 -08:00
xfs_qm.h
xfs_quota.h
xfs_quotaops.c
xfs_refcount_item.c xfs: fix double-cleanup when CUI recovery fails 2017-01-03 18:39:32 -08:00
xfs_refcount_item.h
xfs_reflink.c vfs: fix isize/pos/len checks for reflink & dedupe 2016-12-22 23:00:23 -05:00
xfs_reflink.h
xfs_rmap_item.c
xfs_rmap_item.h
xfs_rtalloc.c
xfs_rtalloc.h
xfs_stats.c
xfs_stats.h
xfs_super.c
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c
xfs_sysctl.h
xfs_sysfs.c xfs: fix max_retries _show and _store functions 2017-01-03 20:34:17 -08:00
xfs_sysfs.h
xfs_trace.c
xfs_trace.h
xfs_trans_ail.c
xfs_trans_bmap.c
xfs_trans_buf.c
xfs_trans_dquot.c
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_refcount.c
xfs_trans_rmap.c
xfs_trans.c
xfs_trans.h
xfs_xattr.c
xfs.h