|
@@ -21,7 +21,7 @@
|
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
|
|
|
|
/* global SRCU for all MMs */
|
|
/* global SRCU for all MMs */
|
|
|
-static struct srcu_struct srcu;
|
|
|
|
|
|
|
+DEFINE_STATIC_SRCU(srcu);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* This function allows mmu_notifier::release callback to delay a call to
|
|
* This function allows mmu_notifier::release callback to delay a call to
|
|
@@ -252,12 +252,6 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
|
|
|
|
|
|
|
|
BUG_ON(atomic_read(&mm->mm_users) <= 0);
|
|
BUG_ON(atomic_read(&mm->mm_users) <= 0);
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- * Verify that mmu_notifier_init() already run and the global srcu is
|
|
|
|
|
- * initialized.
|
|
|
|
|
- */
|
|
|
|
|
- BUG_ON(!srcu.per_cpu_ref);
|
|
|
|
|
-
|
|
|
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
|
mmu_notifier_mm = kmalloc(sizeof(struct mmu_notifier_mm), GFP_KERNEL);
|
|
mmu_notifier_mm = kmalloc(sizeof(struct mmu_notifier_mm), GFP_KERNEL);
|
|
|
if (unlikely(!mmu_notifier_mm))
|
|
if (unlikely(!mmu_notifier_mm))
|
|
@@ -406,9 +400,3 @@ void mmu_notifier_unregister_no_release(struct mmu_notifier *mn,
|
|
|
mmdrop(mm);
|
|
mmdrop(mm);
|
|
|
}
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(mmu_notifier_unregister_no_release);
|
|
EXPORT_SYMBOL_GPL(mmu_notifier_unregister_no_release);
|
|
|
-
|
|
|
|
|
-static int __init mmu_notifier_init(void)
|
|
|
|
|
-{
|
|
|
|
|
- return init_srcu_struct(&srcu);
|
|
|
|
|
-}
|
|
|
|
|
-subsys_initcall(mmu_notifier_init);
|
|
|