mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coredump: add cond_resched() to dump_user_range
@ 2024-10-10 15:36 Rik van Riel
  2024-10-14 14:59 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2024-10-10 15:36 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Christian Brauner, Jan Kara, linux-fsdevel, linux-kernel, kernel-team

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>
---
 fs/coredump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/coredump.c b/fs/coredump.c
index 53a78b6bbb5b..14c385ffbcc9 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1020,6 +1020,7 @@ int dump_user_range(struct coredump_params *cprm, unsigned long start,
 		} else {
 			dump_skip(cprm, PAGE_SIZE);
 		}
+		cond_resched();
 	}
 	dump_page_free(dump_page);
 	return 1;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] coredump: add cond_resched() to dump_user_range
  2024-10-10 15:36 [PATCH] coredump: add cond_resched() to dump_user_range Rik van Riel
@ 2024-10-14 14:59 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-10-14 14:59 UTC (permalink / raw)
  To: Rik van Riel
  Cc: Christian Brauner, Jan Kara, linux-fsdevel, linux-kernel,
	kernel-team, Alexander Viro

On Thu, 10 Oct 2024 11:36:51 -0400, Rik van Riel wrote:
> 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.
> 
> 
> [...]

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] coredump: add cond_resched() to dump_user_range
      https://git.kernel.org/vfs/vfs/c/89be051f0724

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-14 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-10 15:36 [PATCH] coredump: add cond_resched() to dump_user_range Rik van Riel
2024-10-14 14:59 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®