public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Uladzislau Rezki <urezki@gmail.com>,
	Boqun Feng <boqun.feng@gmail.com>, RCU <rcu@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Cheung Wall <zzqq0103.hey@gmail.com>,
	Neeraj upadhyay <Neeraj.Upadhyay@amd.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: Re: [PATCH 2/4] torture: Remove CONFIG_NR_CPUS configuration
Date: Fri, 24 Jan 2025 18:48:40 +0100	[thread overview]
Message-ID: <Z5PSeEn_ceFuqbnz@pc636> (raw)
In-Reply-To: <c57daf05-1018-40b5-9684-22dfd94cc8d9@paulmck-laptop>

On Fri, Jan 24, 2025 at 09:36:07AM -0800, Paul E. McKenney wrote:
> On Fri, Jan 24, 2025 at 06:21:30PM +0100, Uladzislau Rezki wrote:
> > On Fri, Jan 24, 2025 at 07:45:23AM -0800, Paul E. McKenney wrote:
> > > On Fri, Jan 24, 2025 at 12:41:38PM +0100, Uladzislau Rezki wrote:
> > > > On Thu, Jan 23, 2025 at 12:29:45PM -0800, Paul E. McKenney wrote:
> > > > > On Thu, Jan 23, 2025 at 07:58:26PM +0100, Uladzislau Rezki (Sony) wrote:
> > > > > > This configuration specifies the maximum number of CPUs which
> > > > > > is set to 8. The problem is that it can not be overwritten for
> > > > > > something higher.
> > > > > > 
> > > > > > Remove that configuration for TREE05, so it is possible to run
> > > > > > the torture test on as many CPUs as many system has.
> > > > > > 
> > > > > > Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> > > > > 
> > > > > You should be able to override this on the kvm.sh command line by
> > > > > specifying "--kconfig CONFIG_NR_CPUS=128" or whatever number you wish.
> > > > > For example, see the torture.sh querying the system's number of CPUs
> > > > > and then specifying it to a number of tests.
> > > > > 
> > > > > Or am I missing something here?
> > > > > 
> > > > It took me a while to understand what happens. Apparently there is this
> > > > 8 CPUs limitation. Yes, i can do it manually by passing --kconfig but
> > > > you need to know about that. I have not expected that.
> > > > 
> > > > Therefore i removed it from the configuration because i have not found
> > > > a good explanation why we need. It is confusing instead :)
> > > 
> > > Right now, if I do a run with --configs "TREE10 14*CFLIST", this will
> > > make use of 20 systems with 80 CPUs each.  If you remove that line from
> > > TREE05, won't each instance of TREE05 consume a full system, for a total
> > > of 33 systems?  Yes, I could use "--kconfig CONFIG_NR_CPUS=8" on the
> > > command line, but that would affect all the scenarios, not just TREE05.
> > > Including (say) TINY01, where I believe that it would cause kvm.sh
> > > to complain about a Kconfig conflict.
> > > 
> > > Hence me not being in favor of this change.  ;-)
> > > 
> > > Is there another way to make things work for both situations?
> > > 
> > OK, i see. Well. I will just go with --kconfig CONFIG_NR_CPUS=foo if i
> > need more CPUs for TREE05.
> > 
> > I will not resist, we just drop this patch :)
> 
> Thank you!
> 
> The bug you are chasing happens when a given synchonize_rcu() interacts
> with RCU readers, correct?
> 
Below one:

<snip>
/*
 * RCU torture fake writer kthread.  Repeatedly calls sync, with a random
 * delay between calls.
 */
static int
rcu_torture_fakewriter(void *arg)
{
...
<snip>

> In rcutorture, only the rcu_torture_writer() call to synchronize_rcu()
> interacts with rcu_torture_reader().  So my guess is that running
> many small TREE05 guest OSes would reproduce this bug more quickly.
> So instead of this:
> 
> 	--kconfig CONFIG_NR_CPUS=128
> 
> Do this:
> 
> 	--configs "16*TREE05"
> 
> Or maybe even this:
> 
> 	--configs "16*TREE05" --kconfig CONFIG_NR_CPUS=4
Thanks for input.

> 
> Thoughts?
> 
If you mean below splat:

<snip>
[   32.107748] =============================
[   32.108512] WARNING: suspicious RCU usage
[   32.109232] 6.12.0-rc4-dirty #66 Not tainted
[   32.110058] -----------------------------
[   32.110817] kernel/events/core.c:13962 RCU-list traversed in non-reader section!!
[   32.111221] kworker/u34:2 (251) used greatest stack depth: 12112 bytes left
[   32.112125]
[   32.112125] other info that might help us debug this:
[   32.112125]
[   32.112130]
[   32.112130] rcu_scheduler_active = 2, debug_locks = 1
[   32.116039] 3 locks held by cpuhp/1/20:
[   32.116758]  #0: ffffffff93a6a750 (cpu_hotplug_lock){++++}-{0:0}, at: cpuhp_thread_fun+0x50/0x220
[   32.118410]  #1: ffffffff93a6ce00 (cpuhp_state-down){+.+.}-{0:0}, at: cpuhp_thread_fun+0x50/0x220
[   32.120091]  #2: ffffffff93b7eb68 (pmus_lock){+.+.}-{3:3}, at: perf_event_exit_cpu_context+0x32/0x2d0
[   32.121723]
[   32.121723] stack backtrace:
[   32.122413] CPU: 1 UID: 0 PID: 20 Comm: cpuhp/1 Not tainted 6.12.0-rc4-dirty #66
[   32.123666] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
[   32.125302] Call Trace:
[   32.125769]  <TASK>
[   32.126148]  dump_stack_lvl+0x83/0xa0
[   32.126823]  lockdep_rcu_suspicious+0x113/0x180
[   32.127652]  perf_event_exit_cpu_context+0x2c4/0x2d0
[   32.128593]  ? __pfx_perf_event_exit_cpu+0x10/0x10
[   32.129489]  perf_event_exit_cpu+0x9/0x10
[   32.130243]  cpuhp_invoke_callback+0x187/0x6e0
[   32.131065]  ? cpuhp_thread_fun+0x50/0x220
[   32.131800]  cpuhp_thread_fun+0x185/0x220
[   32.132560]  ? __pfx_smpboot_thread_fn+0x10/0x10                                                                                                                           [   32.133394]  smpboot_thread_fn+0xd8/0x1d0
[   32.134050]  kthread+0xd0/0x100
[   32.134592]  ? __pfx_kthread+0x10/0x10
[   32.135270]  ret_from_fork+0x2f/0x50
[   32.135896]  ? __pfx_kthread+0x10/0x10
[   32.136610]  ret_from_fork_asm+0x1a/0x30
[   32.137356]  </TASK>
[   32.140997] smpboot: CPU 1 is now offline
<snip>

I reproduced that using:

+rcutorture.nfakewriters=128
+rcutorture.gp_sync=1
+rcupdate.rcu_expedited=0
+rcupdate.rcu_normal=1
+rcutree.rcu_normal_wake_from_gp=1
<snip>

The test script:

for (( i=0; i<$LOOPS; i++ )); do
        tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 64 --configs \
        '100*TREE05' --memory 20G --bootargs 'rcutorture.fwd_progress=1'
        echo "Done $i"
done

i.e. with more nfakewriters.

If you mean the one that has recently reported, i am not able to
reproduce it anyhow :)

--
Uladzislau Rezki

  reply	other threads:[~2025-01-24 17:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 18:58 [PATCH 1/4] rcutorture: Allow a negative value for nfakewriters Uladzislau Rezki (Sony)
2025-01-23 18:58 ` [PATCH 2/4] torture: Remove CONFIG_NR_CPUS configuration Uladzislau Rezki (Sony)
2025-01-23 20:29   ` Paul E. McKenney
2025-01-24 11:41     ` Uladzislau Rezki
2025-01-24 15:45       ` Paul E. McKenney
2025-01-24 17:21         ` Uladzislau Rezki
2025-01-24 17:36           ` Paul E. McKenney
2025-01-24 17:48             ` Uladzislau Rezki [this message]
2025-01-24 19:34               ` Paul E. McKenney
2025-01-27 13:27                 ` Uladzislau Rezki
2025-01-27 14:51                   ` Paul E. McKenney
2025-01-27 15:42                     ` Uladzislau Rezki
2025-01-27 16:51                       ` Paul E. McKenney
2025-01-27 17:26                         ` Uladzislau Rezki
2025-01-27 18:15                           ` Paul E. McKenney
2025-01-27 18:31                             ` Uladzislau Rezki
2025-01-27 19:24                             ` Uladzislau Rezki
2025-01-27 20:37                               ` Uladzislau Rezki
2025-01-28  0:14                                 ` Paul E. McKenney
2025-01-28 12:17                                   ` Uladzislau Rezki
2025-01-28 12:41                                     ` Paul E. McKenney
2025-01-28 14:34                                       ` Uladzislau Rezki
2025-01-28 18:43                                         ` Paul E. McKenney
2025-01-28 20:57                                           ` Uladzislau Rezki
2025-01-23 18:58 ` [PATCH 3/4] rcu: Update TREE05.boot to test normal synchronize_rcu() Uladzislau Rezki (Sony)
2025-01-23 20:30   ` Paul E. McKenney
2025-01-23 18:58 ` [PATCH 4/4] rcu: Use _full() API to debug synchronize_rcu() Uladzislau Rezki (Sony)
2025-01-23 21:52   ` Paul E. McKenney
2025-01-24 11:48     ` Uladzislau Rezki
2025-01-24 15:49       ` Paul E. McKenney
2025-01-28 20:55 ` [PATCH 1/4] rcutorture: Allow a negative value for nfakewriters Uladzislau Rezki
2025-01-28 21:19   ` Paul E. McKenney

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=Z5PSeEn_ceFuqbnz@pc636 \
    --to=urezki@gmail.com \
    --cc=Neeraj.Upadhyay@amd.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=zzqq0103.hey@gmail.com \
    /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