public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	Michal Marek <mmarek@suse.cz>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Jan Beulich <JBeulich@novell.com>, Ingo Molnar <mingo@elte.hu>,
	Alexander van Heukelum <heukelum@fastmail.fm>,
	Dipankar Sarma <dipankar@in.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	David Howells <dhowells@redhat.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	Serge Hallyn <serue@us.ibm.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC PATCH 4/5] RCU: Add TASK_RCU_OFFSET
Date: Wed, 6 Apr 2011 13:13:50 -0700	[thread overview]
Message-ID: <20110406201350.GA9378@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110406192119.GB2265@linux.vnet.ibm.com>

On Wed, Apr 06, 2011 at 12:21:19PM -0700, Paul E. McKenney wrote:
> On Wed, Apr 06, 2011 at 10:10:28AM +0200, Peter Zijlstra wrote:
> > On Tue, 2011-04-05 at 16:07 -0700, Paul E. McKenney wrote:
> > > 
> > > The next layer on this onion is the use of the ctl_table typedef
> > > in include/linux/key.h -- which is defined to be struct ctl_table.
> > > Anyone know where struct ctl_table is defined?  Color me blind, but I
> > > am not seeing it... 
> > 
> > include/linux/sysctl.h:1015
> 
> Thank you!

And the following patch builds correctly for defconfig x86 builds,
while allowing rcupdate.h to see the sched.h definitions as needed
to inline rcu_read_lock() and rcu_read_unlock().

I will try allyesconfig builds and see what else breaks.

							Thanx, Paul

 include/linux/pid.h      |    2 +-
 include/linux/rcupdate.h |   27 +++++++++------------------
 include/linux/rcutree.h  |    2 ++
 include/linux/sched.h    |   10 ++++------
 include/linux/sem.h      |    2 +-
 include/linux/sysctl.h   |    5 +++--
 include/linux/types.h    |   10 ++++++++++
 kernel/pid_namespace.c   |    2 ++
 8 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/include/linux/pid.h b/include/linux/pid.h
index efceda0..3c5719b 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -1,7 +1,7 @@
 #ifndef _LINUX_PID_H
 #define _LINUX_PID_H
 
-#include <linux/rcupdate.h>
+#include <linux/types.h>
 
 enum pid_type
 {
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index ff422d2..2fe6402 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -33,6 +33,7 @@
 #ifndef __LINUX_RCUPDATE_H
 #define __LINUX_RCUPDATE_H
 
+#include <linux/types.h>
 #include <linux/cache.h>
 #include <linux/spinlock.h>
 #include <linux/threads.h>
@@ -52,16 +53,6 @@ extern int rcutorture_runnable; /* for sysctl */
 #define ULONG_CMP_GE(a, b)	(ULONG_MAX / 2 >= (a) - (b))
 #define ULONG_CMP_LT(a, b)	(ULONG_MAX / 2 < (a) - (b))
 
-/**
- * struct rcu_head - callback structure for use with RCU
- * @next: next update requests in a list
- * @func: actual update function to call after the grace period.
- */
-struct rcu_head {
-	struct rcu_head *next;
-	void (*func)(struct rcu_head *head);
-};
-
 /* Exported common interfaces */
 extern void call_rcu_sched(struct rcu_head *head,
 			   void (*func)(struct rcu_head *rcu));
@@ -141,14 +132,6 @@ static inline void rcu_exit_nohz(void)
 
 #endif /* #else #ifdef CONFIG_NO_HZ */
 
-#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
-#include <linux/rcutree.h>
-#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
-#include <linux/rcutiny.h>
-#else
-#error "Unknown RCU implementation specified to kernel configuration"
-#endif
-
 /*
  * init_rcu_head_on_stack()/destroy_rcu_head_on_stack() are needed for dynamic
  * initialization and destruction of rcu_head on the stack. rcu_head structures
@@ -797,4 +780,12 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head)
 }
 #endif	/* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
 
+#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
+#include <linux/rcutree.h>
+#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
+#include <linux/rcutiny.h>
+#else
+#error "Unknown RCU implementation specified to kernel configuration"
+#endif
+
 #endif /* __LINUX_RCUPDATE_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 3a93348..c317eec 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,6 +30,8 @@
 #ifndef __LINUX_RCUTREE_H
 #define __LINUX_RCUTREE_H
 
+#include <linux/sched.h>
+
 extern void rcu_init(void);
 extern void rcu_note_context_switch(int cpu);
 extern int rcu_needs_cpu(int cpu);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 83bd2e2..30a4444 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -78,7 +78,7 @@ struct sched_param {
 #include <linux/topology.h>
 #include <linux/proportions.h>
 #include <linux/seccomp.h>
-#include <linux/rcupdate.h>
+#include <linux/types.h>
 #include <linux/rculist.h>
 #include <linux/rtmutex.h>
 
@@ -2241,11 +2241,9 @@ int same_thread_group(struct task_struct *p1, struct task_struct *p2)
 	return p1->tgid == p2->tgid;
 }
 
-static inline struct task_struct *next_thread(const struct task_struct *p)
-{
-	return list_entry_rcu(p->thread_group.next,
-			      struct task_struct, thread_group);
-}
+/* Avoid #include hell for inlining rcu_read_lock(). */
+#define next_thread(p) \
+	list_entry_rcu((p)->thread_group.next, struct task_struct, thread_group)
 
 static inline int thread_group_empty(struct task_struct *p)
 {
diff --git a/include/linux/sem.h b/include/linux/sem.h
index f2961af..8489a1f 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -78,7 +78,7 @@ struct  seminfo {
 
 #ifdef __KERNEL__
 #include <asm/atomic.h>
-#include <linux/rcupdate.h>
+#include <linux/types.h>
 #include <linux/cache.h>
 
 struct task_struct;
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 11684d9..be80a59 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -19,6 +19,8 @@
  ****************************************************************
  */
 
+#include <linux/key.h>
+
 #ifndef _LINUX_SYSCTL_H
 #define _LINUX_SYSCTL_H
 
@@ -1012,8 +1014,7 @@ extern int proc_do_large_bitmap(struct ctl_table *, int,
  */
 
 /* A sysctl table is an array of struct ctl_table: */
-struct ctl_table 
-{
+struct ctl_table {
 	const char *procname;		/* Text ID for /proc/sys, or zero */
 	void *data;
 	int maxlen;
diff --git a/include/linux/types.h b/include/linux/types.h
index 176da8c..868ef8b 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -231,6 +231,16 @@ struct hlist_node {
 	struct hlist_node *next, **pprev;
 };
 
+/**
+ * struct rcu_head - callback structure for use with RCU
+ * @next: next update requests in a list
+ * @func: actual update function to call after the grace period.
+ */
+struct rcu_head {
+	struct rcu_head *next;
+	void (*func)(struct rcu_head *head);
+};
+
 struct ustat {
 	__kernel_daddr_t	f_tfree;
 	__kernel_ino_t		f_tinode;
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index e9c9adc..bfa75df 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -8,6 +8,8 @@
  *
  */
 
+#include <linux/types.h>
+#include <asm/atomic.h>
 #include <linux/pid.h>
 #include <linux/pid_namespace.h>
 #include <linux/syscalls.h>

  reply	other threads:[~2011-04-06 20:14 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  2:55 [RFC PATCH 0/5] Add kernel-offset file and make rcu_read_[un]lock() included Lai Jiangshan
2011-03-28  2:58 ` [RFC PATCH 1/5] Move task's RCU code to rcupdate.h Lai Jiangshan
2011-03-31 11:31   ` Peter Zijlstra
2011-03-31 23:24     ` Paul E. McKenney
2011-03-28  2:58 ` [RFC PATCH 2/5] kbuild: dedumplicated the generating code Lai Jiangshan
2011-03-28  8:31   ` Jan Beulich
2011-03-31 18:26   ` David Howells
2011-03-28  2:59 ` [RFC PATCH 3/5] kbuild: add kernel-offset file Lai Jiangshan
2011-03-31 18:28   ` David Howells
2011-03-28  3:00 ` [RFC PATCH 4/5] RCU: Add TASK_RCU_OFFSET Lai Jiangshan
2011-03-28  8:35   ` Jan Beulich
2011-03-29  9:41     ` Lai Jiangshan
2011-03-29 21:14     ` H. Peter Anvin
2011-03-29 21:31       ` Paul E. McKenney
2011-03-29 21:32         ` H. Peter Anvin
2011-03-29 21:47           ` Paul E. McKenney
2011-03-29 22:01             ` H. Peter Anvin
2011-03-30  0:47               ` Paul E. McKenney
2011-03-30  5:25                 ` Lai Jiangshan
2011-03-30  7:22                   ` Lai Jiangshan
2011-03-30 10:55                     ` Michal Marek
2011-03-30 10:57                       ` Peter Zijlstra
2011-03-30 11:46                         ` Michal Marek
2011-03-31  1:02                           ` Lai Jiangshan
2011-03-31  1:21                             ` Paul E. McKenney
2011-03-31  1:53                               ` Lai Jiangshan
2011-03-31 23:30                                 ` Paul E. McKenney
2011-04-01  3:28                                   ` Paul E. McKenney
2011-03-31  8:04                             ` Peter Zijlstra
2011-03-31  9:50                               ` Lai Jiangshan
2011-03-31 11:18                                 ` Peter Zijlstra
2011-04-01  1:57                                   ` Lai Jiangshan
2011-04-01 11:35                                     ` Peter Zijlstra
2011-04-05 21:54                                       ` Paul E. McKenney
2011-04-05 23:07                                         ` Paul E. McKenney
2011-04-06  8:10                                           ` Peter Zijlstra
2011-04-06 19:21                                             ` Paul E. McKenney
2011-04-06 20:13                                               ` Paul E. McKenney [this message]
2011-04-06 21:06                                                 ` Peter Zijlstra
2011-04-06 21:27                                                   ` H. Peter Anvin
2011-04-07  0:30                                                     ` Paul E. McKenney
2011-04-07  5:49                                                       ` Lai Jiangshan
2011-04-07 15:47                                                         ` Paul E. McKenney
2011-04-07 16:26                                                           ` Paul E. McKenney
2011-04-08  1:26                                                             ` Lai Jiangshan
2011-04-08  5:13                                                               ` Paul E. McKenney
2011-04-11  3:08                                                                 ` Lai Jiangshan
2011-04-11  5:12                                                                   ` Paul E. McKenney
2011-04-11  6:01                                                                     ` Lai Jiangshan
2011-04-11  8:31                                                                     ` Lai Jiangshan
2011-04-11 21:02                                                                       ` Paul E. McKenney
2011-04-11 21:24                                                                         ` Peter Zijlstra
2011-04-22  7:19                                                                         ` Lai Jiangshan
2011-04-22  8:10                                                                           ` Peter Zijlstra
2011-04-25  7:21                                                                             ` Lai Jiangshan
2011-04-23 20:30                                                                           ` Paul E. McKenney
2011-04-11  8:33                                                                     ` Lai Jiangshan
2011-04-07  7:05                                                       ` [PATCH 1/4] rcu: split rcupdate.h Lai Jiangshan
2011-04-07  7:07                                                       ` [PATCH 2/4] rcu: make rcudpate.h can use struct task_struct Lai Jiangshan
2011-04-07  7:07                                                       ` [PATCH 3/4] rcu: introduce task_rcu_struct and move task's RCU code to rcupdate_defs.h Lai Jiangshan
2011-04-07 13:40                                                         ` Alexey Dobriyan
2011-04-07  7:08                                                       ` [PATCH 4/4] rcu: declare preemptible __rcu_read_[un]lock() as inline function Lai Jiangshan
2011-04-06 17:41                                           ` [RFC PATCH 4/5] RCU: Add TASK_RCU_OFFSET Paul E. McKenney
2011-03-31 19:28                                 ` H. Peter Anvin
2011-03-31 19:25                   ` H. Peter Anvin
2011-03-28  3:01 ` [RFC PATCH 5/5] RCU: declare preemptible __rcu_read_[un]lock() as inline function Lai Jiangshan
2011-03-28 22:17 ` [RFC PATCH 0/5] Add kernel-offset file and make rcu_read_[un]lock() included Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110406201350.GA9378@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=JBeulich@novell.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=heukelum@fastmail.fm \
    --cc=hpa@linux.intel.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mmarek@suse.cz \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sam@ravnborg.org \
    --cc=serue@us.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox