From: Joel Fernandes <joel@joelfernandes.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Qais Yousef <qyousef@layalina.io>,
mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.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,
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, timj@gnu.org,
kprateek.nayak@amd.com, yu.c.chen@intel.com,
youssefesmat@chromium.org
Subject: Re: [PATCH v7 6/9] sched/fair: Add sched group latency support
Date: Fri, 4 Nov 2022 06:55:48 -0400 [thread overview]
Message-ID: <CD57BDD3-5919-48EC-992A-3879D8AA074F@joelfernandes.org> (raw)
In-Reply-To: <CAKfTPtBJQOY7UUkm1=wvG18UWgLLiTW0dr3bTGUJY=siM_LLxQ@mail.gmail.com>
> On Nov 4, 2022, at 6:37 AM, Vincent Guittot <vincent.guittot@linaro.org> wrote:
>
> On Fri, 4 Nov 2022 at 11:15, Joel Fernandes <joel@joelfernandes.org> wrote:
>>
>>> On Thu, Nov 3, 2022 at 5:03 PM Vincent Guittot
>>> <vincent.guittot@linaro.org> wrote:
>>>
>>> On Thu, 3 Nov 2022 at 15:27, Qais Yousef <qyousef@layalina.io> wrote:
>>>>
>>>> On 11/03/22 09:46, Vincent Guittot wrote:
>>>>> On Tue, 1 Nov 2022 at 20:28, Qais Yousef <qyousef@layalina.io> wrote:
>>>>>>
>>>>>> On 10/28/22 11:34, Vincent Guittot wrote:
>>>>>>> Task can set its latency priority with sched_setattr(), which is then used
>>>>>>> to set the latency offset of its sched_enity, but sched group entities
>>>>>>> still have the default latency offset value.
>>>>>>>
>>>>>>> Add a latency.nice field in cpu cgroup controller to set the latency
>>>>>>> priority of the group similarly to sched_setattr(). The latency priority
>>>>>>> is then used to set the offset of the sched_entities of the group.
>>>>>>>
>>>>>>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>>>>>>> ---
>>>>>>> Documentation/admin-guide/cgroup-v2.rst | 8 ++++
>>>>>>> kernel/sched/core.c | 52 +++++++++++++++++++++++++
>>>>>>> kernel/sched/fair.c | 33 ++++++++++++++++
>>>>>>> kernel/sched/sched.h | 4 ++
>>>>>>> 4 files changed, 97 insertions(+)
>>>>>>>
>>>>>>> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
>>>>>>> index be4a77baf784..d8ae7e411f9c 100644
>>>>>>> --- a/Documentation/admin-guide/cgroup-v2.rst
>>>>>>> +++ b/Documentation/admin-guide/cgroup-v2.rst
>>>>>>> @@ -1095,6 +1095,14 @@ All time durations are in microseconds.
>>>>>>> values similar to the sched_setattr(2). This maximum utilization
>>>>>>> value is used to clamp the task specific maximum utilization clamp.
>>>>>>>
>>>>>>> + cpu.latency.nice
>>>>>>> + A read-write single value file which exists on non-root
>>>>>>> + cgroups. The default is "0".
>>>>>>> +
>>>>>>> + The nice value is in the range [-20, 19].
>>>>>>> +
>>>>>>> + This interface file allows reading and setting latency using the
>>>>>>> + same values used by sched_setattr(2).
>>>>>>
>>>>>> I'm still not sure about this [1].
>>>>>
>>>>> I'm still not sure about what you are trying to say here ...
>>>>>
>>>>> This is about setting a latency nice prio to a group level.
>>>>>
>>>>>>
>>>>>> In some scenarios we'd like to get the effective latency_nice of the task. How
>>>>>> will the task inherit the cgroup value or be impacted by it?
>>>>>>
>>>>>> For example if there are tasks that belong to a latency sensitive cgroup; and
>>>>>> I'd like to skip some searches in EAS to improve that latency sensitivity - how
>>>>>> would I extract this info in EAS path given these tasks are using default
>>>>>> latency_nice value? And if should happen if their latency_nice is set to
>>>>>> something else other than default?
>>>>>>
>>>>>> [1] https://lore.kernel.org/lkml/20221012160734.hrkb5jcjdq7r23pr@wubuntu/
>>>>>
>>>>> Hmm so you are speaking about something that is not part of the patch.
>>>>> Let focus on the patchset for now
>>>>
>>>> I am focusing on this patchset. Isn't this an essential part of the design?
>>>> Once the interface is out we can't change it. As it stands, I can't see how it
>>>
>>> So, are you speaking about the interface i.e. setting a value between [-20:19]
>>>
>>>> can be used to replace prefer_idle in cgroup as used in Android. I can't see
>>>> how this could happen if we don't define how the task will inherit the cgroup
>>>> value. If we can, mind elaborating how please?
>>>
>>> Or how to take into account the value set for a cgroup ?
>>>
>>> Regarding the behavior, the rule remains the same that a sched_entity
>>> attached to a cgroup will not get more (latency in this case) than
>>> what has been set for the group entity.
>>
>> I think the interface solves a different problem which is latency of
>> task or cgroup wrt other group. Vincent, you are setting this for a
>> “top app” group in android in your tests, and seeing improvement
>> correct? AFAICS, this improvement comes because of lower latency
>
> Yes Top app and display group
>
>> during *same CPU* competition between different groups by juggling
>> around the wakeup-preemption window -- which maybe is good for
>> Android.
>>
>> OTOH, the “prefer idle” flag in android that Qais is referring to,
>> will need a completely different method as I cannot see how a nice
>> value can communicate that (that can complement Vincent's changes
>> here). And it will need to have a per-task interface as well. We have
>
> Why a negative latency_nice value condition can't be used ? or latency -20 ?
Ah and forgot to reply about negative.
Maybe, but it’s still a horrible overload of the meaning of the value. I am not terribly against choosing negative value if there is consensus among everyone. Qais?
- Joel
>
>> something in ChromeOS as well, which is a proc knob and also
>> out-of-tree patch for that [1]. Without [1] we fail Android CTS
>> testing on a recent ARM64 ChromeOS device.
>> [1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3884575
>> The changelog in [1] also has a detailed description of the ChromeOS usecase.
>>
>> Qais, any other reason you can see why Vincent's change will not be a
>> good thing for Android? Since you 1 CGroup for the whole user-facing
>> app (top app), you can just set that to a low "latency_nice" and get
>> better wake-up latency for that.
>>
>> (Side rant about latency and CFS -- IMHO a better long term solution
>> for lower latency is to use RT but don't throttle -- rather demote. Or
>> break CFS into multiple tiers, and apply demotion. This is in a way
>> what Vincent is doing, as the task becomes more CPU bound'ish, he's
>> taking away the latency boost. Vincent/Qais, somebody was working on
>> the RT demotion vs throttling a while back, any idea on the latest on
>> that?).
>>
>> thanks,
>>
>> - Joel
>>
>>
>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> --
>>>> Qais Yousef
next prev parent reply other threads:[~2022-11-04 10:55 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 9:33 [PATCH v7 0/9] Add latency priority for CFS class Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 1/9] sched/fair: fix unfairness at wakeup Vincent Guittot
2022-11-05 14:32 ` Chen Yu
2022-11-07 8:00 ` Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 2/9] sched: Introduce latency-nice as a per-task attribute Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 3/9] sched/core: Propagate parent task's latency requirements to the child task Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 4/9] sched: Allow sched_{get,set}attr to change latency_nice of the task Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 5/9] sched/fair: Take into account latency priority at wakeup Vincent Guittot
2022-11-13 8:02 ` shrikanth suresh hegde
2022-11-13 8:39 ` shrikanth suresh hegde
2022-11-14 10:36 ` Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 6/9] sched/fair: Add sched group latency support Vincent Guittot
2022-11-01 19:28 ` Qais Yousef
2022-11-03 8:46 ` Vincent Guittot
2022-11-03 14:27 ` Qais Yousef
2022-11-03 17:02 ` Vincent Guittot
2022-11-04 10:14 ` Joel Fernandes
2022-11-04 10:37 ` Vincent Guittot
2022-11-04 10:48 ` Joel Fernandes
2022-11-04 10:57 ` Vincent Guittot
2022-11-04 10:55 ` Joel Fernandes [this message]
2022-11-04 12:06 ` Qais Yousef
2022-11-04 11:47 ` Qais Yousef
2022-11-04 11:21 ` Qais Yousef
2022-11-04 13:13 ` Joel Fernandes
2022-11-05 14:28 ` Qais Yousef
2022-11-04 14:24 ` Vincent Guittot
2022-11-04 14:57 ` Joel Fernandes
2022-11-04 15:03 ` Vincent Guittot
2022-11-04 15:12 ` Joel Fernandes
2022-11-04 15:23 ` Vincent Guittot
2022-11-05 13:41 ` Qais Yousef
2022-10-28 9:34 ` [PATCH v7 7/9] sched/core: Support latency priority with sched core Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 8/9] sched/fair: Add latency list Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 9/9] sched/fair: remove check_preempt_from_others Vincent Guittot
2022-11-13 7:56 ` [PATCH v7 0/9] Add latency priority for CFS class shrikanth suresh hegde
2022-11-13 8:34 ` shrikanth suresh hegde
2022-11-14 10:40 ` 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=CD57BDD3-5919-48EC-992A-3879D8AA074F@joelfernandes.org \
--to=joel@joelfernandes.org \
--cc=David.Laight@aculab.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=chris.hyser@oracle.com \
--cc=dietmar.eggemann@arm.com \
--cc=joshdon@google.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.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=qyousef@layalina.io \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@linux.intel.com \
--cc=timj@gnu.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=youssefesmat@chromium.org \
--cc=yu.c.chen@intel.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
all inboxes | Powered by JetHome®