public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Mike Kravetz <kravetz@us.ibm.com>
Cc: rwhron@earthlink.net, mingo@elte.hu, gh@us.ibm.com,
	linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk
Subject: Re: O(1) scheduler gives big boost to tbench 192
Date: Wed, 8 May 2002 10:50:49 +0200	[thread overview]
Message-ID: <20020508105049.A31998@dualathlon.random> (raw)
In-Reply-To: <20020503093856.A27263@rushmore> <20020507151356.A18701@w-mikek.des.beaverton.ibm.com>

On Tue, May 07, 2002 at 03:13:56PM -0700, Mike Kravetz wrote:
> I believe the decrease in pipe bandwidth is a direct result of the
> removal of the '__wake_up_sync' support.  I'm not exactly sure what
> the arguments were for adding this support to the 'old' scheduler.
> However, it was only used by the 'pipe_write' code when it had to
> block after waking up a the reader on the pipe.  The 'bw_pipe'
> test exercised this code path.  In the 'old' scheduler '__wake_up_sync'
> seemed to accomplish the following:
> 1) Eliminated (possibly) unnecessary schedules on 'remote' CPUs
> 2) Eliminated IPI latency by having both reader and writer
>    execute on the same CPU
> 3) ? Took advantage of pipe data being in the CPU cache, by
>    having the reader read data the writer just wrote into the
>    cache. ?
> As I said, I'm not sure of the arguments for introducing this
> functionality in the 'old' scheduler.  Hopefully, it was not
> just a 'benchmark enhancing' patch.
> 
> I have experimented with reintroducing '__wake_up_sync' support
> into the O(1) scheduler.  The modifications are limited to the
> 'try_to_wake_up' routine as they were before.  If the 'synchronous'
> flag is set, then 'try_to_wake_up' trys to put the awakened task
> on the same runqueue as the caller without forcing a reschedule.
> If the task is not already on a runqueue, this is easy.  If not,
> we give up.  Results, restore previous bandwidth results.
> 
> BEFORE
> ------
> Pipe latency:    6.5185 microseconds
> Pipe bandwidth: 86.35 MB/sec
> 
> AFTER
> -----
> Pipe latency:     6.5723 microseconds
> Pipe bandwidth: 540.13 MB/sec

So my hypothesis about the sync wakeup in the below email proven to be right:

	http://marc.theaimsgroup.com/?l=linux-kernel&m=102050009725367&w=2

Many thanks for verifying this.

Personally if the two tasks ends blocking waiting each other, then I
prefer them to be in the same cpu. That was the whole point of the
optimization. If the pipe buffer is large enough not to require reader
or writer to block, then we don't do the sync wakeup just now (there's a
detail with the reader that may block simply because the writer is slow
at writing, but it probably doesn't matter much). There are many cases
where a PAGE_SIZE of buffer gets filled in much less then a timeslice,
and for all those cases rescheduling the two tasks one after the other
in the same cpu is a win, just like the benchmark shows.  Think the
normal pipes we do from the shell, like a "| grep something", they are
very common and they all wants to be handled as a sync wakeups.  In
short when loads of data pass through the pipe with max bandwith, the
sync-wakeup is a definitive win. If the pipe never gets filled then the
writer never sync-wakeup, it just returns the write call asynchronously,
but of course the pipe doesn't get filled because it's not a
max-bandiwth scenario, and so the producer and the consumer are allowed
to scale in multiple cpus by the design of the workload.

Comments?

I would like if you could pass over your changes to the O(1) scheduler
to resurrect the sync-wakeup.

Andrea

  parent reply	other threads:[~2002-05-08  8:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-03 13:38 O(1) scheduler gives big boost to tbench 192 rwhron
2002-05-03 20:29 ` Gerrit Huizenga
2002-05-04  8:13   ` Andrea Arcangeli
2002-05-07 22:13 ` Mike Kravetz
2002-05-07 22:44   ` Alan Cox
2002-05-07 22:43     ` Mike Kravetz
2002-05-07 23:39       ` Robert Love
2002-05-07 23:48         ` Mike Kravetz
2002-05-08 15:34           ` Jussi Laako
2002-05-08 16:31             ` Robert Love
2002-05-08 17:02               ` Mike Kravetz
2002-05-09  0:26                 ` Jussi Laako
2002-05-08  8:50   ` Andrea Arcangeli [this message]
2002-05-09 23:18     ` Mike Kravetz
  -- strict thread matches above, loose matches on Subject: below --
2002-05-20 12:46 rwhron
2002-05-08 16:39 Bill Davidsen
2002-05-06  8:20 rwhron
2002-05-06 16:42 ` Andrea Arcangeli
2002-05-03 16:37 John Hawkes
2002-05-02 21:36 rwhron
2002-05-03  0:09 ` Gerrit Huizenga
2002-05-02 23:17   ` J.A. Magallon
2002-05-03  0:14   ` Alan Cox
2002-05-03  1:08     ` Gerrit Huizenga

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=20020508105049.A31998@dualathlon.random \
    --to=andrea@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gh@us.ibm.com \
    --cc=kravetz@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rwhron@earthlink.net \
    /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