From patchwork Tue Oct 25 13:58:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 618622 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 90670ECDFA1 for ; Tue, 25 Oct 2022 13:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232192AbiJYN7j (ORCPT ); Tue, 25 Oct 2022 09:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbiJYN7d (ORCPT ); Tue, 25 Oct 2022 09:59:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B7B93BB; Tue, 25 Oct 2022 06:59:28 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666706367; 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=kjVAw8MhbYxCC7wINXEcQMmNl7FSEGbHT8j9jxIsmGY=; b=mcYLXutmXzSR9ZuMfSpPMy8mQSASFUo61PQ7SHQrKWDUi8VnIlN2rlivC+NIYxUL+jWhXo XukDXg7bgvlqbKnay6xYfaddDvjB4JzoR/3at5ZyWY6B4aY9vzMijr17r1FPG2M/OxmEw7 P5jo7g0efgIjCM9NQhOJOak/NtBguBLHDt/WfOXVVHpOG8cRa+GPW+HIfQ8BDobKRsj4U+ jLlgMSxzHk+oh2E29A/B26h8puv9BNJP3ky9uFDl9CpHkcqUJZaZPAmbD1Qux2dh2Bq5ya l/f0ifnZi1PXLK5lEq/OBOtQmqjfd7z3NH6HtT/s0Xjl7RJejjmCnHkNrOpFkg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666706367; 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=kjVAw8MhbYxCC7wINXEcQMmNl7FSEGbHT8j9jxIsmGY=; b=HlRzm2pHphXnjc98iqPYLFBQ1DfuNTeMTrE2jFII10yIqd6mRgG+TLp3EnVl/OalcwMbou CI+wEHaGio7wslCA== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Eric Dumazet , Thomas Gleixner , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Arjan van de Ven , "Paul E. McKenney" , Frederic Weisbecker , Rik van Riel , Anna-Maria Behnsen Subject: [PATCH v3 12/17] timer: Check if timers base is handled already Date: Tue, 25 Oct 2022 15:58:45 +0200 Message-Id: <20221025135850.51044-13-anna-maria@linutronix.de> In-Reply-To: <20221025135850.51044-1-anna-maria@linutronix.de> References: <20221025135850.51044-1-anna-maria@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 --- kernel/time/timer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index bce2f87d5e70..0790ec8efe82 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1913,6 +1913,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);