From patchwork Wed Oct 4 12:34:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 148278 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp99397vqb; Wed, 4 Oct 2023 05:37:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5Ljls4fu4LDXQoP127qPYR0qa5UoSwdHSjJhYpQx2FvQ+BMmtAqhz4KwQ0QZkeGVubC6t X-Received: by 2002:a05:6808:23c4:b0:3a7:5611:a53b with SMTP id bq4-20020a05680823c400b003a75611a53bmr2934921oib.0.1696423064660; Wed, 04 Oct 2023 05:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696423064; cv=none; d=google.com; s=arc-20160816; b=fImN7aswpxtkaGNhHChDqBm3GDH1G0LFjnWK/TTRiMjBeirTUbiTIBlgRgX2Ev3ZKF pqIkTeDMa4AkVYgQvAPVlKYPYoUemwOqlqp/8yjeH+3CN+B48qnL+dRcjbfi7oiGH1LV Z43S7RoFVLi5hPuUAbLDqEFArg4Qb9gcnsNQKAvCGD6TaR2J1loiTrwUISXaz+ttv8g8 J3s8KO+u0GJHOW0kT+/3qkRgTWYHUetmo5n1unRL+wrlal/jL6ZKmqbVOjj+/+oCPUFp coObMYGIF/6EMQ0jjNpwNC/Rq9hDRKIAmQlWmon1IfgY78Du1RH726Yh76XCrgp1av8O 9jug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=KnlNVqR9WmkhQaFL3egg7gM5XjHK7g3gYDo7hW6w0sA=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=NSkOxvLq1MK1UAN3tulX64G7+VwEKM9OoUxJlzLezjaTmaGgXsgx02h9RvJguGpQ5v aPI7Iv7//Hh7BFoLEWvXufSLVNScvcp/0FwYoGhlQ07kiSY39EmZU5L+U0njjFJAcnCm /QEDPZW07oUfTsqAwvH+T93eGQb54Rx4A1yGLY8hiIbb/KNTN4iapRO+cGfYfWIOAPPH PGPdENiusZfNdMgEv2sF9lH+bj2h8cH7MWUWM9NMZ5fGkt3+I9FdyFdCUhkrUp+beAHB rTrxCdztFdD+klh7Wy9Zv6UcjAGRA1ROvj9O74rUXaAPQqi0QUcax8S2onKGKhU6PuZz 1kuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2TZ9kJex; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u186-20020a6385c3000000b00578d3f8d4d4si3450066pgd.448.2023.10.04.05.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2TZ9kJex; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BC49181A9B73; Wed, 4 Oct 2023 05:37:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242540AbjJDMgU (ORCPT + 18 others); Wed, 4 Oct 2023 08:36:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242425AbjJDMfp (ORCPT ); Wed, 4 Oct 2023 08:35:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76ED111D for ; Wed, 4 Oct 2023 05:35:39 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696422938; 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=KnlNVqR9WmkhQaFL3egg7gM5XjHK7g3gYDo7hW6w0sA=; b=2TZ9kJex3ROSXsaXZ7E6YlGyRhNQcoeofEqkGjEFrQtNA9JI7/+5BOxaf2P5Qtw7d4zpO+ G9MR1zjHfkvsM/a4vDvRz7ReaEAwvgoe3n9HMc9v4xD1vanpbtMRDsIj9wGujTkHP3gOUG gruyK2jWfbvnZEOMbkyXr1voAKd0tCNCb9FxxoTmzb9N1M5GXMzEPBwEQ+3Wd8unB0QEfn y6GK7wMm4vbwVbFIhiAutGYsQHZhE74BiYMb/GkfGbfrHSUfykP3IWSdlVVSIln5ixxECx 1YperYHSE3JgjrLQu+PGPrV3K/aXXfkCq7RCaTYE9KDf0CjzCDpIe7cxgzv5Tw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696422938; 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=KnlNVqR9WmkhQaFL3egg7gM5XjHK7g3gYDo7hW6w0sA=; b=ls2cXdt0RpOukfXjfgEx4zuqZfQoPuAoG1FP29n6w5srR0nfJ/iEL78XXgngJh8lvaP0T8 GMX4WEeUul/0XzDQ== 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 v8 21/25] timer: Check if timers base is handled already Date: Wed, 4 Oct 2023 14:34:50 +0200 Message-Id: <20231004123454.15691-22-anna-maria@linutronix.de> In-Reply-To: <20231004123454.15691-1-anna-maria@linutronix.de> References: <20231004123454.15691-1-anna-maria@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:37:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778828511832157857 X-GMAIL-MSGID: 1778828511832157857 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 8893f5dd1d66..7f06553e44de 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2232,6 +2232,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);