Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp483100img; Mon, 18 Mar 2019 07:30:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqykanwHw3DKUNRFqmq0CvYi9GNywTFhFPQPmBlcJ5/IYCWj83czVS+dDx9HHGfSlk3qqAZY X-Received: by 2002:a62:70c9:: with SMTP id l192mr19535588pfc.207.1552919442352; Mon, 18 Mar 2019 07:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552919442; cv=none; d=google.com; s=arc-20160816; b=v2bn44yTGaJXlF5+FynXanOV3EyoANNlaYPwnNE0BPK0oSkOgsR2S3AkCIBJ2EWwR+ B4d7ym4gBT2R1X3qUgdSmvA5lLsMj4K+QELrfThn4SgXwcEoNvrPeUCc2Re2GRdioEJL I1FBrCJiPdM58P//eQ9tEJ6SsZF3wmOwnMsLsX3oZxI2UVgUS80OcPOY60N0DIOPgjcy sC3wCfofZLNYGV4BPJYFC0ueRGMeSX4rfb3t0Is51sU0l7jUUvczM1LsEwumfA275bAL t+A216TtNsmKK75GxLtp1ey4t6BgllVSkuyNqch6ZJWM2TDQLl3HgCBT8Jz9Z3qc0DMc aHgw== 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=laOtTVpv43PYwoSYj86I6ACQnkyPR7h6qSuvkrpg3DM=; b=AjZkkP4+rPGYcB88h610vYW+3a0sWp74+yw8TM6nB7a5DZ8HKcMvri3EiZjvxyn3Aj qPA31iAdJDa2kczsxLqkEqOdYp6VLyi7PUlv+Tx5W0VzY/eOjiBHB7LNR8jBDUmupswn Z42uIxoJgEWj6gDnoGgeBwFPiuGNP1bVnxmPMCFQJN7/Gpm7+I3r4Qj0eWgFxdXL8fhV ZsSvSKDDoSU2D5gjFhpdbJwz++xMFSa/k2KZbyCk7dKY7uRgJb+0bcg1DYZxRxKwtg3Y vMmDp4GL5zCJoJmSo4m9JwjSmHGYVMeiM5ynooPJtt6/gNDeASecHaOGcWJZFU3wqMTr su0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=NY4hXDfK; 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 b13si9614890plz.22.2019.03.18.07.30.26; Mon, 18 Mar 2019 07:30:42 -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=bombadil.20170209 header.b=NY4hXDfK; 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 S1727809AbfCRO3V (ORCPT + 99 others); Mon, 18 Mar 2019 10:29:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41838 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbfCRO3T (ORCPT ); Mon, 18 Mar 2019 10:29:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=laOtTVpv43PYwoSYj86I6ACQnkyPR7h6qSuvkrpg3DM=; b=NY4hXDfKI6zzBr794q9eqRSdP S7VRz7wKZXeuL9Wbiq9/zKUAdp5mjlk8Uxe9lefsuMllB7p1A/w+XOgncmHxzd0T8O63wzhsxmnxW 2v6fgM7QR08Jfv6QdBEXC+PyICCXLRXnPpSxS+DPqFj2pR3ttnUeRP/2+uPSsTJpP+cshDjtn2QM+ ozpaZghOBocFI4knFgP+b9TT3O9Iiwr4MhehM0L8zJ8Zcg+sgquOxhiw4mLaKHjMh6XChawAhfabt 1RvKZ6hGpAN98QWWcbAJxqk/NqLXqPbcHPE6V40IgR/EKZnaFfAW7F5YRt09LHY5w+w1kNah1BVlO AlDXEJ/Uw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5tGL-0004WS-5R; Mon, 18 Mar 2019 14:29:13 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 57200202194F5; Mon, 18 Mar 2019 15:29:10 +0100 (CET) Date: Mon, 18 Mar 2019 15:29:10 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "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 v7 03/15] sched/core: uclamp: Add system default clamps Message-ID: <20190318142910.GR6058@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-4-patrick.bellasi@arm.com> <20190313201821.GW2482@worktop.programming.kicks-ass.net> <20190318121804.tr3myhtgczvovmkq@e110439-lin> <20190318131050.GQ6058@hirez.programming.kicks-ass.net> <20190318142152.44biczhoby44xlfz@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190318142152.44biczhoby44xlfz@e110439-lin> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 18, 2019 at 02:21:52PM +0000, Patrick Bellasi wrote: > On 18-Mar 14:10, Peter Zijlstra wrote: > > On Mon, Mar 18, 2019 at 12:18:04PM +0000, Patrick Bellasi wrote: > > > On 13-Mar 21:18, Peter Zijlstra wrote: > > > > On Fri, Feb 08, 2019 at 10:05:42AM +0000, Patrick Bellasi wrote: > > > > > +static void uclamp_fork(struct task_struct *p) > > > > > +{ > > > > > + unsigned int clamp_id; > > > > > + > > > > > + if (unlikely(!p->sched_class->uclamp_enabled)) > > > > > + return; > > > > > + > > > > > + for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) > > > > > + p->uclamp[clamp_id].active = false; > > > > > +} > > > > > > > > Because in that case .active == false, and copy_process() will have done > > > > thr right thing? > > > > > > Don't really get what you mean here? :/ > > > > Why don't we have to set .active=false when > > !sched_class->uclamp_enabled? > > Ok, got it. > > In principle because: > - FAIR and RT will have uclamp_enabled > - DL cannot fork > > ... thus, yes, it seems that the check above is not necessary anyway. > > Moreover, as per one of your comments in another message, we still need > to cover the "reset on fork" case for FAIR and RT. Thus, I'm going to > completely remove the support check in uclamp_fork and we always reset > active for all classes. Right, thanks!