Skip to content

Commit 2378a19

Browse files
Werkovrostedt
authored andcommitted
tracing: Ensure optimized hashing works
If ever PID_MAX_DEFAULT changes, it must be compatible with tracing hashmaps assumptions. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Michal Koutný <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 4099b98 commit 2378a19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/trace_sched_switch.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ int trace_save_cmdline(struct task_struct *tsk)
247247
if (!tsk->pid)
248248
return 1;
249249

250+
BUILD_BUG_ON(!is_power_of_2(PID_MAX_DEFAULT));
251+
250252
tpid = tsk->pid & (PID_MAX_DEFAULT - 1);
251253

252254
/*

0 commit comments

Comments
 (0)