diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-05-11 11:52:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 02:39:14 -0400 |
commit | 2cb7c9cb426660b5ed58b643d9e7dd5d50ba901f (patch) | |
tree | 39976a7d4ee0ee34da0072e71fcd49e02480f096 /include/linux/highmem.h | |
parent | b3c395ef5556a6c60f4426cc060f5b7bdcf82d5b (diff) |
sched/preempt, mm/kmap: Explicitly disable/enable preemption in kmap_atomic_*
The existing code relies on pagefault_disable() implicitly disabling
preemption, so that no schedule will happen between kmap_atomic() and
kunmap_atomic().
Let's make this explicit, to prepare for pagefault_disable() not
touching preemption anymore.
Reviewed-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: David.Laight@ACULAB.COM
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: airlied@linux.ie
Cc: akpm@linux-foundation.org
Cc: benh@kernel.crashing.org
Cc: bigeasy@linutronix.de
Cc: borntraeger@de.ibm.com
Cc: daniel.vetter@intel.com
Cc: heiko.carstens@de.ibm.com
Cc: herbert@gondor.apana.org.au
Cc: hocko@suse.cz
Cc: hughd@google.com
Cc: mst@redhat.com
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: schwidefsky@de.ibm.com
Cc: yang.shi@windriver.com
Link: http://lkml.kernel.org/r/1431359540-32227-5-git-send-email-dahi@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r-- | include/linux/highmem.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 9286a46b7d69..6aefcd0031a6 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -65,6 +65,7 @@ static inline void kunmap(struct page *page) | |||
65 | 65 | ||
66 | static inline void *kmap_atomic(struct page *page) | 66 | static inline void *kmap_atomic(struct page *page) |
67 | { | 67 | { |
68 | preempt_disable(); | ||
68 | pagefault_disable(); | 69 | pagefault_disable(); |
69 | return page_address(page); | 70 | return page_address(page); |
70 | } | 71 | } |
@@ -73,6 +74,7 @@ static inline void *kmap_atomic(struct page *page) | |||
73 | static inline void __kunmap_atomic(void *addr) | 74 | static inline void __kunmap_atomic(void *addr) |
74 | { | 75 | { |
75 | pagefault_enable(); | 76 | pagefault_enable(); |
77 | preempt_enable(); | ||
76 | } | 78 | } |
77 | 79 | ||
78 | #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) | 80 | #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) |