aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/signal.c
diff options
context:
space:
mode:
authorSteven Rostedt <[email protected]>2024-10-19 01:52:12 +0000
committerSteven Rostedt (Google) <[email protected]>2024-10-19 01:57:20 +0000
commitfae4078c289a2f24229c0de652249948b1cd6bdb (patch)
treeceae6889f6104c43ec1e29b74e0ebe51d2960f5c /rust/helpers/signal.c
parentfgraph: Use CPU hotplug mechanism to initialize idle shadow stacks (diff)
downloadkernel-fae4078c289a2f24229c0de652249948b1cd6bdb.tar.gz
kernel-fae4078c289a2f24229c0de652249948b1cd6bdb.zip
fgraph: Allocate ret_stack_list with proper size
The ret_stack_list is an array of ret_stack shadow stacks for the function graph usage. When the first function graph is enabled, all tasks in the system get a shadow stack. The ret_stack_list is a 32 element array of pointers to these shadow stacks. It allocates the shadow stack in batches (32 stacks at a time), assigns them to running tasks, and continues until all tasks are covered. When the function graph shadow stack changed from an array of ftrace_ret_stack structures to an array of longs, the allocation of ret_stack_list went from allocating an array of 32 elements to just a block defined by SHADOW_STACK_SIZE. Luckily, that's defined as PAGE_SIZE and is much more than enough to hold 32 pointers. But it is way overkill for the amount needed to allocate. Change the allocation of ret_stack_list back to a kcalloc() of FTRACE_RETSTACK_ALLOC_SIZE pointers. Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/20241018215212.23f13f40@rorschach Fixes: 42675b723b484 ("function_graph: Convert ret_stack to a series of longs") Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'rust/helpers/signal.c')
0 files changed, 0 insertions, 0 deletions