* [PATCH] fs/proc: fix softlockup in __read_vmcore (part 2)
@ 2025-01-10 15:28 Rik van Riel
0 siblings, 0 replies; only message in thread
From: Rik van Riel @ 2025-01-10 15:28 UTC (permalink / raw)
To: Baoquan He
Cc: Vivek Goyal, Dave Young, Andrew Morton, kernel-team,
Breno Leitão, kexec, linux-kernel, linux-fsdevel
Since commit 5cbcb62dddf5 ("fs/proc: fix softlockup in __read_vmcore")
the number of softlockups in __read_vmcore at kdump time have gone
down, but they still happen sometimes.
In a memory constrained environment like the kdump image, a softlockup
is not just a harmless message, but it can interfere with things like
RCU freeing memory, causing the crashdump to get stuck.
The second loop in __read_vmcore has a lot more opportunities for
natural sleep points, like scheduling out while waiting for a data
write to happen, but apparently that is not always enough.
Add a cond_resched() to the second loop in __read_vmcore to
(hopefully) get rid of the softlockups.
Signed-off-by: Rik van Riel <riel@surriel.com>
Fixes: 5cbcb62dddf5 ("fs/proc: fix softlockup in __read_vmcore")
Reported-by: Breno Leitao <leitao@debian.org>
---
fs/proc/vmcore.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 3d8a82cee63e..658bf199d424 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -404,6 +404,8 @@ static ssize_t __read_vmcore(struct iov_iter *iter, loff_t *fpos)
if (!iov_iter_count(iter))
return acc;
}
+
+ cond_resched();
}
return acc;
--
2.47.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-10 15:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 15:28 [PATCH] fs/proc: fix softlockup in __read_vmcore (part 2) Rik van Riel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox