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 CD680FC0A for ; Tue, 17 Mar 2026 12:01:07 +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=1773748867; cv=none; b=jVAYjoAuh62qnSd8l7uX5x7r4Iy/XZqTZp4pKv4cn/D7ocJ57RRab5zGlwe+61kjGwS8E9/PuwSEieOF6PmQ9b2naDP/UxGIpkYZRdkCP2iykKrXWIrk2q9SjuosBA4Za1CqQwFrfJRDdWDQjnLx5uLCtW3j+y1nWeE7DkEGfBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773748867; c=relaxed/simple; bh=RfeY0C5P19KtGS4kzX/5LJJYGwQxsCisGoQXlppNccg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=aFeQC88O9FWecYP/YHx1JnZkrs/zxzaI55lh1TxUkvRZQm7XFZE+r2MOJTwdkpkgUf7Zp4rV4aSvCqZbf4ISbFISGCglYMHSK1CdLltvIZRly87kvID2DvnB3d8uQ/In1ogRH+nr8+zD9UkfNBM3QjjGetl8Vv3zPbmoyEx1xWo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0MklgTVe; 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="0MklgTVe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE4B1C4CEF7; Tue, 17 Mar 2026 12:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773748867; bh=RfeY0C5P19KtGS4kzX/5LJJYGwQxsCisGoQXlppNccg=; h=Subject:To:Cc:From:Date:From; b=0MklgTVeGFxeb94c4hP59dDm6TjYYZ6k+SeiR4vs4GS4BYEwdl1hbalOzoY0h/mDf aN0jjb8yC+JbCzRbYSFUJAmEW097ap9rYyQlTZS3MQy7HUQdD6Fdm+s584fLetxeyw PanTF9XqPoQN/xfU2l7ka1vW8ie89rF4wU+BrkuM= Subject: FAILED: patch "[PATCH] fgraph: Fix thresh_return clear per-task notrace" failed to apply to 6.18-stable tree To: hu.shengming@zte.com.cn,mhiramat@kernel.org,rostedt@goodmis.org Cc: From: Date: Tue, 17 Mar 2026 13:01:02 +0100 Message-ID: <2026031701-backer-clumsy-6f09@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 6ca8379b5d36e22b04e6315c3e49a6083377c862 # git commit -s git send-email --to '' --in-reply-to '2026031701-backer-clumsy-6f09@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 6ca8379b5d36e22b04e6315c3e49a6083377c862 Mon Sep 17 00:00:00 2001 From: Shengming Hu Date: Sat, 21 Feb 2026 11:30:07 +0800 Subject: [PATCH] fgraph: Fix thresh_return clear per-task notrace When tracing_thresh is enabled, function graph tracing uses trace_graph_thresh_return() as the return handler. Unlike trace_graph_return(), it did not clear the per-task TRACE_GRAPH_NOTRACE flag set by the entry handler for set_graph_notrace addresses. This could leave the task permanently in "notrace" state and effectively disable function graph tracing for that task. Mirror trace_graph_return()'s per-task notrace handling by clearing TRACE_GRAPH_NOTRACE and returning early when set. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260221113007819YgrZsMGABff4Rc-O_fZxL@zte.com.cn Fixes: b84214890a9bc ("function_graph: Move graph notrace bit to shadow stack global var") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shengming Hu Signed-off-by: Steven Rostedt (Google) diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 3d8239fee004..817d0f1696b6 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -400,14 +400,15 @@ static void trace_graph_thresh_return(struct ftrace_graph_ret *trace, struct fgraph_ops *gops, struct ftrace_regs *fregs) { + unsigned long *task_var = fgraph_get_task_var(gops); struct fgraph_times *ftimes; struct trace_array *tr; int size; ftrace_graph_addr_finish(gops, trace); - if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT)) { - trace_recursion_clear(TRACE_GRAPH_NOTRACE_BIT); + if (*task_var & TRACE_GRAPH_NOTRACE) { + *task_var &= ~TRACE_GRAPH_NOTRACE; return; }