Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2241927rdb; Wed, 21 Feb 2024 01:10:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV7SKwTHSZ5cxz55m0sSmTPUSL8/dXbm9cJ5p3MbVwaLKr4YFEBRws6L4Fs2xWIByvzcfwpbnJsVm93wjKWyZ/0fOdKZznzpjNIe6EbhQ== X-Google-Smtp-Source: AGHT+IHM2BrPqQjABpuI0OdbMyqGx7o4feH4cJcGzKdsdDPOnFuViOq7KxdBCuGng2jZve7R/a2e X-Received: by 2002:a17:902:f544:b0:1db:e837:409a with SMTP id h4-20020a170902f54400b001dbe837409amr8373064plf.48.1708506653143; Wed, 21 Feb 2024 01:10:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708506653; cv=pass; d=google.com; s=arc-20160816; b=wR7QFdxFcSwawMBmDrZuv5SvO1ci680Je9+fIqdcNOytx5xoLd0CfvV3c8jX0kovvo sDdsV/WfkBX/JKPP6KTnlXPLqlWmYpNf3DpaawRn5suOv8Tmr/Bc71icGqJa4jlal0Te nUYHR7oxlETak8wQ7M2FRL5hmiZW+xEQMugc+4v4P/QBzl+ph1KEAhX3QSU7qERZQ0ao bx9mI09HU5CaC/pH5Gq/0gJy1t/xkJACm30mMx+JsnbZgPidt5yyTs7ErJbJ9Kb12t08 T+9ocFw1P2AjSy5rAQDHbEK4bkHad5BUA15SShZlWCq+0dWOKvHlZ+tF0vsFVKhf7iVC o78w== ARC-Message-Signature: i=2; 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=84mTYhbxH69oUoy6SwRp7poh6N58HyKxHp1SCrdM7O4=; fh=N5fTIFf2i7nvF8Om7kdprA8Zy2dleTNav/f0ArIISzo=; b=suDbtvb6ZTQ/BJXEcaJceRS+9Sy36fDzKuvLi3PXuebW15+YrroaOJrPVwzroOVUPX 8wS3rEIRIaHL/ammPqqq6f+psbn84KpmxQeJAl9C3ZweyFtVbFX0ur65cm0q/OsUrvdL HS+4MINIOL6MEaXt5KrM6WoDAevuqGTLwXpuhaQuRNlpqVEQgX8FZ5JKi2d8Eqh6mJEg 7xlrPagFH42vINnqEKkP2scDtahKb64F8Wt+8RfRnEWemAsria9NqUbJRhCQWaZgQEqa GDYX1TzUpF6F4RrAoZFunmpC43mbBgXfWdwppty4ln8BHhhrS9mIp8Y0dHsYFK0Bmytw NPtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZKiwyV2z; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eIB2QWWz; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b1-20020a170903228100b001db56243898si7129390plh.304.2024.02.21.01.10.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:10:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZKiwyV2z; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eIB2QWWz; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74361-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 60115B232D8 for ; Wed, 21 Feb 2024 09:09:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED82140BED; Wed, 21 Feb 2024 09:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZKiwyV2z"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eIB2QWWz" 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 E65903E468 for ; Wed, 21 Feb 2024 09:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506382; cv=none; b=GmSCiox3g8nc0OnBrYNi6sOBNHb5WoH0oo8CZ96D1EIUsZhn096hCJW3Ia3sGVcW+iUDjWaMRvZLVY3LveI5MvG2j50vS78DBQUYfFpPl0rgFolcxYGGfB0Qk4RMU8SbZpRNJTaiYFBUIsldQV7CyKgR9fnbBcbY7fW7PXSecYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506382; c=relaxed/simple; bh=Ud9pgOn2B/0m50aOpIF31SSVvpgQRaOUxbGunhq51UI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pGMoyrZOuJddnwOWCFilyaEROf5iqNNiGYFJmp2bbBiR9uf85kj42iynxSLRBQyxYOxUnC5+0vs0C0CGsIo1A7cqyrj5bBEtQnBZtBNtmCipXK2BiDdhExlyWLavWp1oYaY1A6/Usa58EjaYtoq1qtscYbuwvPPBchhI86nyFJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZKiwyV2z; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eIB2QWWz; arc=none smtp.client-ip=193.142.43.55 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=1708506375; 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=84mTYhbxH69oUoy6SwRp7poh6N58HyKxHp1SCrdM7O4=; b=ZKiwyV2zkZ+h+SdEAzRyGq5O9LN9CHu1eeIzWsHowWJu6xsGLtpPL44lQ4YBsCFe8D8cwy zrenZpCWFkeb9u4ZxmK2v+tJNJ9J2qmrOY5jyCHgWcf8zBZGh+nsPVcERkERUy+TWpWT/m YQruHpAStbSFmkVs8rkOd3Rs7KQF6LOSmpubfL2ukplL/lVvaKcd8HoceXpy3Pujk9nKcC udmHmsSrpVB7uNBPmNXUEk/W9YoiMguuEdhDkPXqC8Q2R4NoARbheI7LEQC5179OikwtqY RWWy6jTQuiqsmpNFvQBxkB3NJA4KOyhSXnWIVgvYwQM2LfjyhiKaVPvBBQkIZw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708506375; 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=84mTYhbxH69oUoy6SwRp7poh6N58HyKxHp1SCrdM7O4=; b=eIB2QWWzcZQPTgaK4YkWqHopYbdU70bbtzBJsBK1v6l+WFLnw8dlk2GujZTaEKWDnqOHqp RC7nGW6K89ngf5AQ== 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 , Christian Loehle , Anna-Maria Behnsen Subject: [PATCH v11 15/20] timers: Check if timers base is handled already Date: Wed, 21 Feb 2024 10:05:43 +0100 Message-Id: <20240221090548.36600-16-anna-maria@linutronix.de> In-Reply-To: <20240221090548.36600-1-anna-maria@linutronix.de> References: <20240221090548.36600-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 Reviewed-by: Frederic Weisbecker --- 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 52af50d00ae6..7b9f9ed25fc2 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2240,6 +2240,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