Re: [PATCH] rmap 24 pte_young first
From: Hugh Dickins
Date: Sat May 08 2004 - 18:00:05 EST
On Sat, 8 May 2004, Russell King wrote:
> On Sat, May 08, 2004 at 11:39:32PM +0100, Hugh Dickins wrote:
> > On Sat, 8 May 2004, Christoph Hellwig wrote:
> > >
> > > stupid question - shouldn't the pte_young check simply move to
> > > the beginning of ptep_test_and_clear_young?
> >
> > I don't think that would be a good idea. We're used to those
> > test_and_clear operations being atomic, putting an initial non-atomic
> > test inside would make it fundamentally non-atomic. We know here that
> > it's not the end of the world if we miss a racing transition of the
> > young bit, but it wouldn't be good to hide and force that on others.
>
> EAGAIN.
>
> include/asm-generic/pgtable.h:
>
> #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
> static inline int ptep_test_and_clear_young(pte_t *ptep)
> {
> pte_t pte = *ptep;
> if (!pte_young(pte))
> return 0;
> set_pte(ptep, pte_mkold(pte));
> return 1;
> }
> #endif
Hah! Delightful refutation of my little lecture. Thanks a lot for
turning that up. Hmm. Well, I guess I need to research that one
further: a first guess would be that the generic variety is silly
to be doing an optimization which the specialist versions don't do:
but perhaps when I look I'll find some of them do. Can scrub that
patch for now if you prefer, Andrew: world won't stop turning either way.
Hugh
-
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/