From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Paul Turner <pjt@google.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Mike Galbraith <efault@gmx.de>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch 2/2] sched: charge unaccounted run-time on entity re-weight
Date: Fri, 17 Dec 2010 13:38:54 +0100 [thread overview]
Message-ID: <1292589534.2266.182.camel@twins> (raw)
In-Reply-To: <AANLkTi=h9vZm4nTnwq7+CeQjFpVV2QaovUP8KOi-gcXy@mail.gmail.com>
On Thu, 2010-12-16 at 14:31 -0800, Paul Turner wrote:
> That doesn't quite work.
>
> The problem stems from:
>
> - update_curr() accues time against current cfs_rq's timeline
> - We always need to do this for entity placement
> - Manipulation of the current cfs_rq's load affects its weights
> However the current cfs_rq in the problem case is a group entity which
> happens to be the current entity on the parenting se's group_cfs_rq
> (say that 10 times fast).
>
> When we update that entity's (call it X) weight to reflect the
> interactions on its owned cfs_rq, the update isout of order with the
> subsequent update_curr() on the parent which is what actually accounts
> the accrued vruntime versus X (which was accumulated at old weight)
>
> We need to either:
>
> A) Get all of the update_currs() done up front, e.g. at the start of
> enqueue_task_fair add another for_each
> - I don't like this approach because it it becomes a concern that has
> to be implemented by all callers
> - There's also no point in issuing these if the entity in question
> isnt cfs_rq->curr since there's no time to account in that case
>
> B) Change the reweights in enqueue/dequeue/etc to occur against the
> owned cfs_rq as opposed to the queueing cfs_rq.
> - This is not really clean in my mind since it steps outside of the
> semantic of we are "enqueuing E to T". Instead of only really
> manipulating T we're adding "oh and we'll finish manipulations
> resulting from prior enqeues against E if it was a tree".
I knew there was a reason I did it like that early on ;-)
> C) Charge unaccounted time versus an entity before re-weighting it
> - I think this ends up being the nicest, we only end up issuing the
> extra update_currs when we need them, and the second becomes a nop
> since rq->clock doesn't move. Not to mention it also blocks up this
> hole completely since it becomes always safe to reweight_entity().
Hrmm, I see what you mean, its not exactly pretty either, but I must
admit to not seeing a better solution at the moment.
OK, so your patch it is ;-)
next prev parent reply other threads:[~2010-12-17 12:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 3:10 [patch 0/2] Fix interactivity buglet with autogroup and shares distribution re-write Paul Turner
2010-12-16 3:10 ` [patch 1/2] sched: move periodic share updates to entity_tick() Paul Turner
2010-12-16 11:03 ` Peter Zijlstra
2010-12-16 14:26 ` Mike Galbraith
2011-01-10 23:49 ` Paul Turner
2011-01-11 0:47 ` Paul Turner
2010-12-20 8:36 ` [tip:sched/core] sched: Move " tip-bot for Paul Turner
2010-12-16 3:10 ` [patch 2/2] sched: charge unaccounted run-time on entity re-weight Paul Turner
2010-12-16 3:35 ` Paul Turner
2010-12-16 3:36 ` Paul Turner
2010-12-16 3:38 ` Paul Turner
2010-12-16 11:03 ` Peter Zijlstra
2010-12-16 22:31 ` Paul Turner
2010-12-17 12:38 ` Peter Zijlstra [this message]
2010-12-20 8:37 ` [tip:sched/core] sched: Fix interactivity bug by charging " tip-bot for Paul Turner
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=1292589534.2266.182.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pjt@google.com \
--cc=torvalds@linux-foundation.org \
/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