public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: James Cloos <cloos@jhcloos.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: MAP_SHARED bizarrely slow
Date: Wed, 27 Oct 2004 17:59:44 +1000	[thread overview]
Message-ID: <20041027075944.GK1676@zax> (raw)
In-Reply-To: <m3u0sgiq0b.fsf@lugabout.cloos.reno.nv.us>

On Wed, Oct 27, 2004 at 12:23:00AM -0700, James Cloos wrote:
> >>>>> "David" == David Gibson <david@gibson.dropbear.id.au> writes:
> 
> David> http://www.ozlabs.org/people/dgibson/maptest.tar.gz
> 
> David> On a number of machines I've tested - both ppc64 and x86 - the
> David> SHARED version is consistently and significantly (50-100%)
> David> slower than the PRIVATE version.
> 
> Just gave it a test on my laptop and server.  Both are p3.  The
> laptop is under heavier mem pressure; the server has just under
> a gig with most free/cache/buff.  Laptop is still running 2.6.7
> whereas the server is bk as of 2004-10-24.
> 
> Buth took about 11 seconds for the private and around 30 seconds
> for the shared tests.
> 
> So if this is a regression, it predates v2.6.7.

Actually, I think I've figured this one out, now.  And I think it may
have been a very subtle change in my test case.

The difference between MAP_SHARED and MAP_PRIVATE is that when a page
is touched for any reason on MAP_SHARED, a new page will be allocated,
whereas if a MAP_PRIVATE page is touched for read only it will get a
copy of the zero page.  My test wasn't initializing the matrices, just
multiplying whatever was in memory, so it was never write-touching the
input matrices.

With the entire input matrices all copies of the zero page, cache
performance, oddly enough, would have been rather better...

<sticks head in bucket>

-- 
David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

  reply	other threads:[~2004-10-27  8:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  6:45 MAP_SHARED bizarrely slow David Gibson
2004-10-27  7:23 ` James Cloos
2004-10-27  7:59   ` David Gibson [this message]
2004-10-28  4:38     ` Ian Wienand
2004-10-27  8:06   ` Andrew Morton
2004-10-27  8:20     ` David Gibson
2004-10-27  8:30     ` James Cloos
2004-10-27 20:54     ` Bill Davidsen
2004-10-28  1:16       ` David Gibson
2004-10-28  5:54     ` dean gaudet

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=20041027075944.GK1676@zax \
    --to=david@gibson.dropbear.id.au \
    --cc=cloos@jhcloos.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox