From nobody Tue Sep 29 09:09:22 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 8FD6739FCDC; Mon, 10 Aug 2026 08:57:45 +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=1786352266; cv=none; b=u8sbwD6CAT53aV8AGoNSetdq7QgUDx9Yuib114sPUdUf6gc15Zez4GD0s59E8OTCjc35VaKBYN6EyYT1CUidMG+l3R/fcSyg/S9Eq3pNOAe5dmxxDlYiHHlz8STbtls8NAL0PS9IpnOLZgEqTYk6ePJ2U4PREJbzSMSIQPZPQSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786352266; c=relaxed/simple; bh=GZm3wJ+HEZuE+dncmma0kzMeJDJjpzwjSWXHcSMI7d8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JxIL8fCIV+ePmoVE8+IAMi/DmrLZshV0jRMYcpKr3U8hp+0Xt0Nn+mDhQMs+wkMFuYRE6JCupZQLF9bJmJ1H1+1IKnghYLptYVJuEBDXAmW1CO26AhULXqKiDyIwcSKX5IPHLWLdzWCyoHRcRAXwe6gqOSoTd497ErbjOjDb8rE= 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=GlNKopcO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KlWfWV1S; 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="GlNKopcO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KlWfWV1S" Date: Mon, 10 Aug 2026 08:57:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786352264; 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=iRCotKq5LVhPK0ulAnka9ee3jT8jqDIULr665K9UYNI=; b=GlNKopcOIcyiR+0B6DMqNBsLtQYnR6Jbnw6c8Bqx823cdCqOyb1/2tSux2ANjllNceBs+b x++qsJwTV8a9sAETkIXwWZvY32knKUgY4U7kUo+gtLP3vPA/iIUE7CfRl+Q/KIT05axrMS K56WdqDIYXrCGlT4WAkzwFZwDxdvIQQQoRl8DdWUv7d03KISMruZMNNJfeTphCPn2GKVP+ z95YcMjbKqALHuI1ifAuMIxeFL1hvkplq06NCs46y6PcNoMPhtR/jh34bn2AyuRUJbuHpJ HEeQyeaZPaBcoFmK9WHCET67VJCPMlrJYo+DOopqV9KQIztQq6SukTNMDeCWIw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786352264; 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=iRCotKq5LVhPK0ulAnka9ee3jT8jqDIULr665K9UYNI=; b=KlWfWV1S8/HEy+xvu6EDD01XAiLBfbEuR9cvy/VZgDvR4mvVTYuiO55JndPdPI0aNPC+ew +6xhcvidwiadVvAw== From: "tip-bot2 for Boqun Feng" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] sched: Remove the unused preempt_offset parameter of __cant_sleep() Cc: Boqun Feng , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260804161447.84806-9-boqun@kernel.org> References: <20260804161447.84806-9-boqun@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178635226238.442315.5708097145901842722.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 locking/core branch of tip: Commit-ID: ac4231a77973fc20808ed84c4af343eca2342d4b Gitweb: https://git.kernel.org/tip/ac4231a77973fc20808ed84c4af343eca= 2342d4b Author: Boqun Feng AuthorDate: Tue, 04 Aug 2026 09:14:30 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Aug 2026 10:50:19 +02:00 sched: Remove the unused preempt_offset parameter of __cant_sleep() The preempt_offset is always 0 in all the callsites of __cant_sleep(), hence remove it. It also allows us to clear up the code a bit by no longer using a "preempt_count() > .." comparison. Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260804161447.84806-9-boqun@kernel.org --- include/linux/kernel.h | 4 ++-- kernel/sched/core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e5570a1..24414c7 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -72,7 +72,7 @@ extern int dynamic_might_resched(void); #ifdef CONFIG_DEBUG_ATOMIC_SLEEP extern void __might_resched(const char *file, int line, unsigned int offse= ts); extern void __might_sleep(const char *file, int line); -extern void __cant_sleep(const char *file, int line, int preempt_offset); +extern void __cant_sleep(const char *file, int line); extern void __cant_migrate(const char *file, int line); =20 /** @@ -95,7 +95,7 @@ extern void __cant_migrate(const char *file, int line); * this macro will print a stack trace if it is executed with preemption e= nabled */ # define cant_sleep() \ - do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) + do { __cant_sleep(__FILE__, __LINE__); } while (0) # define sched_annotate_sleep() (current->task_state_change =3D 0) =20 /** diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9622670..aa116da 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9199,7 +9199,7 @@ void __might_resched(const char *file, int line, unsi= gned int offsets) } EXPORT_SYMBOL(__might_resched); =20 -void __cant_sleep(const char *file, int line, int preempt_offset) +void __cant_sleep(const char *file, int line) { static unsigned long prev_jiffy; =20 @@ -9209,7 +9209,7 @@ void __cant_sleep(const char *file, int line, int pre= empt_offset) if (!IS_ENABLED(CONFIG_PREEMPT_COUNT)) return; =20 - if (preempt_count() > preempt_offset) + if (preempt_count()) return; =20 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)