Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3293182rwb; Tue, 8 Nov 2022 02:55:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM5OeegFCZBgBUDRZaQvX22d8jAVdfAluEfnMqjR9rw7H82DTm+ofK5ICo2XzC7jLraAEEqS X-Received: by 2002:a05:6402:884:b0:461:1ed:579f with SMTP id e4-20020a056402088400b0046101ed579fmr54955498edy.413.1667904945877; Tue, 08 Nov 2022 02:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667904945; cv=none; d=google.com; s=arc-20160816; b=cxMlVl4Sk6BeIjXZN26aAZZYmPqvxwdtz1hHHqBpKsxMEMaEBUun1sDP0DCvP3gC84 QAr5arsBnTRtyKNE8XhY7Yf4PdHwVRaSe4p+o9DdY6q9wS10dvb5xLdd6AvpMF5rBVOm MXT9et3yk6j74lEWjDM3dTxHWnMtIZlBSaevs6FspcoWbBH86f3SUgEO/c4na5gKN7VF g9HEETMi8Jf9qDMDbgtSjnuwTMdxo5S5bN7ni51SuA/us6oWSf0r06TiPCZSXGR4kZG9 gIp5i2xs8SvspoIcz4UuXRHNFzawMFZT/Y8do0zhrvAiJkedIuB7TicMDry+7SuWH8jl 6WpQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5Ao1sJzKQZ0F++pdL217wFfXp4MnFHcjIKNInb+PX7o=; b=KJY7Ki8Anv5jMdz5wEgT3scYgxVIfPOuARjeHHc8jEhxE0UJrrL3t7IiDmKPSUfI0W KgJjsYQzPnhd6tCmQaKTy8eabEz30v9ogECuFb+iv02AJ8Ledm2ii75g9+KEJsI86c2A 1fwd0IbYS9xdxOvH96pfBEVqHiU48rpt4uDziHqcqxOGPWbv4dQhpwAuSO24KwK+oNo/ G36Lh65iod/BTTtUDphb+aZTiJlubjp49iIsNEz4TgAaCjSayXQu2Rd0b0jeqarHKU4J 8KNK2mT/zxLt6Npw9xkv1KbyVl0+jGEN0oG2S8wHiJw0wQtlK+6IPfXtmBkUntMi4dmg EghQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c7LgW4B1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc32-20020a17090716a000b007ae63fe980dsi9892035ejc.931.2022.11.08.02.55.23; Tue, 08 Nov 2022 02:55:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c7LgW4B1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233683AbiKHKrr (ORCPT + 89 others); Tue, 8 Nov 2022 05:47:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233203AbiKHKrp (ORCPT ); Tue, 8 Nov 2022 05:47:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593A71055D for ; Tue, 8 Nov 2022 02:47:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A5E2B819B8 for ; Tue, 8 Nov 2022 10:47:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22693C433C1; Tue, 8 Nov 2022 10:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667904461; bh=0aemqMIa5Wnsttdn47YkqbHMFof+7rLlgEqf4m2rpHE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c7LgW4B1GvtJdsxvuBowaqHeogpN9LdzwOsJOBqyIsPyDJ2nLemGRCIHd06JvhOWc I/QMt46XB6lZZ4+U9I+PV1A88aTgaIvewwB9CTNdd8Gx+JE/ntyL2AIxzKACCn1QkP bewbLuQkCRfhh95+UYmqbXfFODQESq8fMzoN3ZogD+ypnaPxlT8ZDp3eUoX4jyur/8 K+IvHS/MWtM0aBH6x7+a2Wn/IukBZHamqv3TvEj56ylkQ8RCSp2WK0Yh6ipdZUyJ2u t/v7BOSWgRygjTSTmdn54VSYgbAb6GyR0MwLtcr/99bHwgkLDF53esvZQvW34Jpa1h 8+Zdg09txlV3g== Date: Tue, 8 Nov 2022 11:47:38 +0100 From: Frederic Weisbecker 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 Subject: Re: [PATCH v4 14/16] timer: Implement the hierarchical pull model Message-ID: <20221108104738.GA21669@lothringen> References: <20221104145737.71236-1-anna-maria@linutronix.de> <20221104145737.71236-15-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221104145737.71236-15-anna-maria@linutronix.de> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Fri, Nov 04, 2022 at 03:57:35PM +0100, Anna-Maria Behnsen wrote: > @@ -1859,6 +1863,36 @@ void forward_and_idle_timer_bases(unsigned long basej, u64 basem, > */ > is_idle = time_after(nextevt, basej + 1); > > + if (is_idle) { > + u64 next_tmigr; > + > + next_tmigr = tmigr_cpu_deactivate(tevt->global); > + > + tevt->global = KTIME_MAX; > + > + /* > + * If CPU is the last going idle in timer migration > + * hierarchy, make sure CPU will wake up in time to handle > + * remote timers. next_tmigr == KTIME_MAX if other CPUs are > + * still active. > + */ > + if (next_tmigr < tevt->local) { > + u64 tmp; > + > + /* If we missed a tick already, force 0 delta */ > + if (next_tmigr < basem) > + next_tmigr = basem; > + > + tmp = div_u64(next_tmigr - basem, TICK_NSEC); > + > + nextevt = basej + (unsigned long)tmp; > + tevt->local = next_tmigr; > + is_idle = time_after(nextevt, basej + 1); So after that, tevt->global shouldn't matter anymore for tick_nohz_next_event(), right? If so then probably that line can go away (with a comment specifying why we can ignore the global part)?: tevt.local = min_t(u64, tevt.local, tevt.global); Thanks.