All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christian Brauner <brauner@kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, Tejun Heo <tj@kernel.org>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH v2 0/4] writeback: Avoid lockups when switching inodes
Date: Fri, 12 Sep 2025 12:38:34 +0200	[thread overview]
Message-ID: <20250912103522.2935-1-jack@suse.cz> (raw)

Hello!

This patch series addresses lockups reported by users when systemd unit reading
lots of files from a filesystem mounted with lazytime mount option exits. See
patch 3 for more details about the reproducer.

There are two main issues why switching many inodes between wbs:

1) Multiple workers will be spawned to do the switching but they all contend
on the same wb->list_lock making all the parallelism pointless and just
wasting time.

2) Sorting of wb->b_dirty list by dirtied_time_when is inherently slow.

Patches 1-3 address these problems, patch 4 adds a tracepoint for better
observability of inode writeback switching.

Changes since v1:
* Added Acked-by's from Tejun
* Modified patch 1 to directly insert isw items into a list of switches to
  make instead of queueing rcu_work for that. This actually speeded up
  large scale switching about 2x.

								Honza

Previous versions:
Link: http://lore.kernel.org/r/20250909143734.30801-1-jack@suse.cz # v1

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12 10:38 Jan Kara [this message]
2025-09-12 10:38 ` [PATCH v2 1/4] writeback: Avoid contention on wb->list_lock when switching inodes Jan Kara
2025-09-12 16:15   ` Tejun Heo
2025-09-12 16:39     ` Jan Kara
2025-09-12 16:52       ` Tejun Heo
2025-09-12 16:20   ` Tejun Heo
2025-09-12 10:38 ` [PATCH v2 2/4] writeback: Avoid softlockup when switching many inodes Jan Kara
2025-09-12 10:38 ` [PATCH v2 3/4] writeback: Avoid excessively long inode switching times Jan Kara
2025-09-12 10:38 ` [PATCH v2 4/4] writeback: Add tracepoint to track pending inode switches Jan Kara
2025-09-15 12:50 ` [PATCH v2 0/4] writeback: Avoid lockups when switching inodes Christian Brauner
2025-09-15 15:13   ` Jan Kara
2025-09-19 11:09     ` Christian Brauner

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=20250912103522.2935-1-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.