62 lines
2.0 KiB
Diff
62 lines
2.0 KiB
Diff
From 573a49b98c80acdeb8f2b0e3990863a30900c2f7 Mon Sep 17 00:00:00 2001
|
|
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
|
|
Date: Mon, 11 May 2015 17:52:20 +0200
|
|
Subject: [PATCH 14/14] uaccess: decouple preemption from the pagefault logic
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.0/patches-4.0.8-rt6.tar.xz
|
|
|
|
As the fault handlers now all rely on the pagefault_disabled() checks
|
|
and implicit preempt_disable() calls by pagefault_disable() have been
|
|
made explicit, we can completely rely on the pagefault_disableD counter.
|
|
|
|
So let's no longer touch the preempt count when disabling/enabling
|
|
pagefaults. After a call to pagefault_disable(), pagefault_disabled()
|
|
will return true, but in_atomic() won't.
|
|
|
|
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
|
|
---
|
|
include/linux/uaccess.h | 16 ++--------------
|
|
1 file changed, 2 insertions(+), 14 deletions(-)
|
|
|
|
--- a/include/linux/uaccess.h
|
|
+++ b/include/linux/uaccess.h
|
|
@@ -1,7 +1,6 @@
|
|
#ifndef __LINUX_UACCESS_H__
|
|
#define __LINUX_UACCESS_H__
|
|
|
|
-#include <linux/preempt.h>
|
|
#include <linux/sched.h>
|
|
#include <asm/uaccess.h>
|
|
|
|
@@ -20,17 +19,11 @@ static __always_inline void pagefault_di
|
|
* These routines enable/disable the pagefault handler. If disabled, it will
|
|
* not take any locks and go straight to the fixup table.
|
|
*
|
|
- * We increase the preempt and the pagefault count, to be able to distinguish
|
|
- * whether we run in simple atomic context or in a real pagefault_disable()
|
|
- * context.
|
|
- *
|
|
- * For now, after pagefault_disabled() has been called, we run in atomic
|
|
- * context. User access methods will not sleep.
|
|
- *
|
|
+ * User access methods will not sleep when called from a pagefault_disabled()
|
|
+ * environment.
|
|
*/
|
|
static inline void pagefault_disable(void)
|
|
{
|
|
- preempt_count_inc();
|
|
pagefault_disabled_inc();
|
|
/*
|
|
* make sure to have issued the store before a pagefault
|
|
@@ -47,11 +40,6 @@ static inline void pagefault_enable(void
|
|
*/
|
|
barrier();
|
|
pagefault_disabled_dec();
|
|
-#ifndef CONFIG_PREEMPT
|
|
- preempt_count_dec();
|
|
-#else
|
|
- preempt_enable();
|
|
-#endif
|
|
}
|
|
|
|
/*
|