From nobody Wed Feb 11 10:53:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AEA4C77B7D for ; Wed, 10 May 2023 07:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236515AbjEJHae (ORCPT ); Wed, 10 May 2023 03:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236047AbjEJH3p (ORCPT ); Wed, 10 May 2023 03:29:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C76017EF5 for ; Wed, 10 May 2023 00:29:16 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683703725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ks/WY9IQKnnrJ4oAXztzW3W2SS5KA0htj+3VU2cT7Fw=; b=YNWT00Vq66CX/uvbvDqcrmEizrZPabeQfbLr5M9TYIKCEaHPD6CVkw7Z4ng+SWQYKuXXXv +FdM8BTzucsORfCgtBtVMUG98+Z7+OTAYlJ3vMcgwjRY2AYTuWNrqysp5NKxDus9EezH7m AYMRWZs6Xl9PUAgYoDsAxu4GUuJyXMUcR+XVb1PnEwbjQ/AmtyHqXmDDhThY0OAWNbQ/1+ U78VhWr7jgohFzPT0QiTruP4E2hPmU3wI47yv+HNPbBzl4qBdXhKxxqaM+4fFjmeSV3XN/ B0mrAhwQKGDZx0JmIVqBEkl6rBNz5rXC8SQcyA45iQK6HU+WaO7dWn6MpcAB+A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683703725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ks/WY9IQKnnrJ4oAXztzW3W2SS5KA0htj+3VU2cT7Fw=; b=UsrabtosjXaUg7XSvWhTA2Iq0tnfM/KpXHTqmO/9G4EL1RmH/cl7wxtE66z0MyWhDnRDp6 6qQE2tEWo9FushDg== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Anna-Maria Behnsen Subject: [PATCH v6 17/21] timer: Check if timers base is handled already Date: Wed, 10 May 2023 09:28:13 +0200 Message-Id: <20230510072817.116056-18-anna-maria@linutronix.de> In-Reply-To: <20230510072817.116056-1-anna-maria@linutronix.de> References: <20230510072817.116056-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Due to the conversion of the NOHZ timer placement to a pull at expiry time model, the per CPU timer bases with non pinned timers are no longer handled only by the local CPU. In case a remote CPU already expires the non pinned timers base of the local cpu, nothing more needs to be done by the local CPU. A check at the begin of the expire timers routine is required, because timer base lock is dropped before executing the timer callback function. This is a preparatory work, but has no functional impact right now. Signed-off-by: Anna-Maria Behnsen --- v6: Drop double negation --- kernel/time/timer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 61042f1e6f6a..1d7d0d28ef79 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2198,6 +2198,9 @@ static inline void __run_timers(struct timer_base *ba= se) =20 lockdep_assert_held(&base->lock); =20 + if (base->running_timer) + return; + while (time_after_eq(jiffies, base->clk) && time_after_eq(jiffies, base->next_expiry)) { levels =3D collect_expired_timers(base, heads); --=20 2.30.2