Skip to content

Commit

Permalink
Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/paulmck/linux-rcu into core/rcu

Pull RCU changes from Paul E. McKenney:

  - The combination of tree geometry-initialization simplifications
    and OS-jitter-reduction changes to expedited grace periods.
    These two are stacked due to the large number of conflicts
    that would otherwise result.

    [ With one addition, a temporary commit to silence a lockdep false
      positive. Additional changes to the expedited grace-period
      primitives (queued for 4.4) remove the cause of this false
      positive, and therefore include a revert of this temporary commit. ]

  - Documentation updates.

  - Torture-test updates.

  - Miscellaneous fixes.

Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Aug 12, 2015
2 parents 58ccab9 + 3dbe43f commit 9b9412d
Show file tree
Hide file tree
Showing 47 changed files with 989 additions and 841 deletions.
2 changes: 1 addition & 1 deletion Documentation/RCU/rcu_dereference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ o You must use one of the rcu_dereference() family of primitives
o Avoid cancellation when using the "+" and "-" infix arithmetic
operators. For example, for a given variable "x", avoid
"(x-x)". There are similar arithmetic pitfalls from other
arithmetic operatiors, such as "(x*0)", "(x/(x+1))" or "(x%1)".
arithmetic operators, such as "(x*0)", "(x/(x+1))" or "(x%1)".
The compiler is within its rights to substitute zero for all of
these expressions, so that subsequent accesses no longer depend
on the rcu_dereference(), again possibly resulting in bugs due
Expand Down
29 changes: 19 additions & 10 deletions Documentation/RCU/stallwarn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT
Stall-warning messages may be enabled and disabled completely via
/sys/module/rcupdate/parameters/rcu_cpu_stall_suppress.

CONFIG_RCU_CPU_STALL_INFO

This kernel configuration parameter causes the stall warning to
print out additional per-CPU diagnostic information, including
information on scheduling-clock ticks and RCU's idle-CPU tracking.

RCU_STALL_DELAY_DELTA

Although the lockdep facility is extremely useful, it does add
Expand Down Expand Up @@ -101,15 +95,13 @@ interact. Please note that it is not possible to entirely eliminate this
sort of false positive without resorting to things like stop_machine(),
which is overkill for this sort of problem.

If the CONFIG_RCU_CPU_STALL_INFO kernel configuration parameter is set,
more information is printed with the stall-warning message, for example:
Recent kernels will print a long form of the stall-warning message:

INFO: rcu_preempt detected stall on CPU
0: (63959 ticks this GP) idle=241/3fffffffffffffff/0 softirq=82/543
(t=65000 jiffies)

In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is
printed:
In kernels with CONFIG_RCU_FAST_NO_HZ, more information is printed:

INFO: rcu_preempt detected stall on CPU
0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 softirq=82/543 last_accelerate: a345/d342 nonlazy_posted: 25 .D
Expand Down Expand Up @@ -171,6 +163,23 @@ message will be about three times the interval between the beginning
of the stall and the first message.


Stall Warnings for Expedited Grace Periods

If an expedited grace period detects a stall, it will place a message
like the following in dmesg:

INFO: rcu_sched detected expedited stalls on CPUs: { 1 2 6 } 26009 jiffies s: 1043

This indicates that CPUs 1, 2, and 6 have failed to respond to a
reschedule IPI, that the expedited grace period has been going on for
26,009 jiffies, and that the expedited grace-period sequence counter is
1043. The fact that this last value is odd indicates that an expedited
grace period is in flight.

It is entirely possible to see stall warnings from normal and from
expedited grace periods at about the same time from the same run.


What Causes RCU CPU Stall Warnings?

So your kernel printed an RCU CPU stall warning. The next question is
Expand Down
36 changes: 10 additions & 26 deletions Documentation/RCU/trace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,42 +237,26 @@ o "ktl" is the low-order 16 bits (in hexadecimal) of the count of

The output of "cat rcu/rcu_preempt/rcuexp" looks as follows:

s=21872 d=21872 w=0 tf=0 wd1=0 wd2=0 n=0 sc=21872 dt=21872 dl=0 dx=21872
s=21872 wd0=0 wd1=0 wd2=0 wd3=5 n=0 enq=0 sc=21872

These fields are as follows:

o "s" is the starting sequence number.
o "s" is the sequence number, with an odd number indicating that
an expedited grace period is in progress.

o "d" is the ending sequence number. When the starting and ending
numbers differ, there is an expedited grace period in progress.

o "w" is the number of times that the sequence numbers have been
in danger of wrapping.

o "tf" is the number of times that contention has resulted in a
failure to begin an expedited grace period.

o "wd1" and "wd2" are the number of times that an attempt to
start an expedited grace period found that someone else had
completed an expedited grace period that satisfies the
o "wd0", "wd1", "wd2", and "wd3" are the number of times that an
attempt to start an expedited grace period found that someone
else had completed an expedited grace period that satisfies the
attempted request. "Our work is done."

o "n" is number of times that contention was so great that
the request was demoted from an expedited grace period to
a normal grace period.
o "n" is number of times that a concurrent CPU-hotplug operation
forced a fallback to a normal grace period.

o "enq" is the number of quiescent states still outstanding.

o "sc" is the number of times that the attempt to start a
new expedited grace period succeeded.

o "dt" is the number of times that we attempted to update
the "d" counter.

o "dl" is the number of times that we failed to update the "d"
counter.

o "dx" is the number of times that we succeeded in updating
the "d" counter.


The output of "cat rcu/rcu_preempt/rcugp" looks as follows:

Expand Down
2 changes: 1 addition & 1 deletion Documentation/RCU/whatisRCU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ All: lockdep-checked RCU-protected pointer access

rcu_access_pointer
rcu_dereference_raw
rcu_lockdep_assert
RCU_LOCKDEP_WARN
rcu_sleep_check
RCU_NONIDLE

Expand Down
35 changes: 24 additions & 11 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3135,22 +3135,35 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
in a given burst of a callback-flood test.

rcutorture.fqs_duration= [KNL]
Set duration of force_quiescent_state bursts.
Set duration of force_quiescent_state bursts
in microseconds.

rcutorture.fqs_holdoff= [KNL]
Set holdoff time within force_quiescent_state bursts.
Set holdoff time within force_quiescent_state bursts
in microseconds.

rcutorture.fqs_stutter= [KNL]
Set wait time between force_quiescent_state bursts.
Set wait time between force_quiescent_state bursts
in seconds.

rcutorture.gp_cond= [KNL]
Use conditional/asynchronous update-side
primitives, if available.

rcutorture.gp_exp= [KNL]
Use expedited update-side primitives.
Use expedited update-side primitives, if available.

rcutorture.gp_normal= [KNL]
Use normal (non-expedited) update-side primitives.
If both gp_exp and gp_normal are set, do both.
If neither gp_exp nor gp_normal are set, still
do both.
Use normal (non-expedited) asynchronous
update-side primitives, if available.

rcutorture.gp_sync= [KNL]
Use normal (non-expedited) synchronous
update-side primitives, if available. If all
of rcutorture.gp_cond=, rcutorture.gp_exp=,
rcutorture.gp_normal=, and rcutorture.gp_sync=
are zero, rcutorture acts as if is interpreted
they are all non-zero.

rcutorture.n_barrier_cbs= [KNL]
Set callbacks/threads for rcu_barrier() testing.
Expand All @@ -3177,9 +3190,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Set time (s) between CPU-hotplug operations, or
zero to disable CPU-hotplug testing.

rcutorture.torture_runnable= [BOOT]
Start rcutorture running at boot time.

rcutorture.shuffle_interval= [KNL]
Set task-shuffle interval (s). Shuffling tasks
allows some CPUs to go into dyntick-idle mode
Expand Down Expand Up @@ -3220,6 +3230,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Test RCU's dyntick-idle handling. See also the
rcutorture.shuffle_interval parameter.

rcutorture.torture_runnable= [BOOT]
Start rcutorture running at boot time.

rcutorture.torture_type= [KNL]
Specify the RCU implementation to test.

Expand Down
Loading

0 comments on commit 9b9412d

Please sign in to comment.