aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-07-28 10:43:51 +0200
committerAnders Roxell <anders.roxell@linaro.org>2015-05-08 22:33:09 +0200
commit24b7801df27130075c0c3cd69dfb6a53648d26f7 (patch)
treecf3bfc6b21e7a67a31b6ce8b37f393016d329332 /mm
parent894a3968c662eec9c48289e531adf6f44ddc25cb (diff)
mm, rt: kmap_atomic scheduling
In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context switch (if there are any in use of course), this should be esp easy now that we have a kmap_atomic stack. Something like the below.. it wants replacing all the preempt_disable() stuff with pagefault_disable() && migrate_disable() of course, but then you can flip kmaps around like below. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> [dvhart@linux.intel.com: build fix] Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins [tglx@linutronix.de: Get rid of the per cpu variable and store the idx and the pte content right away in the task struct. Shortens the context switch code. ] Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/highmem.c6
-rw-r--r--mm/memory.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/mm/highmem.c b/mm/highmem.c
index 123bcd3ed4f2..16e8cf26d38a 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -29,10 +29,11 @@
#include <linux/kgdb.h>
#include <asm/tlbflush.h>
-
+#ifndef CONFIG_PREEMPT_RT_FULL
#if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
DEFINE_PER_CPU(int, __kmap_atomic_idx);
#endif
+#endif
/*
* Virtual_count is not a pure "count".
@@ -107,8 +108,9 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color)
unsigned long totalhigh_pages __read_mostly;
EXPORT_SYMBOL(totalhigh_pages);
-
+#ifndef CONFIG_PREEMPT_RT_FULL
EXPORT_PER_CPU_SYMBOL(__kmap_atomic_idx);
+#endif
unsigned int nr_free_highpages (void)
{
diff --git a/mm/memory.c b/mm/memory.c
index e38f53b792d9..8b6028fc342e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3247,6 +3247,7 @@ unlock:
#ifdef CONFIG_PREEMPT_RT_FULL
void pagefault_disable(void)
{
+ migrate_disable();
current->pagefault_disabled++;
/*
* make sure to have issued the store before a pagefault
@@ -3264,6 +3265,7 @@ void pagefault_enable(void)
*/
barrier();
current->pagefault_disabled--;
+ migrate_enable();
}
EXPORT_SYMBOL(pagefault_enable);
#endif