Skip to content

xfs: soft lockups in unmapping and reflink remapping path

Ritesh Harjani (IBM) linux-xfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest1 patch 2 repliesIn review
  2. v31 patch 1 replySuperseded
  3. v21 patch 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Changes in v4 from the cover letter

Remove cond_resched() from defer finish and add it to both the unmap range and reflink remap functions individually.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1xfs: Add cond_resched to block unmap range and reflink remap pathfs/xfs/libxfs/xfs_bmap.c fs/xfs/xfs_reflink.c+2 -02 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchDarrick J. WongDisha Goel
1/1R-b T-b

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

Read the v4 thread

Cover letter [PATCHv4 0/1] xfs: soft lockups in unmapping and reflink remapping path

Hello,

In one of the testcases, parallel async dio writes to a file generates large no. of extents (upto 2M or more), and then this file is cleaned up for running other I/O tests. In the process of deleting this file, soft lockup messages are observed. We believe this is happening due to kernel being busy in unmapping/freeing those extents as part of the transaction processing. This is similar observation with the same call stack which was also reported here [1]. I also tried the qemu-img bench testcase shared in [1], and I was able to reproduce the soft lockup with that on Power.

Similarly another instance was reported where xfs reflink remapping path also saw a similar softlockup problem while iterating over a million extent entries.

So as I understood from that discussion [1], that kernel is moving towards a new preemption model, but IIUC, it is still an ongoing work.
Also IMHO, this is still a problem in upstream and in older stable kernels which we still do support and such a fix might still be necessary for them.

This patch adds the cond_resched() to both xfs_bunmapi_range() and xfs_reflink_remap_blocks() functions.

v3 -> v4:
Remove cond_resched() from defer finish and add it to both the unmap range and reflink remap functions individually.

v2 -> v3:
Move cond_resched within xfs_defer_finish_noroll() loop

Ritesh Harjani (IBM) (1):
xfs: Add cond_resched to block unmap range and reflink remap path

 fs/xfs/libxfs/xfs_bmap.c | 1 +
 fs/xfs/xfs_reflink.c     | 1 +
 2 files changed, 2 insertions(+)

--
2.44.0