public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: linux-kernel@vger.kernel.org
Subject: MAP_SHARED bizarrely slow
Date: Wed, 27 Oct 2004 16:45:27 +1000	[thread overview]
Message-ID: <20041027064527.GJ1676@zax> (raw)

http://www.ozlabs.org/people/dgibson/maptest.tar.gz

has a small set of test programs which perform a naive matrix multiply
in memory obtained by several different methods:  one is
MAP_PRIVATE|MAP_ANONYMOUS, one is MAP_SHARED|MAP_ANONYMOUS and the
third attempts to map from hugetlbfs.

On a number of machines I've tested - both ppc64 and x86 - the SHARED
version is consistently and significantly (50-100%) slower than the
PRIVATE version.  Increasing the matrix size does not appear to make
the situation significantly better.  The routine that does the actual
multiply is identical (same .o) in each case, only a wrapper which
allocates memory is different.

I am at a complete loss to explain this behaviour, and I'm sure it
didn't use to happen (unfortunately I can't remember what kernel
version we were on at the time).  oprofile appears to show essentially
all the time is taken in userspace in both cases.  Can anyone explain
what's going on?

I've also seen anomolies with the hugepage version, but it seems to be
less consistent.

-- 
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  6:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  6:45 David Gibson [this message]
2004-10-27  7:23 ` MAP_SHARED bizarrely slow James Cloos
2004-10-27  7:59   ` David Gibson
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=20041027064527.GJ1676@zax \
    --to=david@gibson.dropbear.id.au \
    --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