summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 13:30:37 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-10 00:18:40 (GMT)
commit60f0b2748306e45a2dd3ea6a42d0136439793664 (patch)
tree9330a19c9cdf8242d6798bfa224877a3ae6bbd94 /mm/memory.c
parent6ebefa18828dae29742463c1ed3f59b16bbfdc1d (diff)
downloadlinux-fsl-qoriq-60f0b2748306e45a2dd3ea6a42d0136439793664.tar.xz
mm: Prepare decoupling the page fault disabling logic
Add a pagefault_disabled variable to task_struct to allow decoupling the pagefault-disabled logic from the preempt count. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 22e67a2..7ad7e6d 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3742,6 +3742,35 @@ unlock:
return 0;
}
+void pagefault_disable(void)
+{
+ inc_preempt_count();
+ current->pagefault_disabled++;
+ /*
+ * make sure to have issued the store before a pagefault
+ * can hit.
+ */
+ barrier();
+}
+EXPORT_SYMBOL(pagefault_disable);
+
+void pagefault_enable(void)
+{
+ /*
+ * make sure to issue those last loads/stores before enabling
+ * the pagefault handler again.
+ */
+ barrier();
+ current->pagefault_disabled--;
+ dec_preempt_count();
+ /*
+ * make sure we do..
+ */
+ barrier();
+ preempt_check_resched();
+}
+EXPORT_SYMBOL(pagefault_enable);
+
/*
* By the time we get here, we already hold the mm semaphore
*/