linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/4] writeback: Avoid contention on wb->list_lock when switching inodes
Date: Wed, 10 Sep 2025 07:10:12 -1000	[thread overview]
Message-ID: <aMGw9AjS11coqPF_@slm.duckdns.org> (raw)
In-Reply-To: <6wl26xqf6kvaz4527m7dy2dng5tu22qxva2uf2fi4xtzuzqxwx@l5re7vgx6zlz>

Hello, Jan.

On Wed, Sep 10, 2025 at 10:19:36AM +0200, Jan Kara wrote:
> Well, reducing @max_active to 1 will certainly deal with the list_lock
> contention as well. But I didn't want to do that as on a busy container
> system I assume there can be switching happening between different pairs of
> cgroups. With the approach in this patch switches with different target
> cgroups can still run in parallel. I don't have any real world data to back
> that assumption so if you think this parallelism isn't really needed and we
> are fine with at most one switch happening in the system, switching
> max_active to 1 is certainly simple enough.

What bothers me is that the concurrency doesn't match between the work items
being scheduled and the actual execution and we're resolving that by early
exiting from some work items. It just feels like an roundabout way to do it
with extra code. I think there are better ways to achieve per-bdi_writeback
concurrency:

- Move work_struct from isw to bdi_writeback and schedule the work item on
  the target wb which processes isw's queued on the bdi_writeback.

- Or have a per-wb workqueue with max_active limit so that concurrency is
  regulated per-wb.

The latter is a bit simpler but does cost more memory as workqueue_struct
isn't tiny. The former is a bit more complicated but most likely less so
than the current code. What do you think?

Thanks.

-- 
tejun

  reply	other threads:[~2025-09-10 17:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 14:44 [PATCH 0/4] writeback: Avoid lockups when switching inodes Jan Kara
2025-09-09 14:44 ` [PATCH 1/4] writeback: Avoid contention on wb->list_lock " Jan Kara
2025-09-09 16:52   ` Tejun Heo
2025-09-10  8:19     ` Jan Kara
2025-09-10 17:10       ` Tejun Heo [this message]
2025-09-11 11:30         ` Jan Kara
2025-09-11 12:01           ` Jan Kara
2025-09-12 10:39             ` Jan Kara
2025-09-09 14:44 ` [PATCH 2/4] writeback: Avoid softlockup when switching many inodes Jan Kara
2025-09-09 16:55   ` Tejun Heo
2025-09-09 14:44 ` [PATCH 3/4] writeback: Avoid excessively long inode switching times Jan Kara
2025-09-09 16:56   ` Tejun Heo
2025-09-09 14:44 ` [PATCH 4/4] writeback: Add tracepoint to track pending inode switches Jan Kara
2025-09-09 16:57   ` Tejun Heo

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=aMGw9AjS11coqPF_@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.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).