All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-api@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Paul Turner <pjt@google.com>,
	Quentin Perret <quentin.perret@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Juri Lelli <juri.lelli@redhat.com>, Todd Kjos <tkjos@google.com>,
	Joel Fernandes <joelaf@google.com>,
	Steve Muckle <smuckle@google.com>,
	Suren Baghdasaryan <surenb@google.com>
Subject: Re: [PATCH v9 12/16] sched/core: uclamp: Extend CPU's cgroup controller
Date: Wed, 5 Jun 2019 08:27:54 -0700	[thread overview]
Message-ID: <20190605152754.GO374014@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <20190605150630.vh5pyfpd6y3mfcaa@e110439-lin>

Hello, Patrick.

On Wed, Jun 05, 2019 at 04:06:30PM +0100, Patrick Bellasi wrote:
> The only additional point I can think about as a (slightly) stronger
> reason is that I guess we would like to have the same API for cgroups
> as well as for the task specific and the system wide settings.
> 
> The task specific values comes in via the sched_setattr() syscall:
> 
>    [PATCH v9 06/16] sched/core: uclamp: Extend sched_setattr() to support utilization clamping
>    https://lore.kernel.org/lkml/20190515094459.10317-7-patrick.bellasi@arm.com/
> 
> where we need to encode each clamp into a __u32 value.
> 
> System wide settings are expose similarly to these:
> 
>    grep '' /proc/sys/kernel/sched_*
> 
> where we have always integer numbers.
> 
> AFAIU your proposal will require to use a "scaled percentage" - e.g.
> 3844 for 38.44% which however it's still not quite the same as writing
> the string "38.44".
> 
> Not sure that's a strong enough argument, is it?

It definitely is an argument but the thing is that the units we use in
kernel API are all over the place anyway.  Even for something as
simple as sizes, we use bytes, 512 byte sectors, kilobytes and pages
all over the place.  Some for good reasons (as you mentioned above)
and others for historical / random ones.

So, I'm generally not too concerned about units differing between
cgroup interface and, say, syscall interface.  That ship has sailed a
long while ago and we have to deal with it everywhere anyway (in many
cases there isn't even a good unit to pick for compatibility because
the existing interfaces are already mixing units heavily).  As long as
the translation is trivial, it isn't a big issue.  Note that some
translations are not trivial.  For example, the sched nice value
mapping to weight has a separate unit matching knob for that reason.

> > We can go into the weeds with the semantics but how about us using
> > an alternative adjective "misleading" for the cpu.util.min/max names
> > to short-circuit that?
> 
> Not quite sure to get what you mean here. Are you pointing out that
> with clamps we don't strictly enforce a bandwidth but we just set a
> bias?

It's just that "util" is already used a lot and cpu.util.max reads
like it should cap cpu utilization (wallclock based) to 80% and it's
likely that it'd read seem way to many other folks too.  A more
distinctive name signals that it isn't something that obvious.

Thanks.

-- 
tejun

  reply	other threads:[~2019-06-05 15:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15  9:44 [PATCH v9 00/16] Add utilization clamping support Patrick Bellasi
2019-05-15  9:44 ` Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 01/16] sched/core: uclamp: Add CPU's clamp buckets refcounting Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 02/16] sched/core: uclamp: Add bucket local max tracking Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 03/16] sched/core: uclamp: Enforce last task's UCLAMP_MAX Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 04/16] sched/core: uclamp: Add system default clamps Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 05/16] sched/core: Allow sched_setattr() to use the current policy Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 06/16] sched/core: uclamp: Extend sched_setattr() to support utilization clamping Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 07/16] sched/core: uclamp: Reset uclamp values on RESET_ON_FORK Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 08/16] sched/core: uclamp: Set default clamps for RT tasks Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 09/16] sched/cpufreq: uclamp: Add clamps for FAIR and " Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 10/16] sched/core: uclamp: Add uclamp_util_with() Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 11/16] sched/fair: uclamp: Add uclamp support to energy_compute() Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 12/16] sched/core: uclamp: Extend CPU's cgroup controller Patrick Bellasi
2019-05-31 15:35   ` Tejun Heo
2019-06-03 12:24     ` Patrick Bellasi
2019-06-03 12:27     ` Patrick Bellasi
2019-06-05 14:03       ` Tejun Heo
2019-06-05 14:39         ` Patrick Bellasi
2019-06-05 14:44           ` Tejun Heo
2019-06-05 15:37             ` Patrick Bellasi
2019-06-05 15:39               ` Tejun Heo
2019-06-03 12:29     ` Patrick Bellasi
2019-06-05 14:09       ` Tejun Heo
2019-06-05 15:06         ` Patrick Bellasi
2019-06-05 15:27           ` Tejun Heo [this message]
2019-05-15  9:44 ` [PATCH v9 13/16] sched/core: uclamp: Propagate parent clamps Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 14/16] sched/core: uclamp: Propagate system defaults to root group Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 15/16] sched/core: uclamp: Use TG's clamps to restrict TASK's clamps Patrick Bellasi
2019-05-15  9:44 ` [PATCH v9 16/16] sched/core: uclamp: Update CPU's refcount on TG's clamp changes Patrick Bellasi
2019-05-30 10:15 ` [PATCH v9 00/16] Add utilization clamping support Patrick Bellasi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190605152754.GO374014@devbig004.ftw2.facebook.com \
    --to=tj@kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=joelaf@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=quentin.perret@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=smuckle@google.com \
    --cc=surenb@google.com \
    --cc=tkjos@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.