diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 08:30:37 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-04-11 11:07:22 -0500 |
commit | 1e544a28550be821e354202daaafba012efe0d51 (patch) | |
tree | 9e05a05ac47940e3701b07ded665bae5f4ad27bb /mm | |
parent | 498636b45e16ee97199dbba8464aa8e5922a8fdb (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.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 6105f475fa86..c3b9c80d5fbb 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3467,6 +3467,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 */ |