Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6826103rwp; Tue, 18 Jul 2023 06:29:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlHajZKC25Fm+/GhuD9GBJEuZtMrpWT70TtnhY1Rc+GAW9xH62ZNDVQ6GAEN0GDusd7AFclv X-Received: by 2002:a17:906:196:b0:993:d589:8b75 with SMTP id 22-20020a170906019600b00993d5898b75mr16071926ejb.2.1689686980454; Tue, 18 Jul 2023 06:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689686980; cv=none; d=google.com; s=arc-20160816; b=QUMzL5G+2/uiMIpGudwyvKcqJaAHbakzCYJ2TBnPIvz0JTX+1PLHSYsdYSvKMGQWrO LlWZ+3mqEDqC1u46ByatLJ5Bxdhk9PzVW3XbsYaWVYUocs0ntyTPNv256foInHNzf/wa JEQwxQtkwu9WjPo04FygE8zNZLFAKFomF1vz82Rvc67L4SR0rFJCSkkiyW/s9tNEjNcF PHB65nh7c1UxHszvMZjONcwW4hnqfMexRTCV+L9FF5m5kiHKRnFPa/YlRVCeu6PDrh8L peAJj3r6quHvyRDmFQXCCtuiJjD5Isd+aDlGjWTkXSyQDrzQtSUJmSJyaIZ61UPJQp/9 TXtA== 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=/M/qQnMSwnh+97aUq8vDjOoEVfN55OnkfZv67VGG31g=; fh=umXxQwQ8ly+0WbFtZG5jnxEn+Ak8a2UpZMnBvxZKHf8=; b=boxmPlZbVlRfxa0dVUDrw9AX8bfkvXAUQHVMojPa5ewAygfaGfo3KSOPn2G1xkNgw2 QlE+VB12MuWmCXakuU/vgI3StjeI977Mr2vH6BMKdn4fNkkJW1LCdxYKic/73KxiOrzs S027pWKoKFH93Zh7En2UBuGMFQ/l3b7C4vmBvTtJV+cvuW3ECMfjnC5ePxKpvPKdKWCg mPQinaCxeIaXrW3wUO8kjZE9vhU1YTyyEfkGqC6x+5SbVW1H+nFQfTh8eJyUeFhL0z42 UarMib1NNqJxcC17YnkRSoU4/rsMeTwcWifN1NurEvH9WEw17X8DjlvfwtrF0HQ4vDuW 678Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LChU4XjG; 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 gj13-20020a170906e10d00b00992e21b04aasi1217195ejb.720.2023.07.18.06.29.16; Tue, 18 Jul 2023 06:29:40 -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=LChU4XjG; 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 S231451AbjGRN0X (ORCPT + 99 others); Tue, 18 Jul 2023 09:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbjGRN0V (ORCPT ); Tue, 18 Jul 2023 09:26:21 -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 262E919F for ; Tue, 18 Jul 2023 06:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689686733; 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=/M/qQnMSwnh+97aUq8vDjOoEVfN55OnkfZv67VGG31g=; b=LChU4XjGq0QlL6hx2ras4Gxhh/qpYiR1QuM6Kc5ld1jU5TiAI/64X3nuyo4wIM5tNRqg8z 6EOxjuglBX+C6nEaV3H8oGwY+hsKThH35fuktPuogjmQooOYvr79M2UVM+IAjNjGrY3nSv ZFRDzBb5UwQcZ5LTKiq+aUoPc2VtMSU= 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-19-nJ-UxPPROZGyyjWR7POI3Q-1; Tue, 18 Jul 2023 09:25:31 -0400 X-MC-Unique: nJ-UxPPROZGyyjWR7POI3Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E050881B25; Tue, 18 Jul 2023 13:25:28 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.22.9.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E380C2C864; Tue, 18 Jul 2023 13:25:27 +0000 (UTC) Date: Tue, 18 Jul 2023 09:25:25 -0400 From: Phil Auld To: Tejun Heo Cc: linux-kernel@vger.kernel.org, Juri Lelli , Ingo Molnar , Daniel Bristot de Oliveira , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Ben Segall , Steven Rostedt , Mel Gorman , Frederic Weisbecker Subject: Re: [PATCH v3 1/2] sched, cgroup: Restore meaning to hierarchical_quota Message-ID: <20230718132525.GB126587@lorien.usersys.redhat.com> References: <20230714125746.812891-1-pauld@redhat.com> <20230718125759.GA126587@lorien.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718125759.GA126587@lorien.usersys.redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 Hi Tejun, On Tue, Jul 18, 2023 at 08:57:59AM -0400 Phil Auld wrote: > On Mon, Jul 17, 2023 at 08:27:24AM -1000 Tejun Heo wrote: > > On Fri, Jul 14, 2023 at 08:57:46AM -0400, Phil Auld wrote: > > > In cgroupv2 cfs_b->hierarchical_quota is set to -1 for all task > > > groups due to the previous fix simply taking the min. It should > > > reflect a limit imposed at that level or by an ancestor. Even > > > though cgroupv2 does not require child quota to be less than or > > > equal to that of its ancestors the task group will still be > > > constrained by such a quota so this should be shown here. Cgroupv1 > > > continues to set this correctly. > > > > > > In both cases, add initialization when a new task group is created > > > based on the current parent's value (or RUNTIME_INF in the case of > > > root_task_group). Otherwise, the field is wrong until a quota is > > > changed after creation and __cfs_schedulable() is called. > > > > > > Fixes: c53593e5cb69 ("sched, cgroup: Don't reject lower cpu.max on ancestors") > > > > Does this really fix anything observable? I wonder whether this is more > > misleading than helpful. In cgroup2, the value simply wasn't being used, > > right? > > (Sorry, my editor bit me...I had added:) I don't feel strongly about the fixes. What was there seemed broken to me so ... "Fixes". But it doesn't matter. > > It wasn't being used but was actively being set wrong. I mean if we are > going to bother doing the __cfs_schedulable() tg tree walk we might as > well have not been setting a bogus value. But that said, no it was not > observable until I tried to use it. > We have a field called hierarchical_quota, that was being unconditionally set to -1 for cgroup2. I figured it would be more correct to reflect the hieratchical quota. :) > I'm fine if that's dropped. I just wanted it set right going forward :) > > > > > Signed-off-by: Phil Auld > > > Reviewed-by: Ben Segall > > > Cc: Ingo Molnar > > > Cc: Peter Zijlstra > > > Cc: Vincent Guittot > > > Cc: Juri Lelli > > > Cc: Dietmar Eggemann > > > Cc: Valentin Schneider > > > Cc: Ben Segall > > > Cc: Frederic Weisbecker > > > Cc: Tejun Heo > > > > Acked-by: Tejun Heo > > > > Thanks! > > > > > + * always take the non-RUNTIME_INF min. On cgroup1, only > > > + * inherit when no limit is set. In both cases this is used > > > + * by the scheduler to determine if a given CFS task has a > > > + * bandwidth constraint at some higher level. > > > > The discussion on this comment is stretching too long and this is fine too > > but what's worth commenting for cgroup2 is that the limit value itself > > doesn't mean anything and we're just latching onto the value used by cgroup1 > > to track whether there's any limit active or not. > > I thought that was implied by the wording. "If a given task has a bandwidth > contraint" not "what a given task's bandwidth constraint is". In both cases > that's how the other parts of the scheduler are using it. The actual > non-RUNTIME_INF value only matters in this function (and only for cgroup1 > indeed). > > But... the value is just as accurate for cgroup2 and cgroup1. The task is > still going to be limited by that bandwidth constraint even if its own > bandwidth limit is nominally higher, right? > > > Cheers, > Phil > > > > > Thanks. > > > > -- > > tejun > > > > -- > --