summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 08:30:37 -0500
committerClark Williams <williams@redhat.com>2012-04-10 16:36:34 -0500
commitb174ae88675c254599149f867d70d52d247f7075 (patch)
tree37b356ee1aedbed2baddd4f81860b9cbc4ca7722 /mm
parentbc2b1e292c055dc5e2dba0770b0c79ab0b48b444 (diff)
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 1b1ca176397e..454ad3f099ee 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3444,6 +3444,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_GPL(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_GPL(pagefault_enable);
+
/*
* By the time we get here, we already hold the mm semaphore
*/