Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp904953rdb; Fri, 1 Dec 2023 01:29:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7OZEZs278/vljTqsx0xMH+sgk7PAnWZkBNBDyfnr2PR7i75+W6Ai327g94/s3mGp+OiJU X-Received: by 2002:a17:902:ec92:b0:1cf:bdcb:61d5 with SMTP id x18-20020a170902ec9200b001cfbdcb61d5mr21498688plg.37.1701422944128; Fri, 01 Dec 2023 01:29:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422944; cv=none; d=google.com; s=arc-20160816; b=EUxVrajs0LAvJwXLkV5zKbfUfp7K8VWOJPNMm+ZrFMedcaUeHnFHdT5sSWynXFKskv OkH5JFvPkX2CqGm4u6+9SXqzXd9lMn6osvc3l/+xusqbiZM2kL+YhdsDzxJ1JRoEq5gk kdo327Ps/RFFxSNV6FLGc5D3YRvNtA7J23gzjhAYQO6AXQdcGVL+aVIOZh73Nu0BIU4D AvJZpwP41rfXBQSkyqA2c9CZ7hFHzrCmvKQsVD93f30vne+UEUrh/q2V9Js3/xYKsrgP Ysl9lGyoUqmjEj1Jo+lbDGQ73E6a/5HCmh/W342fFr09tcTJwbgR2dK1nFlm5d+i8ZrE Mwqw== 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=2bCi4tjY8tpa6/56LAAq7Ts1AT6CM22+SLDU0+3P94Q=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=G4IKbXSJPi9c2kngtZOOjJn/iJRtR4ntP7LCD6YAmSAPio+wMjiFUt/rNvlwS0wfl9 fQ1pWLX8Cuua+qyDIq9BN3yImhlf30WV/lKl6PShusx1lVxKTUDUXdSLm5IYj2F1T8nr AhDzgZ+w9vdUG5FwQtl6eENdGI+bMontKj2zn84Xn3OARgMP341gAHsttB2Z97w/+r2E FdKRQZDNydTKnYegpbihwRVIgILSl4TjrIVwezaZAU97X7j88tkp5m6JPIm1+oaE49rM nWi/5BKRdqzyJgtlJ6y5p1whzYihCUx++EsxegqVc40vW8FgmGG1XVXfNLG6NcYPnlmJ 3BFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ahMjG98K; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h9-20020a170902f54900b001c9c967e77esi3048590plf.207.2023.12.01.01.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:29:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ahMjG98K; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id F2A3C80FA86B; Fri, 1 Dec 2023 01:29:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378247AbjLAJ2s (ORCPT + 99 others); Fri, 1 Dec 2023 04:28:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378045AbjLAJ2K (ORCPT ); Fri, 1 Dec 2023 04:28:10 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDBB21FC3 for ; Fri, 1 Dec 2023 01:27:27 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422845; 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=2bCi4tjY8tpa6/56LAAq7Ts1AT6CM22+SLDU0+3P94Q=; b=ahMjG98K3D4qOpghguU0ozTb5iyD0FeZ0e5qaVghe+bnsovvsp9OfHlCCOcSaqeATT2Vkh c1SjyHLSvCTPSGf11wOQ2zyxFpjVtFxMniVVw3F/Q52kHz0HrUtZlSBaE/xRYKYjhSSElS WxFViLi9vbKezJgTeWYLvyjOfEEJcuD9Tq0lrBkeaj4TP53vIdwFRvlg3MfeGjugPF8D06 +ybZr+fk81iM6Q8TgOKUYnWfazS4hFI6RmskRMMxWUfFwGZINJlsSbuAxriqyYib5oQAjk gi395JEUfMV5MhMhK8rJplN0PV51wsrhLxKt703ruRVq5tCXBavriNC/6VmjQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422845; 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=2bCi4tjY8tpa6/56LAAq7Ts1AT6CM22+SLDU0+3P94Q=; b=kRRyCgAuOmpklgvzYnSGwKqnsdjYnb8yb20cvQrna6iuwxMVhjGeLMMflSoErV8LCPv6EQ BP7JgzBcRXdMQuCA== 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 v9 27/32] timers: Check if timers base is handled already Date: Fri, 1 Dec 2023 10:26:49 +0100 Message-Id: <20231201092654.34614-28-anna-maria@linutronix.de> In-Reply-To: <20231201092654.34614-1-anna-maria@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:29:03 -0800 (PST) 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 b0fa8afe9059..a797603dfd49 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); -- 2.39.2