]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/proc: fix softlockup in __read_vmcore
authorRik van Riel <riel@surriel.com>
Tue, 7 May 2024 13:18:58 +0000 (09:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:08:18 +0000 (09:08 +0200)
commit 5cbcb62dddf5346077feb82b7b0c9254222d3445 upstream.

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 <riel@surriel.com>
Acked-by: 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>
fs/proc/vmcore.c

index b1102a31a108527b49684e4b8bee72cf64dac13e..80d90436861332fb75118d9dccfbf8f3401fffc2 100644 (file)
@@ -374,6 +374,8 @@ static ssize_t __read_vmcore(char *buffer, size_t buflen, loff_t *fpos,
                /* leave now if filled buffer already */
                if (buflen == 0)
                        return acc;
+
+               cond_resched();
        }
 
        list_for_each_entry(m, &vmcore_list, list) {