Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp710454rwd; Thu, 8 Jun 2023 06:50:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4K838+mj1w4fLLxc/sN9fd6RncGH3uXkYdnvlpmbd/eyncY6KufFOv7JIg9eXfNpTKyv0L X-Received: by 2002:a17:90a:35c:b0:258:dec2:5c0b with SMTP id 28-20020a17090a035c00b00258dec25c0bmr4431995pjf.21.1686232258687; Thu, 08 Jun 2023 06:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686232258; cv=none; d=google.com; s=arc-20160816; b=dtrw2RWRY8H4SLTCuVTD6ke/v4gL3BrQyOmisMTRcJXDQGxc/8qodWEIjjUXRgioDF o1y+0XR1/MhBCqdvxc8ZcvTxX9oC9UzONiWs9HotIdOP0g9vKTbfXlGz6HJkzGVCXvY3 VljI4M7ZiFJWTpNSvwBjTh/PpaVWJroiTl+AIYIIMmzBxG8hzqctYL56HoYcEr0tYb8Y 92c3sKa9gUCLosHvFp0qu/xpoAel/IKIWhprzpjDfts1t39KoVZ55fI6E/A1fy7kIn+J kjXGzXh49SlxzdxopqtuEvjpnZBtPx4wiU9AkL9mKBjqzLI2HsqWboJTk8gys4zJw4S+ nuNA== 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=KnTmnc9NrsTttLjiiTb3f75wWPSS2kuQjr8eOTqOLiQ=; b=oDvqFalwFWwddbwSeF4xf0Bm7krjBIGweeWrPQrWtRTUa3OZrmv7oms9d4FAQwAKdd OoFnsQJbkScWA0Lu3P6Y3cn/CfGZ/+0kVyKh2yJ+wAKeHxRBJ6jvbOjDbcVyQrQIEkbT TZCE9gbzup7dxWIrpoTa594EJ4Ci9ZXNoAm5Vx4zZQMNhOONxxGrmO3YOreuTG+9efi1 JWdPBaYXp76nos0KfhNghB2/axmIBh/Dp4IMGYJqFxzoxERt4BRf0kRh3dMl4jnhK+pf 9jHPLL4Yr56zw0uh+Qo2Ut72TQNjt/BNV/C5Gycb9Wyg/c6sAX9r+RWcN0nRymDwGpEQ lkzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cg+2xuY/"; 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 d10-20020a63734a000000b00543cca81bb9si1004201pgn.329.2023.06.08.06.50.44; Thu, 08 Jun 2023 06:50:58 -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="cg+2xuY/"; 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 S236553AbjFHNZK (ORCPT + 99 others); Thu, 8 Jun 2023 09:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbjFHNZJ (ORCPT ); Thu, 8 Jun 2023 09:25:09 -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 8977EE57 for ; Thu, 8 Jun 2023 06:25:08 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 201F864AAE for ; Thu, 8 Jun 2023 13:25:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23040C433D2; Thu, 8 Jun 2023 13:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686230707; bh=ffrwrWEfJmcH+mGcOtv3y3UnYs5C7RZS0GATvAwY41Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cg+2xuY/4+rpa2cfGcg68qce/lhCIanbmtEhverETP9h5fY//9MpXiOhA1RqzPwvP AybeqvuPLNoylj8jktjjGJjwIP9k7ivIgceiLTM0y2kABNVq6OM55oXrR2SFxjRnLR 8gGmqxHWDaf4n13rDHWVUbkCx/ne1Y5X1ZNvfXpRNllaGC7dIcia2lC4OyelexoBGL 5ExtBggIOGWj7+Rn33e4GGzXqiCe4AAE6RMZmtXmDF+cl5j2K5Qn4E05tCydqz8ZDn 1NOlhEGSbKn2Hpw5/r6tv3403BD+PsASt9EqOK+7EGpePFvjBNxgV3xmB1CSkvW5GC D1px0+c9XbBHQ== Date: Thu, 8 Jun 2023 15:25:04 +0200 From: Frederic Weisbecker To: Marcelo Tosatti Cc: "Rafael J. Wysocki" , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/idle: disable tick in idle=poll idle entry Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Jun 07, 2023 at 10:10:46PM -0300, Marcelo Tosatti wrote: > > Commit a5183862e76fdc25f36b39c2489b816a5c66e2e5 > ("tick/nohz: Conditionally restart tick on idle exit") allows > a nohz_full CPU to enter idle and return from it with the > scheduler tick disabled (since the tick might be undesired noise). > > The idle=poll case still unconditionally restarts the tick when entering > idle. > > To reduce the noise for that case as well, stop the tick when entering > idle, for the idle=poll case. > > tick_nohz_idle_exit (called if the NEED_RESCHED bit is set) > is responsible for re-enabling the tick when necessary. > > Signed-off-by: Marcelo Tosatti > > --- > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > index 342f58a329f5..fdc240988ea9 100644 > --- a/kernel/sched/idle.c > +++ b/kernel/sched/idle.c > @@ -276,7 +276,7 @@ static void do_idle(void) > * idle as we know that the IPI is going to arrive right away. > */ > if (cpu_idle_force_poll || tick_check_broadcast_expired()) { > - tick_nohz_idle_restart_tick(); > + tick_nohz_idle_stop_tick(); > cpu_idle_poll(); cpu_idle_poll() re-enables interrupts and only checks need_resched(). If an interrupt happens and queues a new timer without waking up a task, the timer gets ignored. > } else { > cpuidle_idle_call(); >