All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] sched: Comment on why sync wakeups try to run on the current CPU
Date: Tue, 19 Dec 2017 20:25:36 +0000	[thread overview]
Message-ID: <20171219202536.vsmlw63apswkwiir@techsingularity.net> (raw)
In-Reply-To: <20171219190644.3neuaenffj6tcxci@hirez.programming.kicks-ass.net>

On Tue, Dec 19, 2017 at 08:06:44PM +0100, Peter Zijlstra wrote:
> On Mon, Dec 18, 2017 at 09:43:26AM +0000, Mel Gorman wrote:
> > The sync wakeup logic in wake_affine_idle deserves a short description.
> > 
> > Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> > ---
> >  kernel/sched/fair.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 392e08b364bd..95b1145bc38d 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -5737,6 +5737,11 @@ wake_affine_idle(int this_cpu, int prev_cpu, int sync)
> >  static int
> >  wake_affine_sync(int this_cpu, int sync)
> >  {
> > +	/*
> > +	 * Consider stacking tasks if it's a sync wakeup and there is only
> > +	 * one task on the runqueue. sync wakesups are expected to sleep
> > +	 * either immediately or shortly after the wakeup.
> > +	 */
> >  	if (sync && cpu_rq(this_cpu)->nr_running == 1)
> >  		return this_cpu;
> >  
> 
> So I don't think this one is over the top -- it went missing from the
> last posting, but I agree with Mike that 4/4 was somewhat dodgy.
> 

I dropped it because I wasn't altering what sync wakeup means any more
and the comment was not that insightful. I've no objection to it being
picked up of course.

> Our SYNC hint does promise the caller will go away 'soon', although I'm
> not sure how many of the current users actually honor that.
> 

How soon matters a little too. I think pipe goes asleep immediately, exit
definitely does.  Networking appears to be soon enough from what I can tell.
I don't think any of the current callers of wake_up_interruptible_sync_poll
are problematic at least.

> In any case, picked up the one new patch, thanks for the giant changelog
> ;-)

Thanks!

-- 
Mel Gorman
SUSE Labs

  reply	other threads:[~2017-12-19 20:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  9:43 [PATCH 0/4] Reduce scheduler migrations due to wake_affine Mel Gorman
2017-12-18  9:43 ` [PATCH 1/4] sched: Only immediately migrate tasks due to interrupts if prev and target CPUs share cache Mel Gorman
2017-12-18  9:43 ` [PATCH 2/4] sched: Allow a wakee to run on the prev_cpu if it is idle and cache-affine with the waker Mel Gorman
2017-12-18 10:26   ` Peter Zijlstra
2017-12-18 10:56     ` Mel Gorman
2017-12-18 10:59       ` Peter Zijlstra
2017-12-18  9:43 ` [PATCH 3/4] sched: Comment on why sync wakeups try to run on the current CPU Mel Gorman
2017-12-19 19:06   ` Peter Zijlstra
2017-12-19 20:25     ` Mel Gorman [this message]
2017-12-20  4:09     ` Mike Galbraith
2017-12-20  4:21       ` Mike Galbraith
2017-12-18  9:43 ` [PATCH 4/4] sched: Allow tasks to stack with a workqueue on the same CPU Mel Gorman
2017-12-18 10:44   ` Mike Galbraith
2017-12-18 11:25     ` Mel Gorman

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=20171219202536.vsmlw63apswkwiir@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.