Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2455046imm; Thu, 16 Aug 2018 09:50:45 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwhxlvdAnNNmmhKl5NtKRMI0APx5s9SkDzDO5d2dNtl4QousZYaw9WM9xpOCYoQ5PCw+CSA X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr33181274pfa.203.1534438245459; Thu, 16 Aug 2018 09:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534438245; cv=none; d=google.com; s=arc-20160816; b=FOrTdagBsPQFUgMOrxaDOROqxvAHEftiJDUzW94YndD2NkJEfJao7wu2cFCr9KCYM6 bkx7J3z9og+mmCQXwsPq4Mpy9u1qW/nerd+0rmGIHSFIE9nqwJ0Cbz6XtLSbUj2CPf5m INknUC2Y2MPa/cl+otZVDbNLC8Epq7Qe0G83T+4HalCjyqrtWb+1xlAdS1YOaAEPQhMR S93HouxNKtKKWIT2dYnyCYde+qg1eStJMlKixNYWZX+2sQEoU3/wr3yXg1le8odNHAXy TkniZOLVwsGZVT1GBpO56kbRRj5vIgSur9YZIQhjyQAHsU4/pG+g9tQQt7+cFFyRGlug 5lWw== 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:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=weuGr3cCIE0egwzIPTFvzIW6XcuxeWUNgmfEgAM44WY=; b=tIFnupM4+SZScdI4lofPbHPaABctLnH0VmkIu5zvB+7V7bAPSPkIhrw2lxK2mom7Ge 9GkH78LmVTEGlLITIG9xZNlnidpv+Pnb//Pq+LPn/apXjnU7qeT69wGCVGxs1MXsGcc1 k9JwYu/9e0jTIW4LH8HTFhWY3s5YeUUN8bv2kdukSqasMMg/m0dEpkMFP0MC46a473bz Nst8H+1pMyJy/7gEaf7gYYTzhYJKYRZy50q2fxZJashsIl40+Px3ao764mPRBXoHpeTn B8e34lJli7ePs1dNBw+AKJc0uDrrZKuzV5HC16h+hP4t62TKSHBu5ARJTL2WTaElhrRN /dGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=eI41sope; dkim=pass header.i=@codeaurora.org header.s=default header.b=mJ9pY54H; 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 v16-v6si26890899pgb.96.2018.08.16.09.50.30; Thu, 16 Aug 2018 09:50:45 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=eI41sope; dkim=pass header.i=@codeaurora.org header.s=default header.b=mJ9pY54H; 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 S2390297AbeHPMGY (ORCPT + 99 others); Thu, 16 Aug 2018 08:06:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53822 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731148AbeHPMGY (ORCPT ); Thu, 16 Aug 2018 08:06:24 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 20DA76219F; Thu, 16 Aug 2018 09:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1534410556; bh=D6+ZfYVj5z4ke9Sfkn/YqsovGpH9r6jzVIBRXq5WsrY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eI41sopeVGMb7gbn3NdJ6kwwyaNDa43haVYMpNkSv5ijYFt9d2zJgelSBQVTaUBqA ZAPGhGB2ALKCxO25fbGf9hbjyQAU7yiAvV1uQDT3V9zQ6NVyr5TJBbrGqwkxzR7F18 HZFximya4RtXvf+x0oBqE+9ugKu3SfU7zs08/qCs= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D5B3E62159; Thu, 16 Aug 2018 09:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1534410554; bh=D6+ZfYVj5z4ke9Sfkn/YqsovGpH9r6jzVIBRXq5WsrY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mJ9pY54H0A0x5D0Dj7h1UfYTkxt1VRUtC32ejqXxecZazEXOi9vkcDA4wgKUgHfN0 r1/qkHENwBRDNNGHFJAHE9YKt+WhwLYSSi9vVqdAvdJGW5pm3NF1JfpODFZjyfqvXT 5e0nShSfJDnH82t7f8QOp19KCr5LJC8C7orQaNzE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D5B3E62159 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org Date: Thu, 16 Aug 2018 14:39:06 +0530 From: Pavan Kondeti To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v3 09/14] sched/core: uclamp: propagate parent clamps Message-ID: <20180816090906.GC2661@codeaurora.org> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-10-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806163946.28380-10-patrick.bellasi@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 06, 2018 at 05:39:41PM +0100, Patrick Bellasi wrote: > In order to properly support hierarchical resources control, the cgroup > delegation model requires that attribute writes from a child group never > fail but still are (potentially) constrained based on parent's assigned > resources. This requires to properly propagate and aggregate parent > attributes down to its descendants. > > Let's implement this mechanism by adding a new "effective" clamp value > for each task group. The effective clamp value is defined as the smaller > value between the clamp value of a group and the effective clamp value > of its parent. This represent also the clamp value which is actually > used to clamp tasks in each task group. > > Since it can be interesting for tasks in a cgroup to know exactly what > is the currently propagated/enforced configuration, the effective clamp > values are exposed to user-space by means of a new pair of read-only > attributes: cpu.util.{min,max}.effective. > > Signed-off-by: Patrick Bellasi > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Tejun Heo > Cc: Rafael J. Wysocki > Cc: Viresh Kumar > Cc: Suren Baghdasaryan > Cc: Todd Kjos > Cc: Joel Fernandes > Cc: Juri Lelli > Cc: linux-kernel@vger.kernel.org > Cc: linux-pm@vger.kernel.org > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 8f48e64fb8a6..3fac2d098084 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -589,6 +589,11 @@ struct uclamp_se { > unsigned int value; > /* Utilization clamp group for this constraint */ > unsigned int group_id; > + /* Effective clamp for tasks in this group */ > + struct { > + unsigned int value; > + unsigned int group_id; > + } effective; > }; Are these needed when CONFIG_UCLAMP_TASK_GROUP is disabled? > > union rcu_special { > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 2ba55a4afffb..f692df3787bd 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -1237,6 +1237,8 @@ static inline void init_uclamp_sched_group(void) > uc_se = &root_task_group.uclamp[clamp_id]; > uc_se->value = uclamp_none(clamp_id); > uc_se->group_id = group_id; > + uc_se->effective.value = uclamp_none(clamp_id); > + uc_se->effective.group_id = group_id; > > /* Attach root TG's clamp group */ > uc_map[group_id].se_count = 1; > > @@ -7622,11 +7687,19 @@ static struct cftype cpu_legacy_files[] = { > .read_u64 = cpu_util_min_read_u64, > .write_u64 = cpu_util_min_write_u64, > }, > + { > + .name = "util.min.effective", > + .read_u64 = cpu_util_min_effective_read_u64, > + }, > { > .name = "util.max", > .read_u64 = cpu_util_max_read_u64, > .write_u64 = cpu_util_max_write_u64, > }, > + { > + .name = "util.max.effective", > + .read_u64 = cpu_util_max_effective_read_u64, > + }, > #endif > { } /* Terminate */ > }; Is there any reason why these are not added for the default hierarchy? Thanks, Pavan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.