lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zr4NN7mZQRQaTyl0@pavilion.home>
Date: Thu, 15 Aug 2024 16:14:15 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Neeraj Upadhyay <Neeraj.Upadhyay@...nel.org>
Cc: Valentin Schneider <vschneid@...hat.com>, rcu@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Paul E. McKenney" <paulmck@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Neeraj Upadhyay <quic_neeraju@...cinc.com>,
	Joel Fernandes <joel@...lfernandes.org>,
	Josh Triplett <josh@...htriplett.org>,
	Boqun Feng <boqun.feng@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Lai Jiangshan <jiangshanlai@...il.com>,
	Zqiang <qiang.zhang1211@...il.com>
Subject: Re: [PATCH v3 13/25] context_tracking, rcu: Rename
 rcu_dynticks_task*() into rcu_task*()

Le Wed, Aug 14, 2024 at 05:36:55PM +0530, Neeraj Upadhyay a écrit :
> On Wed, Jul 31, 2024 at 06:07:32PM +0200, Frederic Weisbecker wrote:
> > Le Wed, Jul 24, 2024 at 04:43:13PM +0200, Valentin Schneider a écrit :
> > > The context_tracking.state RCU_DYNTICKS subvariable has been renamed to
> > > RCU_WATCHING, and the 'dynticks' prefix can be dropped without losing any
> > > meaning.
> > > 
> > > While at it, flip the suffixes of these helpers. We are not telling
> > > that we are entering dynticks mode from an RCU-task perspective anymore; we
> > > are telling that we are exiting RCU-tasks because we are in eqs mode.
> > > 
> > > Suggested-by: Frederic Weisbecker <frederic@...nel.org>
> > > Signed-off-by: Valentin Schneider <vschneid@...hat.com>
> > > ---
> > >  kernel/context_tracking.c | 28 ++++++++++++++--------------
> > >  1 file changed, 14 insertions(+), 14 deletions(-)
> > > 
> > > diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
> > > index 8262f57a43636..1c16a7336360f 100644
> > > --- a/kernel/context_tracking.c
> > > +++ b/kernel/context_tracking.c
> > > @@ -38,24 +38,24 @@ EXPORT_SYMBOL_GPL(context_tracking);
> > >  #ifdef CONFIG_CONTEXT_TRACKING_IDLE
> > >  #define TPS(x)  tracepoint_string(x)
> > >  
> > > -/* Record the current task on dyntick-idle entry. */
> > > -static __always_inline void rcu_dynticks_task_enter(void)
> > > +/* Record the current task on exiting RCU-tasks (dyntick-idle entry). */
> > > +static __always_inline void rcu_task_exit(void)
> > 
> > So this makes sense.
> > 
> > >  {
> > >  #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
> > >  	WRITE_ONCE(current->rcu_tasks_idle_cpu, smp_processor_id());
> > >  #endif /* #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL) */
> > >  }
> > >  
> > > -/* Record no current task on dyntick-idle exit. */
> > > -static __always_inline void rcu_dynticks_task_exit(void)
> > > +/* Record no current task on entering RCU-tasks (dyntick-idle exit). */
> > > +static __always_inline void rcu_task_enter(void)
> > 
> > That too.
> > 
> > >  {
> > >  #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL)
> > >  	WRITE_ONCE(current->rcu_tasks_idle_cpu, -1);
> > >  #endif /* #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL) */
> > >  }
> > >  
> > > -/* Turn on heavyweight RCU tasks trace readers on idle/user entry. */
> > > -static __always_inline void rcu_dynticks_task_trace_enter(void)
> > > +/* Turn on heavyweight RCU tasks trace readers on kernel exit. */
> > > +static __always_inline void rcu_task_trace_exit(void)
> > 
> > But that eventually doesn't, because it's not about not wathing anymore from
> > an RCU-TASKS-TRACE perspective. It's actually about adding more heavyweight
> > ordering to track down RCU-TASKS-TRACE read side while traditional RCU is not
> > watching. Sorry for understanding it that late.
> > 
> > Oh well. So a more accurate name here would be rcu_task_trace_heavyweight_enter().
> > 
> > >  {
> > >  #ifdef CONFIG_TASKS_TRACE_RCU
> > >  	if (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB))
> > > @@ -63,8 +63,8 @@ static __always_inline void rcu_dynticks_task_trace_enter(void)
> > >  #endif /* #ifdef CONFIG_TASKS_TRACE_RCU */
> > >  }
> > >  
> > > -/* Turn off heavyweight RCU tasks trace readers on idle/user exit. */
> > > -static __always_inline void rcu_dynticks_task_trace_exit(void)
> > > +/* Turn off heavyweight RCU tasks trace readers on kernel entry. */
> > > +static __always_inline void rcu_task_trace_enter(void)
> > 
> > And rcu_task_trace_heavyweight_exit().
> > 
> 
> I have updated it here [1]. Please let me know if something looks
> incorrect.
> 
> 
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/neeraj.upadhyay/linux-rcu.git/commit/?h=next.14.08.24a&id=cfc22b9f1572b137dd9f36da831dd7b69c9fe352

Looks good!

Reviewed-by: Frederic Weisbecker <frederic@...nel.org>

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ