mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qais Yousef <qyousef@layalina.io>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Xuewen Yan <xuewen.yan@unisoc.com>,
	mingo@redhat.com, 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,
	ke.wang@unisoc.com, zhaoyang.huang@unisoc.com
Subject: Re: [RFC PATCH] sched/fair: update the vruntime to be max vruntime when yield
Date: Sat, 26 Aug 2023 21:46:59 +0100	[thread overview]
Message-ID: <20230826204659.4b43aie2a2nijrvu@airbuntu> (raw)
In-Reply-To: <CAB8ipk9khfTnQE82cf+D=WNTs8G0S+8ekUNeFUNEhdfydXxFuw@mail.gmail.com>

On 08/23/23 10:03, Xuewen Yan wrote:
> Hi Vincent
> 
> Thanks for your patience to reply!
> 
> On Tue, Aug 22, 2023 at 11:55 PM Vincent Guittot
> <vincent.guittot@linaro.org> wrote:
> >
> > On Mon, 21 Aug 2023 at 09:51, Xuewen Yan <xuewen.yan94@gmail.com> wrote:
> > >
> > > Hi Vincent
> > >
> > > I have some questions to ask,and hope you can help.
> > >
> > > For this problem, In our platform, We found that the vruntime of some
> > > tasks will become abnormal over time, resulting in tasks with abnormal
> > > vruntime not being scheduled.
> > > The following are some tasks in runqueue:
> > > [status: curr] pid: 25501 prio: 116 vrun: 16426426403395799812
> > > [status: skip] pid: 25496 prio: 116 vrun: 16426426403395800756
> > > exec_start: 326203047009312 sum_ex: 29110005599
> > > [status: pend] pid: 25497 prio: 116 vrun: 16426426403395800705
> > > exec_start: 326203047002235 sum_ex: 29110508751
> > > [status: pend] pid: 25321 prio: 130 vrun: 16668783152248554223
> > > exec_start: 0 sum_ex: 16198728
> > > [status: pend] pid: 25798 prio: 112 vrun: 17467381818375696015
> > > exec_start: 0 sum_ex: 9574265
> > > [status: pend] pid: 22282 prio: 120 vrun: 18010356387391134435
> > > exec_start: 0 sum_ex: 53192
> > > [status: pend] pid: 24259 prio: 120 vrun: 359915144918430571
> > > exec_start: 0 sum_ex: 20508197
> > > [status: pend] pid: 25988 prio: 120 vrun: 558552749871164416
> > > exec_start: 0 sum_ex: 2099153
> > > [status: pend] pid: 21857 prio: 124 vrun: 596088822758688878
> > > exec_start: 0 sum_ex: 246057024
> > > [status: pend] pid: 26614 prio: 130 vrun: 688210016831095807
> > > exec_start: 0 sum_ex: 968307
> > > [status: pend] pid: 14229 prio: 120 vrun: 816756964596474655
> > > exec_start: 0 sum_ex: 793001
> > > [status: pend] pid: 23866 prio: 120 vrun: 1313723379399791578
> > > exec_start: 0 sum_ex: 1507038
> > > ...
> > > [status: pend] pid: 25970 prio: 120 vrun: 6830180148220001175
> > > exec_start: 0 sum_ex: 2531884
> > > [status: pend] pid: 25965 prio: 120 vrun: 6830180150700833203
> > > exec_start: 0 sum_ex: 8031809
> > >
> > > And According to your suggestion, we test the patch:
> > > https://lore.kernel.org/all/20230130122216.3555094-1-rkagan@amazon.de/T/#u
> > > The above exception is gone.
> > >
> > > But when  we tested using patch:
> > > https://lore.kernel.org/all/20230130122216.3555094-1-rkagan@amazon.de/T/#u
> > > and
> > > https://lore.kernel.org/all/20230317160810.107988-1-vincent.guittot@linaro.org/
> > > Unfortunately, our issue occurred again.
> > >
> > > So we  have to use a workaround solution to our problem, that is to
> > > change the sleeping time's judgement to 60s.
> > > +
> > > + sleep_time -= se->exec_start;
> > > + if (sleep_time > ((1ULL << 63) / scale_load_down(NICE_0_LOAD)))
> > > + return true;
> > >
> > > to
> > >
> > > + sleep_time -= se->exec_start;
> > > +if ((s64)sleep_time > 60LL * NSEC_PER_SEC)
> > > + return true;
> > >
> > > At this time, the issue also did not occur again.
> > >
> > > But this modification doesn't actually solve the real problem. And then
> >
> > yes, it resetx the task's vruntime once the delta go above 60sec but
> > your problem is still there
> >
> > > Qais suggested us to try this patch:
> > > https://lore.kernel.org/all/20190709115759.10451-1-chris.redpath@arm.com/T/#u
> >
> > we have the below in v6.0 to fix the problem of stalled clock update
> > instead of the above
> > commit e2f3e35f1f5a ("sched/fair: Decay task PELT values during wakeup
> > migration")
> >
> > Which kernel version are you using ?
> 
> We test in kernel5.4, and kernel5.15 also seems to have this problem.
> 
> And I will later test the  commit e2f3e35f1f5a ("sched/fair: Decay
> task PELT values during wakeup migration").

I think it might be worth to cherry-pick the first two patches of that series
to 5.10 and 5.15 (5.4 is a bit too old for me at least to work with).

Although they've been rare enough, but the util swing problem does pop up every
once in a while. And if it helps with this vruntime it might be a simple thing
to do to cherry pick these two patches after all. I think they'll apply without
a problem - I'll look at this.


Cheers

--
Qais Yousef

      reply	other threads:[~2023-08-26 20:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  8:03 Xuewen Yan
2023-02-27  1:51 ` Xuewen Yan
2023-02-27 15:40 ` Peter Zijlstra
2023-02-27 16:21   ` Steven Rostedt
2023-02-27 22:07   ` Qais Yousef
2023-02-28  7:42     ` Xuewen Yan
2023-02-28  7:53       ` Vincent Guittot
2023-02-28  8:20         ` Xuewen Yan
2023-02-28  9:07           ` Vincent Guittot
2023-02-28 13:31             ` Qais Yousef
2023-02-28 13:45               ` Vincent Guittot
2023-03-01  7:30                 ` Xuewen Yan
2023-03-01  8:09                   ` Vincent Guittot
2023-03-01  8:20                     ` Xuewen Yan
2023-03-01 11:23                       ` Dietmar Eggemann
2023-03-01 13:29                         ` Vincent Guittot
2023-06-30 14:40                       ` Qais Yousef
2023-08-21  7:51                         ` Xuewen Yan
2023-08-22 15:54                           ` Vincent Guittot
2023-08-23  2:03                             ` Xuewen Yan
2023-08-26 20:46                               ` Qais Yousef [this message]

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=20230826204659.4b43aie2a2nijrvu@airbuntu \
    --to=qyousef@layalina.io \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=xuewen.yan94@gmail.com \
    --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

all inboxes | Powered by JetHome®