Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2191061imm; Thu, 9 Aug 2018 08:44:31 -0700 (PDT) X-Google-Smtp-Source: AA+uWPygaFjlBqPr6KkhrIOP7pfYsxVLDCJsLo7ogNw+MNBgNDXn0jUImjlYF12NbiMoBPJO5uL9 X-Received: by 2002:a65:62d8:: with SMTP id m24-v6mr2688905pgv.307.1533829471676; Thu, 09 Aug 2018 08:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533829471; cv=none; d=google.com; s=arc-20160816; b=wjALKMgEQ2JLdrDm9R0dAcKWrLLhXWJg4UGXJPKOIcAyUZa9gBeiafkt+4RLCfXbNl v05zfWDak7ZqUmfsGzDD3RaPciQZGsuhg0BBMvJohqJsm1+mwR4yFLwcmeuxoKyofF02 D7RBj4xmdmkrIK/gnu1gS6uYgwr0RZA6TtWDeXJOykNuK7lMXxTv0buqAOHdxPc3UVeo pk0uI8I1j9x59miyaXPitdpSOCqD07dW4OehiohHyuEFwpM81fVrIUP1JztBFMRO8Bs+ tkdTXW2sdj5kFkZGmhnVVb7CYXOWWTitt0h05/H/w40qg5E+a5E0Ro2uWe9qsDuVBUQ7 qxsQ== 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:arc-authentication-results; bh=BMan4/NJf2YSq3XggkO0e4AQN7Ab9SpmT4UGkEia34M=; b=fDStu/en4DQ7gTEnoxXdpMn9Nl7Tev17jSUsGLL9FKC1Oi0ATJ9lnvEjc8cvsSY3sU DKT5F4FT96ypQ90Wti3RvOr4TJao2iVrdDvaCkNd2O9SpOJ7jJEleM7+VhV2MYbl89bc 5yP/mdtEUEckyhJlSMj6GQ9tVuYePJt5PfV3plfg7ueAaY09ZifRtD4ZQkVA054gvgJ2 hv25BfJsROSglRojaufQnR0s48HXXTe9ROwWYJjA+3BAO4/fVnATA7cbBA4hRlIUCZnl ks4jyhfLJUMZf51UErA6WuXnw4jouCovMDxg00R+K59xy2Sv9F4ig/pSeVB1NkwXkqL+ heCg== ARC-Authentication-Results: i=1; mx.google.com; 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 g15-v6si5930162plo.284.2018.08.09.08.44.17; Thu, 09 Aug 2018 08:44:31 -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; 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 S1732330AbeHISHf (ORCPT + 99 others); Thu, 9 Aug 2018 14:07:35 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55744 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730419AbeHISHf (ORCPT ); Thu, 9 Aug 2018 14:07:35 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F83C7A9; Thu, 9 Aug 2018 08:42:07 -0700 (PDT) Received: from darkstar (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B5353F5B3; Thu, 9 Aug 2018 08:42:00 -0700 (PDT) Date: Thu, 9 Aug 2018 16:41:56 +0100 From: Patrick Bellasi To: Quentin Perret Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks Message-ID: <20180809154156.gdsx2vacjmp6p6dp@darkstar> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807135403.s7jktvxmhycujeht@queper01-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180807135403.s7jktvxmhycujeht@queper01-lin> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-Aug 14:54, Quentin Perret wrote: > Hi Patrick, Hi Quentin! > On Monday 06 Aug 2018 at 17:39:38 (+0100), Patrick Bellasi wrote: > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index a7affc729c25..bb25ef66c2d3 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -200,6 +200,7 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, > > static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu) > > { > > struct rq *rq = cpu_rq(sg_cpu->cpu); > > + unsigned long util_cfs, util_rt; > > unsigned long util, irq, max; > > > > sg_cpu->max = max = arch_scale_cpu_capacity(NULL, sg_cpu->cpu); > > IIUC, not far below this you should still have something like: > > if (rt_rq_is_runnable(&rq->rt)) > return max; Do you mean that when RT tasks are RUNNABLE we still want to got to MAX? Not sure to understand... since this patch is actually to clamp the RT class... > So you won't reach the actual clamping code at the end of the function > when a RT task is runnable no? ... mmm... no... this patch is to clamp RT tasks... Am I missing something? > Also, I always had the feeling that the default for RT should be > util_min == 1024, and then users could decide to lower the bar if they > want to. Mmm... good point! This would keep the policy unaltered for RT tasks. I want to keep sched class specific code in uclamp at minimum, but likely this should be achievable by just properly initializing the task-specific util_min for RT tasks, if the original task has UCLAM_NOT_VALID. > For the specific case of RT, that feels more natural than > applying a max util clamp IMO. What do you think ? I'll look better into this for the next posting! Cheers Patrick -- #include Patrick Bellasi