diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 13:30:37 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:37:47 (GMT) |
commit | 07813f094869d3d7029269c0cd46115b17ab1666 (patch) | |
tree | 4694c70e17a64f97df02f6d28351ae95721763cd /mm | |
parent | b9781be7057ca04c2bbf6f6d4d4da9925afb1ef2 (diff) | |
download | linux-fsl-qoriq-07813f094869d3d7029269c0cd46115b17ab1666.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.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 22e67a2..7ad7e6d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3742,6 +3742,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 */ |