linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [rfc][patch] unlock_page speedup
Date: Mon, 22 Dec 2008 04:51:49 +0100	[thread overview]
Message-ID: <20081222035149.GI26419@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.2.00.0812190926000.14014@localhost.localdomain>

On Fri, Dec 19, 2008 at 09:35:14AM -0800, Linus Torvalds wrote:
> 
> 
> On Thu, 18 Dec 2008, Andrew Morton wrote:
> >
> > On Fri, 19 Dec 2008 08:29:09 +0100 Nick Piggin <npiggin@suse.de> wrote:
> > 
> > > Introduce a new page flag, PG_waiters
> > 
> > Leaving how many?  fs-cache wants to take two more.
> 
> Hmm. Do we ever use lock_page() on anything but page-cache pages and the 
> buffer cache?
> 
> We _could_ decide to try to move the whole locking into the "mapping" 
> field, and use a few more bits in the low bits of the pointer. Right now 
> we just use one bit (PAGE_MAPPING_ANON), but if we just make the rule be 
> that "struct address_space" has to be 8-byte aligned, then we'd have two 
> more bits available there, and we could hide the lock bit and the 
> contention bit there too.
> 
> This actually would have a _really_ nice effect, in that if we do this, 
> then I suspect that we could eventually even make the bits in "flags" be 
> non-atomic. The lock bit really is special. The other bits tend to be 
> either pretty static over allocation, or things that should be set only 
> when the page is locked.
> 
> I dunno. But it sounds like a reasonable thing to do, and it would free 
> one bit from the page flags, rather than use yet another one. And because 
> locking is special and because we already have to access that "mapping" 
> pointer specially, I don't think the impact would be very invasive.

I did a patch for that at one point. It doesn't go very far to allowing
non-atomic page flags, but it allows non-atomic unlock_page. But Hugh
wanted to put PG_swapcache in there, so I put it on the shelf for a while.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2008-12-22  4:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19  7:29 Nick Piggin
2008-12-19  7:35 ` Andrew Morton
2008-12-19  7:53   ` Nick Piggin
2008-12-19  7:59     ` Andrew Morton
2008-12-19  8:53       ` Nick Piggin
2008-12-19 17:35   ` Linus Torvalds
2008-12-19 17:55     ` Linus Torvalds
2008-12-23  0:46       ` Hugh Dickins
2008-12-22  3:51     ` Nick Piggin [this message]

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=20081222035149.GI26419@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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