lkml.org 
[lkml]   [2020]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v2 13/13] powerpc/kernel: Do not use READ_ONCE() to access current thread_info flags
Date
current is a volatile pointer hold by r2 register.

READ_ONCE() is not required.

Before: 327 cycles on null_syscall
Before: 325 cycles on null_syscall

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c
index 34fd66fd11a2..3d2f285b8a01 100644
--- a/arch/powerpc/kernel/syscall.c
+++ b/arch/powerpc/kernel/syscall.c
@@ -164,7 +164,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
again:
#endif
local_irq_disable();
- ti_flags = READ_ONCE(*ti_flagsp);
+ ti_flags = current_thread_info()->flags;
while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) {
local_irq_enable();
if (ti_flags & _TIF_NEED_RESCHED) {
@@ -180,7 +180,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
do_notify_resume(regs, ti_flags);
}
local_irq_disable();
- ti_flags = READ_ONCE(*ti_flagsp);
+ ti_flags = current_thread_info()->flags;
}

if (IS_ENABLED(CONFIG_PPC_BOOK3S) && IS_ENABLED(CONFIG_PPC_FPU)) {
--
2.25.0
\
 
 \ /
  Last update: 2020-04-05 19:45    [W:0.115 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site