Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3289362imc; Wed, 13 Mar 2019 13:53:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ5tc8pl9qMVnaEBY2X70DelQzvU42G4HyXel1U8aU3crp+O7jbUEJG3p4VzkAGUm0s69D X-Received: by 2002:a17:902:1105:: with SMTP id d5mr48236778pla.27.1552510409235; Wed, 13 Mar 2019 13:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552510409; cv=none; d=google.com; s=arc-20160816; b=e37sS8QFRnDDIKwqc2M3SP9CBqvtruptto5NczjVxiNAkhSQSu6LX2DS+2mENwFQ7x jOrqjfvGxyiKDe/DmT14jiv9mmuVFz0M1LUfS3HKw2qAn9MPLHYA9vhmpR0xjCnwvWTe yc54/jknhqOhwmE7azlgzybkOmIAQ55QHsFGM/jh0OoBNesCgPGc9PHihbJ0tOok0ovH o6IZ2CaHXSQPDG31JMeWYUPmQqSWNxi/EV0uTdCj7D4LVUm36OUxZ7p5+WQXHw4mYXQd 7JvI2bCswTun5RBQvyZoTvzyQAYSvJ4WuF5c5Mm7nM6pCEpN62ore2GSaJzvjj0i7S7C lFsg== 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=GuHM5VtsuT2QzC+XxvSuatbRUReMLfv3sQaupc2Og28=; b=pE9oLO4LTV+sUp6h0vT92b8rjKqwqDsuNWXBrBkpK6C8NUF9a4xyfwji6Eb3Y2A4qH WGS+SYm0izv7cNklWY86s/wDmZyaO7FS2Y7R4vB1gALlU8gGOJ2n9dMBxSSu1asJmyJh d2wWADrRRAYCOvq0GAnvph8fK3ljogCHvpmh+0rb0FtTfKRAC90NgOno+maVAjun+qGJ JaD84BPHMkMqp68R1S4qscUdndVwChUeyRTwhjfQpV/gHF49/Xd1mnERVBNV8oYe22JU RWHzBj4BQspE7gYBd1Yz0Y+zok0ob49JVyfbPMVqiSK8fHATIvT+5QapD5xOdl2CPDFH 5cVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=b4n5K4bp; 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 e1si10458964pgs.451.2019.03.13.13.53.12; Wed, 13 Mar 2019 13:53:29 -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=b4n5K4bp; 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 S1727310AbfCMUwu (ORCPT + 99 others); Wed, 13 Mar 2019 16:52:50 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54686 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfCMUwu (ORCPT ); Wed, 13 Mar 2019 16:52:50 -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=GuHM5VtsuT2QzC+XxvSuatbRUReMLfv3sQaupc2Og28=; b=b4n5K4bpk4mCjAHenCZXDbwXb y3LuIQICCH53Hc+zym+5hDcgQJIiCQnMLe5nA7TZg9b497lIopqCOwvp6rohXG3XX7nyLQ0AB/DrN ei4NHDze10bJOrrcmPPJozVkdPnAOhmVBcbwJ/mtGl1R9mwRAMSH1I6XmI3/DGtKF7kCRSGEEUq2O 0W9B1Cvk8/x3JDVNJMzmOc3m+8SK5j3MgejNbGnbACBGOdzHWabBhHIqF8mXa7QYZq1EoYWsjecL+ fUKMRtENtPylNRn2GBVRlTRsYwStcjdRDJJqmFOAcNfH+URrwjnue021mCOInGRziMJRGfj9E7JDD +Dn05pfqQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4Are-0000CC-6D; Wed, 13 Mar 2019 20:52:38 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 2F55E9826C0; Wed, 13 Mar 2019 21:52:35 +0100 (CET) Date: Wed, 13 Mar 2019 21:52:35 +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 06/15] sched/core: uclamp: Reset uclamp values on RESET_ON_FORK Message-ID: <20190313205235.GX2482@worktop.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-7-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208100554.32196-7-patrick.bellasi@arm.com> 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 Fri, Feb 08, 2019 at 10:05:45AM +0000, Patrick Bellasi wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 070caa1f72eb..8b282616e9c9 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -1071,7 +1071,7 @@ static void __setscheduler_uclamp(struct task_struct *p, > } > } > > -static void uclamp_fork(struct task_struct *p) > +static void uclamp_fork(struct task_struct *p, bool reset) > { > unsigned int clamp_id; > > @@ -1080,6 +1080,17 @@ static void uclamp_fork(struct task_struct *p) IIRC there's an early return here if the class doesn't have uclamp support, which I think is wrong now. You want the reset irrespective of whether the class supports it, no? > > for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) > p->uclamp[clamp_id].active = false; > + > + if (likely(!reset)) > + return; > + > + for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) { > + unsigned int clamp_value = uclamp_none(clamp_id); > + > + p->uclamp[clamp_id].user_defined = false; > + p->uclamp[clamp_id].value = clamp_value; > + p->uclamp[clamp_id].bucket_id = uclamp_bucket_id(clamp_value); > + } > }