Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6871737ybi; Wed, 5 Jun 2019 07:41:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYGpViyTZFVBQ38MateqluwHOhelrtxbzeUokq35Ijdf2PVZ3y3A6jx5OfsjddRcwJgSc/ X-Received: by 2002:a63:4183:: with SMTP id o125mr5065593pga.161.1559745691382; Wed, 05 Jun 2019 07:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559745691; cv=none; d=google.com; s=arc-20160816; b=VJzPMVEj4bWEYYRtmyvEnNu+m3inMzFk2f5n1mQXrmX+7yrcM/gcVdjPCkmIA9wjOH Zfg6ZsKigGa7c9H8H4K8n0zwNmiI+NOW0dnMdjngPrifA/8WY6a64ThkTUuVTf5xmMPs ETIwA7kCO2vc2VEEVyoaDkkmf+E6J3r4/NS1s/IhR3AYiLQq2rdXZGyIZ0TW4QPRyurF 7OA7lGOByD8j/Vr4J+cxgfnsFXKO5qN7bSr76gExro5MR5u9h0r3CQEmXLSp8pTjKGFj BGV+luV7jLqiKCYxwNqAqXqRETm6xBKzEb0zS185RgiRLm+ub3uF12fY3HnHV55ZIWoQ 5tUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=343dg4JZbrx0mc5+wuOjeNb2jYP4H39qXt9QnfKFpYg=; b=fFfhRNs4oKH1ymVqiwv0GQZd5a5v0Y3nRu0VVCKRPh+baf3mRakXmaFdBqMzGxeO/u rbFyi4+VO1ytELbXdMQ8xW3xPEGcuKNDD3B0mNqBikpAP20fifAnHDsecM3s8bJdYk3E NEBG+s6e6rT1nKKUr6VUPPba7NB0rX3epTlEW9Uom3kEH5X593TBVt0KMOMTANmvH0sO TWU+3Xz3CBmUZn9vvKOzlITHfdKHr8H8e4pN5pxUyxKi1ipq5bvttaaHyE0nczM+97AL sTeLtnv6hzyyfeZaLHpOvmGoFUqrBZN2f/84k+XLPJNqywvMypGNLG+KN+xbJhPRuQCC wjcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si13581860pgc.596.2019.06.05.07.41.13; Wed, 05 Jun 2019 07:41:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728429AbfFEOkA (ORCPT + 99 others); Wed, 5 Jun 2019 10:40:00 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:32884 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbfFEOkA (ORCPT ); Wed, 5 Jun 2019 10:40:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 796AA374; Wed, 5 Jun 2019 07:39:59 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8515E3F246; Wed, 5 Jun 2019 07:39:56 -0700 (PDT) Date: Wed, 5 Jun 2019 15:39:50 +0100 From: Patrick Bellasi To: Tejun Heo Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v9 12/16] sched/core: uclamp: Extend CPU's cgroup controller Message-ID: <20190605143805.olk2ta5p2jnd4mjt@e110439-lin> References: <20190515094459.10317-1-patrick.bellasi@arm.com> <20190515094459.10317-13-patrick.bellasi@arm.com> <20190531153545.GE374014@devbig004.ftw2.facebook.com> <20190603122725.GB19426@darkstar> <20190605140324.GL374014@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605140324.GL374014@devbig004.ftw2.facebook.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-Jun 07:03, Tejun Heo wrote: > Hello, Hi! > On Mon, Jun 03, 2019 at 01:27:25PM +0100, Patrick Bellasi wrote: > > All the above, to me it means that: > > - cgroups are always capped by system clamps > > - cgroups can further restrict system clamps > > > > Does that match with your view? > > Yeah, as long as what's defined at system level clamps everything in > the system whether they're in cgroups or not, it's all good. Right, then we are good with v9 on this point. > > > * Limits (high / max) default to max. Protections (low / min) 0. A > > > new cgroup by default doesn't constrain itself further and doesn't > > > have any protection. > > > > Example 2 > > --------- > > > > Let say we have: > > > > /tg1: > > util_min=200 (as a protection) > > util_max=800 (as a limit) > > > > the moment we create a subgroup /tg1/tg11, in v9 it is initialized > > with the same limits _and protections_ of its father: > > > > /tg1/tg11: > > util_min=200 (protection inherited from /tg1) > > util_max=800 (limit inherited from /tg1) > > > > Do you mean that we should have instead: > > > > /tg1/tg11: > > util_min=0 (no protection by default at creation time) > > util_max=800 (limit inherited from /tg1) > > > > > > i.e. we need to reset the protection of a newly created subgroup? > > The default value for limits should be max, protections 0. Don't > inherit config values from the parent. That gets confusing super fast > because when the parent config is set and each child is created plays > into the overall configuration. Hierarchical confinements should > always be enforced and a new cgroup should always start afresh in > terms of its own configuration. Got it, so in the example above we will create: /tg1/tg11: util_min=0 (no requested protection by default at creation time) util_max=1024 (no requests limit by default at creation time) That's it for the "requested" values side, while the "effective" values are enforced by the hierarchical confinement rules since creation time. Which means we will enforce the effective values as: /tg1/tg11: util_min.effective=0 i.e. keep the child protection since smaller than parent util_max.effective=800 i.e. keep parent limit since stricter than child Please shout if I got it wrong, otherwise I'll update v10 to implement the above logic. > > > * A limit defines the upper ceiling for the subtree. If an ancestor > > > has a limit of X, none of its descendants can have more than X. > > > > That's correct, however we distinguish between "requested" and > > "effective" values. > > Sure, all property propagating controllers should. Right. > > > Note that there's no way for an ancestor to enforce protection its > > > descendants. It can only allow them to claim some. This is > > > intentional as the other end of the spectrum is either descendants > > > losing the ability to further distribute protections as they see fit. > > > > Ok, that means I need to update in v10 the initialization of subgroups > > min clamps to be none by default as discussed in the above Example 2, > > right? > > Yeah and max to max. Right, I've got it now. > Thanks. Cheers, Patrick -- #include Patrick Bellasi