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 D41C01A01BF; Tue, 12 Aug 2025 18:47:27 +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=1755024447; cv=none; b=mgH68uJQ/VI0gYlW6wkWUNF8wjyo8sifpd8Lqz+DsQLq+tyJ9aUrIEn/pZcJmqsclSLy3fXBaL5swoDmpbixcHnJOAS556RcJ4zd28Bk/Laz59knACbP+BqgNf6jxcKZH5a6uKUpMpTU7Vg7F+4JFNzlOJMU6mYSxAQ3AG+vzO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755024447; c=relaxed/simple; bh=wVYQnBmQQ+YMdtVhZKz9xB8MMW5O+QyoWnijiQyu3SU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cC33t5csE5LrTDDIQKa6w1konhurGhMqdlqe6gU91LziawAnlxGnl+NPs2PwNjPh8+jNvJ6ZpRqDrDTWy4aDiTe8/iIqHuviYM71vnN5SuV+Y2z0bDydHmZpoRNodUzpUDhOTMrHaDw+eRfIqGZEaxKx+uf0D/oRve2375Z6ZSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MWUTGhp5; 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="MWUTGhp5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 443D7C4CEF0; Tue, 12 Aug 2025 18:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755024447; bh=wVYQnBmQQ+YMdtVhZKz9xB8MMW5O+QyoWnijiQyu3SU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWUTGhp5Uygyty+ZpByxfH924Q/qvuDK6XxlPjSLKXehvc0xtO7McisqXOdEFAbel iegW38shsLpaESWFI26ENP+kFBROXPQhgPRIg9XN/9SkebjLoHITRIPOMTP0TkeW+u cSZSroOzBFxIvNMMJh1K84gJdFOdCW5e/QFvZ8Kc= 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.16 375/627] kernel: trace: preemptirq_delay_test: use offstack cpu mask Date: Tue, 12 Aug 2025 19:31:10 +0200 Message-ID: <20250812173433.566790389@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812173419.303046420@linuxfoundation.org> References: <20250812173419.303046420@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.16-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