LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][RFC] lockdep: improve comments in wait-type checks
@ 2021-08-10 21:03 Zhouyi Zhou
  2021-08-11  2:44 ` Boqun Feng
  0 siblings, 1 reply; 4+ messages in thread
From: Zhouyi Zhou @ 2021-08-10 21:03 UTC (permalink / raw)
  To: peterz, mingo, will, longman, boqun.feng, paulmck, josh, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, linux-kernel, rcu
  Cc: Zhouyi Zhou

Hi Peter,
  I think comments in wait-type checks may benifit from some comments
improvement.
  I recklessly add Paul to signed-off-by, because I asked his opinion
about comment in rcu_read_lock_bh part.

Thanks a lot
Zhouyi

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 include/linux/lockdep_types.h | 2 +-
 kernel/locking/lockdep.c      | 2 +-
 kernel/rcu/update.c           | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h
index 3e726ace5c62..d22430840b53 100644
--- a/include/linux/lockdep_types.h
+++ b/include/linux/lockdep_types.h
@@ -21,7 +21,7 @@ enum lockdep_wait_type {
 	LD_WAIT_SPIN,		/* spin loops, raw_spinlock_t etc.. */
 
 #ifdef CONFIG_PROVE_RAW_LOCK_NESTING
-	LD_WAIT_CONFIG,		/* CONFIG_PREEMPT_LOCK, spinlock_t etc.. */
+	LD_WAIT_CONFIG,		/* preemptible in PREEMPT_RT, spinlock_t etc.. */
 #else
 	LD_WAIT_CONFIG = LD_WAIT_SPIN,
 #endif
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index bf1c00c881e4..952d0ccf8776 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4671,7 +4671,7 @@ print_lock_invalid_wait_context(struct task_struct *curr,
 /*
  * Verify the wait_type context.
  *
- * This check validates we takes locks in the right wait-type order; that is it
+ * This check validates we take locks in the right wait-type order; that is it
  * ensures that we do not take mutexes inside spinlocks and do not attempt to
  * acquire spinlocks inside raw_spinlocks and the sort.
  *
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index c21b38cc25e9..690b0cec7459 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -247,7 +247,7 @@ struct lockdep_map rcu_lock_map = {
 	.name = "rcu_read_lock",
 	.key = &rcu_lock_key,
 	.wait_type_outer = LD_WAIT_FREE,
-	.wait_type_inner = LD_WAIT_CONFIG, /* XXX PREEMPT_RCU ? */
+	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT implies PREEMPT_RCU */
 };
 EXPORT_SYMBOL_GPL(rcu_lock_map);
 
@@ -256,7 +256,7 @@ struct lockdep_map rcu_bh_lock_map = {
 	.name = "rcu_read_lock_bh",
 	.key = &rcu_bh_lock_key,
 	.wait_type_outer = LD_WAIT_FREE,
-	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_LOCK also makes BH preemptible */
+	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT makes BH preemptible. */
 };
 EXPORT_SYMBOL_GPL(rcu_bh_lock_map);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][RFC] lockdep: improve comments in wait-type checks
  2021-08-10 21:03 [PATCH][RFC] lockdep: improve comments in wait-type checks Zhouyi Zhou
@ 2021-08-11  2:44 ` Boqun Feng
  2021-08-24 13:47   ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Boqun Feng @ 2021-08-11  2:44 UTC (permalink / raw)
  To: Zhouyi Zhou
  Cc: peterz, mingo, will, longman, paulmck, josh, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, linux-kernel, rcu

Hi,

On Wed, Aug 11, 2021 at 05:03:19AM +0800, Zhouyi Zhou wrote:
> Hi Peter,
>   I think comments in wait-type checks may benifit from some comments
> improvement.

Thanks for looking into this!

Even for an RFC patch, it's better that you write a proper commit log,
and note that you can put all this background information right after
the "---" line, if you think that will help people review it.

>   I recklessly add Paul to signed-off-by, because I asked his opinion
> about comment in rcu_read_lock_bh part.
> 

Probably a Suggested-by will suffice, but I leave that to Paul ;-)

> Thanks a lot
> Zhouyi
> 
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Please make you the last one in the "Signed-off-by" list, see
Documentation/process/submitting-patches.rst:

"Notably, the last Signed-off-by: must always be that of the developer
submitting the patch."

Regards,
Boqun

> ---
>  include/linux/lockdep_types.h | 2 +-
>  kernel/locking/lockdep.c      | 2 +-
>  kernel/rcu/update.c           | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h
> index 3e726ace5c62..d22430840b53 100644
> --- a/include/linux/lockdep_types.h
> +++ b/include/linux/lockdep_types.h
> @@ -21,7 +21,7 @@ enum lockdep_wait_type {
>  	LD_WAIT_SPIN,		/* spin loops, raw_spinlock_t etc.. */
>  
>  #ifdef CONFIG_PROVE_RAW_LOCK_NESTING
> -	LD_WAIT_CONFIG,		/* CONFIG_PREEMPT_LOCK, spinlock_t etc.. */
> +	LD_WAIT_CONFIG,		/* preemptible in PREEMPT_RT, spinlock_t etc.. */
>  #else
>  	LD_WAIT_CONFIG = LD_WAIT_SPIN,
>  #endif
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index bf1c00c881e4..952d0ccf8776 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4671,7 +4671,7 @@ print_lock_invalid_wait_context(struct task_struct *curr,
>  /*
>   * Verify the wait_type context.
>   *
> - * This check validates we takes locks in the right wait-type order; that is it
> + * This check validates we take locks in the right wait-type order; that is it
>   * ensures that we do not take mutexes inside spinlocks and do not attempt to
>   * acquire spinlocks inside raw_spinlocks and the sort.
>   *
> diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
> index c21b38cc25e9..690b0cec7459 100644
> --- a/kernel/rcu/update.c
> +++ b/kernel/rcu/update.c
> @@ -247,7 +247,7 @@ struct lockdep_map rcu_lock_map = {
>  	.name = "rcu_read_lock",
>  	.key = &rcu_lock_key,
>  	.wait_type_outer = LD_WAIT_FREE,
> -	.wait_type_inner = LD_WAIT_CONFIG, /* XXX PREEMPT_RCU ? */
> +	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT implies PREEMPT_RCU */
>  };
>  EXPORT_SYMBOL_GPL(rcu_lock_map);
>  
> @@ -256,7 +256,7 @@ struct lockdep_map rcu_bh_lock_map = {
>  	.name = "rcu_read_lock_bh",
>  	.key = &rcu_bh_lock_key,
>  	.wait_type_outer = LD_WAIT_FREE,
> -	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_LOCK also makes BH preemptible */
> +	.wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT makes BH preemptible. */
>  };
>  EXPORT_SYMBOL_GPL(rcu_bh_lock_map);
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][RFC] lockdep: improve comments in wait-type checks
  2021-08-11  2:44 ` Boqun Feng
@ 2021-08-24 13:47   ` Peter Zijlstra
  2021-08-24 14:43     ` Zhouyi Zhou
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2021-08-24 13:47 UTC (permalink / raw)
  To: Boqun Feng
  Cc: Zhouyi Zhou, mingo, will, longman, paulmck, josh, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, linux-kernel, rcu

On Wed, Aug 11, 2021 at 10:44:21AM +0800, Boqun Feng wrote:
> Hi,
> 
> On Wed, Aug 11, 2021 at 05:03:19AM +0800, Zhouyi Zhou wrote:
> > Hi Peter,
> >   I think comments in wait-type checks may benifit from some comments
> > improvement.
> 
> Thanks for looking into this!
> 
> Even for an RFC patch, it's better that you write a proper commit log,
> and note that you can put all this background information right after
> the "---" line, if you think that will help people review it.
> 
> >   I recklessly add Paul to signed-off-by, because I asked his opinion
> > about comment in rcu_read_lock_bh part.
> > 
> 
> Probably a Suggested-by will suffice, but I leave that to Paul ;-)

This, also since Paul never actually touched the patch.

> > Thanks a lot
> > Zhouyi
> > 
> > Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> Please make you the last one in the "Signed-off-by" list, see
> Documentation/process/submitting-patches.rst:
> 
> "Notably, the last Signed-off-by: must always be that of the developer
> submitting the patch."

The first sob should be that of the author, and given that's the same
person as the submitter in this case, he's got a problem at his hands
;-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][RFC] lockdep: improve comments in wait-type checks
  2021-08-24 13:47   ` Peter Zijlstra
@ 2021-08-24 14:43     ` Zhouyi Zhou
  0 siblings, 0 replies; 4+ messages in thread
From: Zhouyi Zhou @ 2021-08-24 14:43 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Boqun Feng, mingo, will, longman, paulmck, Josh Triplett,
	rostedt, Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes,
	Google, linux-kernel, rcu

Thank both of you for correcting my mistakes.
I do benefit a lot from your emails.

Cheers
Zhouyi

On Tue, Aug 24, 2021 at 9:47 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Aug 11, 2021 at 10:44:21AM +0800, Boqun Feng wrote:
> > Hi,
> >
> > On Wed, Aug 11, 2021 at 05:03:19AM +0800, Zhouyi Zhou wrote:
> > > Hi Peter,
> > >   I think comments in wait-type checks may benifit from some comments
> > > improvement.
> >
> > Thanks for looking into this!
> >
> > Even for an RFC patch, it's better that you write a proper commit log,
> > and note that you can put all this background information right after
> > the "---" line, if you think that will help people review it.
> >
> > >   I recklessly add Paul to signed-off-by, because I asked his opinion
> > > about comment in rcu_read_lock_bh part.
> > >
> >
> > Probably a Suggested-by will suffice, but I leave that to Paul ;-)
>
> This, also since Paul never actually touched the patch.
>
> > > Thanks a lot
> > > Zhouyi
> > >
> > > Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> >
> > Please make you the last one in the "Signed-off-by" list, see
> > Documentation/process/submitting-patches.rst:
> >
> > "Notably, the last Signed-off-by: must always be that of the developer
> > submitting the patch."
>
> The first sob should be that of the author, and given that's the same
> person as the submitter in this case, he's got a problem at his hands
> ;-)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-24 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 21:03 [PATCH][RFC] lockdep: improve comments in wait-type checks Zhouyi Zhou
2021-08-11  2:44 ` Boqun Feng
2021-08-24 13:47   ` Peter Zijlstra
2021-08-24 14:43     ` Zhouyi Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).