Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp571433rdb; Mon, 15 Jan 2024 06:41:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJAXGnBc5Q96dQEGV70Y+FMsRnhwrvYbevNvR0ua0wLHy7wTIDDJhMGBd6gfHcQB1D9SU3 X-Received: by 2002:a17:906:395:b0:a2d:582d:ac7 with SMTP id b21-20020a170906039500b00a2d582d0ac7mr1340534eja.48.1705329674717; Mon, 15 Jan 2024 06:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705329674; cv=none; d=google.com; s=arc-20160816; b=qNgwmHtg9L3wCjM+DI34DXJp4g0TL7qC9eUHopceUGZNrasLe0DzhsHmL6AYQ6XTKI Ycb1/78Ia6uwOu4GYNAGeSP8bdpwFJFl0IZDI/2SKigiR7SyT1iitkQ1bvppxc8aeDJr rkWn8wTUaitVeNEspEaoszpyXXPaZVX8VIbmnevvmw+UY5mm324dmRIzb2+Koml7cq7v Zroe+Tbn2db4oLFZRBPMgrJHbwgqoVTb9Q4ofgaCmIX6Kaj6hcNeh7mpoi0GwDHNCVZH 86jUIqbDvgnNVxvQJw1MZTTvyW9EBAzyX9xlh8+/jYlb3XqaYZMHv9QRCFmf3cAhJfTC 4uVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=Opkow5gPOaaBUb3NbiN3AOkG3DcAm/G1qJk4x5I78GI=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=Q0yS29QogItp5TXQ5qGZgkvuNG8Q3+QfZWTG6gOFYEJ3O6lQwccNNQFoxcmbZpTxW6 bVk0CLZO9ODEVU/UnB0fbyon7s3EO8fVg+KNjWxUyaowMVVo1wZaU0x2l5B4VK5qxFzI TgRu4xdpqYUWwtXxesK541SARG+DcXPHfixo3DB9qKW4+cTVVsEgnbXdwwNoi/9KnBb0 qE1R+Oog6+Oe0d0iGJxhWOWvbWb18t2rGOMMmk2OfvYbGHOXAa3HnRPueAyMK8ok6rKy ANi4cPDlYj0Xol1fC6JHU9ejjyjMt8bRDq8oI90eNNZU55x/yZZwQva79mBQ88BFAX35 KYng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ie8gWsdU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-26111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26111-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u5-20020a170906068500b00a28e70f483dsi3861890ejb.164.2024.01.15.06.41.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:41:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ie8gWsdU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-26111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26111-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 703991F22393 for ; Mon, 15 Jan 2024 14:41:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A73018ED3; Mon, 15 Jan 2024 14:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ie8gWsdU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="atGElf/B" 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 4DE9E18C01 for ; Mon, 15 Jan 2024 14:38:13 +0000 (UTC) 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 From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705329491; 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=Opkow5gPOaaBUb3NbiN3AOkG3DcAm/G1qJk4x5I78GI=; b=ie8gWsdUYa+mDSLuzV7dk7msmvEw1vRr4MX7/KUDaezICOJHY5kGXthCkRRrq2V/Cm3QwT M/Ia4z+ICY3uEuKwzf+KJlwoCRioqjhG5E13ONLvcsGwXLtI6hdf3qlCZlTmqAHITBQnV/ oCmnmfKS4Ec15QGfvdk/K10X3oZ5J+4UrWvzf6cl/l+KT72NR1/6rUxenmm0HuPSDIFOEd Ig9fkQEMR2/Exz+mAs2mKoK63fKL4Y7v3bWXdFksZb7DIJ1wO7gDBLfTGXB6yWhCu8Isgb hoGlq1Q7rouQh+yiYK2hDV43qJ91UebEjVLWxcgDnugQhnfUmp/oz2iJ8qyzCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705329491; 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=Opkow5gPOaaBUb3NbiN3AOkG3DcAm/G1qJk4x5I78GI=; b=atGElf/B15NatGtc5QWfPX7yXEKL5ON23WrledoHFHNeTOnwOonj+qkfzRdjJFyPyW6n21 PvNi9dInYpmACHDg== 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" , Srinivas Pandruvada , K Prateek Nayak , Anna-Maria Behnsen Subject: [PATCH v10 15/20] timers: Check if timers base is handled already Date: Mon, 15 Jan 2024 15:37:38 +0100 Message-Id: <20240115143743.27827-16-anna-maria@linutronix.de> In-Reply-To: <20240115143743.27827-1-anna-maria@linutronix.de> References: <20240115143743.27827-1-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- v10: s/cpu/CPU/ in commit message 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 ccb2a5c03b87..eb99297a96fe 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2225,6 +2225,9 @@ static inline void __run_timers(struct timer_base *base) lockdep_assert_held(&base->lock); + if (base->running_timer) + return; + while (time_after_eq(jiffies, base->clk) && time_after_eq(jiffies, base->next_expiry)) { levels = collect_expired_timers(base, heads); -- 2.39.2