summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 13:30:37 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:10 (GMT)
commit8f5ce951e9a668c3b1c749fc6fee9e8b5dd4654b (patch)
treecabe6eff2117c2df19292c003eff84df0e8afd7d /mm
parente7ff7e9c875a719e4b8d83f7a009bef09bbbab1e (diff)
downloadlinux-fsl-qoriq-8f5ce951e9a668c3b1c749fc6fee9e8b5dd4654b.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')
-rw-r--r--mm/memory.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index db2916f..1ae78e9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3747,6 +3747,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
*/