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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 15 Apr 2024 18:36:31 +0200
From: Valentin Schneider <vschneid@...hat.com>
To: paulmck@...nel.org, Frederic Weisbecker <frederic@...nel.org>
Cc: rcu@...r.kernel.org, linux-kernel@...r.kernel.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 2/2] context_tracking, rcu: Rename RCU_DYNTICKS_IDX to
 CT_DYNTICKS_IDX

On 10/04/24 12:19, Paul E. McKenney wrote:
> On Wed, Apr 10, 2024 at 12:30:55PM +0200, Frederic Weisbecker wrote:
>> Le Tue, Apr 09, 2024 at 12:53:03PM -0700, Paul E. McKenney a écrit :
>> > I am having a hard time getting too excited about the name.  I could
>> > suggest CT_RCU_WATCHING_IDX, but that isn't exactly the shortest
>> > possible name.
>>
>> I really like CT_RCU_WATCHING. It says everything. The _IDX isn't even
>> needed after all. What do you think?
>
> Works for me!
>

Sounds good to me too, thanks for the suggestion :)

Now, what about ct_dynticks() & friends? I was about to do:

-static __always_inline int ct_dynticks(void)
+static __always_inline int ct_rcu_watching(void)
 {
-	return atomic_read(this_cpu_ptr(&context_tracking.state)) & CT_DYNTICKS_MASK;
+	return atomic_read(this_cpu_ptr(&context_tracking.state)) & CT_RCU_WATCHING_MASK;
 }

.. but then realised that there's more siblings to the rcu_dynticks*()
family;

AFAICT dynticks_nesting could also get the rcu_watching prefix treatment,
`rcu_dynticks_task_exit() -> rcu_watching_task_exit` doesn't sound as
obvious though. The rcu_dyntick event probably can't be renamed either.

I'm not sure how far to take the renaming; seeing things like:

  notrace bool rcu_is_watching(void)
  {
          bool ret;

          preempt_disable_notrace();
          ret = !rcu_dynticks_curr_cpu_in_eqs();
          preempt_enable_notrace();
          return ret;
  }
  EXPORT_SYMBOL_GPL(rcu_is_watching);

makes me think most of the rcu_*dynticks / rcu_*eqs stuff could get an
rcu_watching facelift?

Here are my current considerations for identifiers used in context_tracking
in decreasing order of confidence:

| Old                                   | New                                                           |
|---------------------------------------+---------------------------------------------------------------|
| RCU_DYNTICKS_IDX                      | CT_RCU_WATCHING                                               |
| RCU_DYNTICKS_MASK                     | CT_RCU_WATCHING_MASK                                          |
| context_tracking.dynticks_nesting     | context_tracking.rcu_watching_nesting                         |
| context_tracking.dynticks_nmi_nesting | context_tracking.rcu_watching_nmi_nesting [bit of a mouthful] |
| rcu_dynticks_curr_cpu_in_eqs()        | rcu_watching_curr_cpu() [with an added negation]              |
|---------------------------------------+---------------------------------------------------------------|
| TRACE_EVENT_RCU(rcu_dyntick,          | [Can't change?]                                               |
|---------------------------------------+---------------------------------------------------------------|
| rcu_dynticks_task_enter()             | rcu_watching_task_enter()                                     |
| rcu_dynticks_task_exit()              | rcu_watching_task_exit()                                      |
| rcu_dynticks_task_trace_enter()       | rcu_watching_task_trace_enter()                               |
| rcu_dynticks_task_trace_exit()        | rcu_watching_task_trace_exit()                                |

Thoughts?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ