]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: mmu_notifier: have mmu_notifiers use a global SRCU so they may safely schedule
authorSagi Grimberg <sagig@mellanox.co.il>
Fri, 28 Sep 2012 00:19:13 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:00:49 +0000 (14:00 +1000)
commit616a214e680769b844641c0f06321c9dc22f5f42
tree13432e25a28c903795c0ced6e3bca4d4d285d04d
parent395e6cb6a83b6454dc42b595281aa74a52abb6a1
mm: mmu_notifier: have mmu_notifiers use a global SRCU so they may safely schedule

With an RCU based mmu_notifier implementation, any callout to
mmu_notifier_invalidate_range_start(), mmu_notifier_invalidate_range_end()
or mmu_notifier_invalidate_page() would not be allowed to call schedule()
as that could potentially allow a modification to the mmu_notifier
structure while it is currently being used.

Since srcu allocs 4 machine words per instance per cpu, we may end up with
memory exhaustion if we use srcu per mm.  So all mms share a global srcu.
Note that during large mmu_notifier activity exit & unregister paths might
hang for longer periods, but it is tolerable for current mmu_notifier
clients.

Signed-off-by: Sagi Grimberg <sagig@mellanox.co.il>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Haggai Eran <haggaie@mellanox.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmu_notifier.h
mm/mmu_notifier.c