From: Rik van Riel Date: Tue, 7 May 2024 13:18:58 +0000 (-0400) Subject: fs/proc: fix softlockup in __read_vmcore X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5cbcb62dddf5346077feb82b7b0c9254222d3445;p=linux.git fs/proc: fix softlockup in __read_vmcore While taking a kernel core dump with makedumpfile on a larger system, softlockup messages often appear. While softlockup warnings can be harmless, they can also interfere with things like RCU freeing memory, which can be problematic when the kdump kexec image is configured with as little memory as possible. Avoid the softlockup, and give things like work items and RCU a chance to do their thing during __read_vmcore by adding a cond_resched. Link: https://lkml.kernel.org/r/20240507091858.36ff767f@imladris.surriel.com Signed-off-by: Rik van Riel Acked-by: Baoquan He Cc: Dave Young Cc: Vivek Goyal Cc: Signed-off-by: Andrew Morton --- diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 5d08d4d159d30..b52d85f8ad592 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -383,6 +383,8 @@ static ssize_t __read_vmcore(struct iov_iter *iter, loff_t *fpos) /* leave now if filled buffer already */ if (!iov_iter_count(iter)) return acc; + + cond_resched(); } list_for_each_entry(m, &vmcore_list, list) {