Re: Unnecessary barrier in sync_page()?

From: Andrea Arcangeli
Date: Wed Jul 07 2004 - 16:10:18 EST


On Wed, Jul 07, 2004 at 04:57:04PM -0400, Chris Mason wrote:
> I wasn't worried about the locked bit when I added the barrier, my goal
> was to order things with people that set page->mapping to null.

page->mapping cannot change from NULL to non-NULL there.

it can only change from non-NULL to NULL, and there's no way to
serialize with the truncate without taking the page lock.

The one extremely important fix you did around the same time, has been
to "cache" the value of "mapping" in the kernel stack, so that it
remains the same during the while function (so that it cannot start
non-NULL an finish NULL). But the smp_mb() itself cannot make a
difference as far as I can tell.
-
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/