linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Miklos Szeredi <mszeredi@redhat.com>,
	Waiman Long <longman@redhat.com>
Subject: [PATCH 0/4] fs/dcache: Limit # of negative dentries
Date: Mon, 17 Jul 2017 09:39:29 -0400	[thread overview]
Message-ID: <1500298773-7510-1-git-send-email-longman@redhat.com> (raw)

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.

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                                     | 312 +++++++++++++++++++++++-
 include/linux/dcache.h                          |   8 +-
 include/linux/list_lru.h                        |   1 +
 mm/list_lru.c                                   |   4 +-
 5 files changed, 327 insertions(+), 5 deletions(-)

-- 
1.8.3.1

             reply	other threads:[~2017-07-17 13:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 13:39 Waiman Long [this message]
2017-07-17 13:39 ` [PATCH 1/4] fs/dcache: Limit numbers of negative dentries Waiman Long
2017-07-17 17:49   ` Matthew Wilcox
2017-07-17 18:31     ` Waiman Long
2017-07-19 14:39   ` Miklos Szeredi
2017-07-19 15:02     ` Waiman Long
2017-07-19 20:24   ` Miklos Szeredi
2017-07-19 20:42     ` Waiman Long
2017-07-20  7:20       ` Miklos Szeredi
2017-07-20 14:21         ` Waiman Long
2017-07-20 15:08           ` Miklos Szeredi
2017-07-20 15:46             ` Waiman Long
2017-07-17 13:39 ` [PATCH 2/4] fs/dcache: Report negative dentry number in dentry-state Waiman Long
2017-07-17 14:09   ` Matthew Wilcox
2017-07-17 14:39     ` Waiman Long
2017-07-17 13:39 ` [PATCH 3/4] fs/dcache: Enable automatic pruning of negative dentries Waiman Long
2017-07-17 13:39 ` [PATCH 4/4] fs/dcache: Protect negative dentry pruning from racing with umount Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500298773-7510-1-git-send-email-longman@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).