diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 11:17:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 11:17:12 -0400 |
| commit | b854e4de0bf88d094476af82c0d5a80f6f2af916 (patch) | |
| tree | 6e9b0a9f28468b043bd395fd816c4b44d4ac8f58 /include/linux | |
| parent | 458c3f60ef12996d5a5b390260a5112bb1da1615 (diff) | |
| parent | 7d992feb7694a21ee81f22894b455dadd5d1c110 (diff) | |
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU updates from Ingo Molnar:
"Main RCU changes this cycle were:
- Full-system idle detection. This is for use by Frederic
Weisbecker's adaptive-ticks mechanism. Its purpose is to allow the
timekeeping CPU to shut off its tick when all other CPUs are idle.
- Miscellaneous fixes.
- Improved rcutorture test coverage.
- Updated RCU documentation"
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
nohz_full: Force RCU's grace-period kthreads onto timekeeping CPU
nohz_full: Add full-system-idle state machine
jiffies: Avoid undefined behavior from signed overflow
rcu: Simplify _rcu_barrier() processing
rcu: Make rcutorture emit online failures if verbose
rcu: Remove unused variable from rcu_torture_writer()
rcu: Sort rcutorture module parameters
rcu: Increase rcutorture test coverage
rcu: Add duplicate-callback tests to rcutorture
doc: Fix memory-barrier control-dependency example
rcu: Update RTFP documentation
nohz_full: Add full-system-idle arguments to API
nohz_full: Add full-system idle states and variables
nohz_full: Add per-CPU idle-state tracking
nohz_full: Add rcu_dyntick data for scalable detection of all-idle state
nohz_full: Add Kconfig parameter for scalable detection of all-idle state
nohz_full: Add testing information to documentation
rcu: Eliminate unused APIs intended for adaptive ticks
rcu: Select IRQ_WORK from TREE_PREEMPT_RCU
rculist: list_first_or_null_rcu() should use list_entry_rcu()
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/debugobjects.h | 6 | ||||
| -rw-r--r-- | include/linux/ftrace_event.h | 34 | ||||
| -rw-r--r-- | include/linux/jiffies.h | 8 | ||||
| -rw-r--r-- | include/linux/rculist.h | 5 | ||||
| -rw-r--r-- | include/linux/rcupdate.h | 26 |
5 files changed, 64 insertions, 15 deletions
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h index 0e5f5785d9f2..98ffcbd4888e 100644 --- a/include/linux/debugobjects.h +++ b/include/linux/debugobjects.h | |||
| @@ -63,7 +63,7 @@ struct debug_obj_descr { | |||
| 63 | extern void debug_object_init (void *addr, struct debug_obj_descr *descr); | 63 | extern void debug_object_init (void *addr, struct debug_obj_descr *descr); |
| 64 | extern void | 64 | extern void |
| 65 | debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); | 65 | debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); |
| 66 | extern void debug_object_activate (void *addr, struct debug_obj_descr *descr); | 66 | extern int debug_object_activate (void *addr, struct debug_obj_descr *descr); |
| 67 | extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); | 67 | extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); |
| 68 | extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); | 68 | extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); |
| 69 | extern void debug_object_free (void *addr, struct debug_obj_descr *descr); | 69 | extern void debug_object_free (void *addr, struct debug_obj_descr *descr); |
| @@ -85,8 +85,8 @@ static inline void | |||
| 85 | debug_object_init (void *addr, struct debug_obj_descr *descr) { } | 85 | debug_object_init (void *addr, struct debug_obj_descr *descr) { } |
| 86 | static inline void | 86 | static inline void |
| 87 | debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } | 87 | debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } |
| 88 | static inline void | 88 | static inline int |
| 89 | debug_object_activate (void *addr, struct debug_obj_descr *descr) { } | 89 | debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; } |
| 90 | static inline void | 90 | static inline void |
| 91 | debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } | 91 | debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } |
| 92 | static inline void | 92 | static inline void |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 120d57a1c3a5..5eaa746735ff 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -359,6 +359,40 @@ do { \ | |||
| 359 | __trace_printk(ip, fmt, ##args); \ | 359 | __trace_printk(ip, fmt, ##args); \ |
| 360 | } while (0) | 360 | } while (0) |
| 361 | 361 | ||
| 362 | /** | ||
| 363 | * tracepoint_string - register constant persistent string to trace system | ||
| 364 | * @str - a constant persistent string that will be referenced in tracepoints | ||
| 365 | * | ||
| 366 | * If constant strings are being used in tracepoints, it is faster and | ||
| 367 | * more efficient to just save the pointer to the string and reference | ||
| 368 | * that with a printf "%s" instead of saving the string in the ring buffer | ||
| 369 | * and wasting space and time. | ||
| 370 | * | ||
| 371 | * The problem with the above approach is that userspace tools that read | ||
| 372 | * the binary output of the trace buffers do not have access to the string. | ||
| 373 | * Instead they just show the address of the string which is not very | ||
| 374 | * useful to users. | ||
| 375 | * | ||
| 376 | * With tracepoint_string(), the string will be registered to the tracing | ||
| 377 | * system and exported to userspace via the debugfs/tracing/printk_formats | ||
| 378 | * file that maps the string address to the string text. This way userspace | ||
| 379 | * tools that read the binary buffers have a way to map the pointers to | ||
| 380 | * the ASCII strings they represent. | ||
| 381 | * | ||
| 382 | * The @str used must be a constant string and persistent as it would not | ||
| 383 | * make sense to show a string that no longer exists. But it is still fine | ||
| 384 | * to be used with modules, because when modules are unloaded, if they | ||
| 385 | * had tracepoints, the ring buffers are cleared too. As long as the string | ||
| 386 | * does not change during the life of the module, it is fine to use | ||
| 387 | * tracepoint_string() within a module. | ||
| 388 | */ | ||
| 389 | #define tracepoint_string(str) \ | ||
| 390 | ({ \ | ||
| 391 | static const char *___tp_str __tracepoint_string = str; \ | ||
| 392 | ___tp_str; \ | ||
| 393 | }) | ||
| 394 | #define __tracepoint_string __attribute__((section("__tracepoint_str"))) | ||
| 395 | |||
| 362 | #ifdef CONFIG_PERF_EVENTS | 396 | #ifdef CONFIG_PERF_EVENTS |
| 363 | struct perf_event; | 397 | struct perf_event; |
| 364 | 398 | ||
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 97ba4e78a37e..d235e88cfd7c 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
| @@ -101,13 +101,13 @@ static inline u64 get_jiffies_64(void) | |||
| 101 | #define time_after(a,b) \ | 101 | #define time_after(a,b) \ |
| 102 | (typecheck(unsigned long, a) && \ | 102 | (typecheck(unsigned long, a) && \ |
| 103 | typecheck(unsigned long, b) && \ | 103 | typecheck(unsigned long, b) && \ |
| 104 | ((long)(b) - (long)(a) < 0)) | 104 | ((long)((b) - (a)) < 0)) |
| 105 | #define time_before(a,b) time_after(b,a) | 105 | #define time_before(a,b) time_after(b,a) |
| 106 | 106 | ||
| 107 | #define time_after_eq(a,b) \ | 107 | #define time_after_eq(a,b) \ |
| 108 | (typecheck(unsigned long, a) && \ | 108 | (typecheck(unsigned long, a) && \ |
| 109 | typecheck(unsigned long, b) && \ | 109 | typecheck(unsigned long, b) && \ |
| 110 | ((long)(a) - (long)(b) >= 0)) | 110 | ((long)((a) - (b)) >= 0)) |
| 111 | #define time_before_eq(a,b) time_after_eq(b,a) | 111 | #define time_before_eq(a,b) time_after_eq(b,a) |
| 112 | 112 | ||
| 113 | /* | 113 | /* |
| @@ -130,13 +130,13 @@ static inline u64 get_jiffies_64(void) | |||
| 130 | #define time_after64(a,b) \ | 130 | #define time_after64(a,b) \ |
| 131 | (typecheck(__u64, a) && \ | 131 | (typecheck(__u64, a) && \ |
| 132 | typecheck(__u64, b) && \ | 132 | typecheck(__u64, b) && \ |
| 133 | ((__s64)(b) - (__s64)(a) < 0)) | 133 | ((__s64)((b) - (a)) < 0)) |
| 134 | #define time_before64(a,b) time_after64(b,a) | 134 | #define time_before64(a,b) time_after64(b,a) |
| 135 | 135 | ||
| 136 | #define time_after_eq64(a,b) \ | 136 | #define time_after_eq64(a,b) \ |
| 137 | (typecheck(__u64, a) && \ | 137 | (typecheck(__u64, a) && \ |
| 138 | typecheck(__u64, b) && \ | 138 | typecheck(__u64, b) && \ |
| 139 | ((__s64)(a) - (__s64)(b) >= 0)) | 139 | ((__s64)((a) - (b)) >= 0)) |
| 140 | #define time_before_eq64(a,b) time_after_eq64(b,a) | 140 | #define time_before_eq64(a,b) time_after_eq64(b,a) |
| 141 | 141 | ||
| 142 | #define time_in_range64(a, b, c) \ | 142 | #define time_in_range64(a, b, c) \ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index f4b1001a4676..4106721c4e5e 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -267,8 +267,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 267 | */ | 267 | */ |
| 268 | #define list_first_or_null_rcu(ptr, type, member) \ | 268 | #define list_first_or_null_rcu(ptr, type, member) \ |
| 269 | ({struct list_head *__ptr = (ptr); \ | 269 | ({struct list_head *__ptr = (ptr); \ |
| 270 | struct list_head __rcu *__next = list_next_rcu(__ptr); \ | 270 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ |
| 271 | likely(__ptr != __next) ? container_of(__next, type, member) : NULL; \ | 271 | likely(__ptr != __next) ? \ |
| 272 | list_entry_rcu(__next, type, member) : NULL; \ | ||
| 272 | }) | 273 | }) |
| 273 | 274 | ||
| 274 | /** | 275 | /** |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4b14bdc911d7..f1f1bc39346b 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -52,7 +52,7 @@ extern int rcutorture_runnable; /* for sysctl */ | |||
| 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 53 | extern void rcutorture_record_test_transition(void); | 53 | extern void rcutorture_record_test_transition(void); |
| 54 | extern void rcutorture_record_progress(unsigned long vernum); | 54 | extern void rcutorture_record_progress(unsigned long vernum); |
| 55 | extern void do_trace_rcu_torture_read(char *rcutorturename, | 55 | extern void do_trace_rcu_torture_read(const char *rcutorturename, |
| 56 | struct rcu_head *rhp, | 56 | struct rcu_head *rhp, |
| 57 | unsigned long secs, | 57 | unsigned long secs, |
| 58 | unsigned long c_old, | 58 | unsigned long c_old, |
| @@ -65,7 +65,7 @@ static inline void rcutorture_record_progress(unsigned long vernum) | |||
| 65 | { | 65 | { |
| 66 | } | 66 | } |
| 67 | #ifdef CONFIG_RCU_TRACE | 67 | #ifdef CONFIG_RCU_TRACE |
| 68 | extern void do_trace_rcu_torture_read(char *rcutorturename, | 68 | extern void do_trace_rcu_torture_read(const char *rcutorturename, |
| 69 | struct rcu_head *rhp, | 69 | struct rcu_head *rhp, |
| 70 | unsigned long secs, | 70 | unsigned long secs, |
| 71 | unsigned long c_old, | 71 | unsigned long c_old, |
| @@ -229,13 +229,9 @@ extern void rcu_irq_exit(void); | |||
| 229 | #ifdef CONFIG_RCU_USER_QS | 229 | #ifdef CONFIG_RCU_USER_QS |
| 230 | extern void rcu_user_enter(void); | 230 | extern void rcu_user_enter(void); |
| 231 | extern void rcu_user_exit(void); | 231 | extern void rcu_user_exit(void); |
| 232 | extern void rcu_user_enter_after_irq(void); | ||
| 233 | extern void rcu_user_exit_after_irq(void); | ||
| 234 | #else | 232 | #else |
| 235 | static inline void rcu_user_enter(void) { } | 233 | static inline void rcu_user_enter(void) { } |
| 236 | static inline void rcu_user_exit(void) { } | 234 | static inline void rcu_user_exit(void) { } |
| 237 | static inline void rcu_user_enter_after_irq(void) { } | ||
| 238 | static inline void rcu_user_exit_after_irq(void) { } | ||
| 239 | static inline void rcu_user_hooks_switch(struct task_struct *prev, | 235 | static inline void rcu_user_hooks_switch(struct task_struct *prev, |
| 240 | struct task_struct *next) { } | 236 | struct task_struct *next) { } |
| 241 | #endif /* CONFIG_RCU_USER_QS */ | 237 | #endif /* CONFIG_RCU_USER_QS */ |
| @@ -1015,4 +1011,22 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | |||
| 1015 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ | 1011 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ |
| 1016 | 1012 | ||
| 1017 | 1013 | ||
| 1014 | /* Only for use by adaptive-ticks code. */ | ||
| 1015 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE | ||
| 1016 | extern bool rcu_sys_is_idle(void); | ||
| 1017 | extern void rcu_sysidle_force_exit(void); | ||
| 1018 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ | ||
| 1019 | |||
| 1020 | static inline bool rcu_sys_is_idle(void) | ||
| 1021 | { | ||
| 1022 | return false; | ||
| 1023 | } | ||
| 1024 | |||
| 1025 | static inline void rcu_sysidle_force_exit(void) | ||
| 1026 | { | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | #endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ | ||
| 1030 | |||
| 1031 | |||
| 1018 | #endif /* __LINUX_RCUPDATE_H */ | 1032 | #endif /* __LINUX_RCUPDATE_H */ |
