* [PATCH tip/core/rcu 0/4] v2 Documentation and rcutorture changes for 3.9 @ 2013-01-27 0:04 Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() Paul E. McKenney 0 siblings, 1 reply; 7+ messages in thread From: Paul E. McKenney @ 2013-01-27 0:04 UTC (permalink / raw) To: linux-kernel Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw Hello! The following are changes to documentation and rcutorture: 1. Export trace_clock_local() in order to allow rcutorture event tracing to emit the time of the beginning of the RCU read-side critical section at the point where a failure is detected. 2. Reduce rcutorture's read-side tracing to include only failures, thus cutting the number of events down to something reasonable (normally zero, in fact!). 3. Add atomic_xchg() to the list of atomic operations and memory barriers, courtesy of Richard Braun. 4. Make rcutorture's shuffler task also shuffle recently added rcutorture kthreads. Changes since v1: o Fixed build problem in #2 located by Randy Dunlap based on diagnosis from Steven Rostedt. o Added patch #4. Thanx, Paul b/Documentation/atomic_ops.txt | 2 + b/Documentation/memory-barriers.txt | 1 b/include/linux/rcupdate.h | 13 ++++++-- b/include/trace/events/rcu.h | 19 +++++++++--- b/kernel/rcupdate.c | 9 +++-- b/kernel/rcutorture.c | 55 ++++++++++++++++++++++++++++-------- b/kernel/trace/trace_clock.c | 1 b/lib/Kconfig.debug | 1 8 files changed, 79 insertions(+), 22 deletions(-) ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() 2013-01-27 0:04 [PATCH tip/core/rcu 0/4] v2 Documentation and rcutorture changes for 3.9 Paul E. McKenney @ 2013-01-27 0:05 ` Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 2/4] rcu: Reduce rcutorture tracing Paul E. McKenney ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Paul E. McKenney @ 2013-01-27 0:05 UTC (permalink / raw) To: linux-kernel Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw, Paul E. McKenney From: "Paul E. McKenney" <paul.mckenney@linaro.org> The rcutorture tests need to be able to trace the time of the beginning of an RCU read-side critical section, and thus need access to trace_clock_local(). This commit therefore adds a the needed EXPORT_SYMBOL_GPL(). Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- kernel/trace/trace_clock.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c index 3947835..1bbb1b2 100644 --- a/kernel/trace/trace_clock.c +++ b/kernel/trace/trace_clock.c @@ -44,6 +44,7 @@ u64 notrace trace_clock_local(void) return clock; } +EXPORT_SYMBOL_GPL(trace_clock_local); /* * trace_clock(): 'between' trace clock. Not completely serialized, -- 1.7.8 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH tip/core/rcu 2/4] rcu: Reduce rcutorture tracing 2013-01-27 0:05 ` [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() Paul E. McKenney @ 2013-01-27 0:05 ` Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 3/4] Documentation: Memory barrier semantics of atomic_xchg() Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks Paul E. McKenney 2 siblings, 0 replies; 7+ messages in thread From: Paul E. McKenney @ 2013-01-27 0:05 UTC (permalink / raw) To: linux-kernel Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw, Paul E. McKenney, Paul E. McKenney From: "Paul E. McKenney" <paul.mckenney@linaro.org> Currently, rcutorture traces every read-side access. This can be problematic because even a two-minute rcutorture run on a two-CPU system can generate 28,853,363 reads. Normally, only a failing read is of interest, so this commit traces adjusts rcutorture's tracing to only trace failing reads. The resulting event tracing records the time and the ->completed value captured at the beginning of the RCU read-side critical section, allowing correlation with other event-tracing messages. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> [ paulmck: Add fix to build problem located by Randy Dunlap based on diagnosis by Steven Rostedt. ] --- include/linux/rcupdate.h | 13 ++++++++++--- include/trace/events/rcu.h | 19 ++++++++++++++----- kernel/rcupdate.c | 9 ++++++--- kernel/rcutorture.c | 31 ++++++++++++++++++++++++------- lib/Kconfig.debug | 1 + 5 files changed, 55 insertions(+), 18 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 275aa3f..7f89cea 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -53,7 +53,10 @@ extern int rcutorture_runnable; /* for sysctl */ extern void rcutorture_record_test_transition(void); extern void rcutorture_record_progress(unsigned long vernum); extern void do_trace_rcu_torture_read(char *rcutorturename, - struct rcu_head *rhp); + struct rcu_head *rhp, + unsigned long secs, + unsigned long c_old, + unsigned long c); #else static inline void rcutorture_record_test_transition(void) { @@ -63,9 +66,13 @@ static inline void rcutorture_record_progress(unsigned long vernum) } #ifdef CONFIG_RCU_TRACE extern void do_trace_rcu_torture_read(char *rcutorturename, - struct rcu_head *rhp); + struct rcu_head *rhp, + unsigned long secs, + unsigned long c_old, + unsigned long c); #else -#define do_trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) +#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ + do { } while (0) #endif #endif diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index d4f559b..09af021 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h @@ -523,22 +523,30 @@ TRACE_EVENT(rcu_batch_end, */ TRACE_EVENT(rcu_torture_read, - TP_PROTO(char *rcutorturename, struct rcu_head *rhp), + TP_PROTO(char *rcutorturename, struct rcu_head *rhp, + unsigned long secs, unsigned long c_old, unsigned long c), - TP_ARGS(rcutorturename, rhp), + TP_ARGS(rcutorturename, rhp, secs, c_old, c), TP_STRUCT__entry( __field(char *, rcutorturename) __field(struct rcu_head *, rhp) + __field(unsigned long, secs) + __field(unsigned long, c_old) + __field(unsigned long, c) ), TP_fast_assign( __entry->rcutorturename = rcutorturename; __entry->rhp = rhp; + __entry->secs = secs; + __entry->c_old = c_old; + __entry->c = c; ), - TP_printk("%s torture read %p", - __entry->rcutorturename, __entry->rhp) + TP_printk("%s torture read %p %luus c: %lu %lu", + __entry->rcutorturename, __entry->rhp, + __entry->secs, __entry->c_old, __entry->c) ); /* @@ -608,7 +616,8 @@ TRACE_EVENT(rcu_barrier, #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ do { } while (0) -#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) +#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ + do { } while (0) #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) #endif /* #else #ifdef CONFIG_RCU_TRACE */ diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index a2cf761..303359d 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c @@ -404,11 +404,14 @@ EXPORT_SYMBOL_GPL(rcuhead_debug_descr); #endif /* #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD */ #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) || defined(CONFIG_RCU_TRACE) -void do_trace_rcu_torture_read(char *rcutorturename, struct rcu_head *rhp) +void do_trace_rcu_torture_read(char *rcutorturename, struct rcu_head *rhp, + unsigned long secs, + unsigned long c_old, unsigned long c) { - trace_rcu_torture_read(rcutorturename, rhp); + trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c); } EXPORT_SYMBOL_GPL(do_trace_rcu_torture_read); #else -#define do_trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) +#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ + do { } while (0) #endif diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 31dea01..a583f1c 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -46,6 +46,7 @@ #include <linux/stat.h> #include <linux/srcu.h> #include <linux/slab.h> +#include <linux/trace_clock.h> #include <asm/byteorder.h> MODULE_LICENSE("GPL"); @@ -1028,7 +1029,6 @@ void rcutorture_trace_dump(void) return; if (atomic_xchg(&beenhere, 1) != 0) return; - do_trace_rcu_torture_read(cur_ops->name, (struct rcu_head *)~0UL); ftrace_dump(DUMP_ALL); } @@ -1042,13 +1042,16 @@ static void rcu_torture_timer(unsigned long unused) { int idx; int completed; + int completed_end; static DEFINE_RCU_RANDOM(rand); static DEFINE_SPINLOCK(rand_lock); struct rcu_torture *p; int pipe_count; + unsigned long long ts; idx = cur_ops->readlock(); completed = cur_ops->completed(); + ts = trace_clock_local(); p = rcu_dereference_check(rcu_torture_current, rcu_read_lock_bh_held() || rcu_read_lock_sched_held() || @@ -1058,7 +1061,6 @@ static void rcu_torture_timer(unsigned long unused) cur_ops->readunlock(idx); return; } - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu); if (p->rtort_mbtest == 0) atomic_inc(&n_rcu_torture_mberror); spin_lock(&rand_lock); @@ -1071,10 +1073,16 @@ static void rcu_torture_timer(unsigned long unused) /* Should not happen, but... */ pipe_count = RCU_TORTURE_PIPE_LEN; } - if (pipe_count > 1) + completed_end = cur_ops->completed(); + if (pipe_count > 1) { + unsigned long __maybe_unused ts_rem = do_div(ts, NSEC_PER_USEC); + + do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu, ts, + completed, completed_end); rcutorture_trace_dump(); + } __this_cpu_inc(rcu_torture_count[pipe_count]); - completed = cur_ops->completed() - completed; + completed = completed_end - completed; if (completed > RCU_TORTURE_PIPE_LEN) { /* Should not happen, but... */ completed = RCU_TORTURE_PIPE_LEN; @@ -1094,11 +1102,13 @@ static int rcu_torture_reader(void *arg) { int completed; + int completed_end; int idx; DEFINE_RCU_RANDOM(rand); struct rcu_torture *p; int pipe_count; struct timer_list t; + unsigned long long ts; VERBOSE_PRINTK_STRING("rcu_torture_reader task started"); set_user_nice(current, 19); @@ -1112,6 +1122,7 @@ rcu_torture_reader(void *arg) } idx = cur_ops->readlock(); completed = cur_ops->completed(); + ts = trace_clock_local(); p = rcu_dereference_check(rcu_torture_current, rcu_read_lock_bh_held() || rcu_read_lock_sched_held() || @@ -1122,7 +1133,6 @@ rcu_torture_reader(void *arg) schedule_timeout_interruptible(HZ); continue; } - do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu); if (p->rtort_mbtest == 0) atomic_inc(&n_rcu_torture_mberror); cur_ops->read_delay(&rand); @@ -1132,10 +1142,17 @@ rcu_torture_reader(void *arg) /* Should not happen, but... */ pipe_count = RCU_TORTURE_PIPE_LEN; } - if (pipe_count > 1) + completed_end = cur_ops->completed(); + if (pipe_count > 1) { + unsigned long __maybe_unused ts_rem = + do_div(ts, NSEC_PER_USEC); + + do_trace_rcu_torture_read(cur_ops->name, &p->rtort_rcu, + ts, completed, completed_end); rcutorture_trace_dump(); + } __this_cpu_inc(rcu_torture_count[pipe_count]); - completed = cur_ops->completed() - completed; + completed = completed_end - completed; if (completed > RCU_TORTURE_PIPE_LEN) { /* Should not happen, but... */ completed = RCU_TORTURE_PIPE_LEN; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 3a35309..7d83f52 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1008,6 +1008,7 @@ config RCU_CPU_STALL_INFO config RCU_TRACE bool "Enable tracing for RCU" depends on DEBUG_KERNEL + select TRACE_CLOCK help This option provides tracing in RCU which presents stats in debugfs for debugging RCU implementation. -- 1.7.8 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH tip/core/rcu 3/4] Documentation: Memory barrier semantics of atomic_xchg() 2013-01-27 0:05 ` [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 2/4] rcu: Reduce rcutorture tracing Paul E. McKenney @ 2013-01-27 0:05 ` Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks Paul E. McKenney 2 siblings, 0 replies; 7+ messages in thread From: Paul E. McKenney @ 2013-01-27 0:05 UTC (permalink / raw) To: linux-kernel Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw, Richard Braun, Paul E. McKenney From: Richard Braun <rbraun@sceen.net> Add atomic_xchg() to documentation for atomic operations and memory barriers. Signed-off-by: Richard Braun <rbraun@sceen.net> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- Documentation/atomic_ops.txt | 2 ++ Documentation/memory-barriers.txt | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 27f2b21..d9ca5be 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -253,6 +253,8 @@ This performs an atomic exchange operation on the atomic variable v, setting the given new value. It returns the old value that the atomic variable v had just before the operation. +atomic_xchg requires explicit memory barriers around the operation. + int atomic_cmpxchg(atomic_t *v, int old, int new); This performs an atomic compare exchange operation on the atomic value v, diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 3c4e1b3..fa5d8a9 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt @@ -1685,6 +1685,7 @@ explicit lock operations, described later). These include: xchg(); cmpxchg(); + atomic_xchg(); atomic_cmpxchg(); atomic_inc_return(); atomic_dec_return(); -- 1.7.8 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks 2013-01-27 0:05 ` [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 2/4] rcu: Reduce rcutorture tracing Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 3/4] Documentation: Memory barrier semantics of atomic_xchg() Paul E. McKenney @ 2013-01-27 0:05 ` Paul E. McKenney 2013-01-27 10:47 ` Josh Triplett 2 siblings, 1 reply; 7+ messages in thread From: Paul E. McKenney @ 2013-01-27 0:05 UTC (permalink / raw) To: linux-kernel Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw, Paul E. McKenney From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> A number of kthreads have been added to rcutorture, but the shuffler task was not informed of them, and thus did not shuffle them. This commit therefore adds the requisite shuffling. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> --- kernel/rcutorture.c | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index a583f1c..3ebc8bf 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -846,7 +846,7 @@ static int rcu_torture_boost(void *arg) /* Wait for the next test interval. */ oldstarttime = boost_starttime; while (ULONG_CMP_LT(jiffies, oldstarttime)) { - schedule_timeout_uninterruptible(1); + schedule_timeout_interruptible(oldstarttime - jiffies); rcu_stutter_wait("rcu_torture_boost"); if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP) @@ -1318,19 +1318,35 @@ static void rcu_torture_shuffle_tasks(void) set_cpus_allowed_ptr(reader_tasks[i], shuffle_tmp_mask); } - if (fakewriter_tasks) { for (i = 0; i < nfakewriters; i++) if (fakewriter_tasks[i]) set_cpus_allowed_ptr(fakewriter_tasks[i], shuffle_tmp_mask); } - if (writer_task) set_cpus_allowed_ptr(writer_task, shuffle_tmp_mask); - if (stats_task) set_cpus_allowed_ptr(stats_task, shuffle_tmp_mask); + if (stutter_task) + set_cpus_allowed_ptr(stutter_task, shuffle_tmp_mask); + if (fqs_task) + set_cpus_allowed_ptr(fqs_task, shuffle_tmp_mask); + if (shutdown_task) + set_cpus_allowed_ptr(shutdown_task, shuffle_tmp_mask); +#ifdef CONFIG_HOTPLUG_CPU + if (onoff_task) + set_cpus_allowed_ptr(onoff_task, shuffle_tmp_mask); +#endif /* #ifdef CONFIG_HOTPLUG_CPU */ + if (stall_task) + set_cpus_allowed_ptr(stall_task, shuffle_tmp_mask); + if (barrier_cbs_tasks) + for (i = 0; i < n_barrier_cbs; i++) + if (barrier_cbs_tasks[i]) + set_cpus_allowed_ptr(barrier_cbs_tasks[i], + shuffle_tmp_mask); + if (barrier_task) + set_cpus_allowed_ptr(barrier_task, shuffle_tmp_mask); if (rcu_idle_cpu == -1) rcu_idle_cpu = num_online_cpus() - 1; -- 1.7.8 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks 2013-01-27 0:05 ` [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks Paul E. McKenney @ 2013-01-27 10:47 ` Josh Triplett 2013-01-29 6:40 ` Paul E. McKenney 0 siblings, 1 reply; 7+ messages in thread From: Josh Triplett @ 2013-01-27 10:47 UTC (permalink / raw) To: Paul E. McKenney Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw On Sat, Jan 26, 2013 at 04:05:20PM -0800, Paul E. McKenney wrote: > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > > A number of kthreads have been added to rcutorture, but the shuffler > task was not informed of them, and thus did not shuffle them. This > commit therefore adds the requisite shuffling. > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> This also makes an unrelated semantic change, and several unrelated whitespace changes. > --- > kernel/rcutorture.c | 24 ++++++++++++++++++++---- > 1 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c > index a583f1c..3ebc8bf 100644 > --- a/kernel/rcutorture.c > +++ b/kernel/rcutorture.c > @@ -846,7 +846,7 @@ static int rcu_torture_boost(void *arg) > /* Wait for the next test interval. */ > oldstarttime = boost_starttime; > while (ULONG_CMP_LT(jiffies, oldstarttime)) { > - schedule_timeout_uninterruptible(1); > + schedule_timeout_interruptible(oldstarttime - jiffies); This change doesn't seem related, and the commit message doesn't explain it either. Could you split it out into a separate commit and document the rationale, please? > rcu_stutter_wait("rcu_torture_boost"); > if (kthread_should_stop() || > fullstop != FULLSTOP_DONTSTOP) > @@ -1318,19 +1318,35 @@ static void rcu_torture_shuffle_tasks(void) > set_cpus_allowed_ptr(reader_tasks[i], > shuffle_tmp_mask); > } > - > if (fakewriter_tasks) { > for (i = 0; i < nfakewriters; i++) > if (fakewriter_tasks[i]) > set_cpus_allowed_ptr(fakewriter_tasks[i], > shuffle_tmp_mask); > } > - > if (writer_task) > set_cpus_allowed_ptr(writer_task, shuffle_tmp_mask); > - These three whitespace changes seem unrelated as well. > if (stats_task) > set_cpus_allowed_ptr(stats_task, shuffle_tmp_mask); > + if (stutter_task) > + set_cpus_allowed_ptr(stutter_task, shuffle_tmp_mask); > + if (fqs_task) > + set_cpus_allowed_ptr(fqs_task, shuffle_tmp_mask); > + if (shutdown_task) > + set_cpus_allowed_ptr(shutdown_task, shuffle_tmp_mask); > +#ifdef CONFIG_HOTPLUG_CPU > + if (onoff_task) > + set_cpus_allowed_ptr(onoff_task, shuffle_tmp_mask); > +#endif /* #ifdef CONFIG_HOTPLUG_CPU */ > + if (stall_task) > + set_cpus_allowed_ptr(stall_task, shuffle_tmp_mask); > + if (barrier_cbs_tasks) > + for (i = 0; i < n_barrier_cbs; i++) > + if (barrier_cbs_tasks[i]) > + set_cpus_allowed_ptr(barrier_cbs_tasks[i], > + shuffle_tmp_mask); > + if (barrier_task) > + set_cpus_allowed_ptr(barrier_task, shuffle_tmp_mask); The rest of this seems fine. - Josh Triplett ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks 2013-01-27 10:47 ` Josh Triplett @ 2013-01-29 6:40 ` Paul E. McKenney 0 siblings, 0 replies; 7+ messages in thread From: Paul E. McKenney @ 2013-01-29 6:40 UTC (permalink / raw) To: Josh Triplett Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren, fweisbec, sbw On Sun, Jan 27, 2013 at 09:47:47PM +1100, Josh Triplett wrote: > On Sat, Jan 26, 2013 at 04:05:20PM -0800, Paul E. McKenney wrote: > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > > > > A number of kthreads have been added to rcutorture, but the shuffler > > task was not informed of them, and thus did not shuffle them. This > > commit therefore adds the requisite shuffling. > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > > This also makes an unrelated semantic change, and several unrelated > whitespace changes. > > > --- > > kernel/rcutorture.c | 24 ++++++++++++++++++++---- > > 1 files changed, 20 insertions(+), 4 deletions(-) > > > > diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c > > index a583f1c..3ebc8bf 100644 > > --- a/kernel/rcutorture.c > > +++ b/kernel/rcutorture.c > > @@ -846,7 +846,7 @@ static int rcu_torture_boost(void *arg) > > /* Wait for the next test interval. */ > > oldstarttime = boost_starttime; > > while (ULONG_CMP_LT(jiffies, oldstarttime)) { > > - schedule_timeout_uninterruptible(1); > > + schedule_timeout_interruptible(oldstarttime - jiffies); > > This change doesn't seem related, and the commit message doesn't explain > it either. Could you split it out into a separate commit and document > the rationale, please? Ah, it is related because the shuffling is trying to keep CPUs idle, which means that we don't want all the boost kthreads waking up every CPU every jiffy. I agree that this is not obvious, so I have updated the commit message to call this out. > > rcu_stutter_wait("rcu_torture_boost"); > > if (kthread_should_stop() || > > fullstop != FULLSTOP_DONTSTOP) > > @@ -1318,19 +1318,35 @@ static void rcu_torture_shuffle_tasks(void) > > set_cpus_allowed_ptr(reader_tasks[i], > > shuffle_tmp_mask); > > } > > - > > if (fakewriter_tasks) { > > for (i = 0; i < nfakewriters; i++) > > if (fakewriter_tasks[i]) > > set_cpus_allowed_ptr(fakewriter_tasks[i], > > shuffle_tmp_mask); > > } > > - > > if (writer_task) > > set_cpus_allowed_ptr(writer_task, shuffle_tmp_mask); > > - > > These three whitespace changes seem unrelated as well. Some cleanup while in the neighborhood. ;-) I added this to the commit message as well. Thanx, Paul > > if (stats_task) > > set_cpus_allowed_ptr(stats_task, shuffle_tmp_mask); > > + if (stutter_task) > > + set_cpus_allowed_ptr(stutter_task, shuffle_tmp_mask); > > + if (fqs_task) > > + set_cpus_allowed_ptr(fqs_task, shuffle_tmp_mask); > > + if (shutdown_task) > > + set_cpus_allowed_ptr(shutdown_task, shuffle_tmp_mask); > > +#ifdef CONFIG_HOTPLUG_CPU > > + if (onoff_task) > > + set_cpus_allowed_ptr(onoff_task, shuffle_tmp_mask); > > +#endif /* #ifdef CONFIG_HOTPLUG_CPU */ > > + if (stall_task) > > + set_cpus_allowed_ptr(stall_task, shuffle_tmp_mask); > > + if (barrier_cbs_tasks) > > + for (i = 0; i < n_barrier_cbs; i++) > > + if (barrier_cbs_tasks[i]) > > + set_cpus_allowed_ptr(barrier_cbs_tasks[i], > > + shuffle_tmp_mask); > > + if (barrier_task) > > + set_cpus_allowed_ptr(barrier_task, shuffle_tmp_mask); > > The rest of this seems fine. > > - Josh Triplett > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-01-29 6:41 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-01-27 0:04 [PATCH tip/core/rcu 0/4] v2 Documentation and rcutorture changes for 3.9 Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 1/4] tracing: Export trace_clock_local() Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 2/4] rcu: Reduce rcutorture tracing Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 3/4] Documentation: Memory barrier semantics of atomic_xchg() Paul E. McKenney 2013-01-27 0:05 ` [PATCH tip/core/rcu 4/4] rcu: Make rcutorture's shuffler task shuffle recently added tasks Paul E. McKenney 2013-01-27 10:47 ` Josh Triplett 2013-01-29 6:40 ` Paul E. McKenney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).