linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
@ 2020-02-28 17:46 madhuparnabhowmik10
  2020-03-01 20:12 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-28 17:46 UTC (permalink / raw)
  To: rjw, pavel, len.brown, gregkh
  Cc: linux-pm, linux-kernel, joel, frextrite, linux-kernel-mentees,
	paulmck, Madhuparna Bhowmik

From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

This patch passes the cond argument to list_for_each_entry_rcu()
to fix the following false-positive lockdep warnings:

[  330.302784] =============================
[  330.302789] WARNING: suspicious RCU usage
[  330.302796] 5.6.0-rc1+ #5 Not tainted
[  330.302801] -----------------------------
[  330.302808] drivers/base/power/main.c:326 RCU-list traversed in non-reader section!!

[  330.303303] =============================
[  330.303307] WARNING: suspicious RCU usage
[  330.303311] 5.6.0-rc1+ #5 Not tainted
[  330.303315] -----------------------------
[  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in non-reader section!!

[  331.934969] =============================
[  331.934971] WARNING: suspicious RCU usage
[  331.934973] 5.6.0-rc1+ #5 Not tainted
[  331.934975] -----------------------------
[  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in non-reader section!!

[  332.467772] WARNING: suspicious RCU usage
[  332.467775] 5.6.0-rc1+ #5 Not tainted
[  332.467775] -----------------------------
[  332.467778] drivers/base/power/main.c:269 RCU-list traversed in non-reader section!!

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
 drivers/base/power/main.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 0e99a760aebd..742c05f3c1e7 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -266,7 +266,8 @@ static void dpm_wait_for_suppliers(struct device *dev, bool async)
 	 * callbacks freeing the link objects for the links in the list we're
 	 * walking.
 	 */
-	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
+	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
+				device_links_read_lock_held())
 		if (READ_ONCE(link->status) != DL_STATE_DORMANT)
 			dpm_wait(link->supplier, async);
 
@@ -323,7 +324,8 @@ static void dpm_wait_for_consumers(struct device *dev, bool async)
 	 * continue instead of trying to continue in parallel with its
 	 * unregistration).
 	 */
-	list_for_each_entry_rcu(link, &dev->links.consumers, s_node)
+	list_for_each_entry_rcu(link, &dev->links.consumers, s_node,
+				 device_links_read_lock_held())
 		if (READ_ONCE(link->status) != DL_STATE_DORMANT)
 			dpm_wait(link->consumer, async);
 
@@ -1235,7 +1237,8 @@ static void dpm_superior_set_must_resume(struct device *dev)
 
 	idx = device_links_read_lock();
 
-	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
+	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
+				 device_links_read_lock_held())
 		link->supplier->power.must_resume = true;
 
 	device_links_read_unlock(idx);
@@ -1695,7 +1698,8 @@ static void dpm_clear_superiors_direct_complete(struct device *dev)
 
 	idx = device_links_read_lock();
 
-	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node) {
+	list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
+				 device_links_read_lock_held()) {
 		spin_lock_irq(&link->supplier->power.lock);
 		link->supplier->power.direct_complete = false;
 		spin_unlock_irq(&link->supplier->power.lock);
-- 
2.17.1


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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
  2020-02-28 17:46 [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking madhuparnabhowmik10
@ 2020-03-01 20:12 ` Rafael J. Wysocki
  2020-03-01 20:53   ` joel
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2020-03-01 20:12 UTC (permalink / raw)
  To: madhuparnabhowmik10, Joel Fernandes
  Cc: Rafael J. Wysocki, Pavel Machek, Len Brown, Greg Kroah-Hartman,
	Linux PM, Linux Kernel Mailing List, frextrite,
	linux-kernel-mentees, paulmck

On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
>
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> This patch passes the cond argument to list_for_each_entry_rcu()
> to fix the following false-positive lockdep warnings:
>
> [  330.302784] =============================
> [  330.302789] WARNING: suspicious RCU usage
> [  330.302796] 5.6.0-rc1+ #5 Not tainted
> [  330.302801] -----------------------------
> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in non-reader section!!
>
> [  330.303303] =============================
> [  330.303307] WARNING: suspicious RCU usage
> [  330.303311] 5.6.0-rc1+ #5 Not tainted
> [  330.303315] -----------------------------
> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in non-reader section!!
>
> [  331.934969] =============================
> [  331.934971] WARNING: suspicious RCU usage
> [  331.934973] 5.6.0-rc1+ #5 Not tainted
> [  331.934975] -----------------------------
> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in non-reader section!!
>
> [  332.467772] WARNING: suspicious RCU usage
> [  332.467775] 5.6.0-rc1+ #5 Not tainted
> [  332.467775] -----------------------------
> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in non-reader section!!

I don't see these warnings in the kernels run locally here.

What do you do to get them?

Joel, any comments here?

>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> ---
>  drivers/base/power/main.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 0e99a760aebd..742c05f3c1e7 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -266,7 +266,8 @@ static void dpm_wait_for_suppliers(struct device *dev, bool async)
>          * callbacks freeing the link objects for the links in the list we're
>          * walking.
>          */
> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
> +                               device_links_read_lock_held())
>                 if (READ_ONCE(link->status) != DL_STATE_DORMANT)
>                         dpm_wait(link->supplier, async);
>
> @@ -323,7 +324,8 @@ static void dpm_wait_for_consumers(struct device *dev, bool async)
>          * continue instead of trying to continue in parallel with its
>          * unregistration).
>          */
> -       list_for_each_entry_rcu(link, &dev->links.consumers, s_node)
> +       list_for_each_entry_rcu(link, &dev->links.consumers, s_node,
> +                                device_links_read_lock_held())
>                 if (READ_ONCE(link->status) != DL_STATE_DORMANT)
>                         dpm_wait(link->consumer, async);
>
> @@ -1235,7 +1237,8 @@ static void dpm_superior_set_must_resume(struct device *dev)
>
>         idx = device_links_read_lock();
>
> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
> +                                device_links_read_lock_held())
>                 link->supplier->power.must_resume = true;
>
>         device_links_read_unlock(idx);
> @@ -1695,7 +1698,8 @@ static void dpm_clear_superiors_direct_complete(struct device *dev)
>
>         idx = device_links_read_lock();
>
> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node) {
> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
> +                                device_links_read_lock_held()) {
>                 spin_lock_irq(&link->supplier->power.lock);
>                 link->supplier->power.direct_complete = false;
>                 spin_unlock_irq(&link->supplier->power.lock);
> --
> 2.17.1
>

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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
  2020-03-01 20:12 ` Rafael J. Wysocki
@ 2020-03-01 20:53   ` joel
  2020-03-01 21:23     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: joel @ 2020-03-01 20:53 UTC (permalink / raw)
  To: Rafael J. Wysocki, madhuparnabhowmik10
  Cc: Rafael J. Wysocki, Pavel Machek, Len Brown, Greg Kroah-Hartman,
	Linux PM, Linux Kernel Mailing List, frextrite,
	linux-kernel-mentees, paulmck



On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
>On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
>>
>> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>>
>> This patch passes the cond argument to list_for_each_entry_rcu()
>> to fix the following false-positive lockdep warnings:
>>
>> [  330.302784] =============================
>> [  330.302789] WARNING: suspicious RCU usage
>> [  330.302796] 5.6.0-rc1+ #5 Not tainted
>> [  330.302801] -----------------------------
>> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in
>non-reader section!!
>>
>> [  330.303303] =============================
>> [  330.303307] WARNING: suspicious RCU usage
>> [  330.303311] 5.6.0-rc1+ #5 Not tainted
>> [  330.303315] -----------------------------
>> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in
>non-reader section!!
>>
>> [  331.934969] =============================
>> [  331.934971] WARNING: suspicious RCU usage
>> [  331.934973] 5.6.0-rc1+ #5 Not tainted
>> [  331.934975] -----------------------------
>> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in
>non-reader section!!
>>
>> [  332.467772] WARNING: suspicious RCU usage
>> [  332.467775] 5.6.0-rc1+ #5 Not tainted
>> [  332.467775] -----------------------------
>> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in
>non-reader section!!
>
>I don't see these warnings in the kernels run locally here.
>
>What do you do to get them?
>
>Joel, any comments here?

You have to enable lockdep in your config. Does your setup have that?

Thanks,

- Joel


>
>>
>> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>> ---
>>  drivers/base/power/main.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
>> index 0e99a760aebd..742c05f3c1e7 100644
>> --- a/drivers/base/power/main.c
>> +++ b/drivers/base/power/main.c
>> @@ -266,7 +266,8 @@ static void dpm_wait_for_suppliers(struct device
>*dev, bool async)
>>          * callbacks freeing the link objects for the links in the
>list we're
>>          * walking.
>>          */
>> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
>> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
>> +                               device_links_read_lock_held())
>>                 if (READ_ONCE(link->status) != DL_STATE_DORMANT)
>>                         dpm_wait(link->supplier, async);
>>
>> @@ -323,7 +324,8 @@ static void dpm_wait_for_consumers(struct device
>*dev, bool async)
>>          * continue instead of trying to continue in parallel with
>its
>>          * unregistration).
>>          */
>> -       list_for_each_entry_rcu(link, &dev->links.consumers, s_node)
>> +       list_for_each_entry_rcu(link, &dev->links.consumers, s_node,
>> +                                device_links_read_lock_held())
>>                 if (READ_ONCE(link->status) != DL_STATE_DORMANT)
>>                         dpm_wait(link->consumer, async);
>>
>> @@ -1235,7 +1237,8 @@ static void dpm_superior_set_must_resume(struct
>device *dev)
>>
>>         idx = device_links_read_lock();
>>
>> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
>> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
>> +                                device_links_read_lock_held())
>>                 link->supplier->power.must_resume = true;
>>
>>         device_links_read_unlock(idx);
>> @@ -1695,7 +1698,8 @@ static void
>dpm_clear_superiors_direct_complete(struct device *dev)
>>
>>         idx = device_links_read_lock();
>>
>> -       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node)
>{
>> +       list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
>> +                                device_links_read_lock_held()) {
>>                 spin_lock_irq(&link->supplier->power.lock);
>>                 link->supplier->power.direct_complete = false;
>>                 spin_unlock_irq(&link->supplier->power.lock);
>> --
>> 2.17.1
>>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
  2020-03-01 20:53   ` joel
@ 2020-03-01 21:23     ` Rafael J. Wysocki
  2020-03-01 22:18       ` Joel Fernandes
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2020-03-01 21:23 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: Rafael J. Wysocki, madhuparnabhowmik10, Rafael J. Wysocki,
	Pavel Machek, Len Brown, Greg Kroah-Hartman, Linux PM,
	Linux Kernel Mailing List, frextrite, linux-kernel-mentees,
	paulmck

On Sun, Mar 1, 2020 at 9:53 PM <joel@joelfernandes.org> wrote:
>
>
>
> On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
> >On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
> >>
> >> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >>
> >> This patch passes the cond argument to list_for_each_entry_rcu()
> >> to fix the following false-positive lockdep warnings:
> >>
> >> [  330.302784] =============================
> >> [  330.302789] WARNING: suspicious RCU usage
> >> [  330.302796] 5.6.0-rc1+ #5 Not tainted
> >> [  330.302801] -----------------------------
> >> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in
> >non-reader section!!
> >>
> >> [  330.303303] =============================
> >> [  330.303307] WARNING: suspicious RCU usage
> >> [  330.303311] 5.6.0-rc1+ #5 Not tainted
> >> [  330.303315] -----------------------------
> >> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in
> >non-reader section!!
> >>
> >> [  331.934969] =============================
> >> [  331.934971] WARNING: suspicious RCU usage
> >> [  331.934973] 5.6.0-rc1+ #5 Not tainted
> >> [  331.934975] -----------------------------
> >> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in
> >non-reader section!!
> >>
> >> [  332.467772] WARNING: suspicious RCU usage
> >> [  332.467775] 5.6.0-rc1+ #5 Not tainted
> >> [  332.467775] -----------------------------
> >> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in
> >non-reader section!!
> >
> >I don't see these warnings in the kernels run locally here.
> >
> >What do you do to get them?
> >
> >Joel, any comments here?
>
> You have to enable lockdep in your config. Does your setup have that?

CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_PROVE_LOCKING=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_LOCKDEP=y

Anything else?

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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
  2020-03-01 21:23     ` Rafael J. Wysocki
@ 2020-03-01 22:18       ` Joel Fernandes
       [not found]         ` <CAD=jOEZ3vdNC4qTMxptaXLjs7i8TCTYjeiv9vXhcapLSkrr9RQ@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Fernandes @ 2020-03-01 22:18 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Madhuparna Bhowmik, Rafael J. Wysocki, Pavel Machek, Len Brown,
	Greg Kroah-Hartman, Linux PM, Linux Kernel Mailing List,
	Amol Grover, linux-kernel-mentees, Paul E. McKenney

On Sun, Mar 1, 2020 at 4:23 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Sun, Mar 1, 2020 at 9:53 PM <joel@joelfernandes.org> wrote:
> >
> >
> >
> > On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
> > >On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
> > >>
> > >> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> > >>
> > >> This patch passes the cond argument to list_for_each_entry_rcu()
> > >> to fix the following false-positive lockdep warnings:
> > >>
> > >> [  330.302784] =============================
> > >> [  330.302789] WARNING: suspicious RCU usage
> > >> [  330.302796] 5.6.0-rc1+ #5 Not tainted
> > >> [  330.302801] -----------------------------
> > >> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in
> > >non-reader section!!
> > >>
> > >> [  330.303303] =============================
> > >> [  330.303307] WARNING: suspicious RCU usage
> > >> [  330.303311] 5.6.0-rc1+ #5 Not tainted
> > >> [  330.303315] -----------------------------
> > >> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in
> > >non-reader section!!
> > >>
> > >> [  331.934969] =============================
> > >> [  331.934971] WARNING: suspicious RCU usage
> > >> [  331.934973] 5.6.0-rc1+ #5 Not tainted
> > >> [  331.934975] -----------------------------
> > >> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in
> > >non-reader section!!
> > >>
> > >> [  332.467772] WARNING: suspicious RCU usage
> > >> [  332.467775] 5.6.0-rc1+ #5 Not tainted
> > >> [  332.467775] -----------------------------
> > >> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in
> > >non-reader section!!
> > >
> > >I don't see these warnings in the kernels run locally here.
> > >
> > >What do you do to get them?
> > >
> > >Joel, any comments here?
> >
> > You have to enable lockdep in your config. Does your setup have that?
>
> CONFIG_LOCK_DEBUGGING_SUPPORT=y
> CONFIG_PROVE_LOCKING=y
> CONFIG_DEBUG_SPINLOCK=y
> CONFIG_DEBUG_LOCK_ALLOC=y
> CONFIG_LOCKDEP=y

This should be it. I am not sure what else Madhuparna did to trigger
it. Madhuparna, could you elaborate?

thanks,

 - Joel

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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
       [not found]         ` <CAD=jOEZ3vdNC4qTMxptaXLjs7i8TCTYjeiv9vXhcapLSkrr9RQ@mail.gmail.com>
@ 2020-03-02 17:02           ` Rafael J. Wysocki
  2020-03-03 16:09             ` Madhuparna Bhowmik
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2020-03-02 17:02 UTC (permalink / raw)
  To: Madhuparna Bhowmik
  Cc: Joel Fernandes, Rafael J. Wysocki, Rafael J. Wysocki,
	Pavel Machek, Len Brown, Greg Kroah-Hartman, Linux PM,
	Linux Kernel Mailing List, Amol Grover, linux-kernel-mentees,
	Paul E. McKenney

On Mon, Mar 2, 2020 at 1:34 PM Madhuparna Bhowmik
<madhuparnabhowmik10@gmail.com> wrote:
>
>
>
> On Mon, 2 Mar, 2020, 3:48 AM Joel Fernandes, <joel@joelfernandes.org> wrote:
>>
>> On Sun, Mar 1, 2020 at 4:23 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>> >
>> > On Sun, Mar 1, 2020 at 9:53 PM <joel@joelfernandes.org> wrote:
>> > >
>> > >
>> > >
>> > > On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
>> > > >On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
>> > > >>
>> > > >> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>> > > >>
>> > > >> This patch passes the cond argument to list_for_each_entry_rcu()
>> > > >> to fix the following false-positive lockdep warnings:
>> > > >>
>> > > >> [  330.302784] =============================
>> > > >> [  330.302789] WARNING: suspicious RCU usage
>> > > >> [  330.302796] 5.6.0-rc1+ #5 Not tainted
>> > > >> [  330.302801] -----------------------------
>> > > >> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in
>> > > >non-reader section!!
>> > > >>
>> > > >> [  330.303303] =============================
>> > > >> [  330.303307] WARNING: suspicious RCU usage
>> > > >> [  330.303311] 5.6.0-rc1+ #5 Not tainted
>> > > >> [  330.303315] -----------------------------
>> > > >> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in
>> > > >non-reader section!!
>> > > >>
>> > > >> [  331.934969] =============================
>> > > >> [  331.934971] WARNING: suspicious RCU usage
>> > > >> [  331.934973] 5.6.0-rc1+ #5 Not tainted
>> > > >> [  331.934975] -----------------------------
>> > > >> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in
>> > > >non-reader section!!
>> > > >>
>> > > >> [  332.467772] WARNING: suspicious RCU usage
>> > > >> [  332.467775] 5.6.0-rc1+ #5 Not tainted
>> > > >> [  332.467775] -----------------------------
>> > > >> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in
>> > > >non-reader section!!
>> > > >
>> > > >I don't see these warnings in the kernels run locally here.
>> > > >
>> > > >What do you do to get them?
>> > > >
>> > > >Joel, any comments here?
>> > >
>> > > You have to enable lockdep in your config. Does your setup have that?
>> >
>> > CONFIG_LOCK_DEBUGGING_SUPPORT=y
>> > CONFIG_PROVE_LOCKING=y
>> > CONFIG_DEBUG_SPINLOCK=y
>> > CONFIG_DEBUG_LOCK_ALLOC=y
>> > CONFIG_LOCKDEP=y
>>
>>
> I had CONFIG_PROVE_RCU_LIST = y and I think these warnings were triggered when I had closed my laptop (like just close without shutting down).

OK, so let's define a macro for that in this file to avoid code duplication.

And analogously in the second patch.

Thanks!

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

* Re: [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking
  2020-03-02 17:02           ` Rafael J. Wysocki
@ 2020-03-03 16:09             ` Madhuparna Bhowmik
  0 siblings, 0 replies; 7+ messages in thread
From: Madhuparna Bhowmik @ 2020-03-03 16:09 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Madhuparna Bhowmik, Joel Fernandes, Rafael J. Wysocki,
	Pavel Machek, Len Brown, Greg Kroah-Hartman, Linux PM,
	Linux Kernel Mailing List, Amol Grover, linux-kernel-mentees,
	Paul E. McKenney

On Mon, Mar 02, 2020 at 06:02:21PM +0100, Rafael J. Wysocki wrote:
> On Mon, Mar 2, 2020 at 1:34 PM Madhuparna Bhowmik
> <madhuparnabhowmik10@gmail.com> wrote:
> >
> >
> >
> > On Mon, 2 Mar, 2020, 3:48 AM Joel Fernandes, <joel@joelfernandes.org> wrote:
> >>
> >> On Sun, Mar 1, 2020 at 4:23 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >> >
> >> > On Sun, Mar 1, 2020 at 9:53 PM <joel@joelfernandes.org> wrote:
> >> > >
> >> > >
> >> > >
> >> > > On March 1, 2020 3:12:53 PM EST, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
> >> > > >On Fri, Feb 28, 2020 at 6:47 PM <madhuparnabhowmik10@gmail.com> wrote:
> >> > > >>
> >> > > >> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >> > > >>
> >> > > >> This patch passes the cond argument to list_for_each_entry_rcu()
> >> > > >> to fix the following false-positive lockdep warnings:
> >> > > >>
> >> > > >> [  330.302784] =============================
> >> > > >> [  330.302789] WARNING: suspicious RCU usage
> >> > > >> [  330.302796] 5.6.0-rc1+ #5 Not tainted
> >> > > >> [  330.302801] -----------------------------
> >> > > >> [  330.302808] drivers/base/power/main.c:326 RCU-list traversed in
> >> > > >non-reader section!!
> >> > > >>
> >> > > >> [  330.303303] =============================
> >> > > >> [  330.303307] WARNING: suspicious RCU usage
> >> > > >> [  330.303311] 5.6.0-rc1+ #5 Not tainted
> >> > > >> [  330.303315] -----------------------------
> >> > > >> [  330.303319] drivers/base/power/main.c:1698 RCU-list traversed in
> >> > > >non-reader section!!
> >> > > >>
> >> > > >> [  331.934969] =============================
> >> > > >> [  331.934971] WARNING: suspicious RCU usage
> >> > > >> [  331.934973] 5.6.0-rc1+ #5 Not tainted
> >> > > >> [  331.934975] -----------------------------
> >> > > >> [  331.934977] drivers/base/power/main.c:1238 RCU-list traversed in
> >> > > >non-reader section!!
> >> > > >>
> >> > > >> [  332.467772] WARNING: suspicious RCU usage
> >> > > >> [  332.467775] 5.6.0-rc1+ #5 Not tainted
> >> > > >> [  332.467775] -----------------------------
> >> > > >> [  332.467778] drivers/base/power/main.c:269 RCU-list traversed in
> >> > > >non-reader section!!
> >> > > >
> >> > > >I don't see these warnings in the kernels run locally here.
> >> > > >
> >> > > >What do you do to get them?
> >> > > >
> >> > > >Joel, any comments here?
> >> > >
> >> > > You have to enable lockdep in your config. Does your setup have that?
> >> >
> >> > CONFIG_LOCK_DEBUGGING_SUPPORT=y
> >> > CONFIG_PROVE_LOCKING=y
> >> > CONFIG_DEBUG_SPINLOCK=y
> >> > CONFIG_DEBUG_LOCK_ALLOC=y
> >> > CONFIG_LOCKDEP=y
> >>
> >>
> > I had CONFIG_PROVE_RCU_LIST = y and I think these warnings were triggered when I had closed my laptop (like just close without shutting down).
> 
> OK, so let's define a macro for that in this file to avoid code duplication.
> 
> And analogously in the second patch.
>
Sure, I will do it and send the patch soon.

> Thanks!

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

end of thread, other threads:[~2020-03-03 16:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 17:46 [PATCH 1/2] drivers: base: power: main: Use built-in RCU list checking madhuparnabhowmik10
2020-03-01 20:12 ` Rafael J. Wysocki
2020-03-01 20:53   ` joel
2020-03-01 21:23     ` Rafael J. Wysocki
2020-03-01 22:18       ` Joel Fernandes
     [not found]         ` <CAD=jOEZ3vdNC4qTMxptaXLjs7i8TCTYjeiv9vXhcapLSkrr9RQ@mail.gmail.com>
2020-03-02 17:02           ` Rafael J. Wysocki
2020-03-03 16:09             ` Madhuparna Bhowmik

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).