rmap: page_mapping barrier

From: Hugh Dickins
Date: Thu Apr 08 2004 - 08:23:29 EST


My page_mapping(page) says PageAnon(page)? NULL: page->mapping;
I've just realized, looking again at sync_page but it goes way
beyond it, that we need smp barriers of some kind somewhere,
don't we? That is, we cannot just write the address of one of
our non-address_space structures into page->mapping, without
being very careful that others will see the PageAnon and treat
it as NULL. There are places all over using page_mapping(page)
while another cpu might be right in page_add_rmap. I go very
mushy when it comes to barriers, you understand them better
than most, any idea what we need to do in page_mapping(page),
and when setting and clearing PageAnon?

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