Skip to content

Commit 522d7de

Browse files
walken-googleKAGA-KOKO
authored andcommitted
futex: Remove redundant pagefault_disable in futex_atomic_cmpxchg_inatomic()
kernel/futex.c disables page faults before calling futex_atomic_cmpxchg_inatomic(), so there is no need to do it again within that function. Signed-off-by: Michel Lespinasse <[email protected]> Cc: Darren Hart <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Matt Turner <[email protected]> Cc: Russell King <[email protected]> Cc: David Howells <[email protected]> Cc: Tony Luck <[email protected]> Cc: Michal Simek <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Linus Torvalds <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent c0c9ed1 commit 522d7de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/arm/include/asm/futex.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
9595
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
9696
return -EFAULT;
9797

98-
pagefault_disable(); /* implies preempt_disable() */
98+
/* Note that preemption is disabled by futex_atomic_cmpxchg_inatomic
99+
* call sites. */
99100

100101
__asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
101102
"1: " T(ldr) " %0, [%3]\n"
@@ -115,8 +116,6 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
115116
: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
116117
: "cc", "memory");
117118

118-
pagefault_enable(); /* subsumes preempt_enable() */
119-
120119
return val;
121120
}
122121

0 commit comments

Comments
 (0)