]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix page-faults detection in swap-token logic
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Thu, 8 Dec 2011 04:38:53 +0000 (15:38 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Dec 2011 04:18:53 +0000 (15:18 +1100)
commitb512d61a7ba8b5f39200c0efd19f16cb9a7482b5
treef0a7bdb996a17452b39e2503b593fb124240a3e8
parentb09420dfeb243fe1dab46b47835611329637fac5
mm: fix page-faults detection in swap-token logic

After commit v2.6.36-5896-gd065bd8 "mm: retry page fault when blocking on
disk transfer" we usually wait in page-faults without mmap_sem held, so
all swap-token logic was broken, because it based on using
rwsem_is_locked(&mm->mmap_sem) as sign of in progress page-faults.

Add an atomic counter of in progress page-faults for mm to the mm_struct
with swap-token.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm_types.h
include/linux/swap.h
kernel/fork.c
mm/memory.c
mm/rmap.c