diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 08:30:37 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-02-15 10:32:32 -0600 |
commit | 95d59d56816ad3e5df37ea57826ba83ffa5f0c06 (patch) | |
tree | 39e947894b3e69aad050e8147fdbce2b7e4d027d /mm | |
parent | 31a092f0d40328fc2bfbb2d0b4e72a52d16cbf96 (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 829d43735402..52e3f6502b50 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3436,6 +3436,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 */ |