Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp4096916rwp; Sat, 15 Jul 2023 16:54:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7xdKHmDknQ8JrQS95B8RhiT2zYtwDrINl5W4Jp7jiTS75n6I87pq0FPWZLzssV6EJfq+4 X-Received: by 2002:aa7:dacf:0:b0:51b:c887:dd1e with SMTP id x15-20020aa7dacf000000b0051bc887dd1emr7480722eds.18.1689465262022; Sat, 15 Jul 2023 16:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689465262; cv=none; d=google.com; s=arc-20160816; b=OsrzKZbL7CzRCBrcNdv1Ni18UIKPW5TaJkd5uJOi5ng82Nij2GqUS89Wd3OLOfuCvE SE/2U9FwQD7vooGUkbKGAy/7BkeLBWAvrnydrNCjNKMCAvT9jQFBHZWcE8c+Ruf2E4wE v6ror5jLEjUoLI93QsdlEkSrZSlfVvexIcqHfwo+HtXRZv8ayXb1FqsFkP2lPXLpGLzk GddB+oJUIUIYwKiZENfq5qgcyPxVynLYtqs+ZtAzQrI2ArshgwQN2z0TdTB575LTYE77 kQZvDnxGA1yaWXaQEg6oDAByar+QXZwKIXQunbjZGUHPwBklG89nWDZoSmqgCuQ8ODdj HTVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:cc:references:message-id:date :subject:mime-version:from:content-transfer-encoding:dkim-signature; bh=N7MgboZx90jF0EJSqAzzEpTDlebQzsGpE8n/Cdx0a74=; fh=0Ul1RUH9IA2iTcfi7W/3JPmbKZzn6SMjDRqdsKBMhLI=; b=avVzdiLseMET2HZSZ6d49ZHT1tlWHjMp2ZPxIogqUgWdMAjWyx+iTEgmoTZGGBsMmZ E3nshS1DlXfjtEJu/ZXMlTcACjXyHBBHm0muk5RVTiovXNz350HBuU2y2hrSLSKsjnGW dqXnBAehVQL9lC+mqdxiYC8HS0GR6fDu2nCNgpKjjFtpAXwM2Xt4Ad+qz3weNsTaxR4m LYzAPDiu+KuyQSr26mPhqOi/zI0el2DKaX0DCDPLAqagaOTr6uRZhooMeE9GKnIC7a3c FY4enbHYlhw8zAGe6Bvf4iEPebEYHVCI9U7z9EvCOWn3dpP4FtJg/2CaGB9MHRwoDICc T3sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=b8RoTGCX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020aa7d4d9000000b0051dd511f0c1si4528251edr.177.2023.07.15.16.53.46; Sat, 15 Jul 2023 16:54:21 -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=@joelfernandes.org header.s=google header.b=b8RoTGCX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbjGOWbj (ORCPT + 99 others); Sat, 15 Jul 2023 18:31:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjGOWbi (ORCPT ); Sat, 15 Jul 2023 18:31:38 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B84151993 for ; Sat, 15 Jul 2023 15:31:37 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-403b3273074so14156601cf.1 for ; Sat, 15 Jul 2023 15:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1689460297; x=1692052297; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=N7MgboZx90jF0EJSqAzzEpTDlebQzsGpE8n/Cdx0a74=; b=b8RoTGCX7eaGsMYVj+LzjQRa5iRr8pH1/hQn+GKXAUnvQJIof5tsqtklxPOJNDVIg0 VpbTwd9/4wauLBMt23b0oGTpvFfSz87nAWvqKNwwvLN/lb3twp62h1/QSiaKZAMm+8v7 LkO/Luc+aICKNj6PvQVG+T08PYZIHxkbItTLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689460297; x=1692052297; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N7MgboZx90jF0EJSqAzzEpTDlebQzsGpE8n/Cdx0a74=; b=kHty71/lkMPHFaDHbRp2uc512DCjX2JIb91c0zjBj+qDRhKAOcu06uhNt5ivBaMsUs EBavyyO7cktY0J9/0RRFrLILMTPlJhW4/RQo73Y3YFzcQUjEvF4cz61R4/VP30nL3tlq n3QTj5feNgPA59sic/Qzd/fU31qVVR6m2igj0tC4XuT7ckLOLZIIFE9geM8z1X5aIXW7 klZb2LWrcXiOMAMVAZEGqiZGrsU03O2O7d81Ra2ei/+2Ad5BEhuVpVhGziXGwBTvpB/1 r5OW3WwdjOfDqEjPGv6K5eR08pLTOp/wmwoAlC7BnFS3OFnViOGb6dAMShfkANUOc2E7 YfQg== X-Gm-Message-State: ABy/qLah4lGAM2Xn6NO9uf7J/T77tUOECFR0+ct2WAB/UnYdIAh9kBmQ ArIO35QaNYJ8gmvDC70D1stXvw== X-Received: by 2002:ac8:5ac9:0:b0:400:9f2c:1211 with SMTP id d9-20020ac85ac9000000b004009f2c1211mr8970043qtd.29.1689460296808; Sat, 15 Jul 2023 15:31:36 -0700 (PDT) Received: from smtpclient.apple ([192.145.116.143]) by smtp.gmail.com with ESMTPSA id ay14-20020a05622a228e00b003f9e58afea6sm5097446qtb.12.2023.07.15.15.31.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jul 2023 15:31:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Joel Fernandes Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 3/3] tick/nohz: Don't shutdown the lowres tick from itself Date: Sat, 15 Jul 2023 18:31:24 -0400 Message-Id: References: Cc: Thomas Gleixner , LKML In-Reply-To: To: Frederic Weisbecker X-Mailer: iPhone Mail (20B101) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Jul 15, 2023, at 2:19 PM, Frederic Weisbecker wro= te: >=20 > =EF=BB=BFOn Fri, Jul 14, 2023 at 09:02:43PM -0400, Joel Fernandes wrote: >>> On Fri, Jul 14, 2023 at 8:01=E2=80=AFPM Frederic Weisbecker wrote: >>>=20 >>> 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(), do= n'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? >>>>=20 >>>> /* Skip reprogram of event if its not changed */ >>>> if (ts->tick_stopped && (expires =3D=3D ts->next_tick)) { >>>> /* Sanity check: make sure clockevent is actually progra= mmed */ >>>> if (tick =3D=3D KTIME_MAX || ts->next_tick =3D=3D [...]= >>>> return; >>>> [...] >>>> } >>>=20 >>> 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. >>>=20 >>> Or am I missing something else? >>=20 >> Just take it with a grain of salt but I think you need to still call >> tick_program_event(KTIME_MAX, 1) here for the case where the tick was >> previously stopped, and then when the next tick fires (say after a >> long time T), but that tick is a one-off and does not result in >> restarting the tick -- then there is no one to call >> "tick_program_event(KTIME_MAX, 1)". >=20 > I'm a bit confused about that one-off thing. What can trigger that timer > interrupt if it has been stopped? It is the tick that has been stopped in this scenario. The timer could still be armed to serve a future hrtimer? I think the naming in the code for is a bit confusing for tick vs timer even= t, so I could be the confused one. Thanks, - Joel > One thing can happen though: a pending timer IRQ while we are stopping the= > tick (IRQs are disabled in that idle loop portion). But then that pending t= imer > interrupt is not going to reprogram another one. So it remains stopped. >=20 > Thanks.