Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1561241 > unrolled thread
| Started by | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| First post | 2017-01-18 04:00 +0100 |
| Last post | 2017-01-24 23:00 +0100 |
| Articles | 20 on this page of 41 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH tip/core/rcu 0/20] Miscellaneous fixes for 4.11 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:00 +0100
[PATCH v2 tip/core/rcu 01/18] rcu: update: Make RCU_EXPEDITE_BOOT be the default "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:00 +0100
[PATCH v2 tip/core/rcu 14/18] rcu: Enable RCU tracepoints by default to aid in debugging "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:00 +0100
[PATCH v2 tip/core/rcu 08/18] rcu: Remove short-term CPU kicking "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:00 +0100
Re: [PATCH v2 tip/core/rcu 08/18] rcu: Remove short-term CPU kicking Josh Triplett <josh@joshtriplett.org> - 2017-01-21 21:50 +0100
Re: [PATCH v2 tip/core/rcu 08/18] rcu: Remove short-term CPU kicking "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-23 20:40 +0100
[PATCH v2 tip/core/rcu 11/18] rcu: Don't wake rcuc/X kthreads on NOCB CPUs "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:10 +0100
[PATCH v2 tip/core/rcu 15/18] rcu: Fix comment in rcu_organize_nocb_kthreads() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:30 +0100
[PATCH v2 tip/core/rcu 06/18] rcu: Remove unused but set variable "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:40 +0100
[PATCH v2 tip/core/rcu 13/18] rcu: Make rcu_cpu_starting() use its "cpu" argument "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 04:40 +0100
[PATCH v2 tip/core/rcu 18/18] rcu: Add lockdep checks to synchronous expedited primitives "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 05:00 +0100
[PATCH v2 tip/core/rcu 03/18] Fix: Disable sys_membarrier when nohz_full is enabled "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 05:40 +0100
[PATCH v2 tip/core/rcu 12/18] rcu: Add comment headers to expedited-grace-period counter functions "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 05:50 +0100
[PATCH v2 tip/core/rcu 17/18] rcu: Eliminate unused expedited_normal counter "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 05:50 +0100
[PATCH v2 tip/core/rcu 16/18] llist: Clarify comments about when locking is needed "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 06:20 +0100
[PATCH v2 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 06:40 +0100
Re: [PATCH v2 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err Josh Triplett <josh@joshtriplett.org> - 2017-01-21 21:50 +0100
Re: [PATCH v2 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-23 20:40 +0100
Re: [PATCH v2 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err Josh Triplett <josh@joshtriplett.org> - 2017-01-23 23:40 +0100
Re: [PATCH v2 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 01:20 +0100
[PATCH v2 tip/core/rcu 05/18] rcu: Remove unneeded rcu_process_callbacks() declarations "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 07:10 +0100
[PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-18 07:10 +0100
Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking Josh Triplett <josh@joshtriplett.org> - 2017-01-21 21:50 +0100
Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-23 20:40 +0100
Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking Josh Triplett <josh@joshtriplett.org> - 2017-01-23 21:30 +0100
Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking Josh Triplett <josh@joshtriplett.org> - 2017-01-21 21:50 +0100
[PATCH v3 tip/core/rcu 0/18] Miscellaneous fixes for 4.11 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 17/18] rcu: Eliminate unused expedited_normal counter "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 04/18] rcu: Only dump stalled-tasks stacks if there was a real stall "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 16/18] llist: Clarify comments about when locking is needed "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 06/18] rcu: Remove unused but set variable "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 05/18] rcu: Remove unneeded rcu_process_callbacks() declarations "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 12/18] rcu: Add comment headers to expedited-grace-period counter functions "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 14/18] rcu: Enable RCU tracepoints by default to aid in debugging "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 07/18] rcu: Add long-term CPU kicking "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 18/18] rcu: Add lockdep checks to synchronous expedited primitives "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 11/18] rcu: Don't wake rcuc/X kthreads on NOCB CPUs "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 13/18] rcu: Make rcu_cpu_starting() use its "cpu" argument "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 10/18] rcu: Re-enable TASKS_RCU for User Mode Linux "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
[PATCH v3 tip/core/rcu 15/18] rcu: Fix comment in rcu_organize_nocb_kthreads() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-01-24 23:00 +0100
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-18 07:10 +0100 |
| Subject | [PATCH v2 tip/core/rcu 05/18] rcu: Remove unneeded rcu_process_callbacks() declarations |
| Message-ID | <t0RBv-oA-13@gated-at.bofh.it> |
| In reply to | #1561241 |
The declarations of __rcu_process_callbacks() and rcu_process_callbacks() are not needed, as the definition of both of these functions appear before any uses. This commit therefore removes both declarations. Reported-by: "Ahmed, Iftekhar" <ahmedi@oregonstate.edu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- kernel/rcu/tiny.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index b23a4d076f3d..fa6a48d3917b 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c @@ -41,8 +41,6 @@ /* Forward declarations for tiny_plugin.h. */ struct rcu_ctrlblk; -static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); -static void rcu_process_callbacks(struct softirq_action *unused); static void __call_rcu(struct rcu_head *head, rcu_callback_t func, struct rcu_ctrlblk *rcp); -- 2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-18 07:10 +0100 |
| Subject | [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t0RBw-oA-27@gated-at.bofh.it> |
| In reply to | #1561241 |
Commit d2db185bfee8 ("rcu: Remove short-term CPU kicking") removed
frequent calls to resched_cpu(), which means that the only time
resched_cpu() is invoked is after an RCU CPU stall warning. Although
this is good from an avoid-IPIs perspective, we should try to break
things loose -before- splatting. This commit therefore starts invoking
resched_cpu() for each holdout at each force-quiescent-state interval
that is more than halfway through the stall-warning interval.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcu/tree.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 83bf054e194e..0e61b62e3f4a 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) ||
ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
+ /*
+ * If more than halfway to RCU CPU stall-warning time, do
+ * a resched_cpu() to try to loosen things up a bit.
+ */
+ if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2)
+ resched_cpu(rdp->cpu);
return 0;
}
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | Josh Triplett <josh@joshtriplett.org> |
|---|---|
| Date | 2017-01-21 21:50 +0100 |
| Subject | Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t2aLM-8sX-13@gated-at.bofh.it> |
| In reply to | #1561304 |
On Tue, Jan 17, 2017 at 06:53:46PM -0800, Paul E. McKenney wrote:
> Commit d2db185bfee8 ("rcu: Remove short-term CPU kicking") removed
> frequent calls to resched_cpu(), which means that the only time
> resched_cpu() is invoked is after an RCU CPU stall warning. Although
> this is good from an avoid-IPIs perspective, we should try to break
> things loose -before- splatting. This commit therefore starts invoking
> resched_cpu() for each holdout at each force-quiescent-state interval
> that is more than halfway through the stall-warning interval.
Just realized an issue with this commit message: you're referring to
what now appears as patch 8 in the past tense as something already done,
and with a commit ID that probably doesn't work anymore. You need to
rephrase this to describe how it leads to a *subsequent* change rather
than fixing something already changed.
With the commit message fixed:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
> kernel/rcu/tree.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 83bf054e194e..0e61b62e3f4a 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
> rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) ||
> ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
> + /*
> + * If more than halfway to RCU CPU stall-warning time, do
> + * a resched_cpu() to try to loosen things up a bit.
> + */
> + if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2)
> + resched_cpu(rdp->cpu);
>
> return 0;
> }
> --
> 2.5.2
>
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-23 20:40 +0100 |
| Subject | Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t2SD8-237-23@gated-at.bofh.it> |
| In reply to | #1564241 |
On Sat, Jan 21, 2017 at 12:42:55PM -0800, Josh Triplett wrote:
> On Tue, Jan 17, 2017 at 06:53:46PM -0800, Paul E. McKenney wrote:
> > Commit d2db185bfee8 ("rcu: Remove short-term CPU kicking") removed
> > frequent calls to resched_cpu(), which means that the only time
> > resched_cpu() is invoked is after an RCU CPU stall warning. Although
> > this is good from an avoid-IPIs perspective, we should try to break
> > things loose -before- splatting. This commit therefore starts invoking
> > resched_cpu() for each holdout at each force-quiescent-state interval
> > that is more than halfway through the stall-warning interval.
>
> Just realized an issue with this commit message: you're referring to
> what now appears as patch 8 in the past tense as something already done,
> and with a commit ID that probably doesn't work anymore. You need to
> rephrase this to describe how it leads to a *subsequent* change rather
> than fixing something already changed.
>
> With the commit message fixed:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Good point! It now reads as follows:
------------------------------------------------------------------------
This commit prepares for the removal of short-term CPU kicking (in a
subsequent commit). It does so by starting to invoke resched_cpu()
for each holdout at each force-quiescent-state interval that is more
than halfway through the stall-warning interval.
------------------------------------------------------------------------
Does that work?
Thanx, Paul
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
>
>
> > ---
> > kernel/rcu/tree.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index 83bf054e194e..0e61b62e3f4a 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
> > rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) ||
> > ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> > resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
> > + /*
> > + * If more than halfway to RCU CPU stall-warning time, do
> > + * a resched_cpu() to try to loosen things up a bit.
> > + */
> > + if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2)
> > + resched_cpu(rdp->cpu);
> >
> > return 0;
> > }
> > --
> > 2.5.2
> >
>
[toc] | [prev] | [next] | [standalone]
| From | Josh Triplett <josh@joshtriplett.org> |
|---|---|
| Date | 2017-01-23 21:30 +0100 |
| Subject | Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t2Tpw-2Be-41@gated-at.bofh.it> |
| In reply to | #1565259 |
On Mon, Jan 23, 2017 at 11:34:45AM -0800, Paul E. McKenney wrote:
> On Sat, Jan 21, 2017 at 12:42:55PM -0800, Josh Triplett wrote:
> > On Tue, Jan 17, 2017 at 06:53:46PM -0800, Paul E. McKenney wrote:
> > > Commit d2db185bfee8 ("rcu: Remove short-term CPU kicking") removed
> > > frequent calls to resched_cpu(), which means that the only time
> > > resched_cpu() is invoked is after an RCU CPU stall warning. Although
> > > this is good from an avoid-IPIs perspective, we should try to break
> > > things loose -before- splatting. This commit therefore starts invoking
> > > resched_cpu() for each holdout at each force-quiescent-state interval
> > > that is more than halfway through the stall-warning interval.
> >
> > Just realized an issue with this commit message: you're referring to
> > what now appears as patch 8 in the past tense as something already done,
> > and with a commit ID that probably doesn't work anymore. You need to
> > rephrase this to describe how it leads to a *subsequent* change rather
> > than fixing something already changed.
> >
> > With the commit message fixed:
> > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
>
> Good point! It now reads as follows:
>
> ------------------------------------------------------------------------
> This commit prepares for the removal of short-term CPU kicking (in a
> subsequent commit). It does so by starting to invoke resched_cpu()
> for each holdout at each force-quiescent-state interval that is more
> than halfway through the stall-warning interval.
> ------------------------------------------------------------------------
>
> Does that work?
Looks good to me.
> Thanx, Paul
>
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> >
> >
> > > ---
> > > kernel/rcu/tree.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > > index 83bf054e194e..0e61b62e3f4a 100644
> > > --- a/kernel/rcu/tree.c
> > > +++ b/kernel/rcu/tree.c
> > > @@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
> > > rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) ||
> > > ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> > > resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
> > > + /*
> > > + * If more than halfway to RCU CPU stall-warning time, do
> > > + * a resched_cpu() to try to loosen things up a bit.
> > > + */
> > > + if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2)
> > > + resched_cpu(rdp->cpu);
> > >
> > > return 0;
> > > }
> > > --
> > > 2.5.2
> > >
> >
>
[toc] | [prev] | [next] | [standalone]
| From | Josh Triplett <josh@joshtriplett.org> |
|---|---|
| Date | 2017-01-21 21:50 +0100 |
| Subject | Re: [PATCH v2 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t2aLM-8sX-27@gated-at.bofh.it> |
| In reply to | #1561304 |
On Tue, Jan 17, 2017 at 06:53:46PM -0800, Paul E. McKenney wrote:
> Commit d2db185bfee8 ("rcu: Remove short-term CPU kicking") removed
> frequent calls to resched_cpu(), which means that the only time
> resched_cpu() is invoked is after an RCU CPU stall warning. Although
> this is good from an avoid-IPIs perspective, we should try to break
> things loose -before- splatting. This commit therefore starts invoking
> resched_cpu() for each holdout at each force-quiescent-state interval
> that is more than halfway through the stall-warning interval.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> kernel/rcu/tree.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 83bf054e194e..0e61b62e3f4a 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
> rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) ||
> ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> resched_cpu(rdp->cpu); /* Force CPU into scheduler. */
> + /*
> + * If more than halfway to RCU CPU stall-warning time, do
> + * a resched_cpu() to try to loosen things up a bit.
> + */
> + if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2)
> + resched_cpu(rdp->cpu);
>
> return 0;
> }
> --
> 2.5.2
>
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 0/18] Miscellaneous fixes for 4.11 |
| Message-ID | <t3hi9-1ka-7@gated-at.bofh.it> |
| In reply to | #1561241 |
Hello! This series provides v3 of miscellaneous fixes: 1. Make RCU_EXPEDITE_BOOT be the default in order to speed up boot, courtesy of Sebastian Andrzej Siewior. 2. Make RCU suspicious-access lockdep splats use pr_err(). 3. Disable sys_membarrier when nohz_full is enabled, courtesy of Mathieu Desnoyers. 4. Only dump stalled-tasks stacks if there was a real stall, courtesy of Byungchul Park. 5. Remove unneeded rcu_process_callbacks() declarations. 6. Remove unused but set "mask" variable, courtesy of Tobias Klauser. 7. Add long-term CPU kicking. 8. Remove short-term CPU kicking. 9. Once again use NMI-based stack traces in stall warnings. 10. Re-enable TASKS_RCU for User Mode Linux. 11. Don't wake rcuc/X kthreads on NOCB CPUs. 12. Add comment headers to expedited-grace-period counter functions. 13. Make rcu_cpu_starting() use its "cpu" argument. 14. Enable RCU tracepoints by default to aid in debugging, courtesy of Matt Fleming. 15. Fix comment in rcu_organize_nocb_kthreads(), which no longer spawns kthreads. 16. Clarify comments about when llist locking is needed, courtesy of Joel Fernandes. 17. Eliminate unused expedited_normal counter. 18. Add lockdep checks to synchronous expedited primitives. Changes since v2: o Fixed lockdep message as noted by Josh Triplett. Changes since v1: o Reverse the order of patches 7 and 8. o Defer the patch adding tests for trivial grace periods. o Defer the patch making cond_resched() provide RCU quiescent states. o Apply other feedback from Josh Triplett, Peter Zijlstra, and Michal Hocko. Thanx, Paul ------------------------------------------------------------------------ Documentation/RCU/trace.txt | 5 +---- include/linux/llist.h | 37 +++++++++++++++++++++---------------- init/Kconfig | 14 -------------- kernel/locking/lockdep.c | 12 ++++++------ kernel/membarrier.c | 4 ++++ kernel/rcu/tiny.c | 2 -- kernel/rcu/tree.c | 35 ++++++++++++++++++----------------- kernel/rcu/tree.h | 1 - kernel/rcu/tree_exp.h | 28 +++++++++++++++++++++++++++- kernel/rcu/tree_plugin.h | 5 +++-- kernel/rcu/tree_trace.c | 3 +-- kernel/rcu/update.c | 6 ++---- lib/Kconfig.debug | 1 + 13 files changed, 84 insertions(+), 69 deletions(-)
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 17/18] rcu: Eliminate unused expedited_normal counter |
| Message-ID | <t3hia-1ka-25@gated-at.bofh.it> |
| In reply to | #1566174 |
Expedited grace periods no longer fall back to normal grace periods
in response to lock contention, given that expedited grace periods
now use the rcu_node tree so as to avoid contention. This commit
therfore removes the expedited_normal counter.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
Documentation/RCU/trace.txt | 5 +----
kernel/rcu/tree.h | 1 -
kernel/rcu/tree_trace.c | 3 +--
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index 00a3a38b375a..6549012033f9 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -237,7 +237,7 @@ 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 wd1=0 wd2=0 wd3=5 n=0 enq=0 sc=21872
+s=21872 wd1=0 wd2=0 wd3=5 enq=0 sc=21872
These fields are as follows:
@@ -249,9 +249,6 @@ o "wd1", "wd2", and "wd3" are the number of times that an attempt
completed an expedited grace period that satisfies the attempted
request. "Our work is done."
-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
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index fe98dd24adf8..8f750dffb0dd 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -521,7 +521,6 @@ struct rcu_state {
struct mutex exp_mutex; /* Serialize expedited GP. */
struct mutex exp_wake_mutex; /* Serialize wakeup. */
unsigned long expedited_sequence; /* Take a ticket. */
- atomic_long_t expedited_normal; /* # fallbacks to normal. */
atomic_t expedited_need_qs; /* # CPUs left to check in. */
struct swait_queue_head expedited_wq; /* Wait for check-ins. */
int ncpus_snap; /* # CPUs seen last time. */
diff --git a/kernel/rcu/tree_trace.c b/kernel/rcu/tree_trace.c
index b1f28972872c..2e932cd1da31 100644
--- a/kernel/rcu/tree_trace.c
+++ b/kernel/rcu/tree_trace.c
@@ -194,9 +194,8 @@ static int show_rcuexp(struct seq_file *m, void *v)
s2 += atomic_long_read(&rdp->exp_workdone2);
s3 += atomic_long_read(&rdp->exp_workdone3);
}
- seq_printf(m, "s=%lu wd0=%lu wd1=%lu wd2=%lu wd3=%lu n=%lu enq=%d sc=%lu\n",
+ seq_printf(m, "s=%lu wd0=%lu wd1=%lu wd2=%lu wd3=%lu enq=%d sc=%lu\n",
rsp->expedited_sequence, s0, s1, s2, s3,
- atomic_long_read(&rsp->expedited_normal),
atomic_read(&rsp->expedited_need_qs),
rsp->expedited_sequence / 2);
return 0;
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 04/18] rcu: Only dump stalled-tasks stacks if there was a real stall |
| Message-ID | <t3hia-1ka-31@gated-at.bofh.it> |
| In reply to | #1566174 |
From: Byungchul Park <byungchul.park@lge.com>
The print_other_cpu_stall() function currently unconditionally invokes
rcu_print_detail_task_stall(). This is OK because if there was a stall
sufficient to cause print_other_cpu_stall() to be invoked, that stall
is very likely to persist through the entire print_other_cpu_stall()
execution. However, if the stall did not persist, the variable ndetected
will be zero, and that variable is already tested in an "if" statement.
Therefore, this commit moves the call to rcu_print_detail_task_stall()
under that pre-existing "if" to improve readability, with a very rare
reduction in overhead.
Signed-off-by: Byungchul Park <byungchul.park@lge.com>
[ paulmck: Reworked commit log. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index cb4e2056ccf3..6232d2f9a84e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1379,6 +1379,9 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
(long)rsp->gpnum, (long)rsp->completed, totqlen);
if (ndetected) {
rcu_dump_cpu_stacks(rsp);
+
+ /* Complain about tasks blocking the grace period. */
+ rcu_print_detail_task_stall(rsp);
} else {
if (READ_ONCE(rsp->gpnum) != gpnum ||
READ_ONCE(rsp->completed) == gpnum) {
@@ -1395,9 +1398,6 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
}
}
- /* Complain about tasks blocking the grace period. */
- rcu_print_detail_task_stall(rsp);
-
rcu_check_gp_kthread_starvation(rsp);
panic_on_rcu_stall();
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 16/18] llist: Clarify comments about when locking is needed |
| Message-ID | <t3hib-1ka-45@gated-at.bofh.it> |
| In reply to | #1566174 |
From: Joel Fernandes <joelaf@google.com> llist.h comments are confusing about when locking is needed versus when it isn't. Clarify these comments by being more descriptive about why locking is needed for llist_del_first. Cc: Ingo Molnar <mingo@kernel.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Huang Ying <ying.huang@intel.com> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Joel Fernandes <joelaf@google.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- include/linux/llist.h | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/include/linux/llist.h b/include/linux/llist.h index fd4ca0b4fe0f..171baa90f6f6 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -3,28 +3,33 @@ /* * Lock-less NULL terminated single linked list * - * If there are multiple producers and multiple consumers, llist_add - * can be used in producers and llist_del_all can be used in - * consumers. They can work simultaneously without lock. But - * llist_del_first can not be used here. Because llist_del_first - * depends on list->first->next does not changed if list->first is not - * changed during its operation, but llist_del_first, llist_add, - * llist_add (or llist_del_all, llist_add, llist_add) sequence in - * another consumer may violate that. - * - * If there are multiple producers and one consumer, llist_add can be - * used in producers and llist_del_all or llist_del_first can be used - * in the consumer. - * - * This can be summarized as follow: + * Cases where locking is not needed: + * If there are multiple producers and multiple consumers, llist_add can be + * used in producers and llist_del_all can be used in consumers simultaneously + * without locking. Also a single consumer can use llist_del_first while + * multiple producers simultaneously use llist_add, without any locking. + * + * Cases where locking is needed: + * If we have multiple consumers with llist_del_first used in one consumer, and + * llist_del_first or llist_del_all used in other consumers, then a lock is + * needed. This is because llist_del_first depends on list->first->next not + * changing, but without lock protection, there's no way to be sure about that + * if a preemption happens in the middle of the delete operation and on being + * preempted back, the list->first is the same as before causing the cmpxchg in + * llist_del_first to succeed. For example, while a llist_del_first operation + * is in progress in one consumer, then a llist_del_first, llist_add, + * llist_add (or llist_del_all, llist_add, llist_add) sequence in another + * consumer may cause violations. + * + * This can be summarized as follows: * * | add | del_first | del_all * add | - | - | - * del_first | | L | L * del_all | | | - * - * Where "-" stands for no lock is needed, while "L" stands for lock - * is needed. + * Where, a particular row's operation can happen concurrently with a column's + * operation, with "-" being no lock needed, while "L" being lock is needed. * * The list entries deleted via llist_del_all can be traversed with * traversing function such as llist_for_each etc. But the list -- 2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 06/18] rcu: Remove unused but set variable |
| Message-ID | <t3hia-1ka-35@gated-at.bofh.it> |
| In reply to | #1566174 |
From: Tobias Klauser <tklauser@distanz.ch>
Since commit 7ec99de36f40 ("rcu: Provide exact CPU-online tracking for
RCU"), the variable mask in rcu_init_percpu_data is set but no longer
used. Remove it to fix the following warning when building with 'W=1':
kernel/rcu/tree.c: In function ‘rcu_init_percpu_data’:
kernel/rcu/tree.c:3765:16: warning: variable ‘mask’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 6232d2f9a84e..83bf054e194e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3765,7 +3765,6 @@ static void
rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
{
unsigned long flags;
- unsigned long mask;
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rcu_get_root(rsp);
@@ -3788,7 +3787,6 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
* of the next grace period.
*/
rnp = rdp->mynode;
- mask = rdp->grpmask;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
if (!rdp->beenonline)
WRITE_ONCE(rsp->ncpus, READ_ONCE(rsp->ncpus) + 1);
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 05/18] rcu: Remove unneeded rcu_process_callbacks() declarations |
| Message-ID | <t3hib-1ka-47@gated-at.bofh.it> |
| In reply to | #1566174 |
The declarations of __rcu_process_callbacks() and rcu_process_callbacks() are not needed, as the definition of both of these functions appear before any uses. This commit therefore removes both declarations. Reported-by: "Ahmed, Iftekhar" <ahmedi@oregonstate.edu> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- kernel/rcu/tiny.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index b23a4d076f3d..fa6a48d3917b 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c @@ -41,8 +41,6 @@ /* Forward declarations for tiny_plugin.h. */ struct rcu_ctrlblk; -static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); -static void rcu_process_callbacks(struct softirq_action *unused); static void __call_rcu(struct rcu_head *head, rcu_callback_t func, struct rcu_ctrlblk *rcp); -- 2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 02/18] lockdep: Make RCU suspicious-access splats use pr_err |
| Message-ID | <t3hib-1ka-43@gated-at.bofh.it> |
| In reply to | #1566174 |
This commit switches RCU suspicious-access splats use pr_err()
instead of the current INFO printk()s. This change makes it easier
to automatically classify splats.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/locking/lockdep.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 7c38f8f3d97b..d9a698e8458f 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4412,13 +4412,13 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
#endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */
/* Note: the following can be executed concurrently, so be careful. */
printk("\n");
- printk("===============================\n");
- printk("[ INFO: suspicious RCU usage. ]\n");
+ pr_err("===============================\n");
+ pr_err("[ ERR: suspicious RCU usage. ]\n");
print_kernel_ident();
- printk("-------------------------------\n");
- printk("%s:%d %s!\n", file, line, s);
- printk("\nother info that might help us debug this:\n\n");
- printk("\n%srcu_scheduler_active = %d, debug_locks = %d\n",
+ pr_err("-------------------------------\n");
+ pr_err("%s:%d %s!\n", file, line, s);
+ pr_err("\nother info that might help us debug this:\n\n");
+ pr_err("\n%srcu_scheduler_active = %d, debug_locks = %d\n",
!rcu_lockdep_current_cpu_online()
? "RCU used illegally from offline CPU!\n"
: !rcu_is_watching()
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 12/18] rcu: Add comment headers to expedited-grace-period counter functions |
| Message-ID | <t3hib-1ka-59@gated-at.bofh.it> |
| In reply to | #1566174 |
These functions (rcu_exp_gp_seq_start(), rcu_exp_gp_seq_end(),
rcu_exp_gp_seq_snap(), and rcu_exp_gp_seq_done() seemed too obvious
to comment when written, but not so much when being documented.
This commit therefore adds header comments to each of them.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree_exp.h | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index e59e1849b89a..303df97bbfc5 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -20,16 +20,26 @@
* Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
*/
-/* Wrapper functions for expedited grace periods. */
+/*
+ * Record the start of an expedited grace period.
+ */
static void rcu_exp_gp_seq_start(struct rcu_state *rsp)
{
rcu_seq_start(&rsp->expedited_sequence);
}
+
+/*
+ * Record the end of an expedited grace period.
+ */
static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
{
rcu_seq_end(&rsp->expedited_sequence);
smp_mb(); /* Ensure that consecutive grace periods serialize. */
}
+
+/*
+ * Take a snapshot of the expedited-grace-period counter.
+ */
static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
{
unsigned long s;
@@ -39,6 +49,12 @@ static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
return s;
}
+
+/*
+ * Given a counter snapshot from rcu_exp_gp_seq_snap(), return true
+ * if a full expedited grace period has elapsed since that snapshot
+ * was taken.
+ */
static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
{
return rcu_seq_done(&rsp->expedited_sequence, s);
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 14/18] rcu: Enable RCU tracepoints by default to aid in debugging |
| Message-ID | <t3hib-1ka-51@gated-at.bofh.it> |
| In reply to | #1566174 |
From: Matt Fleming <matt@codeblueprint.co.uk> While debugging a performance issue I needed to understand why RCU sofitrqs were firing so frequently. Unfortunately, the RCU callback tracepoints are hidden behind CONFIG_RCU_TRACE which defaults to off in the upstream kernel and is likely to also be disabled in enterprise distribution configs. Enable it by default for CONFIG_TREE_RCU. However, we must keep it disabled for tiny RCU, because it would otherwise pull in a large amount of code that would make tiny RCU less than tiny. I ran some file system metadata intensive workloads (git checkout, FS-Mark) on a variety of machines with this patch and saw no detectable change in performance. Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- lib/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b06848a104e6..5655bd95919a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1450,6 +1450,7 @@ config RCU_CPU_STALL_TIMEOUT config RCU_TRACE bool "Enable tracing for RCU" depends on DEBUG_KERNEL + default y if TREE_RCU select TRACE_CLOCK help This option provides tracing in RCU which presents stats -- 2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 07/18] rcu: Add long-term CPU kicking |
| Message-ID | <t3hib-1ka-53@gated-at.bofh.it> |
| In reply to | #1566174 |
This commit prepares for the removal of short-term CPU kicking (in a subsequent commit). It does so by starting to invoke resched_cpu() for each holdout at each force-quiescent-state interval that is more than halfway through the stall-warning interval. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- kernel/rcu/tree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 83bf054e194e..0e61b62e3f4a 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1225,6 +1225,12 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp, rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) || ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs)) resched_cpu(rdp->cpu); /* Force CPU into scheduler. */ + /* + * If more than halfway to RCU CPU stall-warning time, do + * a resched_cpu() to try to loosen things up a bit. + */ + if (jiffies - rdp->rsp->gp_start > rcu_jiffies_till_stall_check() / 2) + resched_cpu(rdp->cpu); return 0; } -- 2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 18/18] rcu: Add lockdep checks to synchronous expedited primitives |
| Message-ID | <t3hic-1ka-63@gated-at.bofh.it> |
| In reply to | #1566174 |
The non-expedited synchronize_*rcu() primitives have lockdep checks, but
their expedited counterparts lack these checks. This commit therefore
adds these checks to the expedited synchronize_*rcu() primitives.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree_exp.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 303df97bbfc5..f3e214898e3a 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -639,6 +639,11 @@ void synchronize_sched_expedited(void)
{
struct rcu_state *rsp = &rcu_sched_state;
+ RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
+ lock_is_held(&rcu_lock_map) ||
+ lock_is_held(&rcu_sched_lock_map),
+ "Illegal synchronize_sched_expedited() in RCU read-side critical section");
+
/* If only one CPU, this is automatically a grace period. */
if (rcu_blocking_is_gp())
return;
@@ -708,6 +713,11 @@ void synchronize_rcu_expedited(void)
{
struct rcu_state *rsp = rcu_state_p;
+ RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
+ lock_is_held(&rcu_lock_map) ||
+ lock_is_held(&rcu_sched_lock_map),
+ "Illegal synchronize_rcu_expedited() in RCU read-side critical section");
+
if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
return;
_synchronize_rcu_expedited(rsp, sync_rcu_exp_handler);
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 11/18] rcu: Don't wake rcuc/X kthreads on NOCB CPUs |
| Message-ID | <t3hic-1ka-65@gated-at.bofh.it> |
| In reply to | #1566174 |
Chris Friesen notice that rcuc/X kthreads were consuming CPU even on
NOCB CPUs. This makes no sense because the only purpose or these
kthreads is to invoke normal (non-offloaded) callbacks, of which there
will never be any on NOCB CPUs. This problem was due to a bug in
cpu_has_callbacks_ready_to_invoke(), which should have been checking
->nxttail[RCU_NEXT_TAIL] for NULL, but which was instead (incorrectly)
checking ->nxttail[RCU_DONE_TAIL]. Because ->nxttail[RCU_DONE_TAIL] is
never NULL, the only effect is to cause the rcuc/X kthread to execute
when it should not do so.
This commit therefore checks ->nxttail[RCU_NEXT_TAIL], which is NULL
for NOCB CPUs.
Reported-by: Chris Friesen <chris.friesen@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index d7b63b88434b..be2301238a23 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -611,7 +611,7 @@ static int
cpu_has_callbacks_ready_to_invoke(struct rcu_data *rdp)
{
return &rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL] &&
- rdp->nxttail[RCU_DONE_TAIL] != NULL;
+ rdp->nxttail[RCU_NEXT_TAIL] != NULL;
}
/*
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 13/18] rcu: Make rcu_cpu_starting() use its "cpu" argument |
| Message-ID | <t3hib-1ka-55@gated-at.bofh.it> |
| In reply to | #1566174 |
The rcu_cpu_starting() function uses this_cpu_ptr() to locate the
incoming CPU's rcu_data structure. This works for the boot CPU and for
all CPUs onlined after rcu_init() executes (during very early boot).
Currently, this is the full set of CPUs, so all is well. But if
anyone ever parallelizes boot before rcu_init() time, it will fail.
This commit therefore substitutes the rcu_cpu_starting() function's
this_cpu_pointer() for per_cpu_ptr(), future-proofing the code and
(arguably) improving readability.
This commit inadvertently fixes a latent bug: If there ever had been
more than just the boot CPU online at rcu_init() time, the old code
would not initialize the non-boot CPUs, but rather would repeatedly
initialize the boot CPU.
Reported-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index be2301238a23..a4b4762442bb 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3873,7 +3873,7 @@ void rcu_cpu_starting(unsigned int cpu)
struct rcu_state *rsp;
for_each_rcu_flavor(rsp) {
- rdp = this_cpu_ptr(rsp->rda);
+ rdp = per_cpu_ptr(rsp->rda, cpu);
rnp = rdp->mynode;
mask = rdp->grpmask;
raw_spin_lock_irqsave_rcu_node(rnp, flags);
--
2.5.2
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 23:00 +0100 |
| Subject | [PATCH v3 tip/core/rcu 10/18] rcu: Re-enable TASKS_RCU for User Mode Linux |
| Message-ID | <t3hic-1ka-69@gated-at.bofh.it> |
| In reply to | #1566174 |
Now that User Mode Linux supports arch_irqs_disabled_flags(), this commit re-enables TASKS_RCU for User Mode Linux. Reported-by: Richard Weinberger <richard@nod.at> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> --- init/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index 96e6d56acd50..d0caacb4bc14 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -529,7 +529,6 @@ config SRCU config TASKS_RCU bool default n - depends on !UML select SRCU help This option enables a task-based RCU implementation that uses -- 2.5.2
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | linux.kernel
csiph-web