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>2013-04-04 22:09:09 (GMT)
commit86e57c2dc838d57324ccc333a36c32e12df4f11f (patch)
tree61415aa15cb37d84a68b575bc199a99ec236e8a3 /mm
parent959661cdb998fe5c3d9109340f1596e3b61907ec (diff)
downloadlinux-fsl-qoriq-86e57c2dc838d57324ccc333a36c32e12df4f11f.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 bb1369f..2f059a9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3669,6 +3669,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
*/