Skip to content

Commit 0d3c55b

Browse files
committed
Merge branches 'doc.2013.12.03a', 'fixes.2013.12.12a', 'rcutorture.2013.12.03a' and 'sparse.2013.12.12a' into HEAD
doc.2013.12.03a: Topic branch for documentation changes. fixes.2013.12.12a: Topic branch for miscellaneous fixes. rcutorture.2013.12.03a: Topic branch for new rcutorture/KVM scripting. sparse.2013.12.12a: Topic branch for sparse-RCU changes.
4 parents 6c43c09 + bd73a7f + 0e342a8 + 462225a commit 0d3c55b

File tree

125 files changed

+3736
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+3736
-174
lines changed

Documentation/RCU/trace.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,14 @@ o Each element of the form "3/3 ..>. 0:7 ^0" represents one rcu_node
396396

397397
The output of "cat rcu/rcu_sched/rcu_pending" looks as follows:
398398

399-
0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903
400-
1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113
401-
2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889
402-
3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469
403-
4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042
404-
5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422
405-
6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699
406-
7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147
399+
0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903 ndw=0
400+
1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113 ndw=0
401+
2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889 ndw=0
402+
3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469 ndw=0
403+
4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042 ndw=0
404+
5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422 ndw=0
405+
6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699 ndw=0
406+
7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147 ndw=0
407407

408408
The fields are as follows:
409409

@@ -432,6 +432,10 @@ o "gpc" is the number of times that an old grace period had
432432
o "gps" is the number of times that a new grace period had started,
433433
but this CPU was not yet aware of it.
434434

435+
o "ndw" is the number of times that a wakeup of an rcuo
436+
callback-offload kthread had to be deferred in order to avoid
437+
deadlock.
438+
435439
o "nn" is the number of times that this CPU needed nothing.
436440

437441

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7033,6 +7033,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
70337033
F: Documentation/RCU/torture.txt
70347034
F: kernel/rcu/torture.c
70357035

7036+
RCUTORTURE TEST FRAMEWORK
7037+
M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7038+
S: Supported
7039+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
7040+
F: tools/testing/selftests/rcutorture
7041+
70367042
RDC R-321X SoC
70377043
M: Florian Fainelli <florian@openwrt.org>
70387044
S: Maintained

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ static int __bond_release_one(struct net_device *bond_dev,
17631763
}
17641764

17651765
if (all) {
1766-
rcu_assign_pointer(bond->curr_active_slave, NULL);
1766+
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
17671767
} else if (oldcurrent == slave) {
17681768
/*
17691769
* Note that we hold RTNL over this sequence, so there

include/linux/rculist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new,
5555
next->prev = new;
5656
}
5757
#else
58-
extern void __list_add_rcu(struct list_head *new,
59-
struct list_head *prev, struct list_head *next);
58+
void __list_add_rcu(struct list_head *new,
59+
struct list_head *prev, struct list_head *next);
6060
#endif
6161

6262
/**

include/linux/rcupdate.h

Lines changed: 83 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */
5050
#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
5151

5252
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
53-
extern void rcutorture_record_test_transition(void);
54-
extern void rcutorture_record_progress(unsigned long vernum);
55-
extern void do_trace_rcu_torture_read(const char *rcutorturename,
56-
struct rcu_head *rhp,
57-
unsigned long secs,
58-
unsigned long c_old,
59-
unsigned long c);
53+
void rcutorture_record_test_transition(void);
54+
void rcutorture_record_progress(unsigned long vernum);
55+
void do_trace_rcu_torture_read(const char *rcutorturename,
56+
struct rcu_head *rhp,
57+
unsigned long secs,
58+
unsigned long c_old,
59+
unsigned long c);
6060
#else
6161
static inline void rcutorture_record_test_transition(void)
6262
{
@@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum)
6565
{
6666
}
6767
#ifdef CONFIG_RCU_TRACE
68-
extern void do_trace_rcu_torture_read(const char *rcutorturename,
69-
struct rcu_head *rhp,
70-
unsigned long secs,
71-
unsigned long c_old,
72-
unsigned long c);
68+
void do_trace_rcu_torture_read(const char *rcutorturename,
69+
struct rcu_head *rhp,
70+
unsigned long secs,
71+
unsigned long c_old,
72+
unsigned long c);
7373
#else
7474
#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
7575
do { } while (0)
@@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename,
118118
* if CPU A and CPU B are the same CPU (but again only if the system has
119119
* more than one CPU).
120120
*/
121-
extern void call_rcu(struct rcu_head *head,
122-
void (*func)(struct rcu_head *head));
121+
void call_rcu(struct rcu_head *head,
122+
void (*func)(struct rcu_head *head));
123123

124124
#else /* #ifdef CONFIG_PREEMPT_RCU */
125125

@@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head,
149149
* See the description of call_rcu() for more detailed information on
150150
* memory ordering guarantees.
151151
*/
152-
extern void call_rcu_bh(struct rcu_head *head,
153-
void (*func)(struct rcu_head *head));
152+
void call_rcu_bh(struct rcu_head *head,
153+
void (*func)(struct rcu_head *head));
154154

155155
/**
156156
* call_rcu_sched() - Queue an RCU for invocation after sched grace period.
@@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head,
171171
* See the description of call_rcu() for more detailed information on
172172
* memory ordering guarantees.
173173
*/
174-
extern void call_rcu_sched(struct rcu_head *head,
175-
void (*func)(struct rcu_head *rcu));
174+
void call_rcu_sched(struct rcu_head *head,
175+
void (*func)(struct rcu_head *rcu));
176176

177-
extern void synchronize_sched(void);
177+
void synchronize_sched(void);
178178

179179
#ifdef CONFIG_PREEMPT_RCU
180180

181-
extern void __rcu_read_lock(void);
182-
extern void __rcu_read_unlock(void);
183-
extern void rcu_read_unlock_special(struct task_struct *t);
181+
void __rcu_read_lock(void);
182+
void __rcu_read_unlock(void);
183+
void rcu_read_unlock_special(struct task_struct *t);
184184
void synchronize_rcu(void);
185185

186186
/*
@@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void)
216216
#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
217217

218218
/* Internal to kernel */
219-
extern void rcu_init(void);
220-
extern void rcu_sched_qs(int cpu);
221-
extern void rcu_bh_qs(int cpu);
222-
extern void rcu_check_callbacks(int cpu, int user);
219+
void rcu_init(void);
220+
void rcu_sched_qs(int cpu);
221+
void rcu_bh_qs(int cpu);
222+
void rcu_check_callbacks(int cpu, int user);
223223
struct notifier_block;
224-
extern void rcu_idle_enter(void);
225-
extern void rcu_idle_exit(void);
226-
extern void rcu_irq_enter(void);
227-
extern void rcu_irq_exit(void);
224+
void rcu_idle_enter(void);
225+
void rcu_idle_exit(void);
226+
void rcu_irq_enter(void);
227+
void rcu_irq_exit(void);
228228

229229
#ifdef CONFIG_RCU_USER_QS
230-
extern void rcu_user_enter(void);
231-
extern void rcu_user_exit(void);
230+
void rcu_user_enter(void);
231+
void rcu_user_exit(void);
232232
#else
233233
static inline void rcu_user_enter(void) { }
234234
static inline void rcu_user_exit(void) { }
@@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev,
262262
} while (0)
263263

264264
#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
265-
extern bool __rcu_is_watching(void);
265+
bool __rcu_is_watching(void);
266266
#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */
267267

268268
/*
@@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf);
289289
* initialization.
290290
*/
291291
#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
292-
extern void init_rcu_head_on_stack(struct rcu_head *head);
293-
extern void destroy_rcu_head_on_stack(struct rcu_head *head);
292+
void init_rcu_head_on_stack(struct rcu_head *head);
293+
void destroy_rcu_head_on_stack(struct rcu_head *head);
294294
#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
295295
static inline void init_rcu_head_on_stack(struct rcu_head *head)
296296
{
@@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map)
325325
extern struct lockdep_map rcu_lock_map;
326326
extern struct lockdep_map rcu_bh_lock_map;
327327
extern struct lockdep_map rcu_sched_lock_map;
328+
extern struct lockdep_map rcu_callback_map;
328329
extern int debug_lockdep_rcu_enabled(void);
329330

330331
/**
@@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void)
362363
* rcu_read_lock_bh_held() is defined out of line to avoid #include-file
363364
* hell.
364365
*/
365-
extern int rcu_read_lock_bh_held(void);
366+
int rcu_read_lock_bh_held(void);
366367

367368
/**
368369
* rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section?
@@ -448,7 +449,7 @@ static inline int rcu_read_lock_sched_held(void)
448449

449450
#ifdef CONFIG_PROVE_RCU
450451

451-
extern int rcu_my_thread_group_empty(void);
452+
int rcu_my_thread_group_empty(void);
452453

453454
/**
454455
* rcu_lockdep_assert - emit lockdep splat if specified condition not met
@@ -548,10 +549,48 @@ static inline void rcu_preempt_sleep_check(void)
548549
smp_read_barrier_depends(); \
549550
(_________p1); \
550551
})
551-
#define __rcu_assign_pointer(p, v, space) \
552+
553+
/**
554+
* RCU_INITIALIZER() - statically initialize an RCU-protected global variable
555+
* @v: The value to statically initialize with.
556+
*/
557+
#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
558+
559+
/**
560+
* rcu_assign_pointer() - assign to RCU-protected pointer
561+
* @p: pointer to assign to
562+
* @v: value to assign (publish)
563+
*
564+
* Assigns the specified value to the specified RCU-protected
565+
* pointer, ensuring that any concurrent RCU readers will see
566+
* any prior initialization.
567+
*
568+
* Inserts memory barriers on architectures that require them
569+
* (which is most of them), and also prevents the compiler from
570+
* reordering the code that initializes the structure after the pointer
571+
* assignment. More importantly, this call documents which pointers
572+
* will be dereferenced by RCU read-side code.
573+
*
574+
* In some special cases, you may use RCU_INIT_POINTER() instead
575+
* of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
576+
* to the fact that it does not constrain either the CPU or the compiler.
577+
* That said, using RCU_INIT_POINTER() when you should have used
578+
* rcu_assign_pointer() is a very bad thing that results in
579+
* impossible-to-diagnose memory corruption. So please be careful.
580+
* See the RCU_INIT_POINTER() comment header for details.
581+
*
582+
* Note that rcu_assign_pointer() evaluates each of its arguments only
583+
* once, appearances notwithstanding. One of the "extra" evaluations
584+
* is in typeof() and the other visible only to sparse (__CHECKER__),
585+
* neither of which actually execute the argument. As with most cpp
586+
* macros, this execute-arguments-only-once property is important, so
587+
* please be careful when making changes to rcu_assign_pointer() and the
588+
* other macros that it invokes.
589+
*/
590+
#define rcu_assign_pointer(p, v) \
552591
do { \
553592
smp_wmb(); \
554-
(p) = (typeof(*v) __force space *)(v); \
593+
ACCESS_ONCE(p) = RCU_INITIALIZER(v); \
555594
} while (0)
556595

557596

@@ -889,32 +928,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
889928
preempt_enable_notrace();
890929
}
891930

892-
/**
893-
* rcu_assign_pointer() - assign to RCU-protected pointer
894-
* @p: pointer to assign to
895-
* @v: value to assign (publish)
896-
*
897-
* Assigns the specified value to the specified RCU-protected
898-
* pointer, ensuring that any concurrent RCU readers will see
899-
* any prior initialization.
900-
*
901-
* Inserts memory barriers on architectures that require them
902-
* (which is most of them), and also prevents the compiler from
903-
* reordering the code that initializes the structure after the pointer
904-
* assignment. More importantly, this call documents which pointers
905-
* will be dereferenced by RCU read-side code.
906-
*
907-
* In some special cases, you may use RCU_INIT_POINTER() instead
908-
* of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
909-
* to the fact that it does not constrain either the CPU or the compiler.
910-
* That said, using RCU_INIT_POINTER() when you should have used
911-
* rcu_assign_pointer() is a very bad thing that results in
912-
* impossible-to-diagnose memory corruption. So please be careful.
913-
* See the RCU_INIT_POINTER() comment header for details.
914-
*/
915-
#define rcu_assign_pointer(p, v) \
916-
__rcu_assign_pointer((p), (v), __rcu)
917-
918931
/**
919932
* RCU_INIT_POINTER() - initialize an RCU protected pointer
920933
*
@@ -949,7 +962,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
949962
*/
950963
#define RCU_INIT_POINTER(p, v) \
951964
do { \
952-
p = (typeof(*v) __force __rcu *)(v); \
965+
p = RCU_INITIALIZER(v); \
953966
} while (0)
954967

955968
/**
@@ -958,7 +971,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
958971
* GCC-style initialization for an RCU-protected pointer in a structure field.
959972
*/
960973
#define RCU_POINTER_INITIALIZER(p, v) \
961-
.p = (typeof(*v) __force __rcu *)(v)
974+
.p = RCU_INITIALIZER(v)
962975

963976
/*
964977
* Does the specified offset indicate that the corresponding rcu_head
@@ -1005,16 +1018,16 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
10051018
__kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
10061019

10071020
#ifdef CONFIG_RCU_NOCB_CPU
1008-
extern bool rcu_is_nocb_cpu(int cpu);
1021+
bool rcu_is_nocb_cpu(int cpu);
10091022
#else
10101023
static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
10111024
#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
10121025

10131026

10141027
/* Only for use by adaptive-ticks code. */
10151028
#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
1016-
extern bool rcu_sys_is_idle(void);
1017-
extern void rcu_sysidle_force_exit(void);
1029+
bool rcu_sys_is_idle(void);
1030+
void rcu_sysidle_force_exit(void);
10181031
#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
10191032

10201033
static inline bool rcu_sys_is_idle(void)

include/linux/rcutiny.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static inline void exit_rcu(void)
125125

126126
#ifdef CONFIG_DEBUG_LOCK_ALLOC
127127
extern int rcu_scheduler_active __read_mostly;
128-
extern void rcu_scheduler_starting(void);
128+
void rcu_scheduler_starting(void);
129129
#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
130130
static inline void rcu_scheduler_starting(void)
131131
{

0 commit comments

Comments
 (0)