Re: [patch 3/3] mm: PageActive no testset

From: Nick Piggin
Date: Thu Jan 19 2006 - 09:48:42 EST


Hi Marcelo,

On Wed, Jan 18, 2006 at 12:13:46PM -0200, Marcelo Tosatti wrote:
> Hi Nick,
>
> On Wed, Jan 18, 2006 at 11:40:58AM +0100, Nick Piggin wrote:
> > PG_active is protected by zone->lru_lock, it does not need TestSet/TestClear
> > operations.
>
> page->flags bits (including PG_active and PG_lru bits) are touched by
> several codepaths which do not hold zone->lru_lock.
>
> AFAICT zone->lru_lock guards access to the LRU list, and no more than
> that.
>

Yep.

> Moreover, what about consistency of the rest of page->flags bits?
>

That's OK, set_bit and clear_bit are atomic as well, they just don't
imply memory barriers and can be implemented a bit more simply.

The test-set / test-clear operations also kind of imply that it is
being used for locking or without other synchronisation (usually).

> PPC for example implements test_and_set_bit() with:
>
> lwarx reg, addr (load and create reservation for 32-bit addr)
> or reg, BITOP_MASK(nr)
> stwcx reg, addr (store word upon reservation validation, otherwise loop)
>

Thanks,
Nick
-
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/