From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755512AbcEYAeu (ORCPT ); Tue, 24 May 2016 20:34:50 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:32896 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755476AbcEYAep (ORCPT ); Tue, 24 May 2016 20:34:45 -0400 Date: Wed, 25 May 2016 08:38:20 +0800 From: Boqun Feng To: "Paul E. McKenney" Cc: kernel test robot , LKP , linux-kernel@vger.kernel.org, wfg@linux.intel.com Subject: Re: [rcutorture] 8704baab9b: WARNING: CPU: 0 PID: 30 at kernel/rcu/rcuperf.c:363 rcu_perf_writer Message-ID: <20160525003820.GB21433@insomnia> References: <20160523043517.GA21433@insomnia> <20160524180652.GJ4148@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20160524180652.GJ4148@linux.vnet.ibm.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 24, 2016 at 11:06:52AM -0700, Paul E. McKenney wrote: > On Mon, May 23, 2016 at 12:35:35PM +0800, Boqun Feng wrote: > > On Sun, May 22, 2016 at 08:28:06AM -0700, Paul E. McKenney wrote: > > > On Sun, May 22, 2016 at 02:26:49PM +0800, Boqun Feng wrote: > > > > Hi Paul, > > > >=20 > > > > On Sat, May 21, 2016 at 10:24:22PM -0700, Paul E. McKenney wrote: > > > > > On Sun, May 22, 2016 at 10:36:00AM +0800, kernel test robot wrote: > > > > > > Greetings, > > > > > >=20 > > > > > > 0day kernel testing robot got the below dmesg and the first bad= commit is > > > > > >=20 > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.= git master > > > > > >=20 > > > > > > commit 8704baab9bc848b58c129fed6b591bb84ec02f41 > > > > > > Author: Paul E. McKenney > > > > > > AuthorDate: Thu Dec 31 18:33:22 2015 -0800 > > > > > > Commit: Paul E. McKenney > > > > > > CommitDate: Thu Mar 31 13:37:38 2016 -0700 > > > > > >=20 > > > > > > rcutorture: Add RCU grace-period performance tests > > > > > > =20 > > > > > > This commit adds a new rcuperf module that carries out simp= le performance > > > > > > tests of RCU grace periods. > > > > > > =20 > > > > > > Signed-off-by: Paul E. McKenney > > > > >=20 > > > > > ??? > > > > >=20 > > > > > This commit adds a default-n performance-test module. I don't be= lieve > > > >=20 > > > > I think the robot was using a !SMP && CONFIG_TORTURE_TEST=3Dy && > > > > CONFIG_RCU_PERF_TEST=3Dy configuration ;-) > > > >=20 > > > > > that this would result in boot failures. False bisection? > > > > >=20 > > > >=20 > > > > The code triggering the warning is: > > > >=20 > > > > WARN_ON(rcu_gp_is_normal() && gp_exp); > > > >=20 > > > > , so rcu_gp_is_normal() is true because we are using TINY RCU, more= over > > > > the default value of gp_exp for *rcuperf* is also true (whereas the= one > > > > for rcutorture is false). That's why the warnning was triggered. > > > >=20 > > > > It happened in the boot progress because rcu_perf_writer threads we= re > > > > created and ran via module init function rcu_perf_init(). > > > >=20 > > > > Maybe we'd better change the defaut value of gp_exp for rcuperf? > > >=20 > > > Or make the default depend on CONFIG_TINY_RCU. Or downgrade the > > > WARN_ON() to soething that results in torture-test failure but does > > > not cause 0day to complain. Or... > > >=20 > >=20 > > So I think a better is we > >=20 > > 1. set the default value to false (to align with rcutorture) > >=20 > > and > >=20 > > 2. downgrade the WARN_ON() to torture-test failures, because those > > are not kernel bugs. > >=20 > > Here is a patch for further discussion: >=20 > This patch looks good to me, given a little editing of the commit log. > (See below for error string suggestion.) >=20 Those are better (shorter and more accurate), thank you! I will send out a standalone patch with the modification. Regards, Boqun > Other thoughts? >=20 > Thanx, Paul >=20 > > ------------------------->8 > > Subject: [PATCH] rcuperf: Don't treat gp_exp mis-setting as a kernel wa= rning > >=20 > > 0day found a boot warning triggered in rcu_perf_writer() on !SMP kernel: > >=20 > > WARN_ON(rcu_gp_is_normal() && gp_exp); > >=20 > > , which turned out to be caused by the default value of gp_exp. > >=20 > > However, the reason of the warning is only mis-setting, which should be > > handled inside rcuperf module rather than treated as a kernel warning. > >=20 > > Therefore this patch moves the WARN_ON from rcu_perf_writer() and > > handles those checkings in rcu_perf_init(), which could also save the > > checkings for each writer. > >=20 > > 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. > >=20 > > Signed-off-by: Boqun Feng > > Fixes: http://lkml.kernel.org/r/57411b10.mFvG0+AgcrMXGtcj%fengguang.wu@= intel.com > > --- > > kernel/rcu/rcuperf.c | 14 +++++++++++--- > > 1 file changed, 11 insertions(+), 3 deletions(-) > >=20 > > diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c > > index 3cee0d8393ed..1dc2bd1de4b6 100644 > > --- a/kernel/rcu/rcuperf.c > > +++ b/kernel/rcu/rcuperf.c > > @@ -58,7 +58,7 @@ MODULE_AUTHOR("Paul E. McKenney "); > > #define VERBOSE_PERFOUT_ERRSTRING(s) \ > > do { if (verbose) pr_alert("%s" PERF_FLAG "!!! %s\n", perf_type, s); = } while (0) > >=20 > > -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 =3D writer_durations[me]; > >=20 > > 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 =3D 1; > > @@ -631,6 +629,16 @@ rcu_perf_init(void) > > firsterr =3D -ENOMEM; > > goto unwind; > > } > > + if (rcu_gp_is_expedited() && !rcu_gp_is_normal() && !gp_exp) { > > + VERBOSE_PERFOUT_ERRSTRING("try to measure normal grace periods when = all the grace periods are expedited"); >=20 > "All grace periods expedited, no normal ones to measure!" >=20 > > + firsterr =3D -EINVAL; > > + goto unwind; > > + } > > + if (rcu_gp_is_normal() && gp_exp) { > > + VERBOSE_PERFOUT_ERRSTRING("try to measure expedited grace periods wh= en all the expedited ones fall back to the normal ones"); >=20 > "All grace periods normal, no expedited ones to measure!" >=20 > > + firsterr =3D -EINVAL; > > + goto unwind; > > + } > > for (i =3D 0; i < nrealwriters; i++) { > > writer_durations[i] =3D > > kcalloc(MAX_MEAS, sizeof(*writer_durations[i]), > > --=20 > > 2.8.2 > >=20 >=20 --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXRPP4AAoJEEl56MO1B/q4aUYH/25KEmjbWTOO0CW2StE822O6 Mk+RELHG2Qg3tkoDrzS6NEGsm6FEyjDAON+zM/uGoc1JcextwIONN8Sm2EIf5flJ RdCzMFOznEcUsvO/B0Su9bHXsQcrQowsbSc2lofzzq3bwYNpmpa0EAQAs4Pown7o 1NUIvxPm57mOz342dq0Rn5wyE8u4AZO5AwyWYV0LQnNzJO4l/sjWwZ1bmuYEbhYj SLTXR2zFB+Lwjyl9LPV38ifr/QV9Q3p/ZqIY2oYpV6wJUaFA7OxgCcdRqRbHdi+B 5gIvNjbQra0QJAj4CK1omVqsEX9hXeKzsxRNvLEQnT6ixjpOU+L3bE3/7Ct/nrQ= =H0Ct -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--