Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp638784imm; Fri, 14 Sep 2018 04:10:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYgDeqim7oSB493YwMnQZDx2ZvrV80JAwGPFbgXb9QZNyj5SOeanTBjUQbJuqTKX3WJShZP X-Received: by 2002:a62:c8d2:: with SMTP id i79-v6mr11957582pfk.35.1536923440840; Fri, 14 Sep 2018 04:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536923440; cv=none; d=google.com; s=arc-20160816; b=MmJTZNyBEJ3Xx87uDfLFewI5MvXtJGTWeB9Ld88WxpYMABuOEwuSGgG4vpFYA6EwlE 6U2OTjfFzOfKyh7U7KsNYWUnbwDVXpXlOVVzSfXo6RrmdLWad3k9lbQbrw6K8KWXCA7u uSHbsAxPEWmYjyanhxCWwJTqP2glGu7od67pSiEUjABdYeH6XKnxBqYlgySbxsyGwnDk uc3Ov+pZC6pidRNkIEon+bbCVqYBkN60s5rU77DZAboo8tLAYWbnIotx6Ipn5kGESaCw CNkJbmclee2NUdXyAVkKGCVYaxeP/Tp/ORBGvNhlXyLyEYNIZVLlaksCIAveRQ3eo+3D UlGA== 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:dkim-signature; bh=L91hesCxwrsmspGhu6/nktd6VBuPJq4l1UYkxX5JsSg=; b=HQPYKOpBlFtzmzrrS1OFiGiMLa3jZ/dBY2olca8X9d4MvstgpD2MOz1u9QiOOaklbk C1ld9BM/GuPMHPGzBgIOoW65oz/CLoZ1w6dPjPzrFL+NMLN20Yi+Ep3ovKVvFIOmW0++ Tt66fNYLdRPNT5D+DMQzy3VmmJGRBBZpdtT4Gf4w9rx0//VF8AVhGGyMJm9NozVbiaIO f6azdZqln7vmdpOwRataAbJFUY6C2T4SAOLaqlk8w2ScsUKzXZg2H5f46QV9+Q9ZL61p mi04rC72Q2qGL9njvvG8Fmnr5o5HQphBVsA1T1U/nsqnk+TrSqJ3NM/KKIB90p261zS3 43rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="rbuasfm/"; 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 r14-v6si7551106pli.447.2018.09.14.04.10.25; Fri, 14 Sep 2018 04:10:40 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="rbuasfm/"; 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 S1727730AbeINQYU (ORCPT + 99 others); Fri, 14 Sep 2018 12:24:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39844 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbeINQYU (ORCPT ); Fri, 14 Sep 2018 12:24:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=L91hesCxwrsmspGhu6/nktd6VBuPJq4l1UYkxX5JsSg=; b=rbuasfm/+Nn1D/AbZN0hoi62C V0o06rAV5RKj70AFCety8B/IxzHJGrA8pezip9tHVgM7n0ZrP7s4JmDjgsq+uKYhHhsT/WxZnVzoB r5C05QdekJQZBGWBYaBgZ430Q+V6Vf3GFkDI/qEaoIqTcBm1OjRJ2p6Jh6+PkQuXOs0Uixe75yhuh 5T0HAcZbFg+QlY8DTGmKnI4DX8SDPgLG8pnfEHHlZkBfn3yDP96xCo6SBUP0D9uwhQBiSCTKEEjZU qKj6/mnVW+vAqyoxch2Ad16N5i2f0zF0eY3v5c0fIC8+zCYyNYTF39rgmIFFXNFBTomuwKme2I/Dl LaqLa21sQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0lzB-00027j-SC; Fri, 14 Sep 2018 11:10:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9D962202B2E3D; Fri, 14 Sep 2018 13:10:03 +0200 (CEST) Date: Fri, 14 Sep 2018 13:10:03 +0200 From: Peter Zijlstra To: Patrick Bellasi Cc: Juri Lelli , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v4 14/16] sched/core: uclamp: request CAP_SYS_ADMIN by default Message-ID: <20180914111003.GC24082@hirez.programming.kicks-ass.net> References: <20180828135324.21976-1-patrick.bellasi@arm.com> <20180828135324.21976-15-patrick.bellasi@arm.com> <20180904134748.GA4974@localhost.localdomain> <20180906144053.GD25636@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906144053.GD25636@e110439-lin> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 03:40:53PM +0100, Patrick Bellasi wrote: > 1) _I think_ we don't want to depend on capable(CAP_SYS_NICE) but > instead on capable(CAP_SYS_ADMIN) > > Does that make sense ? Neither of them really makes sense to me. The max clamp makes a task 'consume' less and you should always be able to reduce yourself. The min clamp doesn't avoid while(1); and is therefore also not a problem. So I think setting clamps on a task should not be subject to additional capabilities. Now, of course, there is a problem of clamp resources, which are limited. Consuming those _is_ a problem. I think the problem here is that the two are conflated in the very same interface. Would it make sense to move the available clamp values out to some sysfs interface like thing and guard that with a capability, while keeping the task interface unprivilidged? Another thing that has me 'worried' about this interface is the direct tie to CPU capacity (not that I have a better suggestion). But it does raise the point of how userspace is going to discover the relevant values of the platform.