All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: rcu@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>, Ingo Molnar <mingo@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	David Howells <dhowells@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH tip/core/rcu 3/4] rcutorture: Make grace-period kthread report match RCU flavor being tested
Date: Sun, 27 Dec 2020 08:49:17 -0800	[thread overview]
Message-ID: <20201227164917.GA2139@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20201216164829.GI2657@paulmck-ThinkPad-P72>

On Wed, Dec 16, 2020 at 08:48:29AM -0800, Paul E. McKenney wrote:
> On Wed, Dec 16, 2020 at 10:31:16AM +0100, Geert Uytterhoeven wrote:
> > Hi Paul,
> > 
> > On Tue, Dec 15, 2020 at 7:24 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> > > On Tue, Dec 15, 2020 at 09:40:26AM +0100, Geert Uytterhoeven wrote:
> > > > On Fri, Nov 6, 2020 at 12:40 AM <paulmck@kernel.org> wrote:
> > > > > From: "Paul E. McKenney" <paulmck@kernel.org>
> > > > >
> > > > > At the end of the test and after rcu_torture_writer() stalls, rcutorture
> > > > > invokes show_rcu_gp_kthreads() in order to dump out information on the
> > > > > RCU grace-period kthread.  This makes a lot of sense when testing vanilla
> > > > > RCU, but not so much for the other flavors.  This commit therefore allows
> > > > > per-flavor kthread-dump functions to be specified.
> > > > >
> > > > > [ paulmck: Apply feedback from kernel test robot <lkp@intel.com>. ]
> > > > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > > >
> > > > Thanks for your patch, which is now commit 27c0f1448389baf7
> > > > ("rcutorture: Make grace-period kthread report match RCU flavor being
> > > > tested").
> > > >
> > > > > --- a/kernel/rcu/rcu.h
> > > > > +++ b/kernel/rcu/rcu.h
> > > > > @@ -533,4 +533,20 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
> > > > >  static inline void rcu_bind_current_to_nocb(void) { }
> > > > >  #endif
> > > > >
> > > > > +#if !defined(CONFIG_TINY_RCU) && defined(CONFIG_TASKS_RCU)
> > > > > +void show_rcu_tasks_classic_gp_kthread(void);
> > > > > +#else
> > > > > +static inline void show_rcu_tasks_classic_gp_kthread(void) {}
> > > > > +#endif
> > > > > +#if !defined(CONFIG_TINY_RCU) && defined(CONFIG_TASKS_RUDE_RCU)
> > > > > +void show_rcu_tasks_rude_gp_kthread(void);
> > > > > +#else
> > > > > +static inline void show_rcu_tasks_rude_gp_kthread(void) {}
> > > > > +#endif
> > > >
> > > > The #ifdef expression does not match the one for the implementation
> > > > below.
> > >
> > > That does sound like something I would do...
> > >
> > > The definition of show_rcu_tasks_rude_gp_kthread() must be provided
> > > elsewhere if !TINY_RCU && TASKS_RUDE_RCU, correct?
> > >
> > > > > --- a/kernel/rcu/rcutorture.c
> > > > > +++ b/kernel/rcu/rcutorture.c
> > > >
> > > > > @@ -762,6 +765,7 @@ static struct rcu_torture_ops tasks_rude_ops = {
> > > > >         .exp_sync       = synchronize_rcu_tasks_rude,
> > > > >         .call           = call_rcu_tasks_rude,
> > > > >         .cb_barrier     = rcu_barrier_tasks_rude,
> > > > > +       .gp_kthread_dbg = show_rcu_tasks_rude_gp_kthread,
> > > >
> > > > Perhaps you just want to have a NULL pointer for the dummy case, instead
> > > > of instantiating a dummy static inline function and taking its address?
> > >
> > > You mean something like this in kernel/rcu/rcu.h?
> > >
> > > #if !defined(CONFIG_TINY_RCU) && defined(CONFIG_TASKS_RUDE_RCU)
> > > void show_rcu_tasks_rude_gp_kthread(void);
> > > #else
> > > #define show_rcu_tasks_rude_gp_kthread NULL
> > > #endif
> > >
> > > This does looks better to me, and at first glance would work.
> > 
> > Exactly. This is similar to how unimplemented PM callbacks are handled
> > (git grep "#define\s*pm_.*NULL").
> 
> OK, as shown in the (untested) patch below?

I finally got around to running the full suite after completing a couple
of long-running bisections, and yes, you got me on this one!  ;-)

Both locktorture and scftorture build with CONFIG_TINY_RCU,
CONFIG_TASKS_RCU, CONFIG_TASKS_RUDE_RCU, and CONFIG_TASKS_TRACE_RCU
all disabled.  So when the compiler attempts to build this:

	void show_rcu_tasks_gp_kthreads(void)
	{
		show_rcu_tasks_classic_gp_kthread();
		show_rcu_tasks_rude_gp_kthread();
		show_rcu_tasks_trace_gp_kthread();
	}

It sees this:

	void show_rcu_tasks_gp_kthreads(void)
	{
		NULL();
		NULL();
		NULL();
	}

Needless to say, it doesn't like this much, and refuses to suffer
in silence.

I am reverting the commit that defined these three functions to NULL.
This means that rcutorture runs still instantiate static inline
definitions of these three functions, but that does work and only takes
effect for those who are actually running rcutorture.

							Thanx, Paul

  reply	other threads:[~2020-12-27 16:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 23:39 [PATCH tip/core/rcu 0/4] RCU-tasks updates for v5.11 Paul E. McKenney
2020-11-05 23:39 ` [PATCH tip/core/rcu 1/4] rcutorture: Make preemptible TRACE02 enable lockdep paulmck
2020-11-05 23:39 ` [PATCH tip/core/rcu 2/4] rcu-tasks: Convert rcu_tasks_wait_gp() for-loop to while-loop paulmck
2020-11-05 23:39 ` [PATCH tip/core/rcu 3/4] rcutorture: Make grace-period kthread report match RCU flavor being tested paulmck
2020-12-15  8:40   ` Geert Uytterhoeven
2020-12-15 18:24     ` Paul E. McKenney
2020-12-16  9:31       ` Geert Uytterhoeven
2020-12-16 16:48         ` Paul E. McKenney
2020-12-27 16:49           ` Paul E. McKenney [this message]
2020-11-05 23:39 ` [PATCH tip/core/rcu 4/4] rcu-tasks: Make the units of ->init_fract be jiffies paulmck

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=20201227164917.GA2139@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.