Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30168rwd; Wed, 7 Jun 2023 18:43:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Wm9B18JZai04IEfGiD+7abaTubJ2qbFxY34MwSm/DNDWpK8dUiGQLwdy51Kmv0zU5aChl X-Received: by 2002:a54:440f:0:b0:398:2db1:dc26 with SMTP id k15-20020a54440f000000b003982db1dc26mr4798662oiw.31.1686188613165; Wed, 07 Jun 2023 18:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686188613; cv=none; d=google.com; s=arc-20160816; b=au+WApia2p2YOap/8GO8iVOm9Hx7izSQe8SXAE27wfzpd/5LVuwghMj1X79KnXdXa5 8HXmbQQUIiez2n9y5M/qcYwihESv6SwT6Til0NP+1CElyPd6GijLFDDLHc7guhT5OQd+ 3T19OarNzLfjBLXAxr0JOoyQ2by5hQZ66gb/r9a8JVkAc+KypvCjX2XMv6uihD0zLTAV w7sYGiYiRiwyHEBnn2DM7c+VSyMM5npFE7njFU1UCJ4rZC9J3j/bB4qj/oFUIM991WEj i7Pz0Qh9FueD/vSueXzzZOyLrHm5BIhO4cvnfqokD6C5Ue1wSRI6PBFRjimbDxvufUFH JJow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=ng32tWXL98UVNzodQ7JANpAeSKBoyfdr5bFpej8jqqg=; b=lE0ihsjKG6qPpOT+SVVubYcMzwb+1Hq813tlNhAJ8JMY9NdddqKVytm7zl/yE/jvFi 7XP6dQFHCgRrsfKOtEu6mXT2xa4fFYfINbHlg+Da/3c8jspEP617yBLk91swU9awJdmv x/bKZvcHxXOYggS6e21tbX6DE1djHGtVYvm8V3QOViSOVsLt0pu+w1EsNK2J+nXHnSRH gIxlfYa3UsUzxe4s+m2O2DxRLLvEX13cMXKVAIKmdGAF7KMjPCBTvZc8JydugzqumYJp GLXQY18GtkMG/tIEeOYCIubPKcgSquJTLVJCEWNDgzOxCoonSQcV+KHcZmZvqeqbqT4Y XU8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ORRq/TGT"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a17090a828100b00253667cf6e4si1978989pjn.20.2023.06.07.18.43.16; Wed, 07 Jun 2023 18:43:33 -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=@redhat.com header.s=mimecast20190719 header.b="ORRq/TGT"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbjFHBMg (ORCPT + 99 others); Wed, 7 Jun 2023 21:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbjFHBMe (ORCPT ); Wed, 7 Jun 2023 21:12:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D00C26A4 for ; Wed, 7 Jun 2023 18:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686186707; 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; bh=ng32tWXL98UVNzodQ7JANpAeSKBoyfdr5bFpej8jqqg=; b=ORRq/TGTJy/WIsR1Xmh1emWdL3MbE6TAgb0fXo264PB9iCJ8Y5CjHUqEzupPGtMzFa7fx4 ODSfwp2VgB3pSCxi2pIfkPffjeSo7mOr/kiJqxDt/zgksYhpktgm0ccBH3xjtpUVCs5Ikq FhRUyxQlHRpDecWqoqa5et8bZyyuBCc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-fvbDl8aGMO26Vh-XVmcLYQ-1; Wed, 07 Jun 2023 21:11:42 -0400 X-MC-Unique: fvbDl8aGMO26Vh-XVmcLYQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ED86F185A78B; Thu, 8 Jun 2023 01:11:41 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EFA0140E954; Thu, 8 Jun 2023 01:11:41 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id F223D40194A6F; Wed, 7 Jun 2023 22:10:46 -0300 (-03) Date: Wed, 7 Jun 2023 22:10:46 -0300 From: Marcelo Tosatti To: Frederic Weisbecker Cc: "Rafael J. Wysocki" , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH] sched/idle: disable tick in idle=poll idle entry Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 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(); } else { cpuidle_idle_call();