On Fri, Aug 27, 2010 at 1:56 PM, Christoph Lameter <cl@linux.com> wrote:
No second version of the patch, no. As I said already, it's that
second page_mapped check which gives the guarantee that the anon_vma
has not yet been freed, hence we've locked the correct object.
Yes. (not counting RCU's read "lock" as a lock).
No, SLAB_DESTROY_BY_RCU gives us just the stablity we need to take the lock.
Yes, unlikely but possible. (Well, actually, is it possible? It can
be unmapped on exit without any lock, but unmapping for pageout would
require the page lock, would insert a swp_entry_t, and mapping again
would go to do_swap_page which would again require the page lock. But
never mind that, let's assume there is a way it can be unmapped and
mapped again.) The thing is, page->mapping will point to the same
anon_vma throughout, that only gets reset when the page is freed, and
there should be nowhere else that modifies page->mapping once it's
been set to anon_vma - if you know of somewhere, please point to it,
we do need to examine that case.
--