[lkml]   [2004]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: MAP_SHARED bizarrely slow
On Wed, Oct 27, 2004 at 12:23:00AM -0700, James Cloos wrote:
> >>>>> "David" == David Gibson <> writes:
> David>
> 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 | solution which is simple, neat and
| wrong.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:07    [W:0.057 / U:1.928 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site