From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF607C04A6A for ; Wed, 2 Aug 2023 14:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjHBOVV (ORCPT ); Wed, 2 Aug 2023 10:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjHBOVT (ORCPT ); Wed, 2 Aug 2023 10:21:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B9BA2 for ; Wed, 2 Aug 2023 07:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690986030; 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: in-reply-to:in-reply-to:references:references; bh=4cULcRDzjAEp5tsRJsYNJAOaHhUEHwj8tmDruDkdM4Q=; b=E44dLJnb3pyLZV+0S1BzZMyO7SUQMd8cOwAsYBD1i5cevr0HlPvc0l9HCr5MDzM3TWktuy PVsEjAb9qXVx0MEKb1e+CNBAHrUp7uzEMvPYPB+HwL1vCXQmY99btssGfWNDT61bPMn0GR g/rpvUs6Jhssxfq1NYB30wldNIKNlM0= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-687-Bxh9ZkkBPbKkq3-wRp9Qnw-1; Wed, 02 Aug 2023 10:20:26 -0400 X-MC-Unique: Bxh9ZkkBPbKkq3-wRp9Qnw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D059F3815F71; Wed, 2 Aug 2023 14:20:25 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.39.192.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90A17F7FA4; Wed, 2 Aug 2023 14:20:22 +0000 (UTC) Date: Wed, 2 Aug 2023 10:20:19 -0400 From: Phil Auld To: Peter Zijlstra 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: <20230802142019.GB325565@lorien.usersys.redhat.com> References: <20230712133357.381137-1-pauld@redhat.com> <20230712133357.381137-3-pauld@redhat.com> <20230731224934.GD51835@hirez.programming.kicks-ass.net> <20230801111342.GA268019@lorien.usersys.redhat.com> <20230801153731.GD11704@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801153731.GD11704@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2023 at 05:37:31PM +0200 Peter Zijlstra wrote: > On Tue, Aug 01, 2023 at 07:13:42AM -0400, Phil Auld wrote: > > On Tue, Aug 01, 2023 at 12:49:34AM +0200 Peter Zijlstra wrote: > > > 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? > > > > > > > That was just a hedge in case it caused issues. I'd probably have had to > > enable it in RHEL anyway. Using a feature was to make it inocuous when > > disabled. Would you prefer me to enable it or remove the sched_feat > > entirely? (or do you want to just switch that to true when you apply it?) > > I've edited it to default enabled -- we can pull the feature flag > eventually I suppose. > > Things didn't readily apply, so I've kicked at it a little. Should be in > queue/sched/core for the robots to chew on. > Or "choke on" as the case may be :) I sent you something that will hopefully clean that up. Thanks! Cheers, Phil --