mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Avi Kivity <avi@redhat.com>
Cc: Jim Meyering <jim@meyering.net>, Theodore Tso <tytso@mit.edu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: efficient access to "rotational";  new fcntl?
Date: Sat, 19 Sep 2009 13:30:13 +0200	[thread overview]
Message-ID: <20090919133013.5a27290c@infradead.org> (raw)
In-Reply-To: <4AB4BC6A.3020104@redhat.com>

On Sat, 19 Sep 2009 14:11:38 +0300
Avi Kivity <avi@redhat.com> wrote:

> On 09/19/2009 12:19 PM, Arjan van de Ven wrote:
> >> However, sort *would* benefit, and some UCLA students implemented
> >> that for a term project.  Unfortunately, the project is stalled
> >> because the implementation was not efficient enough, and no one
> >> has found the time to improve it since.
> >>      
> > parallel sort... call me skeptical. My gut feeling is that you'll
> > get killed by communication overhead.
> > (sort seems to be more communication than raw cpu use)
> >
> >    
> 
> Why?  a sort that fits in memory is purely cpu and memory access.

memory access == communication due to cache line bounces....

> 
> Instead of O(N log N) you'd get K * O(N/K log N/K) followed by an
> O(N) merge.  For large N and small K, you get a speedup of roughly K
> (since the O(N) merge is dominated by the preceding sort.

doing big-O arithmatic and then add constant divisions/multipliers is
rather.. dangerous ;)

You actually get K * C1 * O(N/K log N/K) + C2 * O(N)
where C1/C2 is the actual cost of the extra intra-cpu communication.
(and for most sorting, I suspect the communication costs dominate over
CPU cost)

I'd be happy to be proven wrong... 


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2009-09-19 11:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 19:31 Jim Meyering
2009-09-18 22:16 ` Theodore Tso
2009-09-19  8:01   ` Jim Meyering
2009-09-19  8:31     ` Arjan van de Ven
2009-09-19  9:07       ` Jim Meyering
2009-09-19  9:19         ` Arjan van de Ven
2009-09-19 11:11           ` Avi Kivity
2009-09-19 11:30             ` Arjan van de Ven [this message]
2009-09-19 11:40               ` Avi Kivity
2009-09-19 11:25 ` Willy Tarreau

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=20090919133013.5a27290c@infradead.org \
    --to=arjan@infradead.org \
    --cc=avi@redhat.com \
    --cc=jim@meyering.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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

Powered by JetHome