Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers-nohz-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull NOHZ update from Thomas Gleixner:
"Remove TIF_NOHZ from three architectures

These architectures use a static key to decide whether context
tracking needs to be invoked and the TIF_NOHZ flag just causes a
pointless slowpath execution for nothing"

* tag 'timers-nohz-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
arm64: Remove TIF_NOHZ
arm: Remove TIF_NOHZ
x86: Remove TIF_NOHZ
context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ
x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY

+19 -17
+11 -5
arch/Kconfig
··· 540 540 help 541 541 Provide kernel/user boundaries probes necessary for subsystems 542 542 that need it, such as userspace RCU extended quiescent state. 543 - Syscalls need to be wrapped inside user_exit()-user_enter() through 544 - the slow path using TIF_NOHZ flag. Exceptions handlers must be 545 - wrapped as well. Irqs are already protected inside 546 - rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on 547 - irq exit still need to be protected. 543 + Syscalls need to be wrapped inside user_exit()-user_enter(), either 544 + optimized behind static key or through the slow path using TIF_NOHZ 545 + flag. Exceptions handlers must be wrapped as well. Irqs are already 546 + protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal 547 + handling on irq exit still need to be protected. 548 + 549 + config HAVE_TIF_NOHZ 550 + bool 551 + help 552 + Arch relies on TIF_NOHZ and syscall slow path to implement context 553 + tracking calls to user_enter()/user_exit(). 548 554 549 555 config HAVE_VIRT_CPU_ACCOUNTING 550 556 bool
-1
arch/arm/include/asm/thread_info.h
··· 141 141 #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ 142 142 #define TIF_SECCOMP 7 /* seccomp syscall filtering active */ 143 143 144 - #define TIF_NOHZ 12 /* in adaptive nohz mode */ 145 144 #define TIF_USING_IWMMXT 17 146 145 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 147 146 #define TIF_RESTORE_SIGMASK 20
+1 -3
arch/arm64/include/asm/thread_info.h
··· 63 63 #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */ 64 64 #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ 65 65 #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */ 66 - #define TIF_NOHZ 7 67 66 #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ 68 67 #define TIF_SYSCALL_AUDIT 9 /* syscall auditing */ 69 68 #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ ··· 82 83 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 83 84 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 84 85 #define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE) 85 - #define _TIF_NOHZ (1 << TIF_NOHZ) 86 86 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 87 87 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 88 88 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) ··· 98 100 99 101 #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ 100 102 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ 101 - _TIF_NOHZ | _TIF_SYSCALL_EMU) 103 + _TIF_SYSCALL_EMU) 102 104 103 105 #define INIT_THREAD_INFO(tsk) \ 104 106 { \
+1
arch/mips/Kconfig
··· 51 51 select HAVE_ASM_MODVERSIONS 52 52 select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS 53 53 select HAVE_CONTEXT_TRACKING 54 + select HAVE_TIF_NOHZ 54 55 select HAVE_COPY_THREAD_TLS 55 56 select HAVE_C_RECORDMCOUNT 56 57 select HAVE_DEBUG_KMEMLEAK
+1
arch/powerpc/Kconfig
··· 182 182 select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) 183 183 select HAVE_STACKPROTECTOR if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2) 184 184 select HAVE_CONTEXT_TRACKING if PPC64 185 + select HAVE_TIF_NOHZ if PPC64 185 186 select HAVE_COPY_THREAD_TLS 186 187 select HAVE_DEBUG_KMEMLEAK 187 188 select HAVE_DEBUG_STACKOVERFLOW
+1
arch/sparc/Kconfig
··· 71 71 select HAVE_FTRACE_MCOUNT_RECORD 72 72 select HAVE_SYSCALL_TRACEPOINTS 73 73 select HAVE_CONTEXT_TRACKING 74 + select HAVE_TIF_NOHZ 74 75 select HAVE_DEBUG_KMEMLEAK 75 76 select IOMMU_HELPER 76 77 select SPARSE_IRQ
+2 -8
arch/x86/include/asm/thread_info.h
··· 92 92 #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */ 93 93 #define TIF_NOTSC 16 /* TSC is not accessible in userland */ 94 94 #define TIF_IA32 17 /* IA32 compatibility process */ 95 - #define TIF_NOHZ 19 /* in adaptive nohz mode */ 96 95 #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ 97 96 #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */ 98 97 #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ ··· 121 122 #define _TIF_NOCPUID (1 << TIF_NOCPUID) 122 123 #define _TIF_NOTSC (1 << TIF_NOTSC) 123 124 #define _TIF_IA32 (1 << TIF_IA32) 124 - #define _TIF_NOHZ (1 << TIF_NOHZ) 125 125 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 126 126 #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) 127 127 #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) ··· 131 133 #define _TIF_X32 (1 << TIF_X32) 132 134 #define _TIF_FSCHECK (1 << TIF_FSCHECK) 133 135 134 - /* 135 - * work to do in syscall_trace_enter(). Also includes TIF_NOHZ for 136 - * enter_from_user_mode() 137 - */ 136 + /* Work to do before invoking the actual syscall. */ 138 137 #define _TIF_WORK_SYSCALL_ENTRY \ 139 138 (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT | \ 140 - _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \ 141 - _TIF_NOHZ) 139 + _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) 142 140 143 141 /* flags to check in __switch_to() */ 144 142 #define _TIF_WORK_CTXSW_BASE \
+2
kernel/context_tracking.c
··· 198 198 if (initialized) 199 199 return; 200 200 201 + #ifdef CONFIG_HAVE_TIF_NOHZ 201 202 /* 202 203 * Set TIF_NOHZ to init/0 and let it propagate to all tasks through fork 203 204 * This assumes that init is the only task at this early boot stage. 204 205 */ 205 206 set_tsk_thread_flag(&init_task, TIF_NOHZ); 207 + #endif 206 208 WARN_ON_ONCE(!tasklist_empty()); 207 209 208 210 initialized = true;