summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRik van Riel <riel@surriel.com>2025-01-10 10:28:21 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:17:14 +0100
commit65c367bd9d4f43513c7f837df5753bea9561b836 (patch)
tree7f561aed1fff05434e324a313555554b886a03d4
parent80fc836f3ebe2f2d2d2c80c698b7667974285a04 (diff)
downloadlinux-65c367bd9d4f43513c7f837df5753bea9561b836.tar.gz
linux-65c367bd9d4f43513c7f837df5753bea9561b836.tar.bz2
linux-65c367bd9d4f43513c7f837df5753bea9561b836.zip
fs/proc: fix softlockup in __read_vmcore (part 2)
commit cbc5dde0a461240046e8a41c43d7c3b76d5db952 upstream. 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. Link: https://lkml.kernel.org/r/20250110102821.2a37581b@fangorn Fixes: 5cbcb62dddf5 ("fs/proc: fix softlockup in __read_vmcore") Signed-off-by: Rik van Riel <riel@surriel.com> Reported-by: Breno Leitao <leitao@debian.org> Cc: Baoquan He <bhe@redhat.com> Cc: Dave Young <dyoung@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/proc/vmcore.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 147cc771d5a6..3f5a4a5e1a82 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;