public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, vschneid@redhat.com,
	linux-kernel@vger.kernel.org, parth@linux.ibm.com,
	qais.yousef@arm.com, chris.hyser@oracle.com,
	valentin.schneider@arm.com, patrick.bellasi@matbug.net,
	David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz,
	tj@kernel.org, qperret@google.com, tim.c.chen@linux.intel.com,
	joshdon@google.com
Subject: Re: [PATCH v4 6/8] sched/fair: Add sched group latency support
Date: Tue, 20 Sep 2022 20:17:29 +0200	[thread overview]
Message-ID: <07193d97-476a-498f-e738-e7920c2fdeea@arm.com> (raw)
In-Reply-To: <CAKfTPtASminP4ogVRhcvQ4R3-x-E+UUzuMaEu-xQU_MtLr9+Xg@mail.gmail.com>

On 19/09/2022 17:49, Vincent Guittot wrote:
> On Mon, 19 Sept 2022 at 13:55, Dietmar Eggemann
> <dietmar.eggemann@arm.com> wrote:
>>
>> s/valentin.schneider@arm.com//
>>
>> On 16/09/2022 10:03, Vincent Guittot wrote:
>>> Task can set its latency priority, which is then used to decide to preempt
>>> the current running entity of the cfs, but sched group entities still have
>>> the default latency offset.
>>>
>>> Add a latency field in task group to set the latency offset of the
>>> sched_eneities of the group, which will be used against other entities in
>>
>> s/sched_eneities/sched_entity
>>
>>> the parent cfs when deciding which entity to schedule first.
>>
>> So latency for cgroups does not follow any (existing) Resource
>> Distribution Model/Scheme (Documentation/admin-guide/cgroup-v2.rst)?
>> Latency values are only used to compare sched entities at the same level.
> 
> Just like share/cpu.weight value does for time sharing

But for this we define it as following the `Weights` scheme. That's why
I was asking,

>> [...]
>>
>>> +static int cpu_latency_write_s64(struct cgroup_subsys_state *css,
>>> +                             struct cftype *cft, s64 latency)
>>> +{
>>
>> There is no [MIN, MAX] checking?
> 
> This is done is sched_group_set_latency() which checks that
> abs(latency) < sysctl_sched_latency

I see. Nit-picking: Wouldn't this allow to specify a latency offset
value for the non-existent `nice = 20`? Highest nice value 19 maps to
`973/1024 * sysctl_sched_latency`.

> 
>>
>> min_weight = sched_latency_to_weight[0]  = -1024
>> max_weight = sched_latency_to_weight[39] =   973
>>
>> [MIN, MAX] = [sysctl_sched_latency * min_weight >> NICE_LATENCY_SHIFT,
>>               sysctl_sched_latency * max_weight >> NICE_LATENCY_SHIFT]
>>
>>
>> With the `cpu.latency` knob user would have to know for example that the
>> value is -24,000,000ns to get the same behaviour as for a task latency
>> nice = -20 (latency prio = 0) (w/ sysctl_sched_latency = 24ms)?
> 
> Yes, Tejun raised some concerns about adding an interface like nice in
> the task group in v2 so I have removed it.
> 
>>
>> For `nice` we have `cpu.weight.nice` next to `cpu.weight` in cgroup v2 ?
> 
> If everybody is ok, I can add back the cpu.latency.nice interface in
> the v5 in addition to the cpu.latency

cpu.weight/cpu.weight.nice interface:

echo X > cpu.weight	   tg->shares

    1                          10,240
  100                       1,048,576
10000                     104,857,600

echo X > cpu.weight.nice

  -20                     90,891,264
    0                      1,048,576
   19                         15,360

Wouldn't then a similar interface for cpu.latency [1..100..10000] and
cpu.latency.nice [-20..0..19] make most sense?

Raw latency_offset values at interface level are not portable.



  parent reply	other threads:[~2022-09-20 18:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  8:02 [PATCH v4 0/8] Add latency priority for CFS class Vincent Guittot
2022-09-16  8:02 ` [PATCH v4 1/8] sched: Introduce latency-nice as a per-task attribute Vincent Guittot
2022-09-16  8:02 ` [PATCH v4 2/8] sched/core: Propagate parent task's latency requirements to the child task Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 3/8] sched: Allow sched_{get,set}attr to change latency_nice of the task Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 4/8] sched/core: Add permission checks for setting the latency_nice value Vincent Guittot
2022-09-19  8:52   ` timj
2022-09-19  8:52     ` timj
2022-09-19 12:41     ` Vincent Guittot
2022-09-20 10:18       ` Tim Janik
2022-09-20 14:56         ` Vincent Guittot
2022-09-21 16:11           ` Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 5/8] sched/fair: Take into account latency priority at wakeup Vincent Guittot
     [not found]   ` <20220916120245.2951-1-hdanton@sina.com>
2022-09-16 13:36     ` Vincent Guittot
     [not found]       ` <20220917225819.817-1-hdanton@sina.com>
2022-09-18 10:46         ` Vincent Guittot
     [not found]           ` <20220920113238.1176-1-hdanton@sina.com>
2022-09-20 15:17             ` Vincent Guittot
2022-09-19 10:05   ` Dietmar Eggemann
2022-09-19 15:39     ` Vincent Guittot
2022-09-20 13:18       ` Dietmar Eggemann
2022-09-20 15:49         ` Vincent Guittot
2022-09-21 22:41           ` Dietmar Eggemann
2022-09-22  7:12             ` Vincent Guittot
2022-09-22 16:50               ` Dietmar Eggemann
2022-09-23  6:01                 ` Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 6/8] sched/fair: Add sched group latency support Vincent Guittot
2022-09-19 11:55   ` Dietmar Eggemann
2022-09-19 15:49     ` Vincent Guittot
2022-09-19 17:34       ` Tejun Heo
2022-09-20  7:03         ` Vincent Guittot
2022-09-21 16:07         ` Qais Yousef
2022-09-21 16:48           ` Tejun Heo
2022-09-21 17:02             ` Vincent Guittot
2022-09-21 17:12               ` Tejun Heo
2022-09-22  6:40                 ` Vincent Guittot
2022-09-22 10:49                   ` Qais Yousef
2022-09-20 18:17       ` Dietmar Eggemann [this message]
2022-09-21  7:48         ` Vincent Guittot
2022-09-19 17:34     ` Tejun Heo
2022-09-20  7:02       ` Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 7/8] sched/core: support latency priority with sched core Vincent Guittot
2022-09-16  8:03 ` [PATCH v4 8/8] sched/fair: Add latency list Vincent Guittot
2022-09-21 16:08 ` [PATCH v4 0/8] Add latency priority for CFS class Qais Yousef
2022-09-22  7:19   ` Vincent Guittot
2022-09-22 11:00     ` Qais Yousef
2022-09-22 13:03       ` Vincent Guittot

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=07193d97-476a-498f-e738-e7920c2fdeea@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=David.Laight@aculab.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=chris.hyser@oracle.com \
    --cc=joshdon@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=parth@linux.ibm.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=qais.yousef@arm.com \
    --cc=qperret@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tj@kernel.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox