Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp859184rdb; Wed, 6 Dec 2023 01:48:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ/8Syk7Vm6Rhj71dW/RkZS0L81MsaKWCbr7FhKHHnuXiYE8LPDUaUEU0IKNuEUejew2ja X-Received: by 2002:a05:6e02:1106:b0:35d:59a2:2bc with SMTP id u6-20020a056e02110600b0035d59a202bcmr723650ilk.92.1701856093876; Wed, 06 Dec 2023 01:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701856093; cv=none; d=google.com; s=arc-20160816; b=Np4qpUpO0PTRrvscKoqW2+FvZBAZpQGUWUkx2sNxvCZDN5RLjS1/hwCrLFFbTiKTzU vJTKFNpgQ8tc+94cYEKkuZy8LiJ/8fmPu+cF1CD8bLWTgGuE8K0xaOQwDVHODKRa6IP1 dZfaOFA4z+uS3Edr0DGIJzARRmROsAiqJmC9cj1iyGhALD0DEAT99DmLMAVXbpVTkndc eUNNy42K0WWvJgHTq3NLujGXoRWwdQYvZdyqd7JxGONl8vZ8Lme0cF5T/Orn7Wrkf24Z X4OQ7WQ8IqG/h110rn2LnY8Y7c/c32M7RzWc9EGAdA88v38FodbOEFGWCzZkMPs4qNhg L+bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=dZL4xpIW5Xbtis3hnUiCyn0G7mTR94oGieX73+hE5Tk=; fh=4LKILmejfgmojncqcPqQssQ1OafpGCkuCUM9riGOaE4=; b=XgEQTvae27Dtfs8drGT031gCYiYiRhd5dM8iGpFPoyhgPuPtGOk4m93ELzgyHU0G7C S0vZAnwcmNpIQEnK22kPFTgLc2V3FBGZxqB7tzwDCauc2/0OqEbn8hVqtLYoFrp67LPw zQV0Qbn8BBI0yoH1Eo8926xAfu9c8pvHLbS4RmQtIVgRYtyOUt2A7Cu4CyqVPYLjmZyc hWAaKQNz3ImKtY07IP6tlynWTWyWowi0mQiFMGuVl2AUDq4E28UhqSnbcL9fWavin1Lj eiYM8T/XUQaNaegMfIyrGHPSnCtd0AxXJkPXCnwAm75yZti5YPrMkG4RVGVwcNXnG7/j hcHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RemarrlJ; dkim=neutral (no key) header.i=@linutronix.de header.b=z4zP1RhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id g10-20020a656cca000000b005bd27be66e1si11596766pgw.719.2023.12.06.01.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 01:48:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RemarrlJ; dkim=neutral (no key) header.i=@linutronix.de header.b=z4zP1RhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 1871D82E7B27; Wed, 6 Dec 2023 01:48:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377343AbjLFJrt (ORCPT + 99 others); Wed, 6 Dec 2023 04:47:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377348AbjLFJrl (ORCPT ); Wed, 6 Dec 2023 04:47:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E4E110D4 for ; Wed, 6 Dec 2023 01:47:39 -0800 (PST) Date: Wed, 6 Dec 2023 10:47:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701856057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dZL4xpIW5Xbtis3hnUiCyn0G7mTR94oGieX73+hE5Tk=; b=RemarrlJFGANeBLplMKNzkZVPTgIXVgK0dnGTqZRpWRUqYuPNg/igS6wMk7e9a0ywmooih E8hIqIr8R7+MShTnVtcZAT52YYNbPlrbT7WnPcUGXKSxK8qlpV0HB6PBAPLKMYreUbN7l/ kXGyL+1mc6S8vz/bZy53JD0DxWMzleHzS9WqHZ/Ua6g3x7veJh2bNdp0zsT8QwBtqiImuU ePXAGipjEoSKs5jrQgk6DZspsnsspss9zmjvXdcBBXROPv3BxwEWN7rbXk2j+VkkaftBO3 5dEzCBM7PruJi5aRi+CN1bBDQPjmWGIEmcGgPZZjzUJuFqYPGoQXGUOooewa6Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701856057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dZL4xpIW5Xbtis3hnUiCyn0G7mTR94oGieX73+hE5Tk=; b=z4zP1RhM6n+SbF00Fk8AL8K/95cDBJ1CT8SFh0vLFGW1f56DUpS23k285R6aMNF9pyEemp Eol2yJnCC/pv0/Dg== From: Sebastian Siewior To: Anna-Maria Behnsen Cc: linux-kernel@vger.kernel.org, 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 , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Richard Cochran Subject: Re: [PATCH v9 23/32] timers: Retrieve next expiry of pinned/non-pinned timers separately Message-ID: <20231206094735.HMFIZlHa@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-24-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231201092654.34614-24-anna-maria@linutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 01:48:11 -0800 (PST) On 2023-12-01 10:26:45 [+0100], Anna-Maria Behnsen wrote: > For the conversion of the NOHZ timer placement to a pull at expiry time > model it's required to have separate expiry times for the pinned and the > non-pinned (movable) timers. Therefore struct timer_events is introduced. >=20 > No functional change >=20 > Originally-by: Richard Cochran (linutronix GmbH) > Signed-off-by: Anna-Maria Behnsen > Reviewed-by: Frederic Weisbecker =E2=80=A6 > index 366ea26ce3ba..0d53d853ae22 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c =E2=80=A6 > @@ -2022,13 +2028,31 @@ static inline u64 __get_next_timer_interrupt(unsi= gned long basej, u64 basem, > =20 > nextevt =3D local_first ? nextevt_local : nextevt_global; > =20 > - if (base_local->timers_pending || base_global->timers_pending) { > + /* > + * If the @nextevt is at max. one tick away, use @nextevt and store > + * it in the local expiry value. The next global event is irrelevant in > + * this case and can be left as KTIME_MAX. > + */ > + if (time_before_eq(nextevt, basej + 1)) { > /* If we missed a tick already, force 0 delta */ > if (time_before(nextevt, basej)) > nextevt =3D basej; > - expires =3D basem + (u64)(nextevt - basej) * TICK_NSEC; > + tevt.local =3D basem + (u64)(nextevt - basej) * TICK_NSEC; > + goto unlock; You claim "No functional change" in the patch description. However if you take the shortcut here you don't update `idle' if set and you don't __forward_timer_base(). The `idle` parameter doesn't matter because it was false and will remain false as per current logic. But what about the forward of the timer base? It is probably not real problem since the next add/mod timer call will forward it. Sebastian