Skip to contentSkip to conversation

rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone

PATCH Applied Paul Gortmaker 2 participants 7 messages Feb 19, 2014 – Feb 24, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): Message-ID: <[email protected]

#1 lore raw

PATCH v2 1/1 rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

---

[v2: move the #include <trace/events/rcu.h> outside of the scope
of #ifdef CONFIG_RCU_TRACE so it is unconditionally included.]

 kernel/rcu/rcu.h    | 1 +
 kernel/rcu/srcu.c   | 2 --
 kernel/rcu/tiny.c   | 4 ----
 kernel/rcu/tree.c   | 2 --
 kernel/rcu/update.c | 1 -
 5 files changed, 1 insertion(+), 9 deletions(-)
kernel/rcu/rcu.h +1 -0
index 1bd787fddcb2..3d2a037332b2 100644
@@ -23,6 +23,7 @@
 #ifndef __LINUX_RCU_H
 #define __LINUX_RCU_H
 
+#include <trace/events/rcu.h>
 #ifdef CONFIG_RCU_TRACE
 #define RCU_TRACE(stmt) stmt
 #else /* #ifdef CONFIG_RCU_TRACE */
kernel/rcu/srcu.c +0 -2
index 5db7e9272d37..8e66b05bfd82 100644
@@ -36,8 +36,6 @@
 #include <linux/delay.h>
 #include <linux/srcu.h>
 
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 /*
kernel/rcu/tiny.c +0 -4
index 53b95bbf4abb..d9efcc13008c 100644
@@ -37,10 +37,6 @@
 #include <linux/prefetch.h>
 #include <linux/ftrace_event.h>
 
-#ifdef CONFIG_RCU_TRACE
-#include <trace/events/rcu.h>
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
-
 #include "rcu.h"
 
 /* Forward declarations for tiny_plugin.h. */
kernel/rcu/tree.c +0 -2
index c7a00dbe768b..351faba48b91 100644
@@ -58,8 +58,6 @@
 #include <linux/suspend.h>
 
 #include "tree.h"
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 MODULE_ALIAS("rcutree");
kernel/rcu/update.c +0 -1
index fd0d5b5b8e7c..4c0a9b0af469 100644
@@ -49,7 +49,6 @@
 #include <linux/module.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/rcu.h>
 
 #include "rcu.h"
 
Signature · 1 line
1.8.5.2
#2 lore raw
Quoted 16 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Quoted 8 lines

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Queued for 3.16, thank you, Paul!

Thanx, Paul

Quoted 80 lines

---

[v2: move the #include <trace/events/rcu.h> outside of the scope
of #ifdef CONFIG_RCU_TRACE so it is unconditionally included.]

 kernel/rcu/rcu.h    | 1 +
 kernel/rcu/srcu.c   | 2 --
 kernel/rcu/tiny.c   | 4 ----
 kernel/rcu/tree.c   | 2 --
 kernel/rcu/update.c | 1 -
 5 files changed, 1 insertion(+), 9 deletions(-)
kernel/rcu/rcu.h +1 -0
index 1bd787fddcb2..3d2a037332b2 100644
@@ -23,6 +23,7 @@
 #ifndef __LINUX_RCU_H
 #define __LINUX_RCU_H
 
+#include <trace/events/rcu.h>
 #ifdef CONFIG_RCU_TRACE
 #define RCU_TRACE(stmt) stmt
 #else /* #ifdef CONFIG_RCU_TRACE */
kernel/rcu/srcu.c +0 -2
index 5db7e9272d37..8e66b05bfd82 100644
@@ -36,8 +36,6 @@
 #include <linux/delay.h>
 #include <linux/srcu.h>
 
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 /*
kernel/rcu/tiny.c +0 -4
index 53b95bbf4abb..d9efcc13008c 100644
@@ -37,10 +37,6 @@
 #include <linux/prefetch.h>
 #include <linux/ftrace_event.h>
 
-#ifdef CONFIG_RCU_TRACE
-#include <trace/events/rcu.h>
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
-
 #include "rcu.h"
 
 /* Forward declarations for tiny_plugin.h. */
kernel/rcu/tree.c +0 -2
index c7a00dbe768b..351faba48b91 100644
@@ -58,8 +58,6 @@
 #include <linux/suspend.h>
 
 #include "tree.h"
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 MODULE_ALIAS("rcutree");
kernel/rcu/update.c +0 -1
index fd0d5b5b8e7c..4c0a9b0af469 100644
@@ -49,7 +49,6 @@
 #include <linux/module.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/rcu.h>
 
 #include "rcu.h"
 
Signature · 1 line
1.8.5.2
#3 lore raw
Quoted 23 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 22 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Quoted 4 lines
Quoted 2 lines

Queued for 3.16, thank you, Paul!

Thanks!

I'm assuming you meant 3.15 -- unless of course you are allowing for an insurance policy for me possibly breaking the build. ;)

P.
--

Quoted 84 lines

Thanx, Paul

Quoted 80 lines

---

[v2: move the #include <trace/events/rcu.h> outside of the scope
of #ifdef CONFIG_RCU_TRACE so it is unconditionally included.]

 kernel/rcu/rcu.h    | 1 +
 kernel/rcu/srcu.c   | 2 --
 kernel/rcu/tiny.c   | 4 ----
 kernel/rcu/tree.c   | 2 --
 kernel/rcu/update.c | 1 -
 5 files changed, 1 insertion(+), 9 deletions(-)
kernel/rcu/rcu.h +1 -0
index 1bd787fddcb2..3d2a037332b2 100644
@@ -23,6 +23,7 @@
 #ifndef __LINUX_RCU_H
 #define __LINUX_RCU_H
 
+#include <trace/events/rcu.h>
 #ifdef CONFIG_RCU_TRACE
 #define RCU_TRACE(stmt) stmt
 #else /* #ifdef CONFIG_RCU_TRACE */
kernel/rcu/srcu.c +0 -2
index 5db7e9272d37..8e66b05bfd82 100644
@@ -36,8 +36,6 @@
 #include <linux/delay.h>
 #include <linux/srcu.h>
 
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 /*
kernel/rcu/tiny.c +0 -4
index 53b95bbf4abb..d9efcc13008c 100644
@@ -37,10 +37,6 @@
 #include <linux/prefetch.h>
 #include <linux/ftrace_event.h>
 
-#ifdef CONFIG_RCU_TRACE
-#include <trace/events/rcu.h>
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
-
 #include "rcu.h"
 
 /* Forward declarations for tiny_plugin.h. */
kernel/rcu/tree.c +0 -2
index c7a00dbe768b..351faba48b91 100644
@@ -58,8 +58,6 @@
 #include <linux/suspend.h>
 
 #include "tree.h"
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 MODULE_ALIAS("rcutree");
kernel/rcu/update.c +0 -1
index fd0d5b5b8e7c..4c0a9b0af469 100644
@@ -49,7 +49,6 @@
 #include <linux/module.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/rcu.h>
 
 #include "rcu.h"
 
Signature · 1 line
1.8.5.2
#4 lore raw
Quoted 28 lines · Paul Gortmaker
Quoted 26 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 24 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Quoted 6 lines
Quoted 1 line

Queued for 3.16, thank you, Paul!

Thanks!

I'm assuming you meant 3.15 -- unless of course you are allowing for an insurance policy for me possibly breaking the build. ;)

Well, it does seem to be doing better in testing. ;-)

I split off the stuff for the 3.15 merge window a few days back, but if the lack of this patch is causing a problem, I could be talked into slipping it in.

Thanx, Paul

Quoted 88 lines

P.
--

Quoted 84 lines

Thanx, Paul

Quoted 80 lines

---

[v2: move the #include <trace/events/rcu.h> outside of the scope
of #ifdef CONFIG_RCU_TRACE so it is unconditionally included.]

 kernel/rcu/rcu.h    | 1 +
 kernel/rcu/srcu.c   | 2 --
 kernel/rcu/tiny.c   | 4 ----
 kernel/rcu/tree.c   | 2 --
 kernel/rcu/update.c | 1 -
 5 files changed, 1 insertion(+), 9 deletions(-)
kernel/rcu/rcu.h +1 -0
index 1bd787fddcb2..3d2a037332b2 100644
@@ -23,6 +23,7 @@
 #ifndef __LINUX_RCU_H
 #define __LINUX_RCU_H
 
+#include <trace/events/rcu.h>
 #ifdef CONFIG_RCU_TRACE
 #define RCU_TRACE(stmt) stmt
 #else /* #ifdef CONFIG_RCU_TRACE */
kernel/rcu/srcu.c +0 -2
index 5db7e9272d37..8e66b05bfd82 100644
@@ -36,8 +36,6 @@
 #include <linux/delay.h>
 #include <linux/srcu.h>
 
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 /*
kernel/rcu/tiny.c +0 -4
index 53b95bbf4abb..d9efcc13008c 100644
@@ -37,10 +37,6 @@
 #include <linux/prefetch.h>
 #include <linux/ftrace_event.h>
 
-#ifdef CONFIG_RCU_TRACE
-#include <trace/events/rcu.h>
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
-
 #include "rcu.h"
 
 /* Forward declarations for tiny_plugin.h. */
kernel/rcu/tree.c +0 -2
index c7a00dbe768b..351faba48b91 100644
@@ -58,8 +58,6 @@
 #include <linux/suspend.h>
 
 #include "tree.h"
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 MODULE_ALIAS("rcutree");
kernel/rcu/update.c +0 -1
index fd0d5b5b8e7c..4c0a9b0af469 100644
@@ -49,7 +49,6 @@
 #include <linux/module.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/rcu.h>
 
 #include "rcu.h"
 
Signature · 1 line
1.8.5.2
#5 lore raw
Quoted 33 lines · Paul E. McKenney
Quoted 32 lines · Paul Gortmaker
Quoted 23 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 22 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Quoted 4 lines
Quoted 2 lines

Queued for 3.16, thank you, Paul!

Thanks!

Quoted 8 lines
Quoted 2 lines

I'm assuming you meant 3.15 -- unless of course you are allowing for an insurance policy for me possibly breaking the build. ;)

Well, it does seem to be doing better in testing. ;-)

I split off the stuff for the 3.15 merge window a few days back, but if the lack of this patch is causing a problem, I could be talked into slipping it in.

And it does seem to be doing well, so I will be putting it forward for 3.15.

Thanx, Paul

#6 lore raw
Quoted 37 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 36 lines · Paul E. McKenney
Quoted 34 lines · Paul Gortmaker
Quoted 23 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 22 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Quoted 4 lines
Quoted 2 lines

Queued for 3.16, thank you, Paul!

Thanks!

I'm assuming you meant 3.15 -- unless of course you are allowing for an insurance policy for me possibly breaking the build. ;)

Quoted 7 lines
Quoted 5 lines

Well, it does seem to be doing better in testing. ;-)

I split off the stuff for the 3.15 merge window a few days back, but if the lack of this patch is causing a problem, I could be talked into slipping it in.

And it does seem to be doing well, so I will be putting it forward for 3.15.

Great, thanks -- there was really no rush; I'd just assumed that the 3.16 was a typo, since I personally can't plan that far ahead. ;)

Paul.
--

Quoted 3 lines

Thanx, Paul

#7 lore raw
Quoted 41 lines · Paul Gortmaker
Quoted 39 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 38 lines · Paul E. McKenney
Quoted 28 lines · Paul Gortmaker
Quoted 26 lines · [Re: [PATCH v2] rcu: ensure kernel/rcu/rcu.h can be sourced/used stand-alone]…
Quoted 24 lines · Paul Gortmaker

The kbuild test bot uncovered an implicit dependence on the trace header being present before rcu.h in ia64 allmodconfig that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration] kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all were sourcing the trace header in advance of rcu.h itself, as seen in the context of this diff. There were also some inconsistencies as to whether it was or wasn't sourced based on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not, lets just source the trace header just once, in the actual consumer of it, which is rcu.h itself. We include it unconditionally, as build testing shows us that is a hard requirement for some files.

Quoted 6 lines
Quoted 1 line

Queued for 3.16, thank you, Paul!

Thanks!

I'm assuming you meant 3.15 -- unless of course you are allowing for an insurance policy for me possibly breaking the build. ;)

Well, it does seem to be doing better in testing. ;-)

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I split off the stuff for the 3.15 merge window a few days back, but if the lack of this patch is causing a problem, I could be talked into slipping it in.

And it does seem to be doing well, so I will be putting it forward for 3.15.

Great, thanks -- there was really no rush; I'd just assumed that the 3.16 was a typo, since I personally can't plan that far ahead. ;)

I like to hammer new patches for a few weeks before passing them on. My experience is that if I fail to do so, they hammer me somewhat later. ;-)

Thanx, Paul