Re: [rfc] optimise unlock_page
- From: Hugh Dickins <hugh@xxxxxxxxxxx>
- Date: Wed, 16 May 2007 18:54:15 +0100 (BST)
On Sun, 13 May 2007, Nick Piggin wrote:
On Sun, May 13, 2007 at 05:39:03AM +0100, Hugh Dickins wrote:
On Sun, 13 May 2007, Nick Piggin wrote:
On Fri, May 11, 2007 at 02:15:03PM +0100, Hugh Dickins wrote:
Hmm, well, I think that's fairly horrid, and would it even be
guaranteed to work on all architectures? Playing with one char
of an unsigned long in one way, while playing with the whole of
the unsigned long in another way (bitops) sounds very dodgy to me.
Of course not, but they can just use a regular atomic word sized
bitop. The problem with i386 is that its atomic ops also imply
memory barriers that you obviously don't need on unlock.
But is it even a valid procedure on i386?
Well I think so, but not completely sure.
That's not quite enough to convince me!
I do retract my "fairly horrid" remark, that was a kneejerk reaction
to cleverness; it's quite nice, if it can be guaranteed to work (and
if lowering FLAGS_RESERVED from 9 to 7 doesn't upset whoever carefully
chose 9).
Please seek out those guarantees. Like you, I can't really see how
it would go wrong (how could moving in the unlocked char mess with
the flag bits in the rest of the long? how could atomically modifying
the long have a chance of undoing that move?), but it feels like it
might take us into errata territory.
Hugh
OTOH, I admit this is one-
of the more contentious speedups ;) It is likely to be vary a lot by
the arch (I think the P4 is infamous for expensive locked ops, others
may prefer not to mix the byte sized ops with word length ones).
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/
- Follow-Ups:
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- References:
- Re: [rfc] optimise unlock_page
- From: Benjamin Herrenschmidt
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- From: Hugh Dickins
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- From: Hugh Dickins
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- From: Hugh Dickins
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- From: Hugh Dickins
- Re: [rfc] optimise unlock_page
- From: Nick Piggin
- Re: [rfc] optimise unlock_page
- Prev by Date: Re: [PATCH] UDF: check for allocated memory for inode data
- Next by Date: Re: [PATCH] UDF: check for allocated memory for inode data
- Previous by thread: Re: [rfc] optimise unlock_page
- Next by thread: Re: [rfc] optimise unlock_page
- Index(es):