From: Trond Myklebust <trondmy@hammerspace.com>
To: "tj@kernel.org" <tj@kernel.org>
Cc: "jiangshanlai@gmail.com" <jiangshanlai@gmail.com>,
"mhocko@suse.com" <mhocko@suse.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"neilb@suse.de" <neilb@suse.de>
Subject: Re: [PATCH rfc] workqueue: honour cond_resched() more effectively.
Date: Mon, 9 Nov 2020 14:11:42 +0000 [thread overview]
Message-ID: <d2c79d91e29134ef6184138de5fc856ca530d2a5.camel@hammerspace.com> (raw)
In-Reply-To: <20201109140141.GE7496@mtj.duckdns.org>
On Mon, 2020-11-09 at 09:01 -0500, tj@kernel.org wrote:
> Hello,
>
> On Mon, Nov 09, 2020 at 01:50:40PM +0000, Trond Myklebust wrote:
> > > I'm thinking the real problem is that you're abusing workqueues.
> > > Just
> > > don't stuff so much work into it that this becomes a problem. Or
> > > rather,
> > > if you do, don't lie to it about it.
> >
> > If we can't use workqueues to call iput_final() on an inode, then
> > what
> > is the point of having them at all?
> >
> > Neil's use case is simply a file that has managed to accumulate a
> > seriously large page cache, and is therefore taking a long time to
> > complete the call to truncate_inode_pages_final(). Are you saying
> > we
> > have to allocate a dedicated thread for every case where this
> > happens?
>
> I think the right thing to do here is setting CPU_INTENSIVE or using
> an
> unbound workqueue. Concurrency controlled per-cpu workqueue is
> unlikely to
> be a good fit if the work can run long enough to need cond_resched().
> Better
> to let the scheduler handle it. Making workqueue warn against long-
> running
> concurrency managed per-cpu work items would be great. I'll put that
> on my
> todo list but if anyone is interested please be my guest.
>
That means changing all filesystem code to use cpu-intensive queues. As
far as I can tell, they all use workqueues (most of them using the
standard system queue) for fput(), dput() and/or iput() calls.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2020-11-09 14:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 2:54 [PATCH rfc] workqueue: honour cond_resched() more effectively NeilBrown
2020-11-09 7:50 ` Michal Hocko
2020-11-09 8:00 ` Peter Zijlstra
2020-11-09 13:50 ` Trond Myklebust
2020-11-09 14:01 ` tj
2020-11-09 14:11 ` Trond Myklebust [this message]
2020-11-09 16:10 ` tj
2020-11-17 22:16 ` NeilBrown
[not found] ` <20201118025820.307-1-hdanton@sina.com>
2020-11-18 5:11 ` NeilBrown
[not found] ` <20201118055108.358-1-hdanton@sina.com>
2020-11-19 23:07 ` NeilBrown
2020-12-02 20:20 ` tj
[not found] ` <20201120025953.607-1-hdanton@sina.com>
2020-11-20 4:33 ` NeilBrown
[not found] ` <20201126100646.1790-1-hdanton@sina.com>
2020-11-26 23:44 ` NeilBrown
2020-11-19 23:23 ` NeilBrown
2020-11-25 12:36 ` tj
2020-11-26 23:30 ` NeilBrown
2020-11-09 14:20 ` Peter Zijlstra
2020-11-10 2:26 ` NeilBrown
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=d2c79d91e29134ef6184138de5fc856ca530d2a5.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=jiangshanlai@gmail.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=neilb@suse.de \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.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).