[PATCH v2 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead

Wander Lairson Costa posted 2 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v2 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead
Posted by Wander Lairson Costa 3 months, 1 week ago
Similar to the IRQ tracepoint, the preempt tracepoints are typically
disabled in production systems due to the significant overhead they
introduce even when not in use.

The overhead primarily comes from two sources: First, when tracepoints
are compiled into the kernel, preempt_count_add() and preempt_count_sub()
become external function calls rather than inlined operations. Second,
these functions perform unnecessary preempt_count() checks even when the
tracepoint itself is disabled.

This optimization introduces an early check of the tracepoint static key,
which allows us to skip both the function call overhead and the redundant
preempt_count() checks when tracing is disabled. The change maintains all
existing functionality when tracing is active while significantly
reducing overhead for the common case where tracing is inactive.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
---
 include/linux/preempt.h         | 35 ++++++++++++++++++++++++++++++---
 kernel/sched/core.c             | 12 +----------
 kernel/trace/trace_preemptirq.c | 19 ++++++++++++++++++
 3 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index b0af8d4ef6e6..d13c755cd934 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -10,6 +10,7 @@
 #include <linux/linkage.h>
 #include <linux/cleanup.h>
 #include <linux/types.h>
+#include <linux/tracepoint-defs.h>
 
 /*
  * We put the hardirq and softirq counter into the preemption
@@ -191,17 +192,45 @@ static __always_inline unsigned char interrupt_context_level(void)
  */
 #define in_atomic_preempt_off() (preempt_count() != PREEMPT_DISABLE_OFFSET)
 
-#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE)
+#if defined(CONFIG_DEBUG_PREEMPT)
 extern void preempt_count_add(int val);
 extern void preempt_count_sub(int val);
-#define preempt_count_dec_and_test() \
-	({ preempt_count_sub(1); should_resched(0); })
+#elif defined(CONFIG_TRACE_PREEMPT_TOGGLE)
+extern void __trace_preempt_on(void);
+extern void __trace_preempt_off(void);
+
+DECLARE_TRACEPOINT(preempt_enable);
+DECLARE_TRACEPOINT(preempt_disable);
+
+#define __preempt_trace_enabled(type) \
+	(tracepoint_enabled(preempt_##type) && preempt_count() == val)
+
+static inline void preempt_count_add(int val)
+{
+	__preempt_count_add(val);
+
+	if (__preempt_trace_enabled(disable))
+		__trace_preempt_off();
+}
+
+static inline void preempt_count_sub(int val)
+{
+	if (__preempt_trace_enabled(enable))
+		__trace_preempt_on();
+
+	__preempt_count_sub(val);
+}
 #else
 #define preempt_count_add(val)	__preempt_count_add(val)
 #define preempt_count_sub(val)	__preempt_count_sub(val)
 #define preempt_count_dec_and_test() __preempt_count_dec_and_test()
 #endif
 
+#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE)
+#define preempt_count_dec_and_test() \
+	({ preempt_count_sub(1); should_resched(0); })
+#endif
+
 #define __preempt_count_inc() __preempt_count_add(1)
 #define __preempt_count_dec() __preempt_count_sub(1)
 
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8988d38d46a3..4feba4738d79 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5840,8 +5840,7 @@ static inline void sched_tick_start(int cpu) { }
 static inline void sched_tick_stop(int cpu) { }
 #endif
 
-#if defined(CONFIG_PREEMPTION) && (defined(CONFIG_DEBUG_PREEMPT) || \
-				defined(CONFIG_TRACE_PREEMPT_TOGGLE))
+#if defined(CONFIG_PREEMPTION) && defined(CONFIG_DEBUG_PREEMPT)
 /*
  * If the value passed in is equal to the current preempt count
  * then we just disabled preemption. Start timing the latency.
@@ -5850,30 +5849,24 @@ static inline void preempt_latency_start(int val)
 {
 	if (preempt_count() == val) {
 		unsigned long ip = get_lock_parent_ip();
-#ifdef CONFIG_DEBUG_PREEMPT
 		current->preempt_disable_ip = ip;
-#endif
 		trace_preempt_off(CALLER_ADDR0, ip);
 	}
 }
 
 void preempt_count_add(int val)
 {
-#ifdef CONFIG_DEBUG_PREEMPT
 	/*
 	 * Underflow?
 	 */
 	if (DEBUG_LOCKS_WARN_ON((preempt_count() < 0)))
 		return;
-#endif
 	__preempt_count_add(val);
-#ifdef CONFIG_DEBUG_PREEMPT
 	/*
 	 * Spinlock count overflowing soon?
 	 */
 	DEBUG_LOCKS_WARN_ON((preempt_count() & PREEMPT_MASK) >=
 				PREEMPT_MASK - 10);
-#endif
 	preempt_latency_start(val);
 }
 EXPORT_SYMBOL(preempt_count_add);
@@ -5891,7 +5884,6 @@ static inline void preempt_latency_stop(int val)
 
 void preempt_count_sub(int val)
 {
-#ifdef CONFIG_DEBUG_PREEMPT
 	/*
 	 * Underflow?
 	 */
@@ -5903,14 +5895,12 @@ void preempt_count_sub(int val)
 	if (DEBUG_LOCKS_WARN_ON((val < PREEMPT_MASK) &&
 			!(preempt_count() & PREEMPT_MASK)))
 		return;
-#endif
 
 	preempt_latency_stop(val);
 	__preempt_count_sub(val);
 }
 EXPORT_SYMBOL(preempt_count_sub);
 NOKPROBE_SYMBOL(preempt_count_sub);
-
 #else
 static inline void preempt_latency_start(int val) { }
 static inline void preempt_latency_stop(int val) { }
diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c
index 90ee65db4516..deb2428b34a2 100644
--- a/kernel/trace/trace_preemptirq.c
+++ b/kernel/trace/trace_preemptirq.c
@@ -118,6 +118,25 @@ EXPORT_TRACEPOINT_SYMBOL(irq_enable);
 
 #ifdef CONFIG_TRACE_PREEMPT_TOGGLE
 
+#if !defined(CONFIG_DEBUG_PREEMPT)
+EXPORT_SYMBOL(__tracepoint_preempt_disable);
+EXPORT_SYMBOL(__tracepoint_preempt_enable);
+
+void __trace_preempt_on(void)
+{
+	trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip());
+}
+EXPORT_SYMBOL(__trace_preempt_on);
+NOKPROBE_SYMBOL(__trace_preempt_on);
+
+void __trace_preempt_off(void)
+{
+	trace_preempt_off(CALLER_ADDR0, get_lock_parent_ip());
+}
+EXPORT_SYMBOL(__trace_preempt_off);
+NOKPROBE_SYMBOL(__trace_preempt_off);
+#endif /* !CONFIG_DEBUG_PREEMPT */
+
 void trace_preempt_on(unsigned long a0, unsigned long a1)
 {
 	trace(preempt_enable, TP_ARGS(a0, a1));
-- 
2.50.0
Re: [PATCH v2 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead
Posted by kernel test robot 3 months, 1 week ago
Hi Wander,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[also build test ERROR on tip/sched/core linus/master v6.16-rc4 next-20250701]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Wander-Lairson-Costa/trace-preemptirq-reduce-overhead-of-irq_enable-disable-tracepoints/20250701-035446
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link:    https://lore.kernel.org/r/20250630195243.701516-3-wander%40redhat.com
patch subject: [PATCH v2 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead
config: powerpc-randconfig-003-20250701 (https://download.01.org/0day-ci/archive/20250701/202507011942.sCSGnb2M-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project e04c938cc08a90ae60440ce22d072ebc69d67ee8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250701/202507011942.sCSGnb2M-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507011942.sCSGnb2M-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:14:
   In file included from include/linux/sem.h:5:
   In file included from include/uapi/linux/sem.h:5:
   In file included from include/linux/ipc.h:7:
   In file included from include/linux/rhashtable-types.h:12:
   In file included from include/linux/alloc_tag.h:11:
   In file included from include/linux/preempt.h:13:
   In file included from include/linux/tracepoint-defs.h:11:
   In file included from include/linux/atomic.h:7:
   In file included from arch/powerpc/include/asm/atomic.h:11:
   In file included from arch/powerpc/include/asm/cmpxchg.h:755:
   In file included from include/asm-generic/cmpxchg-local.h:6:
   include/linux/irqflags.h:201:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     201 | DECLARE_TRACEPOINT(irq_enable);
         | ^
         | int
   include/linux/irqflags.h:201:20: error: a parameter list without types is only allowed in a function definition
     201 | DECLARE_TRACEPOINT(irq_enable);
         |                    ^
   include/linux/irqflags.h:202:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     202 | DECLARE_TRACEPOINT(irq_disable);
         | ^
         | int
   include/linux/irqflags.h:202:20: error: a parameter list without types is only allowed in a function definition
     202 | DECLARE_TRACEPOINT(irq_disable);
         |                    ^
   include/linux/irqflags.h:277:47: error: call to undeclared function 'tracepoint_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     277 | DEFINE_LOCK_GUARD_0(irq, local_irq_disable(), local_irq_enable())
         |                                               ^
   include/linux/irqflags.h:210:7: note: expanded from macro 'local_irq_enable'
     210 |                 if (__trace_enabled(irq_enable))        \
         |                     ^
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^
   include/linux/irqflags.h:277:47: error: use of undeclared identifier 'irq_enable'
     277 | DEFINE_LOCK_GUARD_0(irq, local_irq_disable(), local_irq_enable())
         |                                               ^~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:210:23: note: expanded from macro 'local_irq_enable'
     210 |                 if (__trace_enabled(irq_enable))        \
         |                                     ^~~~~~~~~~
   include/linux/irqflags.h:277:26: error: call to undeclared function 'tracepoint_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     277 | DEFINE_LOCK_GUARD_0(irq, local_irq_disable(), local_irq_enable())
         |                          ^
   include/linux/irqflags.h:219:7: note: expanded from macro 'local_irq_disable'
     219 |                 if (__trace_enabled(irq_disable) &&     \
         |                     ^
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^
   include/linux/irqflags.h:277:26: error: use of undeclared identifier 'irq_disable'
     277 | DEFINE_LOCK_GUARD_0(irq, local_irq_disable(), local_irq_enable())
         |                          ^~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:219:23: note: expanded from macro 'local_irq_disable'
     219 |                 if (__trace_enabled(irq_disable) &&     \
         |                                     ^~~~~~~~~~~
   include/linux/irqflags.h:280:7: error: call to undeclared function 'tracepoint_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     280 |                     local_irq_restore(_T->flags),
         |                     ^
   include/linux/irqflags.h:234:7: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                     ^
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^
   include/linux/irqflags.h:280:7: error: use of undeclared identifier 'irq_enable'
     280 |                     local_irq_restore(_T->flags),
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:234:23: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                                     ^~~~~~~~~~
   include/linux/irqflags.h:279:7: error: call to undeclared function 'tracepoint_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     279 |                     local_irq_save(_T->flags),
         |                     ^
   include/linux/irqflags.h:227:7: note: expanded from macro 'local_irq_save'
     227 |                 if (__trace_enabled(irq_disable) &&     \
         |                     ^
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^
   include/linux/irqflags.h:279:7: error: use of undeclared identifier 'irq_disable'
     279 |                     local_irq_save(_T->flags),
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:227:23: note: expanded from macro 'local_irq_save'
     227 |                 if (__trace_enabled(irq_disable) &&     \
         |                                     ^~~~~~~~~~~
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
>> include/linux/spinlock_api_smp.h:151:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     151 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:234:7: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:103:1: note: expanded from here
     103 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
>> include/linux/spinlock_api_smp.h:151:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     151 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:234:7: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:103:1: note: expanded from here
     103 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
>> include/linux/spinlock_api_smp.h:151:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     151 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:234:7: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:103:1: note: expanded from here
     103 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
>> include/linux/spinlock_api_smp.h:151:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     151 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:234:7: note: expanded from macro 'local_irq_restore'
     234 |                 if (__trace_enabled(irq_enable) &&      \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:103:1: note: expanded from here
     103 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
   include/linux/spinlock_api_smp.h:159:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     159 |         local_irq_enable();
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:210:7: note: expanded from macro 'local_irq_enable'
     210 |                 if (__trace_enabled(irq_enable))        \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:108:1: note: expanded from here
     108 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
   include/linux/spinlock_api_smp.h:159:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     159 |         local_irq_enable();
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:210:7: note: expanded from macro 'local_irq_enable'
     210 |                 if (__trace_enabled(irq_enable))        \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))
         |          ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint-defs.h:92:27: note: expanded from macro 'tracepoint_enabled'
      92 |         static_branch_unlikely(&(__tracepoint_##tp).key)
         |                                  ^~~~~~~~~~~~~~~~~
   <scratch space>:108:1: note: expanded from here
     108 | __tracepoint_irq_enable
         | ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/preempt.h:202:1: note: '__tracepoint_preempt_enable' declared here
     202 | DECLARE_TRACEPOINT(preempt_enable);
         | ^
   include/linux/tracepoint-defs.h:88:27: note: expanded from macro 'DECLARE_TRACEPOINT'
      88 |         extern struct tracepoint __tracepoint_##tp
         |                                  ^
   <scratch space>:104:1: note: expanded from here
     104 | __tracepoint_preempt_enable
         | ^
   In file included from arch/powerpc/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:15:
   In file included from include/linux/socket.h:8:
   In file included from include/linux/uio.h:9:
   In file included from include/linux/mm_types.h:8:
   In file included from include/linux/kref.h:16:
   In file included from include/linux/spinlock.h:312:
   include/linux/spinlock_api_smp.h:159:2: error: use of undeclared identifier '__tracepoint_irq_enable'; did you mean '__tracepoint_preempt_enable'?
     159 |         local_irq_enable();
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:210:7: note: expanded from macro 'local_irq_enable'
     210 |                 if (__trace_enabled(irq_enable))        \
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/irqflags.h:206:3: note: expanded from macro '__trace_enabled'
     206 |          tracepoint_enabled(tp))


vim +151 include/linux/spinlock_api_smp.h

69d0ee7377eef80 Heiko Carstens  2009-08-31  145  
9c1721aa4994f66 Thomas Gleixner 2009-12-03  146  static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
69d0ee7377eef80 Heiko Carstens  2009-08-31  147  					    unsigned long flags)
69d0ee7377eef80 Heiko Carstens  2009-08-31  148  {
5facae4f3549b5c Qian Cai        2019-09-19  149  	spin_release(&lock->dep_map, _RET_IP_);
9828ea9d75c38fe Thomas Gleixner 2009-12-03  150  	do_raw_spin_unlock(lock);
69d0ee7377eef80 Heiko Carstens  2009-08-31 @151  	local_irq_restore(flags);
69d0ee7377eef80 Heiko Carstens  2009-08-31  152  	preempt_enable();
69d0ee7377eef80 Heiko Carstens  2009-08-31  153  }
69d0ee7377eef80 Heiko Carstens  2009-08-31  154  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki