mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
tracing: Ensure optimized hashing works
If ever PID_MAX_DEFAULT changes, it must be compatible with tracing hashmaps assumptions. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20250924113810.2433478-1-mkoutny@suse.com Link: https://lore.kernel.org/r/20240409110126.651e94cb@gandalf.local.home/ Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt (Google)
parent
4099b98203
commit
2378a191f4
@@ -247,6 +247,8 @@ int trace_save_cmdline(struct task_struct *tsk)
|
||||
if (!tsk->pid)
|
||||
return 1;
|
||||
|
||||
BUILD_BUG_ON(!is_power_of_2(PID_MAX_DEFAULT));
|
||||
|
||||
tpid = tsk->pid & (PID_MAX_DEFAULT - 1);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user