Re: [rfc] optimise unlock_page
From: Nick Piggin
Date: Thu May 17 2007 - 02:27:49 EST
On Wed, May 16, 2007 at 12:47:54PM -0700, Linus Torvalds wrote:
>
> On Wed, 16 May 2007, Hugh Dickins wrote:
>
> > > The other option of moving the bit into ->mapping hopefully avoids all
> > > the issues, and would probably be a little faster again on the P4, at the
> > > expense of being a more intrusive (but it doesn't look too bad, at first
> > > glance)...
> >
> > Hmm, I'm so happy with PG_swapcache in there, that I'm reluctant to
> > cede it to your PG_locked, though I can't deny your use should take
> > precedence. Perhaps we could enforce 8-byte alignment of struct
> > address_space and struct anon_vma to make both bits available
> > (along with the anon bit).
>
> We probably could. It should be easy enough to mark "struct address_space"
> to be 8-byte aligned.
Yeah, it might be worthwhile, because I agree that PG_swapcache would
work nicely there too.
> > But I think you may not be appreciating how intrusive PG_locked
> > will be. There are many references to page->mapping (often ->host)
> > throughout fs/ : when we keep anon/swap flags in page->mapping, we
> > know the filesystems will never see those bits set in their pages,
> > so no page_mapping-like conversion is needed; just a few places in
> > common code need to adapt.
>
> You're right, it could be really painful. We'd have to rename the field,
> and use some inline function to access it (which masks off the low bits).
Yeah, I realise that the change is intrusive in terms of lines touched,
but AFAIKS, it should not be much more complex than a search/replace...
As far as deprecating things goes... I don't think we have to wait too
long, its more for features, drivers, or more fundamental APIs isn't it?
If we just point out that one must use set_page_mapping/page_mapping
rather than page->mapping, it is trivial to fix any out of tree breakage.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/