From: Xuewen Yan <xuewen.yan94@gmail.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Zhaoyang Huang <huangzhaoyang@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
xuewen.yan@unisoc.com, Ke Wang <Ke.Wang@unisoc.com>
Subject: Re: [Resend PATCH] psi : calc cfs task memstall time more precisely
Date: Wed, 10 Nov 2021 13:38:27 +0800 [thread overview]
Message-ID: <CAB8ipk-AumAR1wXEwd94bj-Fj_QXkom3c9jy9qpeUU4mSacYuA@mail.gmail.com> (raw)
In-Reply-To: <25828616-1976-6e24-cd7d-a95b789f1bc0@arm.com>
On Tue, Nov 9, 2021 at 8:29 PM Dietmar Eggemann
<dietmar.eggemann@arm.com> wrote:
>
> On 08/11/2021 10:20, Zhaoyang Huang wrote:
> > On Mon, Nov 8, 2021 at 4:49 PM Xuewen Yan <xuewen.yan94@gmail.com> wrote:
> >>
> >> Hi Dietmar
> >>
> >> On Sat, Nov 6, 2021 at 1:20 AM Dietmar Eggemann
> >> <dietmar.eggemann@arm.com> wrote:
> >>>
> >>> On 05/11/2021 06:58, Zhaoyang Huang wrote:
>
> [...]
>
> >>>>> This will let the idle task (swapper) pass. Is this indented? Or do you
> >>>>> want to only let CFS tasks (including SCHED_IDLE) pass?
> >>>> idle tasks will NOT call psi_memstall_xxx. We just want CFS tasks to
> >>>> scale the STALL time.
> >>>
> >>> Not sure I get this.
> >>>
> >>> __schedule() -> psi_sched_switch() -> psi_task_change() ->
> >>> psi_group_change() -> record_times() -> psi_memtime_fixup()
> >>>
> >>> is something else than calling psi_memstall_enter() or _leave()?
> >>>
> >>> IMHO, at least record_times() can be called with current equal
> >>> swapper/X. Or is it that PSI_MEM_SOME is never set for the idle task in
> >>> this callstack? I don't know the PSI internals.
> > According to my understanding, PSI_MEM_SOME represents the CORE's
> > state within which there is at least one task trapped in memstall
> > path(only counted in by calling PSI_MEMSTALL_ENTER). record_times is
> > responsible for collecting the delta time of the CORE since it start.
> > What we are doing is to make the delta time more precise. So idle task
> > is irrelevant for these.
>
> Coming back to the original snippet of the patch.
>
> static unsigned long psi_memtime_fixup(u32 growth)
> {
>
> if (!(current->policy == SCHED_NORMAL ||
> current->policy == SCHED_BATCH))
> return growth_fixed;
>
> With this condition:
>
> (1) you're not bailing when current is the idle task. It has policy
> equal 0 (SCHED_NORMAL)
>
> (2) But you're bailing for a SCHED_IDLE (CFS) task.
>
> I'm not sure that this is indented here?
>
> Since you want to do the scaling later based on whats left for CFS tasks
> from the CPU capacity my hunch is that you want to rather do:
>
> if (current->sched_class != &fair_sched_class)
> return growth_fixed;
Yes, It is the correct method!
Thanks!
>
> What's the possible sched classes of current in psi_memtime_fixup?
next prev parent reply other threads:[~2021-11-10 5:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 6:16 Huangzhaoyang
2021-11-02 19:47 ` Johannes Weiner
2021-11-03 7:07 ` Zhaoyang Huang
2021-11-03 7:08 ` Zhaoyang Huang
2021-11-04 8:58 ` Dietmar Eggemann
2021-11-05 5:58 ` Zhaoyang Huang
2021-11-05 16:42 ` Dietmar Eggemann
2021-11-08 8:49 ` Xuewen Yan
2021-11-08 9:20 ` Zhaoyang Huang
2021-11-09 12:29 ` Dietmar Eggemann
2021-11-10 5:38 ` Xuewen Yan [this message]
2021-11-09 9:43 ` Dietmar Eggemann
2021-11-10 5:36 ` Xuewen Yan
2021-11-12 14:16 ` Dietmar Eggemann
2021-11-09 14:56 ` Peter Zijlstra
2021-11-10 1:37 ` Zhaoyang Huang
2021-11-10 8:36 ` Peter Zijlstra
2021-11-10 8:47 ` Zhaoyang Huang
2021-11-10 8:49 ` Vincent Guittot
2021-11-10 9:04 ` Zhaoyang Huang
2021-11-12 16:36 ` Johannes Weiner
2021-11-12 19:23 ` Peter Zijlstra
2021-11-15 2:24 ` Zhaoyang Huang
-- strict thread matches above, loose matches on Subject: below --
2021-09-26 3:27 Huangzhaoyang
2021-09-18 5:25 Huangzhaoyang
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=CAB8ipk-AumAR1wXEwd94bj-Fj_QXkom3c9jy9qpeUU4mSacYuA@mail.gmail.com \
--to=xuewen.yan94@gmail.com \
--cc=Ke.Wang@unisoc.com \
--cc=akpm@linux-foundation.org \
--cc=dietmar.eggemann@arm.com \
--cc=hannes@cmpxchg.org \
--cc=huangzhaoyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=peterz@infradead.org \
--cc=vdavydov.dev@gmail.com \
--cc=vincent.guittot@linaro.org \
--cc=xuewen.yan@unisoc.com \
--cc=zhaoyang.huang@unisoc.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