Skip to content

writeback: Avoid lockups when switching inodes

Jan Kara linux-fsdevel 2 versions – Applied

Status from this message: Applied to the vfs-6.18.writeback branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 7 repliesApplied
  2. v14 patches 9 repliesSuperseded

Changes in v2 from the cover letter

* 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.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4writeback: Avoid contention on wb->list_lock when switching inodesfs/fs-writeback.c include/linux/backing-dev-defs.h include/linux/writeback.h +1 more+75 -364 replies
2/4writeback: Avoid softlockup when switching many inodesfs/fs-writeback.c+10 -10 replies
3/4writeback: Avoid excessively long inode switching timesfs/fs-writeback.c+11 -100 replies
4/4writeback: Add tracepoint to track pending inode switchesfs/fs-writeback.c include/trace/events/writeback.h+31 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTejun Heo
SeriesA-b
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] writeback: Avoid lockups when switching inodes

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: