Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1246125pxj; Fri, 4 Jun 2021 09:27:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFsteVCK+0wcfiIYqe3kRqy9Z/x5MnjC7O+U02jERkz+ilK1xNbYTZVTGpA2vO+w4g7yZr X-Received: by 2002:a17:906:509:: with SMTP id j9mr2482624eja.149.1622824056693; Fri, 04 Jun 2021 09:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622824056; cv=none; d=google.com; s=arc-20160816; b=Znry+mRenJr+d5KrJWOvAM9Qzi/egrJqg0E/pu1krZ4eCTolLNMLdSuD2Dn4Nb58/E AK93ANAHluwwbmTDFPzgF3Uz6IKH26FIEYvdd5xZrAa1Mwi7tNEeSZjkYy2mrVLd6B1p McATOUR1mCxsBawD1Jtvcf5k72yO2guSduXAGBiIAEyWdx28MuBJX++qPEZuV3G76RIH 7PG3kzxT/jv/+FaXorIMf/JKDjVfxwwcoThgO5MOue5Hs/oiNdjOOICq624WWo8rsV0D Wtu1AcSwc3gW9wS+GS04UHvrPfnXK4ATrMYE6ulw8JAnBmbs0HpU75mYY7MhA/xHNgEu 3GQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=WZjvZJ1LU7r1TrDTlLfGZnOV2m898cwd57NqCbyETHU=; b=KTnFehdyzJ9tRFMOmQe0OXhd5SqSHCtVsl91IuvP66Qp4mhiP+l8H1rdFse73QQSoW Cw1Fb9AswfRpJhXrWPPaXOJsbZNdYXSLK0JaaWukbqR5PSrvCFNpVF9P+pDYlF2S2nF+ aznZ7cTZNbkzEUB/Ha9wCoPzoZATSkvrbHTMNesYhSlLZvEYW7LRQ0TWfqNrB1TMvuNY hnPmN6xDrGKvQQsA6DWIEQrXV5foARqa/QTfo5aVH+uwgc7PEGVVPVGLxbR1kxpehv7n nThreRhd4cuRghr2/KJQSNJKMemrQB0MypPcfllNBzVaYxC/xA6SAS+U6pCqZYs2F84y ngpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si3095727eds.594.2021.06.04.09.27.13; Fri, 04 Jun 2021 09:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231514AbhFDQYh (ORCPT + 99 others); Fri, 4 Jun 2021 12:24:37 -0400 Received: from foss.arm.com ([217.140.110.172]:42556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbhFDQYg (ORCPT ); Fri, 4 Jun 2021 12:24:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1BC601424; Fri, 4 Jun 2021 09:22:50 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A3BBA3F73D; Fri, 4 Jun 2021 09:22:47 -0700 (PDT) Subject: Re: [PATCH] sched/uclamp: Avoid setting cpu.uclamp.min bigger than cpu.uclamp.max To: Qais Yousef , Xuewen Yan Cc: Quentin Perret , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel , Chunyan Zhang , Ryan Y , Patrick Bellasi , tj@kernel.org References: <20210602123803.15738-1-xuewen.yan94@gmail.com> <20210604160839.2op4ak75vle3gmt3@e107158-lin.cambridge.arm.com> From: Dietmar Eggemann Message-ID: Date: Fri, 4 Jun 2021 18:22:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210604160839.2op4ak75vle3gmt3@e107158-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/06/2021 18:08, Qais Yousef wrote: > On 06/03/21 10:24, Xuewen Yan wrote: >> +CC Qais > > Thanks for the CC :) > >> >> >> Hi Quentin >> >> On Wed, Jun 2, 2021 at 9:22 PM Quentin Perret wrote: >>> >>> +CC Patrick and Tejun >>> >>> On Wednesday 02 Jun 2021 at 20:38:03 (+0800), Xuewen Yan wrote: >>>> From: Xuewen Yan >>>> >>>> When setting cpu.uclamp.min/max in cgroup, there is no validating >>>> like uclamp_validate() in __sched_setscheduler(). It may cause the >>>> cpu.uclamp.min is bigger than cpu.uclamp.max. >>> >>> ISTR this was intentional. We also allow child groups to ask for >>> whatever clamps they want, but that is always limited by the parent, and >>> reflected in the 'effective' values, as per the cgroup delegation model. > > As Quentin said. This intentional to comply with cgroup model. > > See Limits and Protections sections in Documentation/admin-guide/cgroup-v2.rst > > Specifically > > "all configuration combinations are valid" > > So user can set cpu.uclamp.min higher than cpu.uclamp.max. But when we apply > the setting, cpu.uclamp.min will be capped by cpu.uclamp.max. I can see you > found the cpu_util_update_eff() logic. To support this: Patrick had appropriate checks in his `[PATCH v10 12/16] sched/core: uclamp: Extend CPU's cgroup controller`. https://lkml.kernel.org/r/20190621084217.8167-13-patrick.bellasi@arm.com But is was discussed that cgroup v2 `resource distribution model` configurations (here protection/limit: uclamp_min/uclamp_max) should not be restricted. Further down in this thread: "... Limits always trump protection in effect of course but please don't limit what can be configured..."