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 X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE41EC4743D for ; Sat, 5 Jun 2021 02:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84005613D2 for ; Sat, 5 Jun 2021 02:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbhFECRJ (ORCPT ); Fri, 4 Jun 2021 22:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbhFECRI (ORCPT ); Fri, 4 Jun 2021 22:17:08 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39389C061766 for ; Fri, 4 Jun 2021 19:15:07 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id v22so15479357lfa.3 for ; Fri, 04 Jun 2021 19:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1EI6m4DFQAlCt7nir2Xp+wCzvHYT20bXHAsNalWojQQ=; b=QWsgQnfVWlVwkO8wXtuVA8D26uH86+8XkaNXxmUgybfCss6KHbg3Jsf+csekF8M3P4 4X7yp6jRsNc+4pZoBLlFXSO0tqAGUteW2rtN6a39ZKvgPNJiID9zi9nBx1nvf3S5grZO m3BynhIye9NJ8Fq0G3QZTOrg4BASGwDZoS3x7auJN2JmKe0kkQftCz4W2fAKfxfSYtDm XQrugGXaJNXA1wnKnifbj4Z/shK20QV/KoN4o2w8hhOzPgI4/R5BM7IPu86OcAzJJRge qLYAZIMjTWZVdY22qWH9vVYn1PrUhuHPqaUkm/YitHosAQe05IlKyPWL5RnpjhCLEYXS mF1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1EI6m4DFQAlCt7nir2Xp+wCzvHYT20bXHAsNalWojQQ=; b=rUA1mG9LynoOULldm7tlg2GDkQdAtZAQ4tKGf9TGb1ve4xHai7FYCBJPNJ4N1/rw5F U66wfzGECdfFVgS3Pz8l9uWubUPD+fDqgY+LFBmHNNQX0WrTk+bkNy3iUkwQfYR/8/mD 47lztiOnKjWsXYUel16EWoZLbxDTuTAY61vETXjxWQLoBhJJYKTcx3tAPuPI8nXkCyIl XX0DFAnANSRMrA2jEYnX/hW6a0RFTHepm+Pi6WaCNNtAZwhJgb7UGCwT7X7cRuF+nxM9 QG80x/iVSCzQikcnm7HBBD40N8hqKOZeVsg/9BTjjVokrH19Ttk3TItH9gbPK4r9HIM9 osNw== X-Gm-Message-State: AOAM530DW+ic9yMjbDC/zHS4RZS7OajXcrRQRU5anCD+C5DxcCi4jR1E b+84308GzVk3MEP2lqkjO/mOqTN9VzLwpViRoBA= X-Google-Smtp-Source: ABdhPJwnVHtwJzEup1p+5GKbnv4WHi4QY45TAGmHdjIZTyAf+gX52IUPSmhq6zMLWCrTBkquqcu7tYZ77fVeqJpbkQg= X-Received: by 2002:a05:6512:3749:: with SMTP id a9mr4737337lfs.110.1622859305584; Fri, 04 Jun 2021 19:15:05 -0700 (PDT) MIME-Version: 1.0 References: <20210602123803.15738-1-xuewen.yan94@gmail.com> <20210604160839.2op4ak75vle3gmt3@e107158-lin.cambridge.arm.com> In-Reply-To: From: Xuewen Yan Date: Sat, 5 Jun 2021 10:14:04 +0800 Message-ID: Subject: Re: [PATCH] sched/uclamp: Avoid setting cpu.uclamp.min bigger than cpu.uclamp.max To: Dietmar Eggemann Cc: Qais Yousef , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 5, 2021 at 12:22 AM Dietmar Eggemann wrote: > > 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..." Okay, I have got it. Thanks a lot! BR xuewen.yan