mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Paul Turner <pjt@google.com>
Cc: Venkatesh Pallipadi <venki@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH] sched: next buddy hint on sleep and preempt path
Date: Wed, 02 Mar 2011 08:40:43 +0100	[thread overview]
Message-ID: <1299051643.17065.11.camel@marge.simson.net> (raw)
In-Reply-To: <AANLkTimhfvoKWdYJtxQLWhBwfSvZ3jGy7EXX_YSn_HLr@mail.gmail.com>

On Tue, 2011-03-01 at 23:08 -0800, Paul Turner wrote:
> On Tue, Mar 1, 2011 at 10:47 PM, Mike Galbraith <efault@gmx.de> wrote:
> > On Tue, 2011-03-01 at 21:43 -0800, Paul Turner wrote:
> >> On Tue, Mar 1, 2011 at 3:33 PM, Venkatesh Pallipadi <venki@google.com> wrote:
> >
> >> >        for_each_sched_entity(se) {
> >> >                cfs_rq = cfs_rq_of(se);
> >> >                dequeue_entity(cfs_rq, se, flags);
> >> >
> >> >                /* Don't dequeue parent if it has other entities besides us */
> >> > -               if (cfs_rq->load.weight)
> >> > +               if (cfs_rq->load.weight) {
> >> > +                       /*
> >> > +                        * Bias pick_next to pick a task from this cfs_rq, as
> >> > +                        * p is sleeping when it is within its sched_slice.
> >> > +                        */
> >> > +                       if (task_flags & DEQUEUE_SLEEP && se->parent)
> >> > +                               set_next_buddy(se->parent);
> >>
> >> re-using the last_buddy would seem like a more natural fit here; also
> >> doesn't have a clobber race with a wakeup
> >
> > Hm, that would break last_buddy no?  A preempted task won't get the CPU
> > back after light preempting thread deactivates.  (it's disabled atm
> > unless heavily overloaded anyway, but..)
> 
> Ommm yeah.. we're actually a little snookered in this case since the
> pre-empting thread's sleep will be voluntary which will try to return
> time to its hierarchy.
> 
> I suppose keeping the last_buddy is preferable to the occasional clobber.

Yeah, I think we don't want to break it.  I don't know if pgsql still
uses userland spinlocks, haven't run it in quite a while now, but with
those nasty things, last_buddy was the only thing that kept it from
collapsing into a quivering heap when you try to scale.  Preempting a
userland spinlock holder gets ugly in the extreme.

I'm going to test this patch some more, but in light testing, I saw no
interactivity problems with it, and it does _seem_ to be improving
throughput when there are competing grouped loads sharing the box.  I
haven't tested that heftily though, that's just watching the numbers and
recalling the relative effect of mixing loads previously.

	-Mike


  reply	other threads:[~2011-03-02  7:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 23:33 Venkatesh Pallipadi
2011-03-02  2:44 ` Rik van Riel
2011-03-02  5:43 ` Paul Turner
2011-03-02  6:47   ` Mike Galbraith
2011-03-02  7:08     ` Paul Turner
2011-03-02  7:40       ` Mike Galbraith [this message]
2011-03-02 19:12     ` Venkatesh Pallipadi
2011-03-08  0:59       ` [PATCH] sched: next buddy hint on sleep and preempt path - v1 Venkatesh Pallipadi
2011-03-08  1:29         ` Paul Turner
2011-03-08  1:47           ` Venkatesh Pallipadi
2011-04-14  1:21             ` [PATCH 0/2] sched: Avoid frequent cross taskgroup switches -v2 Venkatesh Pallipadi
2011-04-14  1:21             ` [PATCH 1/2] sched: Make set_*_buddy work on non-task entity -v2 Venkatesh Pallipadi
2011-04-19 12:05               ` [tip:sched/core] sched: Make set_*_buddy() work on non-task entities tip-bot for Venkatesh Pallipadi
2011-04-14  1:21             ` [PATCH 2/2] sched: next buddy hint on sleep and preempt path -v2 Venkatesh Pallipadi
2011-04-14 10:50               ` Peter Zijlstra
2011-04-14 17:30                 ` Venkatesh Pallipadi
2011-04-15 21:45                   ` Rik van Riel
2011-04-19 12:05                   ` [tip:sched/core] sched: Next buddy hint on sleep and preempt path tip-bot for Venkatesh Pallipadi
2011-03-08  2:33           ` [PATCH] sched: next buddy hint on sleep and preempt path - v1 Venkatesh Pallipadi
2011-03-02 19:22   ` [PATCH] sched: next buddy hint on sleep and preempt path Venkatesh Pallipadi
2011-03-02 10:31 ` Peter Zijlstra
2011-03-02 15:25   ` Mike Galbraith

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=1299051643.17065.11.camel@marge.simson.net \
    --to=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=riel@redhat.com \
    --cc=venki@google.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®