Thread (38 messages) 38 messages, 5 authors, 2025-08-15
STALE344d

[RFC PATCH v1 4/9] freezer: Set default freeze priority for userspace tasks

From: Zihuan Zhang <hidden>
Date: 2025-08-07 12:14:56
Also in: linux-fsdevel, linux-mm, linux-pm, lkml
Subsystem: exec & binfmt api, elf, memory management - core, scheduler, the rest · Maintainers: Kees Cook, Andrew Morton, David Hildenbrand, Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot, Linus Torvalds

The freezer framework now supports per-task freeze priorities. To
ensure consistent behavior, this patch assigns a default freeze
priority (FREEZE_PRIORITY_NORMAL) to all newly created userspace tasks.

This helps maintain deterministic freezing order and prepares the
ground for future enhancements based on priority-aware freezing logic.

Kernel threads are not affected by this change, since they are excluded.

Signed-off-by: Zihuan Zhang <redacted>
---
 kernel/fork.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/kernel/fork.c b/kernel/fork.c
index 9ce93fd20f82..04af5390af25 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2422,6 +2422,7 @@ __latent_entropy struct task_struct *copy_process(
 
 	copy_oom_score_adj(clone_flags, p);
 
+	freeze_set_default_priority(p, FREEZE_PRIORITY_NORMAL);
 	return p;
 
 bad_fork_core_free:
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help