From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CD4F3594E; Tue, 12 Aug 2025 19:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026226; cv=none; b=mVPNPAYnW+1ynUJiWf69cA6DBMA/8e4rL9AJgmhaTMO9xiDaska89S30+DzlXq0eC/ymwbMVyfgq4M2nwCx7CZ3o/GPzvE1cN3Ws9eDDH6o/0veqcM7dTUo6W3p04gFRyk5HgrfsBKEVjChW6R62TYglJcaAkjMiRcX0lFfMa5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026226; c=relaxed/simple; bh=+3tqT0RDBMgdUG++VA8ioGkcfdlrd5HEwrShJTwrx74=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bT3tRYapCI85He7Ns02QYM9UXCn54KbEJwI7o9Ku6dnnFeFS3V8cXbNVQ2uxKie2XeQ4kwwd4zsBt2rntNSisZOzlPX1JxBGy6C2thcprxvKtFkiFHSnI+kS18/jZL3cEeVniMffW5Tf2dP1y+EPYFU4AMVhSd27bpurWJKDH2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K853RHQP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K853RHQP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29DB1C4CEF0; Tue, 12 Aug 2025 19:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755026225; bh=+3tqT0RDBMgdUG++VA8ioGkcfdlrd5HEwrShJTwrx74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K853RHQPJqW6cWpVWh9MyjoFA5Y7o1G9OClPutdICFX82q3Q+FX4nsMifz7MO2d8p rON9MZyA2HE4oocTwp0FC5pHFOWtLbtrZpmacfgXEZqRxSDaEf/R1+KlKySQHd2qF6 ZsHdlokIQKebT5/CTU1Dc2OmPHPf6DaxpvjnyO2M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masami Hiramatsu , Song Chen , Mathieu Desnoyers , Arnd Bergmann , "Steven Rostedt (Google)" , Sasha Levin Subject: [PATCH 6.15 275/480] kernel: trace: preemptirq_delay_test: use offstack cpu mask Date: Tue, 12 Aug 2025 19:48:03 +0200 Message-ID: <20250812174408.782788257@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812174357.281828096@linuxfoundation.org> References: <20250812174357.281828096@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit adc353c0bfb243ebfd29b6222fa3bf149169a6de ] 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 Cc: Song Chen Cc: Mathieu Desnoyers Link: https://lore.kernel.org/20250620111215.3365305-1-arnd@kernel.org Fixes: 4b9091e1c194 ("kernel: trace: preemptirq_delay_test: add cpu affinity") Signed-off-by: Arnd Bergmann Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- kernel/trace/preemptirq_delay_test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/trace/preemptirq_delay_test.c b/kernel/trace/preemptirq_delay_test.c index 314ffc143039..acb0c971a408 100644 --- a/kernel/trace/preemptirq_delay_test.c +++ b/kernel/trace/preemptirq_delay_test.c @@ -117,12 +117,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); } @@ -139,6 +142,8 @@ static int preemptirq_delay_run(void *data) __set_current_state(TASK_RUNNING); + free_cpumask_var(cpu_mask); + return 0; } -- 2.39.5