From nobody Sat Jun 13 23:11:42 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BC58230BB9B; Tue, 5 May 2026 10:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978550; cv=none; b=QDFwMe5ncI+RIFhT5XstcJLYNKxT2sULONXvvE855z2M4byBu+VbllL07/sQj8jBO+WE6flhn/M6fLe/RRNZMgD+jasQABqGrxeSL2+t89x8qIMiCIcmCj4cr4PBW2yQEK/+V8/gZjpFvY+DzQuXnF9T8m7/vm3wNdKB6SzWmVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978550; c=relaxed/simple; bh=GZUWolaPqZPreJNsaEHvPuemRbhG/j8PxRsmBa8DKWg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JKc4wl9XrOlgDP+r48hS/2Bu0vObf0KckqBGEES5CdzrAbBWnpt6Sld8l9KQGPskUrNF9PkLD7ImtoIOSkRUvjAOqaX+5YHZid/sQldn5RNQon01k3Zy3+NOB7Fy7WTSHLyeiWvRZivE6ILN8Glia1qI6z9cSt4VJfanLQegx9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=yzTfceSo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7IqFbQvD; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yzTfceSo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7IqFbQvD" Date: Tue, 05 May 2026 10:55:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978547; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tswDmn4DW2lPgZc1MxpNOD++hJZRZJLpDmQu4LFaaYA=; b=yzTfceSogSkWrhEIncNdtW45pWIbmWcSVO5qZgTO381SsYvx4Yc728LhDLJQd8MoVWHIIv LLKEFxDQ0VBBY8IC3gJ7a+pe9PHbYUU9/yr6b2vAkTrb9ox6sGs9ScwL6H0Z2P+EDSa+yC LjBlYth7nECVm1ITHzPSCsj0J4alPq9/XNnSt6zuse3twXzUvQtR1yqk8P3mVvBa41oFhk hbOAHLTLUr9sEp5YNFuikV2273D3K2arvnn6XNH6l/CbR54tytcRzg016FCJ3KjEyFgxlu GIta+sv3Tr52qrvA4GftHI2mCNdFcS9tSv59JMBEGaV5lNmvLNA2F9wjfQllKA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978547; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tswDmn4DW2lPgZc1MxpNOD++hJZRZJLpDmQu4LFaaYA=; b=7IqFbQvDylofWNvlx8tqj9u5gS6u+9A4x/Q057s+b+jCkvnNinzpcK+wKmuowyjiEFRBF3 X35Ao+yI8vSFmyAg== From: "tip-bot2 for Gabriele Monaco" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Use trace_call__() to save a static branch Cc: Gabriele Monaco , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260429094227.34087-1-gmonaco@redhat.com> References: <20260429094227.34087-1-gmonaco@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177797854581.424702.5387121396238740257.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: 4ac4d6549a6563878d7c19c154e017f6cb7114d3 Gitweb: https://git.kernel.org/tip/4ac4d6549a6563878d7c19c154e017f6c= b7114d3 Author: Gabriele Monaco AuthorDate: Wed, 29 Apr 2026 11:41:37 +02:00 Committer: Peter Zijlstra CommitterDate: Tue, 05 May 2026 12:50:50 +02:00 sched: Use trace_call__() to save a static branch The wrapper functions __trace_set_current_state() and __trace_set_need_resched() allow the tracepoints to be called from code outside sched/core.c, those calls are already guarded by a tracepoint_enabled() so there is no need to repeat this check once again inside the call using trace_(). Use the new trace_call__() API to directly call the tracepoint without check. Those helper functions must be called after the appropriate check. Signed-off-by: Gabriele Monaco Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260429094227.34087-1-gmonaco@redhat.com --- kernel/sched/core.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b887144..b905805 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -537,10 +537,14 @@ sched_core_dequeue(struct rq *rq, struct task_struct = *p, int flags) { } /* need a wrapper since we may need to trace from modules */ EXPORT_TRACEPOINT_SYMBOL(sched_set_state_tp); =20 -/* Call via the helper macro trace_set_current_state. */ +/* + * Call via the helper macro trace_set_current_state. + * Calls to this function MUST be guarded by a + * tracepoint_enabled(sched_set_state_tp) + */ void __trace_set_current_state(int state_value) { - trace_sched_set_state_tp(current, state_value); + trace_call__sched_set_state_tp(current, state_value); } EXPORT_SYMBOL(__trace_set_current_state); =20 @@ -1203,9 +1207,13 @@ static void __resched_curr(struct rq *rq, int tif) } } =20 +/* + * Calls to this function MUST be guarded by a + * tracepoint_enabled(sched_set_need_resched_tp) + */ void __trace_set_need_resched(struct task_struct *curr, int tif) { - trace_sched_set_need_resched_tp(curr, smp_processor_id(), tif); + trace_call__sched_set_need_resched_tp(curr, smp_processor_id(), tif); } EXPORT_SYMBOL_GPL(__trace_set_need_resched); =20