From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
fengguang.wu@intel.com
Subject: Re: [PATCH] rcuperf: Don't treat gp_exp mis-setting as a WARN
Date: Tue, 24 May 2016 19:26:23 -0700 [thread overview]
Message-ID: <20160525022623.GP4148@linux.vnet.ibm.com> (raw)
In-Reply-To: <1464139533-26551-1-git-send-email-boqun.feng@gmail.com>
On Wed, May 25, 2016 at 09:25:33AM +0800, Boqun Feng wrote:
> 0day found a boot warning triggered in rcu_perf_writer() on !SMP kernel:
>
> WARN_ON(rcu_gp_is_normal() && gp_exp);
>
> , the root cause of which is trying to measure expedited grace
> periods(by setting gp_exp to true by default) when all the grace periods
> are normal(TINY RCU only has normal grace periods).
>
> However, such a mis-setting would only result in failing to measure the
> performance for a specific kind of grace periods, therefore using a
> WARN_ON to check this is a little overkilling. We could handle this
> inside rcuperf module via some error messages to tell users about the
> mis-settings.
>
> Therefore this patch removes the WARN_ON in rcu_perf_writer() and
> handles those checkings in rcu_perf_init() with plain if() code.
>
> Moreover, this patch changes the default value of gp_exp to 1) align
> with rcutorture tests and 2) make the default setting work for all RCU
> implementations by default.
>
> Suggested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> Fixes: http://lkml.kernel.org/r/57411b10.mFvG0+AgcrMXGtcj%fengguang.wu@intel.com
Queued for review and testing, thank you!
Thanx, Paul
> ---
> kernel/rcu/rcuperf.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
> index 3cee0d8393ed..8ce4eecff319 100644
> --- a/kernel/rcu/rcuperf.c
> +++ b/kernel/rcu/rcuperf.c
> @@ -58,7 +58,7 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.vnet.ibm.com>");
> #define VERBOSE_PERFOUT_ERRSTRING(s) \
> do { if (verbose) pr_alert("%s" PERF_FLAG "!!! %s\n", perf_type, s); } while (0)
>
> -torture_param(bool, gp_exp, true, "Use expedited GP wait primitives");
> +torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
> torture_param(int, holdoff, 10, "Holdoff time before test start (s)");
> torture_param(int, nreaders, -1, "Number of RCU reader threads");
> torture_param(int, nwriters, -1, "Number of RCU updater threads");
> @@ -363,8 +363,6 @@ rcu_perf_writer(void *arg)
> u64 *wdpp = writer_durations[me];
>
> VERBOSE_PERFOUT_STRING("rcu_perf_writer task started");
> - WARN_ON(rcu_gp_is_expedited() && !rcu_gp_is_normal() && !gp_exp);
> - WARN_ON(rcu_gp_is_normal() && gp_exp);
> WARN_ON(!wdpp);
> set_cpus_allowed_ptr(current, cpumask_of(me % nr_cpu_ids));
> sp.sched_priority = 1;
> @@ -631,6 +629,16 @@ rcu_perf_init(void)
> firsterr = -ENOMEM;
> goto unwind;
> }
> + if (rcu_gp_is_expedited() && !rcu_gp_is_normal() && !gp_exp) {
> + VERBOSE_PERFOUT_ERRSTRING("All grace periods expedited, no normal ones to measure!");
> + firsterr = -EINVAL;
> + goto unwind;
> + }
> + if (rcu_gp_is_normal() && gp_exp) {
> + VERBOSE_PERFOUT_ERRSTRING("All grace periods normal, no expedited ones to measure!");
> + firsterr = -EINVAL;
> + goto unwind;
> + }
> for (i = 0; i < nrealwriters; i++) {
> writer_durations[i] =
> kcalloc(MAX_MEAS, sizeof(*writer_durations[i]),
> --
> 2.8.2
>
prev parent reply other threads:[~2016-05-25 2:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 1:25 [PATCH] rcuperf: Don't treat gp_exp mis-setting as a WARN Boqun Feng
2016-05-25 2:26 ` Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160525022623.GP4148@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=boqun.feng@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox