* [tip:tracing/kmemtrace] RCU, kmemtrace: fix linux/rcutree.h and linux/rcuclassic.h dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
@ 2009-03-25 15:18 ` Ingo Molnar
2009-03-25 15:33 ` [tip:tracing/kmemtrace] fs, kmemtrace: fix linux/fdtable.h header file dependencies Ingo Molnar
` (12 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 15:18 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: e03b679cfb1ef2270282525fc006be1b183a1e07
Gitweb: http://git.kernel.org/tip/e03b679cfb1ef2270282525fc006be1b183a1e07
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Fri, 13 Mar 2009 03:20:49 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 17:13:40 +0100
RCU, kmemtrace: fix linux/rcutree.h and linux/rcuclassic.h dependencies
Impact: build fix for all non-x86 architectures
The recent removal of percpu.h from rcuclassic.h/rcutree.h broke
the DECLARE_PER_CPU declarations in these files.
Move the quiescent counter management functions to their respective
RCU implementation .c files - they were slightly above the inlining
limit anyway.
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/rcuclassic.h | 15 ++-------------
include/linux/rcutree.h | 26 ++------------------------
kernel/rcuclassic.c | 23 +++++++++++++++++++++--
kernel/rcutree.c | 28 ++++++++++++++++++++++++----
4 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index cc3f723..bfd92e1 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -107,25 +107,14 @@ struct rcu_data {
struct rcu_head barrier;
};
-DECLARE_PER_CPU(struct rcu_data, rcu_data);
-DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
-
/*
* Increment the quiescent state counter.
* The counter is a bit degenerated: We do not need to know
* how many quiescent states passed, just if there was at least
* one since the start of the grace period. Thus just a flag.
*/
-static inline void rcu_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
- rdp->passed_quiesc = 1;
-}
-static inline void rcu_bh_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
- rdp->passed_quiesc = 1;
-}
+extern void rcu_qsctr_inc(int cpu);
+extern void rcu_bh_qsctr_inc(int cpu);
extern int rcu_pending(int cpu);
extern int rcu_needs_cpu(int cpu);
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index a26b4f1..0cdda00 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -235,30 +235,8 @@ struct rcu_state {
#endif /* #ifdef CONFIG_NO_HZ */
};
-extern struct rcu_state rcu_state;
-DECLARE_PER_CPU(struct rcu_data, rcu_data);
-
-extern struct rcu_state rcu_bh_state;
-DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
-
-/*
- * Increment the quiescent state counter.
- * The counter is a bit degenerated: We do not need to know
- * how many quiescent states passed, just if there was at least
- * one since the start of the grace period. Thus just a flag.
- */
-static inline void rcu_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
- rdp->passed_quiesc = 1;
- rdp->passed_quiesc_completed = rdp->completed;
-}
-static inline void rcu_bh_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
- rdp->passed_quiesc = 1;
- rdp->passed_quiesc_completed = rdp->completed;
-}
+extern void rcu_qsctr_inc(int cpu);
+extern void rcu_bh_qsctr_inc(int cpu);
extern int rcu_pending(int cpu);
extern int rcu_needs_cpu(int cpu);
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index 654c640..0f2b0b3 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -65,6 +65,7 @@ static struct rcu_ctrlblk rcu_ctrlblk = {
.lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock),
.cpumask = CPU_BITS_NONE,
};
+
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
.cur = -300,
.completed = -300,
@@ -73,8 +74,26 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = {
.cpumask = CPU_BITS_NONE,
};
-DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L };
-DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L };
+static DEFINE_PER_CPU(struct rcu_data, rcu_data);
+static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+
+/*
+ * Increment the quiescent state counter.
+ * The counter is a bit degenerated: We do not need to know
+ * how many quiescent states passed, just if there was at least
+ * one since the start of the grace period. Thus just a flag.
+ */
+void rcu_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+ rdp->passed_quiesc = 1;
+}
+
+void rcu_bh_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
+ rdp->passed_quiesc = 1;
+}
static int blimit = 10;
static int qhimark = 10000;
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 97ce315..a2015ed 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -72,11 +72,31 @@ EXPORT_SYMBOL_GPL(rcu_lock_map);
.n_force_qs_ngp = 0, \
}
-struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
-DEFINE_PER_CPU(struct rcu_data, rcu_data);
+static struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
+static DEFINE_PER_CPU(struct rcu_data, rcu_data);
-struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
-DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+static struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
+static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+
+/*
+ * Increment the quiescent state counter.
+ * The counter is a bit degenerated: We do not need to know
+ * how many quiescent states passed, just if there was at least
+ * one since the start of the grace period. Thus just a flag.
+ */
+void rcu_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+ rdp->passed_quiesc = 1;
+ rdp->passed_quiesc_completed = rdp->completed;
+}
+
+void rcu_bh_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
+ rdp->passed_quiesc = 1;
+ rdp->passed_quiesc_completed = rdp->completed;
+}
#ifdef CONFIG_NO_HZ
DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace] fs, kmemtrace: fix linux/fdtable.h header file dependencies
[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 ` Ingo Molnar
2009-03-25 15:51 ` [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies Ingo Molnar
` (11 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 15:33 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: fed06d464b8bd4521f5f59409d866f4916823f73
Gitweb: http://git.kernel.org/tip/fed06d464b8bd4521f5f59409d866f4916823f73
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:29:05 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 16:32:25 +0100
fs, kmemtrace: fix linux/fdtable.h header file dependencies
Impact: build fix
fdtable.h uses __init, but does not include init.h.
This can cause build failures on non-x86 architectures:
/home/mingo/tip/include/linux/fdtable.h:66: error: expected '=', ',',
';', 'asm' or '__attribute__' before 'files_defer_init'
make[2]: *** [fs/locks.o] Error 1
It got this header included indirectly via rcupdate.h's percpu.h
inclusion - but that's not there anymore so the build broke. Fix it.
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/fdtable.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 09d6c5b..a2ec74b 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -5,12 +5,14 @@
#ifndef __LINUX_FDTABLE_H
#define __LINUX_FDTABLE_H
-#include <asm/atomic.h>
#include <linux/posix_types.h>
#include <linux/compiler.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/types.h>
+#include <linux/init.h>
+
+#include <asm/atomic.h>
/*
* The default fd array needs to be at least BITS_PER_LONG,
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies
[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 ` Ingo Molnar
2009-03-25 16:11 ` Ingo Molnar
2009-03-25 15:54 ` [tip:tracing/kmemtrace] fs, kmemtrace: fix fs.h's PAGE_SIZE dependency Ingo Molnar
` (10 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 15:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: 5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
Gitweb: http://git.kernel.org/tip/5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
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 16:42:24 +0100
rcutree: fix rcu_tree_trace.c data structure dependencies
Impact: build fix
We removed rcutree internals from the public rcutree.h file - but
kernel/rcutree_trace.c depends on them.
Introduce kernel/rcutree.h for internal definitions. (Probably all
the other data types from include/linux/rcutree.h could be
moved here too - except rcu_data.)
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>
---
kernel/rcutree.c | 8 ++++----
kernel/rcutree.h | 10 ++++++++++
kernel/rcutree_trace.c | 2 ++
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index a2015ed..7f32669 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -72,11 +72,11 @@ EXPORT_SYMBOL_GPL(rcu_lock_map);
.n_force_qs_ngp = 0, \
}
-static struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
-static DEFINE_PER_CPU(struct rcu_data, rcu_data);
+struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
+DEFINE_PER_CPU(struct rcu_data, rcu_data);
-static struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
-static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
+DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
/*
* Increment the quiescent state counter.
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
new file mode 100644
index 0000000..5e872bb
--- /dev/null
+++ b/kernel/rcutree.h
@@ -0,0 +1,10 @@
+
+/*
+ * RCU implementation internal declarations:
+ */
+extern struct rcu_state rcu_state;
+DECLARE_PER_CPU(struct rcu_data, rcu_data);
+
+extern struct rcu_state rcu_bh_state;
+DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
+
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index d6db3e8..4ee954f 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -43,6 +43,8 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
+#include "rcutree.h"
+
static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
{
if (!rdp->beenonline)
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies
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
0 siblings, 1 reply; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 16:11 UTC (permalink / raw)
To: linux-tip-commits, Paul E. McKenney
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx
* Ingo Molnar <mingo@elte.hu> wrote:
> Commit-ID: 5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
> Gitweb: http://git.kernel.org/tip/5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
> 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 16:42:24 +0100
>
> rcutree: fix rcu_tree_trace.c data structure dependencies
>
> Impact: build fix
>
> We removed rcutree internals from the public rcutree.h file - but
> kernel/rcutree_trace.c depends on them.
>
> Introduce kernel/rcutree.h for internal definitions. (Probably all
> the other data types from include/linux/rcutree.h could be
> moved here too - except rcu_data.)
Paul ... what do you think? This is just an interim measure to get
the build going - i think we could do more cleanups here perhaps, if
you agree.
I think many of the data definitions (and the resulting include file
dependencies) in include/linux/rcu*.h could move into kernel/rcu*.h
and be privatized that way. 'struct rcu_state' would be an example.
Agreed?
Ingo
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies
2009-03-25 16:11 ` Ingo Molnar
@ 2009-03-25 16:52 ` Paul E. McKenney
2009-03-25 16:57 ` Ingo Molnar
0 siblings, 1 reply; 21+ messages in thread
From: Paul E. McKenney @ 2009-03-25 16:52 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-tip-commits, linux-kernel, hpa, mingo, penberg,
eduard.munteanu, tglx
On Wed, Mar 25, 2009 at 05:11:47PM +0100, Ingo Molnar wrote:
>
> * Ingo Molnar <mingo@elte.hu> wrote:
>
> > Commit-ID: 5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
> > Gitweb: http://git.kernel.org/tip/5d957021d326fbfdc1d7a4f11a3da1f6f82d6a36
> > 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 16:42:24 +0100
> >
> > rcutree: fix rcu_tree_trace.c data structure dependencies
> >
> > Impact: build fix
> >
> > We removed rcutree internals from the public rcutree.h file - but
> > kernel/rcutree_trace.c depends on them.
> >
> > Introduce kernel/rcutree.h for internal definitions. (Probably all
> > the other data types from include/linux/rcutree.h could be
> > moved here too - except rcu_data.)
>
> Paul ... what do you think? This is just an interim measure to get
> the build going - i think we could do more cleanups here perhaps, if
> you agree.
I am generally in favor of this. I reviewed the above gitweb and it
looks good to me, feel free to append:
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> I think many of the data definitions (and the resulting include file
> dependencies) in include/linux/rcu*.h could move into kernel/rcu*.h
> and be privatized that way. 'struct rcu_state' would be an example.
>
> Agreed?
In principle, yes. In practice, my attempts to make headway in this
direction have usually collided with the desire to inline some of the
functions that appear on fastpaths, so I would prefer caution when moving
in this direction, especially given my treercu-related todos, to which
"speeding up synchronize_rcu()" just got added.
Thanx, Paul
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies
2009-03-25 16:52 ` Paul E. McKenney
@ 2009-03-25 16:57 ` Ingo Molnar
2009-03-26 3:34 ` Paul E. McKenney
0 siblings, 1 reply; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 16:57 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-tip-commits, linux-kernel, hpa, mingo, penberg,
eduard.munteanu, tglx
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> > I think many of the data definitions (and the resulting include
> > file dependencies) in include/linux/rcu*.h could move into
> > kernel/rcu*.h and be privatized that way. 'struct rcu_state'
> > would be an example.
> >
> > Agreed?
>
> In principle, yes. In practice, my attempts to make headway in
> this direction have usually collided with the desire to inline
> some of the functions that appear on fastpaths, so I would prefer
> caution when moving in this direction, especially given my
> treercu-related todos, to which "speeding up synchronize_rcu()"
> just got added.
I think there's a solution, for example the quiescent-state inlines
could still be offered in a kernel/rcupdate_internals.h header to be
included by kernel/softirq.c et al directly.
Otherwise ... i think it generally is not worth the trouble to put
huge data types into common headers just to be able to inline into a
small number of callsites.
Ingo
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies
2009-03-25 16:57 ` Ingo Molnar
@ 2009-03-26 3:34 ` Paul E. McKenney
0 siblings, 0 replies; 21+ messages in thread
From: Paul E. McKenney @ 2009-03-26 3:34 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-tip-commits, linux-kernel, hpa, mingo, penberg,
eduard.munteanu, tglx
On Wed, Mar 25, 2009 at 05:57:13PM +0100, Ingo Molnar wrote:
>
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
>
> > > I think many of the data definitions (and the resulting include
> > > file dependencies) in include/linux/rcu*.h could move into
> > > kernel/rcu*.h and be privatized that way. 'struct rcu_state'
> > > would be an example.
> > >
> > > Agreed?
> >
> > In principle, yes. In practice, my attempts to make headway in
> > this direction have usually collided with the desire to inline
> > some of the functions that appear on fastpaths, so I would prefer
> > caution when moving in this direction, especially given my
> > treercu-related todos, to which "speeding up synchronize_rcu()"
> > just got added.
>
> I think there's a solution, for example the quiescent-state inlines
> could still be offered in a kernel/rcupdate_internals.h header to be
> included by kernel/softirq.c et al directly.
Could definitely do this, as I used to do it this way in a former life.
As long as we are now OK with creating an additional header file or two
per flavor of RCU.
> Otherwise ... i think it generally is not worth the trouble to put
> huge data types into common headers just to be able to inline into a
> small number of callsites.
Information hiding can indeed be a good thing.
Thanx, Paul
^ permalink raw reply [flat|nested] 21+ messages in thread
* [tip:tracing/kmemtrace] fs, kmemtrace: fix fs.h's PAGE_SIZE dependency
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (2 preceding siblings ...)
2009-03-25 15:51 ` [tip:tracing/kmemtrace] rcutree: fix rcu_tree_trace.c data structure dependencies Ingo Molnar
@ 2009-03-25 15:54 ` Ingo Molnar
2009-03-25 16:06 ` [tip:tracing/kmemtrace] rcutree: fix rcupreempt.c data structure dependencies Ingo Molnar
` (9 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 15:54 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: 55553d2b7c253a1d676596fee680412727d84bc4
Gitweb: http://git.kernel.org/tip/55553d2b7c253a1d676596fee680412727d84bc4
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 16:50:47 +0100
fs, kmemtrace: fix fs.h's PAGE_SIZE dependency
Impact: build fix
ARM does not build due to fs.h using PAGE_SIZE but not including
asm/page.h.
(This was masked before by rcupreempt.h including percpu.h which
brought in asm/page.h indirectly.)
( A future enhancement would be to split out the simple_transaction
facility (only two usage sites) from fs.h, into a separate
linux/simple_transaction.h header. )
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/fs.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 159f7b8..79be937 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,8 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
+#include <asm/page.h> /* for PAGE_SIZE */
+
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace] rcutree: fix rcupreempt.c data structure dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (3 preceding siblings ...)
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
2009-03-25 16:51 ` [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set() Ingo Molnar
` (8 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 16:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
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);
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (4 preceding siblings ...)
2009-03-25 16:06 ` [tip:tracing/kmemtrace] rcutree: fix rcupreempt.c data structure dependencies Ingo Molnar
@ 2009-03-25 16:51 ` Ingo Molnar
2009-03-25 17:01 ` Ingo Molnar
2009-03-26 15:48 ` Al Viro
2009-03-25 17:30 ` Ingo Molnar
` (7 subsequent siblings)
13 siblings, 2 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 16:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, viro, tglx,
mingo, adobriyan
Commit-ID: 44eea45ca9e25d6dd660d4806ef4c11209609e03
Gitweb: http://git.kernel.org/tip/44eea45ca9e25d6dd660d4806ef4c11209609e03
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 17:48:14 +0100
fs.h: uninline simple_transaction_set()
Move simple_transaction_set() to the other simple-transaction
file helpers in fs/libfs.c.
This removes an implicit asm/page.h PAGE_SIZE dependency from
fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
and also reduces kernel size a bit.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
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>
---
fs/libfs.c | 15 +++++++++++++++
include/linux/fs.h | 16 +---------------
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 49b4409..a1db380 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -574,6 +574,21 @@ ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
* possibly a read which collects the result - which is stored in a
* file-local buffer.
*/
+
+void simple_transaction_set(struct file *file, size_t n)
+{
+ struct simple_transaction_argresp *ar = file->private_data;
+
+ BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
+
+ /*
+ * The barrier ensures that ar->size will really remain zero until
+ * ar->data is ready for reading.
+ */
+ smp_mb();
+ ar->size = n;
+}
+
char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
{
struct simple_transaction_argresp *ar;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 79be937..2ebe3ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,8 +9,6 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
-#include <asm/page.h> /* for PAGE_SIZE */
-
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
@@ -2173,19 +2171,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);
-static inline void simple_transaction_set(struct file *file, size_t n)
-{
- struct simple_transaction_argresp *ar = file->private_data;
-
- BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
-
- /*
- * The barrier ensures that ar->size will really remain zero until
- * ar->data is ready for reading.
- */
- smp_mb();
- ar->size = n;
-}
+void simple_transaction_set(struct file *file, size_t n);
/*
* simple attribute files
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
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
1 sibling, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 17:01 UTC (permalink / raw)
To: linux-tip-commits, Alexander Viro
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, viro, tglx,
adobriyan
* Ingo Molnar <mingo@elte.hu> wrote:
> Commit-ID: 44eea45ca9e25d6dd660d4806ef4c11209609e03
> Gitweb: http://git.kernel.org/tip/44eea45ca9e25d6dd660d4806ef4c11209609e03
> Author: Ingo Molnar <mingo@elte.hu>
> AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
> Committer: Ingo Molnar <mingo@elte.hu>
> CommitDate: Wed, 25 Mar 2009 17:48:14 +0100
>
> fs.h: uninline simple_transaction_set()
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Alexey Dobriyan <adobriyan@gmail.com>
> 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>
Pekka, Eduard - this commit is needed for the kmemtrace branch
(otherwise headers_check fails) - but it needs the ack of Al Viro -
so i've ordered the branch accordingly.
The fs.h changes look trivial and a step forward to me in untangling
the data type dependency spaghetti (a tiny bit):
44eea45: fs.h: uninline simple_transaction_set()
55553d2: fs, kmemtrace: fix fs.h's PAGE_SIZE dependency
f3edf88: kmemtrace, fs, security: move alloc_secdata() and free_secdata() linux/security
f9ebc8b: fs: don't include <linux/gfp.h> to fix headers-export-check
c60d3ef: kmemtrace: fix build brekage in linux/fs.h
but it needs Acks.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
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
1 sibling, 1 reply; 21+ messages in thread
From: Al Viro @ 2009-03-26 15:48 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, penberg, eduard.munteanu, tglx, mingo,
adobriyan
Cc: linux-tip-commits
On Wed, Mar 25, 2009 at 04:51:28PM +0000, Ingo Molnar wrote:
> Commit-ID: 44eea45ca9e25d6dd660d4806ef4c11209609e03
> Gitweb: http://git.kernel.org/tip/44eea45ca9e25d6dd660d4806ef4c11209609e03
> Author: Ingo Molnar <mingo@elte.hu>
> AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
> Committer: Ingo Molnar <mingo@elte.hu>
> CommitDate: Wed, 25 Mar 2009 17:48:14 +0100
>
> fs.h: uninline simple_transaction_set()
>
> Move simple_transaction_set() to the other simple-transaction
> file helpers in fs/libfs.c.
>
> This removes an implicit asm/page.h PAGE_SIZE dependency from
> fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
> and also reduces kernel size a bit.
*shrug*
I can live with that. Which tree do you want that to go through? I'll
be pushing VFS queue tonight.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
2009-03-26 15:48 ` Al Viro
@ 2009-03-27 9:26 ` Ingo Molnar
0 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-27 9:26 UTC (permalink / raw)
To: Al Viro
Cc: mingo, hpa, linux-kernel, penberg, eduard.munteanu, tglx,
adobriyan, linux-tip-commits
* Al Viro <viro@ZenIV.linux.org.uk> wrote:
> On Wed, Mar 25, 2009 at 04:51:28PM +0000, Ingo Molnar wrote:
> > Commit-ID: 44eea45ca9e25d6dd660d4806ef4c11209609e03
> > Gitweb: http://git.kernel.org/tip/44eea45ca9e25d6dd660d4806ef4c11209609e03
> > Author: Ingo Molnar <mingo@elte.hu>
> > AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
> > Committer: Ingo Molnar <mingo@elte.hu>
> > CommitDate: Wed, 25 Mar 2009 17:48:14 +0100
> >
> > fs.h: uninline simple_transaction_set()
> >
> > Move simple_transaction_set() to the other simple-transaction
> > file helpers in fs/libfs.c.
> >
> > This removes an implicit asm/page.h PAGE_SIZE dependency from
> > fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
> > and also reduces kernel size a bit.
>
> *shrug*
Thanks for the encouragement - it must be a lot of fun for you to
work with other people and you seem to be taking great pride in
seeing improvements to the code you maintain and care about, no
matter how insignificant they seem in isolation ;-)
> I can live with that. Which tree do you want that to go through?
> I'll be pushing VFS queue tonight.
Either way is certainly fine with me, you are the maintainer so it's
your call. I kept the branch isolated and can adopt.
Note: the patch i sent has some (very minimal) dependencies on a
previous patchlet [which adds the asm/page.h include to fs.h - that
dependency was implicit before], it will be all just fine if you
ignore the fs.h reject when you apply the patch.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 21+ messages in thread
* [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (5 preceding siblings ...)
2009-03-25 16:51 ` [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set() Ingo Molnar
@ 2009-03-25 17:30 ` Ingo Molnar
2009-03-28 11:45 ` Ingo Molnar
` (6 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-25 17:30 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, viro, tglx,
mingo, adobriyan
Commit-ID: 1a6ad03119ce01dd862b089b8b2d9d3848453b11
Gitweb: http://git.kernel.org/tip/1a6ad03119ce01dd862b089b8b2d9d3848453b11
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 18:27:56 +0100
fs.h: uninline simple_transaction_set()
Move simple_transaction_set() to the other simple-transaction
file helpers in fs/libfs.c.
This removes an implicit asm/page.h PAGE_SIZE dependency from
fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
and also reduces kernel size a bit.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
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>
---
fs/libfs.c | 16 ++++++++++++++++
include/linux/fs.h | 16 +---------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 49b4409..c872c64 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -574,6 +574,21 @@ ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
* possibly a read which collects the result - which is stored in a
* file-local buffer.
*/
+
+void simple_transaction_set(struct file *file, size_t n)
+{
+ struct simple_transaction_argresp *ar = file->private_data;
+
+ BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
+
+ /*
+ * The barrier ensures that ar->size will really remain zero until
+ * ar->data is ready for reading.
+ */
+ smp_mb();
+ ar->size = n;
+}
+
char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
{
struct simple_transaction_argresp *ar;
@@ -819,6 +834,7 @@ EXPORT_SYMBOL(simple_sync_file);
EXPORT_SYMBOL(simple_unlink);
EXPORT_SYMBOL(simple_read_from_buffer);
EXPORT_SYMBOL(memory_read_from_buffer);
+EXPORT_SYMBOL(simple_transaction_set);
EXPORT_SYMBOL(simple_transaction_get);
EXPORT_SYMBOL(simple_transaction_read);
EXPORT_SYMBOL(simple_transaction_release);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 79be937..2ebe3ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,8 +9,6 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
-#include <asm/page.h> /* for PAGE_SIZE */
-
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
@@ -2173,19 +2171,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);
-static inline void simple_transaction_set(struct file *file, size_t n)
-{
- struct simple_transaction_argresp *ar = file->private_data;
-
- BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
-
- /*
- * The barrier ensures that ar->size will really remain zero until
- * ar->data is ready for reading.
- */
- smp_mb();
- ar->size = n;
-}
+void simple_transaction_set(struct file *file, size_t n);
/*
* simple attribute files
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (6 preceding siblings ...)
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
` (5 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-03-28 11:45 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, viro, tglx,
mingo, adobriyan
Commit-ID: a1525f87fd18c687edf376455c7d2e73c9b2cb6c
Gitweb: http://git.kernel.org/tip/a1525f87fd18c687edf376455c7d2e73c9b2cb6c
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 28 Mar 2009 12:44:06 +0100
fs.h: uninline simple_transaction_set()
Move simple_transaction_set() to the other simple-transaction
file helpers in fs/libfs.c.
This removes an implicit asm/page.h PAGE_SIZE dependency from
fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
and also reduces kernel size a bit.
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
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>
---
fs/libfs.c | 16 ++++++++++++++++
include/linux/fs.h | 16 +---------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 49b4409..c872c64 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -574,6 +574,21 @@ ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
* possibly a read which collects the result - which is stored in a
* file-local buffer.
*/
+
+void simple_transaction_set(struct file *file, size_t n)
+{
+ struct simple_transaction_argresp *ar = file->private_data;
+
+ BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
+
+ /*
+ * The barrier ensures that ar->size will really remain zero until
+ * ar->data is ready for reading.
+ */
+ smp_mb();
+ ar->size = n;
+}
+
char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
{
struct simple_transaction_argresp *ar;
@@ -819,6 +834,7 @@ EXPORT_SYMBOL(simple_sync_file);
EXPORT_SYMBOL(simple_unlink);
EXPORT_SYMBOL(simple_read_from_buffer);
EXPORT_SYMBOL(memory_read_from_buffer);
+EXPORT_SYMBOL(simple_transaction_set);
EXPORT_SYMBOL(simple_transaction_get);
EXPORT_SYMBOL(simple_transaction_read);
EXPORT_SYMBOL(simple_transaction_release);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 79be937..2ebe3ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,8 +9,6 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
-#include <asm/page.h> /* for PAGE_SIZE */
-
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
@@ -2173,19 +2171,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);
-static inline void simple_transaction_set(struct file *file, size_t n)
-{
- struct simple_transaction_argresp *ar = file->private_data;
-
- BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
-
- /*
- * The barrier ensures that ar->size will really remain zero until
- * ar->data is ready for reading.
- */
- smp_mb();
- ar->size = n;
-}
+void simple_transaction_set(struct file *file, size_t n);
/*
* simple attribute files
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, fs: uninline simple_transaction_set()
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (7 preceding siblings ...)
2009-03-28 11:45 ` Ingo Molnar
@ 2009-04-03 10:34 ` Ingo Molnar
2009-04-03 10:34 ` [tip:tracing/kmemtrace-v2] kmemtrace, fs: fix linux/fdtable.h header file dependencies Ingo Molnar
` (4 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-04-03 10:34 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, viro, tglx,
mingo, adobriyan
Commit-ID: 76791ab2d5e00c1eef728a8df4347ba133760fb8
Gitweb: http://git.kernel.org/tip/76791ab2d5e00c1eef728a8df4347ba133760fb8
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:09:09 +0200
kmemtrace, fs: uninline simple_transaction_set()
Impact: cleanup
We want to remove percpu.h from rcupdate.h (for upcoming kmemtrace
changes), but this is not possible currently without breaking the
build because fs.h has an implicit include file depedency: it
uses PAGE_SIZE but does not include asm/page.h which defines it.
This problem gets masked in practice because most fs.h using sites
use rcupreempt.h (and other headers) which includes percpu.h which
brings in asm/page.h indirectly.
We cannot add asm/page.h to asm/fs.h because page.h is not an
exported header.
Move simple_transaction_set() to the other simple-transaction
file helpers in fs/libfs.c.
This removes the include file hell and also reduces
kernel size a bit.
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
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>
---
fs/libfs.c | 16 ++++++++++++++++
include/linux/fs.h | 14 +-------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 4910a36..cd22319 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -575,6 +575,21 @@ ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
* possibly a read which collects the result - which is stored in a
* file-local buffer.
*/
+
+void simple_transaction_set(struct file *file, size_t n)
+{
+ struct simple_transaction_argresp *ar = file->private_data;
+
+ BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
+
+ /*
+ * The barrier ensures that ar->size will really remain zero until
+ * ar->data is ready for reading.
+ */
+ smp_mb();
+ ar->size = n;
+}
+
char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
{
struct simple_transaction_argresp *ar;
@@ -820,6 +835,7 @@ EXPORT_SYMBOL(simple_sync_file);
EXPORT_SYMBOL(simple_unlink);
EXPORT_SYMBOL(simple_read_from_buffer);
EXPORT_SYMBOL(memory_read_from_buffer);
+EXPORT_SYMBOL(simple_transaction_set);
EXPORT_SYMBOL(simple_transaction_get);
EXPORT_SYMBOL(simple_transaction_read);
EXPORT_SYMBOL(simple_transaction_release);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index fc4dc28..e4de2b5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2323,19 +2323,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
size_t size, loff_t *pos);
int simple_transaction_release(struct inode *inode, struct file *file);
-static inline void simple_transaction_set(struct file *file, size_t n)
-{
- struct simple_transaction_argresp *ar = file->private_data;
-
- BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
-
- /*
- * The barrier ensures that ar->size will really remain zero until
- * ar->data is ready for reading.
- */
- smp_mb();
- ar->size = n;
-}
+void simple_transaction_set(struct file *file, size_t n);
/*
* simple attribute files
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, fs: fix linux/fdtable.h header file dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (8 preceding siblings ...)
2009-04-03 10:34 ` [tip:tracing/kmemtrace-v2] kmemtrace, fs: " Ingo Molnar
@ 2009-04-03 10:34 ` Ingo Molnar
2009-04-03 10:35 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies Ingo Molnar
` (3 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-04-03 10:34 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: 21e5445928af0d80f7cf803a77f2b65e9e147890
Gitweb: http://git.kernel.org/tip/21e5445928af0d80f7cf803a77f2b65e9e147890
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:29:05 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:13:03 +0200
kmemtrace, fs: fix linux/fdtable.h header file dependencies
Impact: cleanup
We want to remove percpu.h from rcupdate.h (for upcoming kmemtrace
changes), but this is not possible currently without breaking the
build because fdtable.h has an implicit include file dependency: it
uses __init does not include init.h.
This can cause build failures on non-x86 architectures:
/home/mingo/tip/include/linux/fdtable.h:66: error: expected '=', ',',
';', 'asm' or '__attribute__' before 'files_defer_init'
make[2]: *** [fs/locks.o] Error 1
We got this header included indirectly via rcupdate.h's percpu.h
inclusion - but if that is not there the build will break.
Fix it.
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/fdtable.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 09d6c5b..a2ec74b 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -5,12 +5,14 @@
#ifndef __LINUX_FDTABLE_H
#define __LINUX_FDTABLE_H
-#include <asm/atomic.h>
#include <linux/posix_types.h>
#include <linux/compiler.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/types.h>
+#include <linux/init.h>
+
+#include <asm/atomic.h>
/*
* The default fd array needs to be at least BITS_PER_LONG,
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (9 preceding siblings ...)
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 ` Ingo Molnar
2009-04-03 10:36 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies Ingo Molnar
` (2 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-04-03 10:35 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: b1f77b0581b8fd837acb4a973f7d5496cae6efee
Gitweb: http://git.kernel.org/tip/b1f77b0581b8fd837acb4a973f7d5496cae6efee
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Fri, 13 Mar 2009 03:20:49 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:23:02 +0200
kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies
Impact: build fix for all non-x86 architectures
We want to remove percpu.h from rcuclassic.h/rcutree.h (for upcoming
kmemtrace changes) but that would break the DECLARE_PER_CPU based
declarations in these files.
Move the quiescent counter management functions to their respective
RCU implementation .c files - they were slightly above the inlining
limit anyway.
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/rcuclassic.h | 15 ++-------------
include/linux/rcutree.h | 26 ++------------------------
kernel/rcuclassic.c | 23 +++++++++++++++++++++--
kernel/rcutree.c | 28 ++++++++++++++++++++++++----
4 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index 80044a4..2d688b4 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -108,25 +108,14 @@ struct rcu_data {
struct rcu_head barrier;
};
-DECLARE_PER_CPU(struct rcu_data, rcu_data);
-DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
-
/*
* Increment the quiescent state counter.
* The counter is a bit degenerated: We do not need to know
* how many quiescent states passed, just if there was at least
* one since the start of the grace period. Thus just a flag.
*/
-static inline void rcu_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
- rdp->passed_quiesc = 1;
-}
-static inline void rcu_bh_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
- rdp->passed_quiesc = 1;
-}
+extern void rcu_qsctr_inc(int cpu);
+extern void rcu_bh_qsctr_inc(int cpu);
extern int rcu_pending(int cpu);
extern int rcu_needs_cpu(int cpu);
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index a722fb6..5d6f425 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -236,30 +236,8 @@ struct rcu_state {
#endif /* #ifdef CONFIG_NO_HZ */
};
-extern struct rcu_state rcu_state;
-DECLARE_PER_CPU(struct rcu_data, rcu_data);
-
-extern struct rcu_state rcu_bh_state;
-DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
-
-/*
- * Increment the quiescent state counter.
- * The counter is a bit degenerated: We do not need to know
- * how many quiescent states passed, just if there was at least
- * one since the start of the grace period. Thus just a flag.
- */
-static inline void rcu_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
- rdp->passed_quiesc = 1;
- rdp->passed_quiesc_completed = rdp->completed;
-}
-static inline void rcu_bh_qsctr_inc(int cpu)
-{
- struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
- rdp->passed_quiesc = 1;
- rdp->passed_quiesc_completed = rdp->completed;
-}
+extern void rcu_qsctr_inc(int cpu);
+extern void rcu_bh_qsctr_inc(int cpu);
extern int rcu_pending(int cpu);
extern int rcu_needs_cpu(int cpu);
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index 654c640..0f2b0b3 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -65,6 +65,7 @@ static struct rcu_ctrlblk rcu_ctrlblk = {
.lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock),
.cpumask = CPU_BITS_NONE,
};
+
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
.cur = -300,
.completed = -300,
@@ -73,8 +74,26 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = {
.cpumask = CPU_BITS_NONE,
};
-DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L };
-DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L };
+static DEFINE_PER_CPU(struct rcu_data, rcu_data);
+static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+
+/*
+ * Increment the quiescent state counter.
+ * The counter is a bit degenerated: We do not need to know
+ * how many quiescent states passed, just if there was at least
+ * one since the start of the grace period. Thus just a flag.
+ */
+void rcu_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+ rdp->passed_quiesc = 1;
+}
+
+void rcu_bh_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
+ rdp->passed_quiesc = 1;
+}
static int blimit = 10;
static int qhimark = 10000;
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 97ce315..a2015ed 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -72,11 +72,31 @@ EXPORT_SYMBOL_GPL(rcu_lock_map);
.n_force_qs_ngp = 0, \
}
-struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
-DEFINE_PER_CPU(struct rcu_data, rcu_data);
+static struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
+static DEFINE_PER_CPU(struct rcu_data, rcu_data);
-struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
-DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+static struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
+static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+
+/*
+ * Increment the quiescent state counter.
+ * The counter is a bit degenerated: We do not need to know
+ * how many quiescent states passed, just if there was at least
+ * one since the start of the grace period. Thus just a flag.
+ */
+void rcu_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+ rdp->passed_quiesc = 1;
+ rdp->passed_quiesc_completed = rdp->completed;
+}
+
+void rcu_bh_qsctr_inc(int cpu)
+{
+ struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
+ rdp->passed_quiesc = 1;
+ rdp->passed_quiesc_completed = rdp->completed;
+}
#ifdef CONFIG_NO_HZ
DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (10 preceding siblings ...)
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 ` 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
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-04-03 10:36 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: 6258c4fb59e77d748f7efc2c137ad420372edd07
Gitweb: http://git.kernel.org/tip/6258c4fb59e77d748f7efc2c137ad420372edd07
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:42:24 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:23:03 +0200
kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies
Impact: cleanup
We want to remove rcutree internals from the public rcutree.h file for
upcoming kmemtrace changes - but kernel/rcutree_trace.c depends on them.
Introduce kernel/rcutree.h for internal definitions. (Probably all
the other data types from include/linux/rcutree.h could be
moved here too - except rcu_data.)
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>
---
kernel/rcutree.c | 8 ++++----
kernel/rcutree.h | 10 ++++++++++
kernel/rcutree_trace.c | 2 ++
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index a2015ed..7f32669 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -72,11 +72,11 @@ EXPORT_SYMBOL_GPL(rcu_lock_map);
.n_force_qs_ngp = 0, \
}
-static struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
-static DEFINE_PER_CPU(struct rcu_data, rcu_data);
+struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state);
+DEFINE_PER_CPU(struct rcu_data, rcu_data);
-static struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
-static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
+struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
+DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
/*
* Increment the quiescent state counter.
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
new file mode 100644
index 0000000..5e872bb
--- /dev/null
+++ b/kernel/rcutree.h
@@ -0,0 +1,10 @@
+
+/*
+ * RCU implementation internal declarations:
+ */
+extern struct rcu_state rcu_state;
+DECLARE_PER_CPU(struct rcu_data, rcu_data);
+
+extern struct rcu_state rcu_bh_state;
+DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
+
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index d6db3e8..4ee954f 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -43,6 +43,8 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
+#include "rcutree.h"
+
static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
{
if (!rdp->beenonline)
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcupreempt.c data structure dependencies
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (11 preceding siblings ...)
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 ` 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
13 siblings, 0 replies; 21+ messages in thread
From: Ingo Molnar @ 2009-04-03 10:36 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: a979241c532f07c201fe94e0a632107268f02578
Gitweb: http://git.kernel.org/tip/a979241c532f07c201fe94e0a632107268f02578
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Wed, 25 Mar 2009 16:42:24 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:23:04 +0200
kmemtrace, rcu: fix rcupreempt.c data structure dependencies
Impact: cleanup
We want to remove percpu.h from rcupreempt.h, but if we do that
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 74304b4..3eb8fdd 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);
^ permalink raw reply related [flat|nested] 21+ messages in thread* [tip:tracing/kmemtrace-v2] kmemtrace, rcu: don't include unnecessary headers, allow kmemtrace w/ tracepoints
[not found] <1237898630.25315.83.camel@penberg-laptop>
` (12 preceding siblings ...)
2009-04-03 10:36 ` [tip:tracing/kmemtrace-v2] kmemtrace, rcu: fix rcupreempt.c " Ingo Molnar
@ 2009-04-03 10:36 ` Eduard - Gabriel Munteanu
13 siblings, 0 replies; 21+ messages in thread
From: Eduard - Gabriel Munteanu @ 2009-04-03 10:36 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, penberg, eduard.munteanu, tglx, mingo
Commit-ID: ac44021fccd8f1f2b267b004f23a2e8d7ef05f7b
Gitweb: http://git.kernel.org/tip/ac44021fccd8f1f2b267b004f23a2e8d7ef05f7b
Author: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
AuthorDate: Mon, 23 Mar 2009 15:12:21 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 12:23:05 +0200
kmemtrace, rcu: don't include unnecessary headers, allow kmemtrace w/ tracepoints
Impact: cleanup
linux/percpu.h includes linux/slab.h, which generates circular inclusion
dependencies when trying to switch kmemtrace to use tracepoints instead
of markers.
This patch allows tracing within slab headers' inline functions.
Signed-off-by: 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/rcuclassic.h | 1 -
include/linux/rcupdate.h | 1 -
include/linux/rcupreempt.h | 2 +-
include/linux/rcutree.h | 1 -
4 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index 2d688b4..bfd92e1 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -36,7 +36,6 @@
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
-#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 528343e..15fbb3c 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -36,7 +36,6 @@
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
-#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
#include <linux/lockdep.h>
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 3eb8fdd..fce5227 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -36,7 +36,7 @@
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
-#include <linux/percpu.h>
+#include <linux/smp.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 5d6f425..0cdda00 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -33,7 +33,6 @@
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
-#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
^ permalink raw reply related [flat|nested] 21+ messages in thread