Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3115817rwp; Fri, 14 Jul 2023 18:05:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjwAkYONtekw8WOkMRQi5g//YCBbiFMCL7aRYZHoCqg6ob7xm6e8pPGzQGdSZAOJtW/4/V X-Received: by 2002:adf:f8c7:0:b0:314:3dd7:bb9e with SMTP id f7-20020adff8c7000000b003143dd7bb9emr4653689wrq.7.1689383107664; Fri, 14 Jul 2023 18:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689383107; cv=none; d=google.com; s=arc-20160816; b=TU0YM391pPu7h0ZWoZhBQ+z49Mi2sSILyLn1n+6tS/U4ebiW85HH9qVFWoXQ+UppgZ i39wg60YkP3QxKb3rllSjqO5KKwRa0LUaj6MAe3xFGMt18j/EDYX/Flg3kEzTyrSHZj1 0JQdm7B7wjn2JHQmtORDMuKpZ3E5qNM7Q1ahGfJYDRBcg2J+AtI8iS0wLYMNRd6xrqR/ Ibk2J+wUkBMXmLjrmZkLlLmtXs+qqSn5HGr1hAhALNUyc4ilGySmx7fw9+W0h0C11uKd uixIlFTKvExE4Kj2P8tOfP7McDlSE5P3IQ9M5GsBW3V9jB3OyZ1j81L84lkI+uE7UWv7 ENEw== 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=ZFb1iG6xOA1tFPSgPVwa0vGSqvSeYEYMwFMOFtyAxXI=; fh=KH7SlTDGNMXZSz12qOpLtP1dXGDDKK5qiGJWO0WNkXg=; b=DohGZOwHqg9djxBKf/ijZm6HGMqzc3UNSNT1Q+pATbrAdHFsrJ004wBraDdjvnAnn2 MuKnZKSh3B/GpF4FRZYgHQhmi72qfoMYPE5eCTqSFe5h8uQEVJK0yDzooNL2lQ/7eQo/ NdiXSbSkjlZdH4wBXSpQVBITK0LK+081pWQreEfqONQD0aahOFecccRk6ANh/kPd8tCR EtBtNApwWWrDW3qo7VALOMOSqeKSm5aQK5ulJyCLL9OLABuZwXmgCB/EiR769nBMDRYC VQOPjMH/wa4ecmMOuEEMZSm9gq8nP3vixluYTviKBp+9VIYZzZBknZM4/ULTs3Reiy2m x4OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HtiCKLWt; 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 jx14-20020a170906ca4e00b00993470850bbsi10018932ejb.749.2023.07.14.18.04.43; Fri, 14 Jul 2023 18:05:07 -0700 (PDT) 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=HtiCKLWt; 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 S229542AbjGOAB5 (ORCPT + 99 others); Fri, 14 Jul 2023 20:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjGOAB4 (ORCPT ); Fri, 14 Jul 2023 20:01:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0CF1BFA for ; Fri, 14 Jul 2023 17:01:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3297D61152 for ; Sat, 15 Jul 2023 00:01:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EC96C433C8; Sat, 15 Jul 2023 00:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689379314; bh=48z9z9MmpXB6cr2JS9/1wpOyf340RvMqtEV/mvOeGk4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HtiCKLWtwsdwvqkDrLAi/4oAfTRZ3TKJ19fLMfeH2XAvpgEUHEc4yMP4z0T080prY 4+2AbU/WTu+smvT+ApJUV/o3UKDXi6JU/s7Y984SNc5P60s2KDCPVEMJdLOHPitQ/z 7vUHYm6spzLOtrT23SSaafWeybdDpVcBA3SY3H529yw603nsjPdjzrK1aF1xhsSQca OxRiyZNN5683hpl68ZfvUG5PYYDRLS9VD5cnG5+sWjVjF/rSpH3fF2G9Jn7/V+pZON Qdc4OJ2/8tmMdMf8RvsphBeXpiqQ1ZGmw+pRUn22Bo0yWbJVSY2W5eb+ta2jYm/+iD NM52xWooaXwRg== Date: Sat, 15 Jul 2023 02:01:51 +0200 From: Frederic Weisbecker To: Joel Fernandes Cc: Thomas Gleixner , LKML Subject: Re: [PATCH 3/3] tick/nohz: Don't shutdown the lowres tick from itself Message-ID: References: <20230714120852.23573-1-frederic@kernel.org> <20230714120852.23573-4-frederic@kernel.org> <9347e3d4-e774-f75f-22c4-6c2dba294423@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9347e3d4-e774-f75f-22c4-6c2dba294423@joelfernandes.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, Jul 14, 2023 at 02:44:49PM -0400, Joel Fernandes wrote: > On 7/14/23 08:08, Frederic Weisbecker wrote: > One slight concern here though, where in the idle loop is the removed > statement "tick_program_event(KTIME_MAX, 1);" happening if the tick was > already stopped before? If it is happening in tick_nohz_stop_tick(), don't > we early return from there and avoid doing that > "tick_program_event(KTIME_MAX, 1);" altogether, if the tick was already > stopped and the next event has not changed? > > /* Skip reprogram of event if its not changed */ > if (ts->tick_stopped && (expires == ts->next_tick)) { > /* Sanity check: make sure clockevent is actually programmed */ > if (tick == KTIME_MAX || ts->next_tick == [...] > return; > [...] > } Sure, if tick_program_event(KTIME_MAX, 1) was already called in the previous idle loop iteration, then there is no need to call that again. Or am I missing something else? > > Also just a nit, here you can remove indent by doing: > > if (unlikely(ts->tick_stopped)) > return; > hrtimer_forward(&ts->sched_timer, now, TICK_NSEC); > tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1); > > Which is pretty much the original code except for the tick_program_event(). Either I remove an indent or I remove a statement. I guess it's a matter of personal taste. I don't mind either way :-) Thanks.