public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: insecure <insecure@mail.od.ua>
To: Jeff Garzik <jgarzik@pobox.com>, Larry McVoy <lm@bitmover.com>
Cc: Andrew Morton <akpm@osdl.org>, Hanna Linder <hannal@us.ibm.com>,
	lse-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: Minutes from 10/1 LSE Call
Date: Thu, 2 Oct 2003 21:56:49 +0300	[thread overview]
Message-ID: <200310022156.49678.insecure@mail.od.ua> (raw)
In-Reply-To: <3F7B701C.5020708@pobox.com>

On Thursday 02 October 2003 03:23, Jeff Garzik wrote:
> Larry McVoy wrote:
> > On Wed, Oct 01, 2003 at 04:29:16PM -0700, Andrew Morton wrote:
> >>If you have a loop like:
> >>
> >>	char *buf;
> >>
> >>	for (lots) {
> >>		read(fd, buf, size);
> >>	}
> >>
> >>the optimum value of `size' is small: as little as 8k.  Once `size' gets
> >>close to half the size of the L1 cache you end up pushing the memory at
> >>`buf' out of CPU cache all the time.
> >
> > I've seen this too, not that Andrew needs me to back him up, but in many
> > cases even 4k is big enough.  Linux has a very thin system call layer so
> > it is OK, good even, to use reasonable buffer sizes.
>
> Slight tangent, FWIW...   Back when I was working on my "race-free
> userland" project, I noticed that the fastest cp(1) implementation was
> GNU's:  read/write from a single, statically allocated, page-aligned 4K
> buffer.  I experimented with various buffer sizes, mmap-based copies,
> and even with sendfile(2) where both arguments were files.
> read(2)/write(2) of a single 4K buffer was always the fastest.

That sounds reasonable, but today's RAM throughput is on the order
of 1GB/s, not 100Mb/s. 'Out of L1' theory can't explain 100Mb/s ceiling
it seems.
--
vda

  reply	other threads:[~2003-10-02 18:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-01 19:19 Minutes from 10/1 LSE Call Hanna Linder
2003-10-01 23:29 ` Andrew Morton
2003-10-01 23:38   ` Larry McVoy
2003-10-02  0:23     ` Jeff Garzik
2003-10-02 18:56       ` insecure [this message]
2003-10-02 19:10         ` Jeff Garzik
2003-10-02 22:38           ` insecure
2003-10-02 22:45             ` Hanna Linder
2003-10-05  5:38             ` Andrew Morton
2003-10-02 19:21   ` [Lse-tech] " Steven Pratt
2003-10-02 19:36     ` Andrew Morton
2003-10-03 19:33       ` Steven Pratt
2003-10-03 20:13         ` Andrew Morton

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=200310022156.49678.insecure@mail.od.ua \
    --to=insecure@mail.od.ua \
    --cc=akpm@osdl.org \
    --cc=hannal@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm@bitmover.com \
    --cc=lse-tech@lists.sourceforge.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