Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1548484rdb; Thu, 7 Dec 2023 02:13:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IE35U3R68n/KgW9sd5CR1NuZ+9tmgX38/1Z0zzfEjd16CSw2BNcTGEqUi8cHsDVeJ+sDsIy X-Received: by 2002:a17:902:eb4c:b0:1d0:9826:6570 with SMTP id i12-20020a170902eb4c00b001d098266570mr1978125pli.20.1701943990934; Thu, 07 Dec 2023 02:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701943990; cv=none; d=google.com; s=arc-20160816; b=UVM39pq0R9wzLZM808P4WrKFunt8+SR1TGmoI/XBtRshNsRgtNoQlY7FdBWGswSU4U xeJ/ZG7DAF+OiMCAtttiKP2aRMolIhMwdgu5r3+mdfING3aULrjMQiBEd6pCqmIGdnv6 2ekW1CEPsv1YPOceFzBvATbLEAGOWZYIUTu/gpwbcNIzCHVj/xo4OD2VS8wkzFFdHJjv J7lRlK9Owkk66XbN+yziIc+qnE012S/virxJ9Pg47Tb/zlDoQT8iGWfgKTJMXVSjGl11 ULcLyH0rqjW8A5ufFdq16Ui8uziE2BGE091GcnCtIRNlVn9k9ZYVxotpWo2JYlDgWqhP W9zA== 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 :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=3uUxHjyDj4NRFMrhXCuRnn2gfUyDxgWhxlbVoNO/d3M=; fh=YKn3uPfaA5nN+8pZY/jw/HyZrSnvWg60+MCe46F6YDQ=; b=r9whaxSLTq7zms9A4dexm1aovGvHoV11nHS7pTGVLFncBa8tAp2uwIA0DYJkUrDpWk Q4l6Id5u/P7cctjx+7sBu1Reno7un0Civw4PRjeNnB+t5CU4N/gdU1+AmD238odYo7TE jTTXNlo2ybT0ZCXj37PAhJjRHW8N43d5EIO+mjO+pNfTF7Io6EXGqyBweYw/KtDjkm7e +ITQyCvxF8siiHuEcMeOpA817pqbKY+1XYNxKNpqQtNLmoj4sNfmyBT0HOCVOujk10lY g9ebmb6YrzfxjfUSc5dQvGU/zeVg3eQtcqN9YV0kfMi6GKeUa+VAMWPLXMV4Cw/M1sdr DTbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cfJROQdJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e7-20020a170902b78700b001cff34e87a0si841882pls.600.2023.12.07.02.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:13:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cfJROQdJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id C1B4480D0C49; Thu, 7 Dec 2023 02:13:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231845AbjLGKMr (ORCPT + 99 others); Thu, 7 Dec 2023 05:12:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbjLGKMn (ORCPT ); Thu, 7 Dec 2023 05:12:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3398A8 for ; Thu, 7 Dec 2023 02:12:48 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701943966; 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=3uUxHjyDj4NRFMrhXCuRnn2gfUyDxgWhxlbVoNO/d3M=; b=cfJROQdJKb2KzsnF9n0prH8m5esN/M7acjPp7eQEvIgSMDLshZcvEY1I640zhN3tmfasyu Lb/D358mrpPlcNiRr2vS+q7DvCv1KFv8rOyuZhJfIqOv+XdA++lzVOACq9SI1VOxVUBHk8 KXHqQbLHmeBn80bcc2faNgB9N/jZvSqPqr1yq0gPbCqJQ/wDVPL7TzjMgnY7hsktSt3B8f gTiZWqO/j/aCuwJVxALwvN0tpN1Lt4dyP13uNPTYTzwuDgbMjeyJAL+KKVVTpKAY61PX7V xrZ+9Hg6ckjOlWuB3y4kIR8pYK4bzfLKhg1Gt6kk/LHr4KXxniYj3d8MT9Wv0A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701943966; 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=3uUxHjyDj4NRFMrhXCuRnn2gfUyDxgWhxlbVoNO/d3M=; b=EQAKsl0dDkVzdF0MrvwdUQkH5wXKUQG6fBDuCDpgjWQr6tb7mZVT/QlfUdr+oW/lK5UyAD vfnauG3fCsMZO5AA== To: Sebastian Siewior 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 In-Reply-To: <20231206094735.HMFIZlHa@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-24-anna-maria@linutronix.de> <20231206094735.HMFIZlHa@linutronix.de> Date: Thu, 07 Dec 2023 11:12:45 +0100 Message-ID: <87h6ku8go2.fsf@somnus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 02:13:08 -0800 (PST) Sebastian Siewior writes: > 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(uns= igned long basej, u64 basem, >>=20=20 >> nextevt =3D local_first ? nextevt_local : nextevt_global; >>=20=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. You are right. It is not a problem as the timer base will be forwarded by add/mod timer and also when timers needs to expire. (It is reworked by the next patch...) But it is not consistent and happend within one of the last rework iterations. I'll change the goto label into 'forward' and place it before the forward calls. Thanks, Anna-Maria