From: Peter Zijlstra <peterz@infradead.org>
To: Byungchul Park <byungchul.park@lge.com>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de,
tglx@linutronix.de, yuyang.du@intel.com, pjt@google.com
Subject: Re: [PATCH] sched: prevent getting too much vruntime
Date: Wed, 11 Nov 2015 12:50:43 +0100 [thread overview]
Message-ID: <20151111115043.GM17308@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20151111094849.GD7136@byungchulpark-X58A-UD3R>
On Wed, Nov 11, 2015 at 06:48:49PM +0900, Byungchul Park wrote:
> On Wed, Nov 11, 2015 at 10:26:32AM +0100, Peter Zijlstra wrote:
> > On Wed, Nov 11, 2015 at 05:50:27PM +0900, byungchul.park@lge.com wrote:
> >
> > I've not actually read anything; my brain isn't working right today.
> >
> > > +static inline void vruntime_unnormalize(struct cfs_rq *cfs_rq, struct sched_entity *se)
> > > +{
> > > + se->vruntime += cfs_rq->min_vruntime;
> > > + if (unlikely((s64)se->vruntime < 0))
> > > + se->vruntime = 0;
> > > +}
> >
> > But this is broken. This simply _cannot_ be right.
> >
> > vruntime very much needs to wrap in u64 space. While regular time in ns
> > takes some 584 year to wrap, vruntime is scaled. The fastest vruntime is
> > 2/1024 or 512 times faster than normal time. Making it take just over a
> > year to wrap around. This will happen.
>
> Then, do you mean it's no problem even if we compare between a vruntime
> not wrapped yet and another vruntime already wrapped? I really wonder it.
It should be; we were really careful with this back when we wrote all
that. All vruntime comparisons should be of the form (s64)(a-b). Which
gets you the correct order assuming things haven't drifted more than
2^63 apart.
next prev parent reply other threads:[~2015-11-11 11:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 8:50 byungchul.park
2015-11-11 9:26 ` Peter Zijlstra
2015-11-11 9:48 ` Byungchul Park
2015-11-11 11:50 ` Peter Zijlstra [this message]
2015-11-12 5:10 ` Byungchul Park
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=20151111115043.GM17308@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=byungchul.park@lge.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pjt@google.com \
--cc=tglx@linutronix.de \
--cc=yuyang.du@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®