mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-10-21 11:48:53 +10:00
kernel: trace: preemptirq_delay_test: use offstack cpu mask
[ Upstream commitadc353c0bf
] A CPU mask on the stack is broken for large values of CONFIG_NR_CPUS: kernel/trace/preemptirq_delay_test.c: In function ‘preemptirq_delay_run’: kernel/trace/preemptirq_delay_test.c:143:1: error: the frame size of 8512 bytes is larger than 1536 bytes [-Werror=frame-larger-than=] Fall back to dynamic allocation here. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Song Chen <chensong_2000@189.cn> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20250620111215.3365305-1-arnd@kernel.org Fixes:4b9091e1c1
("kernel: trace: preemptirq_delay_test: add cpu affinity") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b6fbac6ae9
commit
b1b1bfb81a
@ -119,12 +119,15 @@ static int preemptirq_delay_run(void *data)
|
||||
{
|
||||
int i;
|
||||
int s = MIN(burst_size, NR_TEST_FUNCS);
|
||||
struct cpumask cpu_mask;
|
||||
cpumask_var_t cpu_mask;
|
||||
|
||||
if (!alloc_cpumask_var(&cpu_mask, GFP_KERNEL))
|
||||
return -ENOMEM;
|
||||
|
||||
if (cpu_affinity > -1) {
|
||||
cpumask_clear(&cpu_mask);
|
||||
cpumask_set_cpu(cpu_affinity, &cpu_mask);
|
||||
if (set_cpus_allowed_ptr(current, &cpu_mask))
|
||||
cpumask_clear(cpu_mask);
|
||||
cpumask_set_cpu(cpu_affinity, cpu_mask);
|
||||
if (set_cpus_allowed_ptr(current, cpu_mask))
|
||||
pr_err("cpu_affinity:%d, failed\n", cpu_affinity);
|
||||
}
|
||||
|
||||
@ -141,6 +144,8 @@ static int preemptirq_delay_run(void *data)
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
|
||||
free_cpumask_var(cpu_mask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user