public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	penberg@cs.helsinki.fi, eduard.munteanu@linux360.ro,
	tglx@linutronix.de, mingo@elte.hu
Subject: [tip:tracing/kmemtrace] rcutree: fix rcupreempt.c data structure dependencies
Date: Wed, 25 Mar 2009 16:06:29 GMT	[thread overview]
Message-ID: <tip-778ed34693a18b211e0ece9ceeeddd0cc51046d8@git.kernel.org> (raw)
In-Reply-To: <1237898630.25315.83.camel@penberg-laptop>

Commit-ID:  778ed34693a18b211e0ece9ceeeddd0cc51046d8
Gitweb:     http://git.kernel.org/tip/778ed34693a18b211e0ece9ceeeddd0cc51046d8
Author:     Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:42:24 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 17:02:53 +0100

rcutree: fix rcupreempt.c data structure dependencies

Impact: build fix

With percpu.h gone from rcupreempt.h, the percpu primitives
there wont build anymore. Move them to the .c file instead.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: paulmck@linux.vnet.ibm.com
LKML-Reference: <1237898630.25315.83.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 include/linux/rcupreempt.h |   51 +++++++------------------------------------
 kernel/rcupreempt.c        |   48 +++++++++++++++++++++++++++++++++++++---
 2 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 5ff2d23..fce5227 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -40,30 +40,15 @@
 #include <linux/cpumask.h>
 #include <linux/seqlock.h>
 
-struct rcu_dyntick_sched {
-	int dynticks;
-	int dynticks_snap;
-	int sched_qs;
-	int sched_qs_snap;
-	int sched_dynticks_snap;
-};
-
-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
-
-static inline void rcu_qsctr_inc(int cpu)
-{
-	struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);
-
-	rdssp->sched_qs++;
-}
-#define rcu_bh_qsctr_inc(cpu)
+extern void rcu_qsctr_inc(int cpu);
+static inline void rcu_bh_qsctr_inc(int cpu) { }
 
 /*
  * Someone might want to pass call_rcu_bh as a function pointer.
  * So this needs to just be a rename and not a macro function.
  *  (no parentheses)
  */
-#define call_rcu_bh	 	call_rcu
+#define call_rcu_bh		call_rcu
 
 /**
  * call_rcu_sched - Queue RCU callback for invocation after sched grace period.
@@ -117,30 +102,12 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 struct softirq_action;
 
 #ifdef CONFIG_NO_HZ
-
-static inline void rcu_enter_nohz(void)
-{
-	static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
-
-	smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
-	__get_cpu_var(rcu_dyntick_sched).dynticks++;
-	WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs);
-}
-
-static inline void rcu_exit_nohz(void)
-{
-	static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
-
-	__get_cpu_var(rcu_dyntick_sched).dynticks++;
-	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
-	WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
-				&rs);
-}
-
-#else /* CONFIG_NO_HZ */
-#define rcu_enter_nohz()	do { } while (0)
-#define rcu_exit_nohz()		do { } while (0)
-#endif /* CONFIG_NO_HZ */
+extern void rcu_enter_nohz(void);
+extern void rcu_exit_nohz(void);
+#else
+# define rcu_enter_nohz()	do { } while (0)
+# define rcu_exit_nohz()	do { } while (0)
+#endif
 
 /*
  * A context switch is a grace period for rcupreempt synchronize_rcu()
diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c
index 5d59e85..ce97a4d 100644
--- a/kernel/rcupreempt.c
+++ b/kernel/rcupreempt.c
@@ -147,7 +147,51 @@ struct rcu_ctrlblk {
 	wait_queue_head_t sched_wq;	/* Place for rcu_sched to sleep. */
 };
 
+struct rcu_dyntick_sched {
+	int dynticks;
+	int dynticks_snap;
+	int sched_qs;
+	int sched_qs_snap;
+	int sched_dynticks_snap;
+};
+
+static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_dyntick_sched, rcu_dyntick_sched) = {
+	.dynticks = 1,
+};
+
+void rcu_qsctr_inc(int cpu)
+{
+	struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);
+
+	rdssp->sched_qs++;
+}
+
+#ifdef CONFIG_NO_HZ
+
+void rcu_enter_nohz(void)
+{
+	static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
+
+	smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
+	__get_cpu_var(rcu_dyntick_sched).dynticks++;
+	WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs);
+}
+
+void rcu_exit_nohz(void)
+{
+	static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
+
+	__get_cpu_var(rcu_dyntick_sched).dynticks++;
+	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
+	WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
+				&rs);
+}
+
+#endif /* CONFIG_NO_HZ */
+
+
 static DEFINE_PER_CPU(struct rcu_data, rcu_data);
+
 static struct rcu_ctrlblk rcu_ctrlblk = {
 	.fliplock = __SPIN_LOCK_UNLOCKED(rcu_ctrlblk.fliplock),
 	.completed = 0,
@@ -427,10 +471,6 @@ static void __rcu_advance_callbacks(struct rcu_data *rdp)
 	}
 }
 
-DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_dyntick_sched, rcu_dyntick_sched) = {
-	.dynticks = 1,
-};
-
 #ifdef CONFIG_NO_HZ
 static DEFINE_PER_CPU(int, rcu_update_flag);
 

  parent reply	other threads:[~2009-03-25 16:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1237898630.25315.83.camel@penberg-laptop>
2009-03-25 15:18 ` [tip:tracing/kmemtrace] RCU, kmemtrace: fix linux/rcutree.h and linux/rcuclassic.h dependencies Ingo Molnar
2009-03-25 15:33 ` [tip:tracing/kmemtrace] fs, kmemtrace: fix linux/fdtable.h header file dependencies Ingo Molnar
2009-03-25 15:51 ` [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies Ingo Molnar
2009-03-25 16:11   ` Ingo Molnar
2009-03-25 16:52     ` Paul E. McKenney
2009-03-25 16:57       ` Ingo Molnar
2009-03-26  3:34         ` Paul E. McKenney
2009-03-25 15:54 ` [tip:tracing/kmemtrace] fs, kmemtrace: fix fs.h's PAGE_SIZE dependency Ingo Molnar
2009-03-25 16:06 ` Ingo Molnar [this message]
2009-03-25 16:51 ` [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set() Ingo Molnar
2009-03-25 17:01   ` Ingo Molnar
2009-03-26 15:48   ` Al Viro
2009-03-27  9:26     ` Ingo Molnar
2009-03-25 17:30 ` Ingo Molnar
2009-03-28 11:45 ` Ingo Molnar
2009-04-03 10:34 ` [tip:tracing/kmemtrace-v2] kmemtrace, fs: " Ingo Molnar
2009-04-03 10:34 ` [tip:tracing/kmemtrace-v2] kmemtrace, fs: fix linux/fdtable.h header file dependencies Ingo Molnar
2009-04-03 10:35 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies Ingo Molnar
2009-04-03 10:36 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies Ingo Molnar
2009-04-03 10:36 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcupreempt.c " Ingo Molnar
2009-04-03 10:36 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: don't include unnecessary headers, allow kmemtrace w/ tracepoints Eduard - Gabriel Munteanu

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=tip-778ed34693a18b211e0ece9ceeeddd0cc51046d8@git.kernel.org \
    --to=mingo@elte.hu \
    --cc=eduard.munteanu@linux360.ro \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=penberg@cs.helsinki.fi \
    --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