linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs
@ 2020-02-14 15:26 Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 1/5] x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Thomas Gleixner, Andy Lutomirski, Ralf Baechle,
	Ingo Molnar, Will Deacon, Catalin Marinas, Michael Ellerman,
	Russell King

TIF_NOHZ is getting deprecated by static keys which avoid to invoke
syscall slow path on every syscall. So remove that flag from
architectures that don't need it anymore (or worse yet: that spuriously
triggered syscall slow path when it's not needed anymore).

We hope to remove TIF_NOHZ entirely in the long run (PPC, MIPS, SPARC).
If we want to be able to enable/disable nohz full dynamically on runtime,
freezing all tasks and iterating through the whole tasklist to set/clear
TIF_NOHZ doesn't sound very appealing.

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	arch/nohz
	
WARNING: untested on ARM 32

HEAD: 92502ebbf06ac37858694ed8f9d16fdb13ed0fe3

Thanks,
	Frederic
---

Frederic Weisbecker (4):
      context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ
      x86: Remove TIF_NOHZ
      arm: Remove TIF_NOHZ
      arm64: Remove TIF_NOHZ

Thomas Gleixner (1):
      x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY


 arch/Kconfig                         | 16 +++++++++++-----
 arch/arm/include/asm/thread_info.h   |  1 -
 arch/arm64/include/asm/thread_info.h |  4 +---
 arch/mips/Kconfig                    |  1 +
 arch/powerpc/Kconfig                 |  1 +
 arch/sparc/Kconfig                   |  1 +
 arch/x86/include/asm/thread_info.h   | 10 ++--------
 kernel/context_tracking.c            |  2 ++
 8 files changed, 19 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/5] x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
@ 2020-02-14 15:26 ` Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 2/5] context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ Frederic Weisbecker
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Thomas Gleixner, Paul Burton, Peter Zijlstra, David S . Miller,
	Borislav Petkov, Benjamin Herrenschmidt, Paul Mackerras,
	Andy Lutomirski, Frederic Weisbecker, Ralf Baechle, Ingo Molnar,
	Will Deacon, Catalin Marinas, Michael Ellerman, Russell King

From: Thomas Gleixner <tglx@linutronix.de>

Evaluating _TIF_NOHZ to decide whether to use the slow syscall entry path
is not only pointless, it's actually counterproductive:

 1) Context tracking code is invoked unconditionally before that flag is
    evaluated.

 2) If the flag is set the slow path is invoked for nothing due to #1

Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 arch/x86/include/asm/thread_info.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index cf4327986e98..6cb9d1b0d1e6 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -133,14 +133,10 @@ struct thread_info {
 #define _TIF_X32		(1 << TIF_X32)
 #define _TIF_FSCHECK		(1 << TIF_FSCHECK)
 
-/*
- * work to do in syscall_trace_enter().  Also includes TIF_NOHZ for
- * enter_from_user_mode()
- */
+/* Work to do before invoking the actual syscall. */
 #define _TIF_WORK_SYSCALL_ENTRY	\
 	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT |	\
-	 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT |	\
-	 _TIF_NOHZ)
+	 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
 
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW_BASE					\
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 1/5] x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY Frederic Weisbecker
@ 2020-02-14 15:26 ` Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 3/5] x86: Remove TIF_NOHZ Frederic Weisbecker
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Thomas Gleixner, Andy Lutomirski, Ralf Baechle,
	Ingo Molnar, Will Deacon, Catalin Marinas, Michael Ellerman,
	Russell King

A few archs (x86, arm, arm64) don't rely anymore on TIF_NOHZ to call
into context tracking on user entry/exit but instead use static keys
(or not) to optimize those calls. Ideally every arch should migrate to
that behaviour in the long run.

Settle a config option to let those archs remove their TIF_NOHZ
definitions.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: David S. Miller <davem@davemloft.net>
---
 arch/Kconfig              | 16 +++++++++++-----
 arch/arm/Kconfig          |  1 +
 arch/arm64/Kconfig        |  1 +
 arch/mips/Kconfig         |  1 +
 arch/powerpc/Kconfig      |  1 +
 arch/sparc/Kconfig        |  1 +
 arch/x86/Kconfig          |  1 +
 kernel/context_tracking.c |  2 ++
 8 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 98de654b79b3..dbf420a9f87b 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -540,11 +540,17 @@ config HAVE_CONTEXT_TRACKING
 	help
 	  Provide kernel/user boundaries probes necessary for subsystems
 	  that need it, such as userspace RCU extended quiescent state.
-	  Syscalls need to be wrapped inside user_exit()-user_enter() through
-	  the slow path using TIF_NOHZ flag. Exceptions handlers must be
-	  wrapped as well. Irqs are already protected inside
-	  rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
-	  irq exit still need to be protected.
+	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
+	  optimized behind static key or through the slow path using TIF_NOHZ
+	  flag. Exceptions handlers must be wrapped as well. Irqs are already
+	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
+	  handling on irq exit still need to be protected.
+
+config HAVE_TIF_NOHZ
+	bool
+	help
+	  Arch relies on TIF_NOHZ and syscall slow path to implement context
+	  tracking calls to user_enter()/user_exit().
 
 config HAVE_VIRT_CPU_ACCOUNTING
 	bool
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 97864aabc2a6..38b764cae559 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -72,6 +72,7 @@ config ARM
 	select HAVE_ARM_SMCCC if CPU_V7
 	select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_TIF_NOHZ
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 0b30e884e088..5c945fa3df26 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -140,6 +140,7 @@ config ARM64
 	select HAVE_CMPXCHG_DOUBLE
 	select HAVE_CMPXCHG_LOCAL
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_TIF_NOHZ
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_BUGVERBOSE
 	select HAVE_DEBUG_KMEMLEAK
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 797d7f1ad5fe..2589d4760e45 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -51,6 +51,7 @@ config MIPS
 	select HAVE_ASM_MODVERSIONS
 	select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_TIF_NOHZ
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_DEBUG_KMEMLEAK
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 497b7d0b2d7e..6f40af294685 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -182,6 +182,7 @@ config PPC
 	select HAVE_STACKPROTECTOR		if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13)
 	select HAVE_STACKPROTECTOR		if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
 	select HAVE_CONTEXT_TRACKING		if PPC64
+	select HAVE_TIF_NOHZ			if PPC64
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DEBUG_STACKOVERFLOW
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..9cc9ab04bd99 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -71,6 +71,7 @@ config SPARC64
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_CONTEXT_TRACKING
+	select HAVE_TIF_NOHZ
 	select HAVE_DEBUG_KMEMLEAK
 	select IOMMU_HELPER
 	select SPARSE_IRQ
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..549eed3460c9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -211,6 +211,7 @@ config X86
 	select HAVE_STACK_VALIDATION		if X86_64
 	select HAVE_RSEQ
 	select HAVE_SYSCALL_TRACEPOINTS
+	select HAVE_TIF_NOHZ			if X86_64
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_USER_RETURN_NOTIFIER
 	select HAVE_GENERIC_VDSO
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
index 0296b4bda8f1..ce430885c26c 100644
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -198,11 +198,13 @@ void __init context_tracking_cpu_set(int cpu)
 	if (initialized)
 		return;
 
+#ifdef CONFIG_HAVE_TIF_NOHZ
 	/*
 	 * Set TIF_NOHZ to init/0 and let it propagate to all tasks through fork
 	 * This assumes that init is the only task at this early boot stage.
 	 */
 	set_tsk_thread_flag(&init_task, TIF_NOHZ);
+#endif
 	WARN_ON_ONCE(!tasklist_empty());
 
 	initialized = true;
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] x86: Remove TIF_NOHZ
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 1/5] x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 2/5] context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ Frederic Weisbecker
@ 2020-02-14 15:26 ` Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 4/5] arm: " Frederic Weisbecker
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Thomas Gleixner, Andy Lutomirski, Ralf Baechle,
	Ingo Molnar, Will Deacon, Catalin Marinas, Michael Ellerman,
	Russell King

Static keys have replaced TIF_NOHZ to optimize the calls to context
tracking. We can now safely remove that thread flag.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/Kconfig                   | 1 -
 arch/x86/include/asm/thread_info.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 549eed3460c9..beea77046f9b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -211,7 +211,6 @@ config X86
 	select HAVE_STACK_VALIDATION		if X86_64
 	select HAVE_RSEQ
 	select HAVE_SYSCALL_TRACEPOINTS
-	select HAVE_TIF_NOHZ			if X86_64
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_USER_RETURN_NOTIFIER
 	select HAVE_GENERIC_VDSO
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 6cb9d1b0d1e6..384cdde10680 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -92,7 +92,6 @@ struct thread_info {
 #define TIF_NOCPUID		15	/* CPUID is not accessible in userland */
 #define TIF_NOTSC		16	/* TSC is not accessible in userland */
 #define TIF_IA32		17	/* IA32 compatibility process */
-#define TIF_NOHZ		19	/* in adaptive nohz mode */
 #define TIF_MEMDIE		20	/* is terminating due to OOM killer */
 #define TIF_POLLING_NRFLAG	21	/* idle is polling for TIF_NEED_RESCHED */
 #define TIF_IO_BITMAP		22	/* uses I/O bitmap */
@@ -122,7 +121,6 @@ struct thread_info {
 #define _TIF_NOCPUID		(1 << TIF_NOCPUID)
 #define _TIF_NOTSC		(1 << TIF_NOTSC)
 #define _TIF_IA32		(1 << TIF_IA32)
-#define _TIF_NOHZ		(1 << TIF_NOHZ)
 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
 #define _TIF_IO_BITMAP		(1 << TIF_IO_BITMAP)
 #define _TIF_FORCED_TF		(1 << TIF_FORCED_TF)
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] arm: Remove TIF_NOHZ
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
                   ` (2 preceding siblings ...)
  2020-02-14 15:26 ` [PATCH 3/5] x86: Remove TIF_NOHZ Frederic Weisbecker
@ 2020-02-14 15:26 ` Frederic Weisbecker
  2020-02-14 15:26 ` [PATCH 5/5] arm64: " Frederic Weisbecker
  2020-02-20 15:13 ` [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
  5 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Thomas Gleixner, Andy Lutomirski, Ralf Baechle,
	Ingo Molnar, Will Deacon, Catalin Marinas, Michael Ellerman,
	Russell King

Arm entry code calls context tracking from fast path. TIF_NOHZ is unused
and can be safely removed.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@armlinux.org.uk>
---
 arch/arm/Kconfig                   | 1 -
 arch/arm/include/asm/thread_info.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 38b764cae559..97864aabc2a6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -72,7 +72,6 @@ config ARM
 	select HAVE_ARM_SMCCC if CPU_V7
 	select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
 	select HAVE_CONTEXT_TRACKING
-	select HAVE_TIF_NOHZ
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 0d0d5178e2c3..3609a6980c34 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -141,7 +141,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp *,
 #define TIF_SYSCALL_TRACEPOINT	6	/* syscall tracepoint instrumentation */
 #define TIF_SECCOMP		7	/* seccomp syscall filtering active */
 
-#define TIF_NOHZ		12	/* in adaptive nohz mode */
 #define TIF_USING_IWMMXT	17
 #define TIF_MEMDIE		18	/* is terminating due to OOM killer */
 #define TIF_RESTORE_SIGMASK	20
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] arm64: Remove TIF_NOHZ
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
                   ` (3 preceding siblings ...)
  2020-02-14 15:26 ` [PATCH 4/5] arm: " Frederic Weisbecker
@ 2020-02-14 15:26 ` Frederic Weisbecker
  2020-02-18  8:57   ` Will Deacon
  2020-02-20 15:13 ` [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
  5 siblings, 1 reply; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-14 15:26 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Thomas Gleixner, Andy Lutomirski, Ralf Baechle,
	Ingo Molnar, Will Deacon, Catalin Marinas, Michael Ellerman,
	Russell King

The syscall slow path is spuriously invoked when context tracking is
activated while the entry code calls context tracking from fast path.

Remove that overhead and the unused flag itself while at it.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/Kconfig                   | 1 -
 arch/arm64/include/asm/thread_info.h | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5c945fa3df26..0b30e884e088 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -140,7 +140,6 @@ config ARM64
 	select HAVE_CMPXCHG_DOUBLE
 	select HAVE_CMPXCHG_LOCAL
 	select HAVE_CONTEXT_TRACKING
-	select HAVE_TIF_NOHZ
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_BUGVERBOSE
 	select HAVE_DEBUG_KMEMLEAK
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index f0cec4160136..512174a8e789 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -63,7 +63,6 @@ void arch_release_task_struct(struct task_struct *tsk);
 #define TIF_FOREIGN_FPSTATE	3	/* CPU's FP state is not current's */
 #define TIF_UPROBE		4	/* uprobe breakpoint or singlestep */
 #define TIF_FSCHECK		5	/* Check FS is USER_DS on return */
-#define TIF_NOHZ		7
 #define TIF_SYSCALL_TRACE	8	/* syscall trace active */
 #define TIF_SYSCALL_AUDIT	9	/* syscall auditing */
 #define TIF_SYSCALL_TRACEPOINT	10	/* syscall tracepoint for ftrace */
@@ -83,7 +82,6 @@ void arch_release_task_struct(struct task_struct *tsk);
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
 #define _TIF_FOREIGN_FPSTATE	(1 << TIF_FOREIGN_FPSTATE)
-#define _TIF_NOHZ		(1 << TIF_NOHZ)
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
 #define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
@@ -100,7 +98,7 @@ void arch_release_task_struct(struct task_struct *tsk);
 
 #define _TIF_SYSCALL_WORK	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
 				 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
-				 _TIF_NOHZ | _TIF_SYSCALL_EMU)
+				 _TIF_SYSCALL_EMU)
 
 #define INIT_THREAD_INFO(tsk)						\
 {									\
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/5] arm64: Remove TIF_NOHZ
  2020-02-14 15:26 ` [PATCH 5/5] arm64: " Frederic Weisbecker
@ 2020-02-18  8:57   ` Will Deacon
  2020-02-18 14:30     ` Frederic Weisbecker
  0 siblings, 1 reply; 10+ messages in thread
From: Will Deacon @ 2020-02-18  8:57 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: LKML, Paul Burton, Peter Zijlstra, David S . Miller,
	Borislav Petkov, Benjamin Herrenschmidt, Paul Mackerras,
	Thomas Gleixner, Andy Lutomirski, Ralf Baechle, Ingo Molnar,
	Catalin Marinas, Michael Ellerman, Russell King

On Fri, Feb 14, 2020 at 04:26:15PM +0100, Frederic Weisbecker wrote:
> The syscall slow path is spuriously invoked when context tracking is
> activated while the entry code calls context tracking from fast path.
> 
> Remove that overhead and the unused flag itself while at it.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/Kconfig                   | 1 -
>  arch/arm64/include/asm/thread_info.h | 4 +---
>  2 files changed, 1 insertion(+), 4 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Do you want this to go via the arm64 tree? It looks like it makes sense
on its own to me, so I could pick it as a fix.

Will

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/5] arm64: Remove TIF_NOHZ
  2020-02-18  8:57   ` Will Deacon
@ 2020-02-18 14:30     ` Frederic Weisbecker
  0 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-18 14:30 UTC (permalink / raw)
  To: Will Deacon
  Cc: LKML, Paul Burton, Peter Zijlstra, David S . Miller,
	Borislav Petkov, Benjamin Herrenschmidt, Paul Mackerras,
	Thomas Gleixner, Andy Lutomirski, Ralf Baechle, Ingo Molnar,
	Catalin Marinas, Michael Ellerman, Russell King

On Tue, Feb 18, 2020 at 08:57:09AM +0000, Will Deacon wrote:
> On Fri, Feb 14, 2020 at 04:26:15PM +0100, Frederic Weisbecker wrote:
> > The syscall slow path is spuriously invoked when context tracking is
> > activated while the entry code calls context tracking from fast path.
> > 
> > Remove that overhead and the unused flag itself while at it.
> > 
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Borislav Petkov <bp@alien8.de>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > ---
> >  arch/arm64/Kconfig                   | 1 -
> >  arch/arm64/include/asm/thread_info.h | 4 +---
> >  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> Acked-by: Will Deacon <will@kernel.org>
> 
> Do you want this to go via the arm64 tree? It looks like it makes sense
> on its own to me, so I could pick it as a fix.

Thanks Will, unfortunately it depends on some patches on the series, so
the whole needs to go together.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs
  2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
                   ` (4 preceding siblings ...)
  2020-02-14 15:26 ` [PATCH 5/5] arm64: " Frederic Weisbecker
@ 2020-02-20 15:13 ` Frederic Weisbecker
  2020-02-27 13:23   ` Frederic Weisbecker
  5 siblings, 1 reply; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-20 15:13 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Paul Burton, Peter Zijlstra,
	David S . Miller, Borislav Petkov, Benjamin Herrenschmidt,
	Paul Mackerras, Andy Lutomirski, Ralf Baechle, Ingo Molnar,
	Will Deacon, Catalin Marinas, Michael Ellerman, Russell King

Ingo, Thomas,

Please pull the arch/nohz branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	arch/nohz

HEAD: 320a4fc2d1b0c2314342dfdd3348270f126196a4

---
TIF_NOHZ is getting deprecated by static keys which avoid to invoke
syscall slow path on every syscall. So remove that flag from
architectures that don't need it anymore (or worse yet: that spuriously
triggered syscall slow path when it's not needed anymore).

We hope to remove TIF_NOHZ entirely in the long run (PPC, MIPS, SPARC).
If we want to be able to enable/disable nohz full dynamically on runtime,
freezing all tasks and iterating through the whole tasklist to set/clear
TIF_NOHZ doesn't sound very appealing.

Thanks,
	Frederic
---

Frederic Weisbecker (4):
      context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ
      x86: Remove TIF_NOHZ
      arm: Remove TIF_NOHZ
      arm64: Remove TIF_NOHZ

Thomas Gleixner (1):
      x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY


 arch/Kconfig                         | 16 +++++++++++-----
 arch/arm/include/asm/thread_info.h   |  1 -
 arch/arm64/include/asm/thread_info.h |  4 +---
 arch/mips/Kconfig                    |  1 +
 arch/powerpc/Kconfig                 |  1 +
 arch/sparc/Kconfig                   |  1 +
 arch/x86/include/asm/thread_info.h   | 10 ++--------
 kernel/context_tracking.c            |  2 ++
 8 files changed, 19 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs
  2020-02-20 15:13 ` [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
@ 2020-02-27 13:23   ` Frederic Weisbecker
  0 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2020-02-27 13:23 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: LKML, Paul Burton, Peter Zijlstra, David S . Miller,
	Borislav Petkov, Benjamin Herrenschmidt, Paul Mackerras,
	Andy Lutomirski, Ralf Baechle, Ingo Molnar, Will Deacon,
	Catalin Marinas, Michael Ellerman, Russell King

On Thu, Feb 20, 2020 at 04:13:56PM +0100, Frederic Weisbecker wrote:
> Ingo, Thomas,
> 
> Please pull the arch/nohz branch that can be found at:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
> 	arch/nohz
> 

Ping?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-27 13:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 15:26 [PATCH 0/5] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
2020-02-14 15:26 ` [PATCH 1/5] x86/entry: Remove _TIF_NOHZ from _TIF_WORK_SYSCALL_ENTRY Frederic Weisbecker
2020-02-14 15:26 ` [PATCH 2/5] context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ Frederic Weisbecker
2020-02-14 15:26 ` [PATCH 3/5] x86: Remove TIF_NOHZ Frederic Weisbecker
2020-02-14 15:26 ` [PATCH 4/5] arm: " Frederic Weisbecker
2020-02-14 15:26 ` [PATCH 5/5] arm64: " Frederic Weisbecker
2020-02-18  8:57   ` Will Deacon
2020-02-18 14:30     ` Frederic Weisbecker
2020-02-20 15:13 ` [GIT PULL] context_tracking: Remove TIF_NOHZ from 3 archs Frederic Weisbecker
2020-02-27 13:23   ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).