coredump: add cond_resched() to dump_user_range

The loop between elf_core_dump() and dump_user_range() can run for
so long that the system shows softlockup messages, with side effects
like workqueues and RCU getting stuck on the core dumping CPU.

Add a cond_resched() in dump_user_range() to avoid that softlockup.

Signed-off-by: Rik van Riel <riel@surriel.com>
Link: https://lore.kernel.org/r/20241010113651.50cb0366@imladris.surriel.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Rik van Riel 2024-10-10 11:36:51 -04:00 committed by Christian Brauner
parent 98f3ac9ba0
commit 0dfcb72d33
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -951,6 +951,7 @@ int dump_user_range(struct coredump_params *cprm, unsigned long start,
} else { } else {
dump_skip(cprm, PAGE_SIZE); dump_skip(cprm, PAGE_SIZE);
} }
cond_resched();
} }
dump_page_free(dump_page); dump_page_free(dump_page);
return 1; return 1;