From nobody Tue Sep 29 10:33:02 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 32B3B381B1C; Sat, 8 Aug 2026 20:48:35 +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=1786222116; cv=none; b=XDF0g6SzuuoQ5656KYRIRb6dPNuNh9eQd+PpKy0miHR0lLt6nCrKntmYrloI77qitDxDZyEjTHW5yOpr9a7qXg3HV7qyGyqIcP7zrmjFUMnZ9YMEUeME8YQfFA28MJ+Hpa6/j+B0c8nGJbbkSt2xuzYTCuJZVHysyP4HNpz9JMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786222116; c=relaxed/simple; bh=MfPCxd1Hy6O9aIpNgjJG9Fu6hQk4FsYeFSm7E27xWNg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=H2xXJQbeEc6twASqqIXw4pao7R7R5gpWxgACqkO8tZWIhdN0urvm5tWEjpx1pbN1q31ar1TUYMlxeEoDRd10MCt7njKh+/BHmjL5PxOMqCo5AV+dRXfGMKuEIvqEakhH28Bz4jOHQ5EWqRBSbW7Opvkhy65k1hSpsd4t5/eIEP8= 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=ITZ9z4LV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UNacrltl; 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="ITZ9z4LV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UNacrltl" Date: Sat, 08 Aug 2026 20:48:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786222108; 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=PwRiFb0V37ZfpLx30OIuWLjKWe2vJC+WGdx3v/rJr54=; b=ITZ9z4LVW2oiOsi+DqfzcagT20Jq8oV77BT1+3rBTegIhYLmCBHzLD9uKT5kix6W6CF7nD OqOZTjQ9orf5UN/o8gZzJijTlJSIY6pxn8aZJdG4qoH6vugl/h1daR+6Or56VIeGcrEQZ4 ZYMazzcC4mKRyTsg2iMbxGfEZl4kbeddIapegeuY3RuCoO9jGDgSn+/hlkfqXTF13h6d+K fkBaGp7lmYfTNdmwfDZ9+fesDE0KFcwQ8ExDteafPtRTWyO7X2l/ayDGyqsd5u43f917kv ywWzLKHgMec93/dYB5jT58aAH1i+CSmePyh4oPS+lHOAHxaGKDwv7cQC1kcEhQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786222108; 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=PwRiFb0V37ZfpLx30OIuWLjKWe2vJC+WGdx3v/rJr54=; b=UNacrltl2hlPjQn3GxgBgeJuumQLNkN+pz7FCVbbCShrqxt5qmzdp2C9dOALCQqHOoj/Jc 2jYvJMACWcYeX6BA== 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: <178622210690.442315.3396960859679183692.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: 1cda40c48e295f8ad16bd5401591d7e6e5bcb591 Gitweb: https://git.kernel.org/tip/1cda40c48e295f8ad16bd5401591d7e6e= 5bcb591 Author: Boqun Feng AuthorDate: Tue, 04 Aug 2026 09:14:30 -07:00 Committer: Peter Zijlstra CommitterDate: Sat, 08 Aug 2026 22:44:07 +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)