From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavel Machek <pavel@ucw.cz>, Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Waiman Long <longman@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Paul McKenney <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@kernel.org>,
Miklos Szeredi <mszeredi@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Larry Woodman <lwoodman@redhat.com>,
"Wangkai (Kevin,C)" <wangkai86@huawei.com>,
linux-mm <linux-mm@kvack.org>, Michal Hocko <mhocko@kernel.org>
Subject: Re: [PATCH v5 0/6] fs/dcache: Track & limit # of negative dentries
Date: Sat, 14 Jul 2018 19:36:57 +0100 [thread overview]
Message-ID: <20180714183657.GK30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180714183445.GJ30522@ZenIV.linux.org.uk>
On Sat, Jul 14, 2018 at 07:34:45PM +0100, Al Viro wrote:
> On Sat, Jul 14, 2018 at 11:00:32AM -0700, Linus Torvalds wrote:
> > On Sat, Jul 14, 2018 at 10:35 AM Pavel Machek <pavel@ucw.cz> wrote:
> > >
> > > Could we allocate -ve entries from separate slab?
> >
> > No, because negative dentrires don't stay negative.
> >
> > Every single positive dentry starts out as a negative dentry that is
> > passed in to "lookup()" to maybe be made positive.
> >
> > And most of the time they <i>do</i> turn positive, because most of the
> > time people actually open files that exist.
> >
> > But then occasionally you don't, because you're just blindly opening a
> > filename whether it exists or not (to _check_ whether it's there).
>
> BTW, one point that might not be realized by everyone: negative dentries
> are *not* the hard case.
> mount -t tmpfs none /mnt
> touch /mnt/a
> for i in `seq 100000`; do ln /mnt/a /mnt/$i; done
>
> and you've got 100000 *unevictable* dentries, with the time per iteration
> being not all that high (especially if you just call link(2) in a loop).
> They are all positive and all pinned. And you've got only one inode
> there and no persistently opened files, so rlimit and quota won't help
> any.
OK, this
/*
* No ordinary (disk based) filesystem counts links as inodes;
* but each new link needs a new dentry, pinning lowmem, and
* tmpfs dentries cannot be pruned until they are unlinked.
*/
ret = shmem_reserve_inode(inode->i_sb);
if (ret)
goto out;
will probably help (on ramfs it won't, though).
next prev parent reply other threads:[~2018-07-14 18:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 5:51 [PATCH v5 0/6] fs/dcache: Track & limit # of negative dentries Waiman Long
2018-07-02 5:51 ` [PATCH v5 1/6] fs/dcache: Track & report number " Waiman Long
2018-07-02 5:51 ` [PATCH v5 2/6] fs/dcache: Make negative dentry tracking configurable Waiman Long
2018-07-02 21:12 ` Andrew Morton
2018-07-03 0:59 ` Waiman Long
2018-07-02 5:52 ` [PATCH v5 3/6] fs/dcache: Enable automatic pruning of negative dentries Waiman Long
2018-07-02 5:52 ` [PATCH v5 4/6] fs/dcache: Spread negative dentry pruning across multiple CPUs Waiman Long
2018-07-02 5:52 ` [PATCH v5 5/6] fs/dcache: Allow optional enforcement of negative dentry limit Waiman Long
2018-07-02 5:52 ` [PATCH v5 6/6] fs/dcache: Make negative dentry limit enforcement sysctl parameter Waiman Long
2018-07-02 19:34 ` [PATCH v5 0/6] fs/dcache: Track & limit # of negative dentries Linus Torvalds
2018-07-02 21:18 ` Andrew Morton
2018-07-02 22:21 ` Matthew Wilcox
2018-07-02 22:31 ` Linus Torvalds
2018-07-02 22:34 ` James Bottomley
2018-07-02 22:54 ` Linus Torvalds
2018-07-02 23:03 ` Linus Torvalds
2018-07-02 23:19 ` Andrew Morton
2018-07-02 23:28 ` Linus Torvalds
2018-07-03 1:38 ` Waiman Long
2018-07-03 9:18 ` Jan Kara
2018-07-14 17:35 ` Pavel Machek
2018-07-14 18:00 ` Linus Torvalds
2018-07-14 18:34 ` Al Viro
2018-07-14 18:36 ` Al Viro [this message]
2018-07-14 18:43 ` Linus Torvalds
2018-07-18 16:01 ` Waiman Long
2018-07-03 1:11 ` Waiman Long
2018-07-03 13:48 ` Vlastimil Babka
2018-07-03 0:46 ` 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=20180714183657.GK30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=James.Bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=lwoodman@redhat.com \
--cc=mhocko@kernel.org \
--cc=mingo@kernel.org \
--cc=mszeredi@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pavel@ucw.cz \
--cc=torvalds@linux-foundation.org \
--cc=wangkai86@huawei.com \
--cc=willy@infradead.org \
/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).