linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] fs/dcache: Limit # of negative dentries
@ 2017-07-21 13:43 Waiman Long
  2017-07-21 13:43 ` [PATCH v2 1/4] fs/dcache: Limit numbers " Waiman Long
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Waiman Long @ 2017-07-21 13:43 UTC (permalink / raw)
  To: Alexander Viro, Jonathan Corbet
  Cc: linux-kernel, linux-doc, linux-fsdevel, Paul E. McKenney,
	Andrew Morton, Ingo Molnar, Miklos Szeredi, Matthew Wilcox,
	Larry Woodman, Waiman Long

 v1->v2:
  - Move the new nr_negative field to the end of dentry_stat_t structure
    as suggested by Matthew Wilcox.
  - With the help of Miklos Szeredi, fix incorrect locking order in
    dentry_kill() by using lock_parent() instead of locking the parent's
    d_lock directly.
  - Correctly account for positive to negative dentry transitions.
  - Automatic pruning of negative dentries will now ignore the reference
    bit in negative dentries but not the regular shrinking.

A rogue application can potentially create a large number of negative
dentries in the system consuming most of the memory available. This
can impact performance of other applications running on the system.

This patchset introduces changes to the dcache subsystem to limit
the number of negative dentries allowed to be created thus limiting
the amount of memory that can be consumed by negative dentries.

Patch 1 tracks the number of negative dentries used and disallow
the creation of more when the limit is reached.

Patch 2 enables /proc/sys/fs/dentry-state to report the number of
negative dentries in the system.

Patch 3 enables automatic pruning of negative dentries when it is
close to the limit so that we won't end up killing recently used
negative dentries.

Patch 4 prevents racing between negative dentry pruning and umount
operation.

Waiman Long (4):
  fs/dcache: Limit numbers of negative dentries
  fs/dcache: Report negative dentry number in dentry-state
  fs/dcache: Enable automatic pruning of negative dentries
  fs/dcache: Protect negative dentry pruning from racing with umount

 Documentation/admin-guide/kernel-parameters.txt |   7 +
 fs/dcache.c                                     | 408 ++++++++++++++++++++++--
 include/linux/dcache.h                          |   8 +-
 include/linux/list_lru.h                        |   1 +
 mm/list_lru.c                                   |   4 +-
 5 files changed, 392 insertions(+), 36 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-24 15:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21 13:43 [PATCH v2 0/4] fs/dcache: Limit # of negative dentries Waiman Long
2017-07-21 13:43 ` [PATCH v2 1/4] fs/dcache: Limit numbers " Waiman Long
2017-07-21 13:43 ` [PATCH v2 2/4] fs/dcache: Report negative dentry number in dentry-state Waiman Long
2017-07-21 13:43 ` [PATCH v2 3/4] fs/dcache: Enable automatic pruning of negative dentries Waiman Long
2017-07-21 19:30   ` James Bottomley
2017-07-21 20:17     ` Waiman Long
2017-07-21 23:07       ` James Bottomley
2017-07-24 15:54         ` Waiman Long
2017-07-21 13:43 ` [PATCH v2 4/4] fs/dcache: Protect negative dentry pruning from racing with umount Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).