The patch titled Subject: ocfs2: fix potential soft lockup during fstrim has been added to the -mm tree. Its filename is ocfs2-fix-potential-soft-lockup-during-fstrim.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/ocfs2-fix-potential-soft-lockup-during-fstrim.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-fix-potential-soft-lockup-during-fstrim.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Gang He <ghe@xxxxxxxx> Subject: ocfs2: fix potential soft lockup during fstrim When we discard unused blocks on a mounted ocfs2 filesystem, fstrim handles each block goup with locking/unlocking global bitmap meta-file repeatedly. we should let fstrim thread take a break(if need) between unlock and lock, this will avoid the potential soft lockup problem, and also gives the upper applications more IO opportunities, these applications are not blocked for too long at writing files. Link: https://lkml.kernel.org/r/20200927015815.14904-1-ghe@xxxxxxxx Signed-off-by: Gang He <ghe@xxxxxxxx> Reviewed-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> Cc: Mark Fasheh <mark@xxxxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Cc: Junxiao Bi <junxiao.bi@xxxxxxxxxx> Cc: Changwei Ge <gechangwei@xxxxxxx> Cc: Jun Piao <piaojun@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ocfs2/alloc.c~ocfs2-fix-potential-soft-lockup-during-fstrim +++ a/fs/ocfs2/alloc.c @@ -7654,8 +7654,10 @@ out_mutex: * main_bm related locks for avoiding the current IO starve, then go to * trim the next group */ - if (ret >= 0 && group <= last_group) + if (ret >= 0 && group <= last_group) { + cond_resched(); goto next_group; + } out: range->len = trimmed * sb->s_blocksize; return ret; _ Patches currently in -mm which might be from ghe@xxxxxxxx are ocfs2-fix-potential-soft-lockup-during-fstrim.patch