Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4994647rwb; Mon, 31 Jul 2023 16:18:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQn1DXijIYAv7bCpWLdGoFolWILm/gArc8Y2OOmybTE6Z5TR4QoXgSZBNlvkXaFNBIwAvS X-Received: by 2002:a05:6a20:8e04:b0:132:f926:5891 with SMTP id y4-20020a056a208e0400b00132f9265891mr14056908pzj.4.1690845528468; Mon, 31 Jul 2023 16:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690845528; cv=none; d=google.com; s=arc-20160816; b=0qtPAlA879FlWHAU3xjdmqqf3fZyTnSVGEOOfXTvolNQCPC6nwhfUP9vFy/Bu+sWaK TkUSGEAfHrxgThEpRFaRGDSCouOaD+EC1mU2+Z6Z6ObFVTbzlLUCV29fEdfZrwMhMuCP 5pEJ2vdnMuBlNWHhDKVP1FAsgfgXAS+VXEXNhkY4FsZi30IrjZ5KCzKFot8IuwWOMNFD 80+qP40NxLoCiwLErK2+jkvpho+Bsq2X2gQNY7beI/AzwEb5rmctRxp2CajzYfTADUql 7QJtNcZlaMywUkj1ZhbEwaqysaoiAm0cJXHBCVlM/kan3bAD+O0nfnANaCgeXo0AzOtP GL/Q== 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=ahdjnU/aZEg8hQeqIwNWmpju2UZuGxXlSNy7n0A7aSc=; fh=W/gx/LwfuoAA+44g+8J1UCJtq//EfNr/kFtrzb0O43I=; b=zmWfFdwIIzt9MZTCFEpbz1W4NIzmPPYKEikvZ6qSJk2Rc6b3E86PWcwttSdwsBiUN2 0QwSGvRqS1YU05jApo8mTjDIO1W+Nx18EMYp2hohpNmbJEoaDQ7amUJ067WkpZCD4o4K vUT3tfgeAXJ1ynHP4rb9IHS3iefGNR3DgDwUhz26NENTbS0nzFh/3/KatyQnxW7/QRzc vrRPjeNbYZjOZ9tHYMg/EPMcQyj5SAh9XH+G1X3/it3/U895lZ2MwxWhLhIrmq63+pGj 0U7psXVEedbGFAAFljzMxx1rE00NjrV+XMaQTF8djXl8Kdp7vND6DfOGXnGqnsaCNQik Nw1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=cpSiKELB; 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 bx22-20020a056a00429600b0068725ed59eesi3627852pfb.404.2023.07.31.16.18.36; Mon, 31 Jul 2023 16:18:48 -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=@infradead.org header.s=desiato.20200630 header.b=cpSiKELB; 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 S231439AbjGaWtw (ORCPT + 99 others); Mon, 31 Jul 2023 18:49:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbjGaWtv (ORCPT ); Mon, 31 Jul 2023 18:49:51 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A8E1BCC for ; Mon, 31 Jul 2023 15:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ahdjnU/aZEg8hQeqIwNWmpju2UZuGxXlSNy7n0A7aSc=; b=cpSiKELBZ5h3LCVZdnTVpaRM0n /ae9paxwqpOr0ptZRDqtA067osyVwL3FQSi9FlMCyykqOZBm0syCGzsqSYg3R+EP0fDdt957aC2gS F8CjcHIpLt+lpSzmFyS/FjSfor+Cba6xoOTeqPfeq29paZs5YJP6X3KyJw9Rc23lAmkprDdnZlpzi w35NPFZwU6L/tfZ2f7WUxYO3xbcfpd99HRHtY+nC2AZeVcIFU8r7of31p7fnfAijpmEiB0YULuUAt S8l/BpVRV8lj47x5JJmSTIJIfsIEvJZeV5KSpUDon6QZGBc4k+z1fZuciDtTEsn0YwxBuEiMtzbll gtFblefw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQbhn-00D8le-2g; Mon, 31 Jul 2023 22:49:37 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 22E43300134; Tue, 1 Aug 2023 00:49:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EE138200C570F; Tue, 1 Aug 2023 00:49:34 +0200 (CEST) Date: Tue, 1 Aug 2023 00:49:34 +0200 From: Peter Zijlstra To: Phil Auld Cc: linux-kernel@vger.kernel.org, Juri Lelli , Ingo Molnar , Daniel Bristot de Oliveira , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Ben Segall , Steven Rostedt , Mel Gorman , Frederic Weisbecker , Tejun Heo Subject: Re: [PATCH v6 2/2] Sched/fair: Block nohz tick_stop when cfs bandwidth in use Message-ID: <20230731224934.GD51835@hirez.programming.kicks-ass.net> References: <20230712133357.381137-1-pauld@redhat.com> <20230712133357.381137-3-pauld@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712133357.381137-3-pauld@redhat.com> 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_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 On Wed, Jul 12, 2023 at 09:33:57AM -0400, Phil Auld wrote: > CFS bandwidth limits and NOHZ full don't play well together. Tasks > can easily run well past their quotas before a remote tick does > accounting. This leads to long, multi-period stalls before such > tasks can run again. Currently, when presented with these conflicting > requirements the scheduler is favoring nohz_full and letting the tick > be stopped. However, nohz tick stopping is already best-effort, there > are a number of conditions that can prevent it, whereas cfs runtime > bandwidth is expected to be enforced. > > Make the scheduler favor bandwidth over stopping the tick by setting > TICK_DEP_BIT_SCHED when the only running task is a cfs task with > runtime limit enabled. We use cfs_b->hierarchical_quota to > determine if the task requires the tick. > > Add check in pick_next_task_fair() as well since that is where > we have a handle on the task that is actually going to be running. > > Add check in sched_can_stop_tick() to cover some edge cases such > as nr_running going from 2->1 and the 1 remains the running task. These appear fine to me, except: > Add sched_feat HZ_BW (off by default) to control the tick_stop > behavior. What was the thinking here? This means nobody will be using this -- why would you want this default disabled?