Re: [PATCH 2/2] Futex non-page-pinning fix

From: Hugh Dickins
Date: Mon Sep 01 2003 - 22:28:00 EST


On Mon, 1 Sep 2003, Hugh Dickins wrote:
>
> 5. If you're not doing anything in __remove_from_page_cache (rightly
> trying to avoid hotpath), you do need to futex_rehash in mm/swap_state.c
> __delete_from_swap_cache (last time I did say without the __s, but that
> would miss an instance you need to catch). That will handle the swapoff
> case amongst others.

Of course, the reason I originally said without the __s, was because
move_from_swap_cache uses __delete_from_swap_cache, and we don't want
interference there. So best convert that to use __remove_from_page_cache
instead, with INC_CACHE_INFO(del_total) outside the locking, after the
set_page_dirty: would improve symmetry between move_from_ and move_to_.

The instance of __delete_from_swap_cache I say you need to catch, is
that in remove_exclusive_swap_page; though I think its count restrictions
limit it to cornercases like your test program, rather than real
communication between processes. But hold on, in such a cornercase
(no other references to the swap), what if the process unmaps the vma
containing the futex while it is swapped out and not even in page cache?
Unclear.

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/