From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nikolay Borisov <nborisov@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Khazhismel Kumykov <khazhy@google.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
David Rientjes <rientjes@google.com>,
Goldwyn Rodrigues <rgoldwyn@suse.de>,
Jeff Mahoney <jeffm@suse.com>,
Davidlohr Bueso <dave@stgolabs.net>
Subject: Re: [PATCH] fs/dcache.c: re-add cond_resched() in shrink_dcache_parent()
Date: Sat, 14 Apr 2018 21:58:46 +0100 [thread overview]
Message-ID: <20180414205846.GW30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFz4fwzcUWWT78AxK+GeVNVveWPNS+=V+ppb1ksn56TjUA@mail.gmail.com>
On Sat, Apr 14, 2018 at 09:36:23AM -0700, Linus Torvalds wrote:
> But it does *not* make sense for the case where we've hit a dentry
> that is already on the shrink list. Sure, we'll continue to gather all
> the other dentries, but if there is concurrent shrinking, shouldn't we
> give up the CPU more eagerly - *particularly* if somebody else is
> waiting (it might be the other process that actually gets rid of the
> shrinking dentries!)?
>
> So my gut feel is that we should at least try doing something like
> this in select_collect():
>
> - if (!list_empty(&data->dispose))
> + if (data->found)
> ret = need_resched() ? D_WALK_QUIT : D_WALK_NORETRY;
>
> because even if we haven't actually been able to shrink something, if
> we hit an already shrinking entry we should probably at least not do
> the "retry for rename". And if we actually are going to reschedule, we
> might as well start from the beginning.
>
> I realize that *this* thread might not be making any actual progress
> (because it didn't find any dentries to shrink), but since it did find
> _a_ dentry that is being shrunk, we know the operation itself - on a
> bigger scale - is making progress.
>
> Hmm?
That breaks d_invalidate(), unfortunately. Look at the termination
conditions in the loop there...
next prev parent reply other threads:[~2018-04-14 20:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180413181350.88831-1-khazhy@google.com>
2018-04-13 20:28 ` [PATCH] fs/dcache.c: re-add cond_resched() in shrink_dcache_parent() Khazhismel Kumykov
2018-04-13 21:14 ` Andrew Morton
2018-04-14 7:00 ` Nikolay Borisov
2018-04-14 8:02 ` Al Viro
2018-04-14 16:36 ` Linus Torvalds
2018-04-14 20:58 ` Al Viro [this message]
2018-04-14 21:47 ` Linus Torvalds
2018-04-15 0:51 ` Al Viro
2018-04-15 2:39 ` Al Viro
2018-04-15 14:21 ` Al Viro
2018-04-15 18:34 ` Linus Torvalds
2018-04-15 20:40 ` Al Viro
2018-04-15 21:54 ` Al Viro
2018-04-15 22:34 ` Al Viro
2018-04-16 18:28 ` Khazhismel Kumykov
2018-04-13 21:15 ` David Rientjes
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=20180414205846.GW30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=jeffm@suse.com \
--cc=khazhy@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=rgoldwyn@suse.de \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.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