From: Daniel Phillips <phillips@arcor.de>
To: Andrew Morton <akpm@zip.com.au>, Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch 1/13] misc fixes
Date: Mon, 29 Jul 2002 09:26:14 +0200 [thread overview]
Message-ID: <E17Z4v0-0002io-00@starship> (raw)
In-Reply-To: <3D439E09.3348E8D6@zip.com.au>
On Sunday 28 July 2002 09:32, Andrew Morton wrote:
> We have some fairly serious locking contention problems with the reverse
> mapping's pte_chains. Until we have a clear way out of that I believe
> that it is best to not merge code which has a lot of rmap dependency.
>
> It is apparent that these problems will not be solved by tweaking -
> some redesign is needed. In the 2.5 timeframe the only practical
> solution appears to be page table sharing, based on Daniel's February
> work. Daniel and Dave McCracken are working that.
Sadly, it turns out that there are no possibilities for page table sharing
when forking from bash. It turns out there are only about 200 pages being
shared amonst three page tables (stack, text and .interp) and at least one
page in each of these gets written during the exec, so all are unshared and
hence there is no reduction in the number of pte chains that have to be
created. For forking from a larger parent, page table sharing has a
measurable benefit, but not from these little guys.
But there is something massively wrong with this whole picture. Your kickass
4 way is managing to set up and tear down only one pte chain node per
microsecond, if I'm reading your benchmark results correctly. That's really
horrible. I think we need to revisit the locking.
The idea I'm playing with now is to address an array of locks based on
something like:
spin_lock(pte_chain_locks + ((page->index >> 4) & 0xff));
so that 16 consecutive filemap pages use the same lock and there is a limited
total number of locks to keep cache pressure down. Since we are creating the
vast majority of the pte chain nodes while walking across page tables, this
should give nice locality.
For this to work, anon pages will need to have something in page->index.
This isn't too much of a challenge. A reasonable value to put in there is
the creator's virtual address, shifted right, and perhaps mangled a little to
reduce contention.
We can also look at batching the pte chain node creation by preallocating 16
nodes, taking the lock, and walking through the 16 nodes filling in the
pointers. If the page index changes to a different lock we drop the one we
have and acquire the new one.
--
Daniel
next prev parent reply other threads:[~2002-07-29 7:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-28 7:32 Andrew Morton
2002-07-29 7:26 ` Daniel Phillips [this message]
2002-07-29 8:44 ` Rik van Riel
2002-07-29 8:40 ` David S. Miller
2002-07-29 20:00 ` Andrew Morton
2002-07-29 20:55 ` Rik van Riel
2002-07-29 22:36 ` Daniel Phillips
2002-07-29 21:51 ` Daniel Phillips
2002-07-31 22:22 ` Rmap setup/teardown suckage Daniel Phillips
2002-07-30 10:11 ` [patch 1/13] misc fixes Daniel Phillips
2002-07-30 10:18 ` Daniel Phillips
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=E17Z4v0-0002io-00@starship \
--to=phillips@arcor.de \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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
all inboxes | Powered by JetHome®