linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor
@ 2012-11-20  9:48 Li Zhong
  2012-11-20 15:34 ` Paul E. McKenney
  2012-11-20 16:04 ` Rik van Riel
  0 siblings, 2 replies; 5+ messages in thread
From: Li Zhong @ 2012-11-20  9:48 UTC (permalink / raw)
  To: linux-next list; +Cc: riel, youquan.song, rafael.j.wysocki, paulmck

I saw this suspicious RCU usage on the next tree of 11/15

[   67.123404] ===============================
[   67.123413] [ INFO: suspicious RCU usage. ]
[   67.123423] 3.7.0-rc5-next-20121115-dirty #1 Not tainted
[   67.123434] -------------------------------
[   67.123444] include/trace/events/timer.h:186 suspicious rcu_dereference_check() usage!
[   67.123458] 
[   67.123458] other info that might help us debug this:
[   67.123458] 
[   67.123474] 
[   67.123474] RCU used illegally from idle CPU!
[   67.123474] rcu_scheduler_active = 1, debug_locks = 0
[   67.123493] RCU used illegally from extended quiescent state!
[   67.123507] 1 lock held by swapper/1/0:
[   67.123516]  #0:  (&cpu_base->lock){-.-...}, at: [<c0000000000979b0>] .__hrtimer_start_range_ns+0x28c/0x524
[   67.123555] 
[   67.123555] stack backtrace:
[   67.123566] Call Trace:
[   67.123576] [c0000001e2ccb920] [c00000000001275c] .show_stack+0x78/0x184 (unreliable)
[   67.123599] [c0000001e2ccb9d0] [c0000000000c15a0] .lockdep_rcu_suspicious+0x120/0x148
[   67.123619] [c0000001e2ccba70] [c00000000009601c] .enqueue_hrtimer+0x1c0/0x1c8
[   67.123639] [c0000001e2ccbb00] [c000000000097aa0] .__hrtimer_start_range_ns+0x37c/0x524
[   67.123660] [c0000001e2ccbc20] [c0000000005c9698] .menu_select+0x508/0x5bc
[   67.123678] [c0000001e2ccbd20] [c0000000005c740c] .cpuidle_idle_call+0xa8/0x6e4
[   67.123699] [c0000001e2ccbdd0] [c0000000000459a0] .pSeries_idle+0x10/0x34
[   67.123717] [c0000001e2ccbe40] [c000000000014dc8] .cpu_idle+0x130/0x280
[   67.123738] [c0000001e2ccbee0] [c0000000006ffa8c] .start_secondary+0x378/0x384
[   67.123758] [c0000001e2ccbf90] [c00000000000936c] .start_secondary_prolog+0x10/0x14

hrtimer_start was added in 198fd638 and ae515197. The patch below tries
to use RCU_NONIDLE around it to avoid the above report. 

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 drivers/cpuidle/governors/menu.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 2efee27..bd40b94 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -407,8 +407,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 		perfect_us = perfect_cstate_ms * 1000;
 
 		if (repeat && (4 * timer_us < data->expected_us)) {
-			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
-				HRTIMER_MODE_REL_PINNED);
+			RCU_NONIDLE(hrtimer_start(hrtmr,
+				ns_to_ktime(1000 * timer_us),
+				HRTIMER_MODE_REL_PINNED));
 			/* In repeat case, menu hrtimer is started */
 			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_REPEAT;
 		} else if (perfect_us < data->expected_us) {
@@ -418,8 +419,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 			 * In that case, it makes sense to re-enter
 			 * into a deeper C-state after some time.
 			 */
-			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
-				HRTIMER_MODE_REL_PINNED);
+			RCU_NONIDLE(hrtimer_start(hrtmr,
+				ns_to_ktime(1000 * timer_us),
+				HRTIMER_MODE_REL_PINNED));
 			/* In general case, menu hrtimer is started */
 			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_GENERAL;
 		}
-- 
1.7.1

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

* Re: [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor
  2012-11-20  9:48 [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor Li Zhong
@ 2012-11-20 15:34 ` Paul E. McKenney
  2012-11-20 16:04 ` Rik van Riel
  1 sibling, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2012-11-20 15:34 UTC (permalink / raw)
  To: Li Zhong; +Cc: linux-next list, riel, youquan.song, rafael.j.wysocki

On Tue, Nov 20, 2012 at 05:48:13PM +0800, Li Zhong wrote:
> I saw this suspicious RCU usage on the next tree of 11/15
> 
> [   67.123404] ===============================
> [   67.123413] [ INFO: suspicious RCU usage. ]
> [   67.123423] 3.7.0-rc5-next-20121115-dirty #1 Not tainted
> [   67.123434] -------------------------------
> [   67.123444] include/trace/events/timer.h:186 suspicious rcu_dereference_check() usage!
> [   67.123458] 
> [   67.123458] other info that might help us debug this:
> [   67.123458] 
> [   67.123474] 
> [   67.123474] RCU used illegally from idle CPU!
> [   67.123474] rcu_scheduler_active = 1, debug_locks = 0
> [   67.123493] RCU used illegally from extended quiescent state!
> [   67.123507] 1 lock held by swapper/1/0:
> [   67.123516]  #0:  (&cpu_base->lock){-.-...}, at: [<c0000000000979b0>] .__hrtimer_start_range_ns+0x28c/0x524
> [   67.123555] 
> [   67.123555] stack backtrace:
> [   67.123566] Call Trace:
> [   67.123576] [c0000001e2ccb920] [c00000000001275c] .show_stack+0x78/0x184 (unreliable)
> [   67.123599] [c0000001e2ccb9d0] [c0000000000c15a0] .lockdep_rcu_suspicious+0x120/0x148
> [   67.123619] [c0000001e2ccba70] [c00000000009601c] .enqueue_hrtimer+0x1c0/0x1c8
> [   67.123639] [c0000001e2ccbb00] [c000000000097aa0] .__hrtimer_start_range_ns+0x37c/0x524
> [   67.123660] [c0000001e2ccbc20] [c0000000005c9698] .menu_select+0x508/0x5bc
> [   67.123678] [c0000001e2ccbd20] [c0000000005c740c] .cpuidle_idle_call+0xa8/0x6e4
> [   67.123699] [c0000001e2ccbdd0] [c0000000000459a0] .pSeries_idle+0x10/0x34
> [   67.123717] [c0000001e2ccbe40] [c000000000014dc8] .cpu_idle+0x130/0x280
> [   67.123738] [c0000001e2ccbee0] [c0000000006ffa8c] .start_secondary+0x378/0x384
> [   67.123758] [c0000001e2ccbf90] [c00000000000936c] .start_secondary_prolog+0x10/0x14
> 
> hrtimer_start was added in 198fd638 and ae515197. The patch below tries
> to use RCU_NONIDLE around it to avoid the above report. 
> 
> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> ---
>  drivers/cpuidle/governors/menu.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 2efee27..bd40b94 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -407,8 +407,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>  		perfect_us = perfect_cstate_ms * 1000;
> 
>  		if (repeat && (4 * timer_us < data->expected_us)) {
> -			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
> -				HRTIMER_MODE_REL_PINNED);
> +			RCU_NONIDLE(hrtimer_start(hrtmr,
> +				ns_to_ktime(1000 * timer_us),
> +				HRTIMER_MODE_REL_PINNED));
>  			/* In repeat case, menu hrtimer is started */
>  			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_REPEAT;
>  		} else if (perfect_us < data->expected_us) {
> @@ -418,8 +419,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>  			 * In that case, it makes sense to re-enter
>  			 * into a deeper C-state after some time.
>  			 */
> -			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
> -				HRTIMER_MODE_REL_PINNED);
> +			RCU_NONIDLE(hrtimer_start(hrtmr,
> +				ns_to_ktime(1000 * timer_us),
> +				HRTIMER_MODE_REL_PINNED));
>  			/* In general case, menu hrtimer is started */
>  			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_GENERAL;
>  		}
> -- 
> 1.7.1
> 
> 

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

* Re: [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor
  2012-11-20  9:48 [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor Li Zhong
  2012-11-20 15:34 ` Paul E. McKenney
@ 2012-11-20 16:04 ` Rik van Riel
  1 sibling, 0 replies; 5+ messages in thread
From: Rik van Riel @ 2012-11-20 16:04 UTC (permalink / raw)
  To: Li Zhong; +Cc: linux-next list, youquan.song, rafael.j.wysocki, paulmck

On 11/20/2012 04:48 AM, Li Zhong wrote:
> I saw this suspicious RCU usage on the next tree of 11/15
>
> [   67.123404] ===============================
> [   67.123413] [ INFO: suspicious RCU usage. ]
> [   67.123423] 3.7.0-rc5-next-20121115-dirty #1 Not tainted
> [   67.123434] -------------------------------
> [   67.123444] include/trace/events/timer.h:186 suspicious rcu_dereference_check() usage!

> hrtimer_start was added in 198fd638 and ae515197. The patch below tries
> to use RCU_NONIDLE around it to avoid the above report.
>
> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>

Reviewed-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

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

* [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor
@ 2012-11-22  1:45 Li Zhong
  2012-11-22 23:12 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Li Zhong @ 2012-11-22  1:45 UTC (permalink / raw)
  To: linux-next list, linux-pm; +Cc: riel, youquan.song, rafael.j.wysocki, paulmck

Adding linux-pm list, and ACKs.

I saw this suspicious RCU usage on the next tree of 11/15

[   67.123404] ===============================
[   67.123413] [ INFO: suspicious RCU usage. ]
[   67.123423] 3.7.0-rc5-next-20121115-dirty #1 Not tainted
[   67.123434] -------------------------------
[   67.123444] include/trace/events/timer.h:186 suspicious rcu_dereference_check() usage!
[   67.123458] 
[   67.123458] other info that might help us debug this:
[   67.123458] 
[   67.123474] 
[   67.123474] RCU used illegally from idle CPU!
[   67.123474] rcu_scheduler_active = 1, debug_locks = 0
[   67.123493] RCU used illegally from extended quiescent state!
[   67.123507] 1 lock held by swapper/1/0:
[   67.123516]  #0:  (&cpu_base->lock){-.-...}, at: [<c0000000000979b0>] .__hrtimer_start_range_ns+0x28c/0x524
[   67.123555] 
[   67.123555] stack backtrace:
[   67.123566] Call Trace:
[   67.123576] [c0000001e2ccb920] [c00000000001275c] .show_stack+0x78/0x184 (unreliable)
[   67.123599] [c0000001e2ccb9d0] [c0000000000c15a0] .lockdep_rcu_suspicious+0x120/0x148
[   67.123619] [c0000001e2ccba70] [c00000000009601c] .enqueue_hrtimer+0x1c0/0x1c8
[   67.123639] [c0000001e2ccbb00] [c000000000097aa0] .__hrtimer_start_range_ns+0x37c/0x524
[   67.123660] [c0000001e2ccbc20] [c0000000005c9698] .menu_select+0x508/0x5bc
[   67.123678] [c0000001e2ccbd20] [c0000000005c740c] .cpuidle_idle_call+0xa8/0x6e4
[   67.123699] [c0000001e2ccbdd0] [c0000000000459a0] .pSeries_idle+0x10/0x34
[   67.123717] [c0000001e2ccbe40] [c000000000014dc8] .cpu_idle+0x130/0x280
[   67.123738] [c0000001e2ccbee0] [c0000000006ffa8c] .start_secondary+0x378/0x384
[   67.123758] [c0000001e2ccbf90] [c00000000000936c] .start_secondary_prolog+0x10/0x14

hrtimer_start was added in 198fd638 and ae515197. The patch below tries
to use RCU_NONIDLE around it to avoid the above report. 

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
---
 drivers/cpuidle/governors/menu.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 2efee27..bd40b94 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -407,8 +407,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 		perfect_us = perfect_cstate_ms * 1000;
 
 		if (repeat && (4 * timer_us < data->expected_us)) {
-			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
-				HRTIMER_MODE_REL_PINNED);
+			RCU_NONIDLE(hrtimer_start(hrtmr,
+				ns_to_ktime(1000 * timer_us),
+				HRTIMER_MODE_REL_PINNED));
 			/* In repeat case, menu hrtimer is started */
 			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_REPEAT;
 		} else if (perfect_us < data->expected_us) {
@@ -418,8 +419,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 			 * In that case, it makes sense to re-enter
 			 * into a deeper C-state after some time.
 			 */
-			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
-				HRTIMER_MODE_REL_PINNED);
+			RCU_NONIDLE(hrtimer_start(hrtmr,
+				ns_to_ktime(1000 * timer_us),
+				HRTIMER_MODE_REL_PINNED));
 			/* In general case, menu hrtimer is started */
 			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_GENERAL;
 		}
-- 
1.7.1

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

* Re: [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor
  2012-11-22  1:45 Li Zhong
@ 2012-11-22 23:12 ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-11-22 23:12 UTC (permalink / raw)
  To: Li Zhong; +Cc: linux-next list, linux-pm, riel, youquan.song, paulmck

On 11/22/2012 2:45 AM, Li Zhong wrote:
> Adding linux-pm list, and ACKs.
>
> I saw this suspicious RCU usage on the next tree of 11/15
>
> [   67.123404] ===============================
> [   67.123413] [ INFO: suspicious RCU usage. ]
> [   67.123423] 3.7.0-rc5-next-20121115-dirty #1 Not tainted
> [   67.123434] -------------------------------
> [   67.123444] include/trace/events/timer.h:186 suspicious rcu_dereference_check() usage!
> [   67.123458]
> [   67.123458] other info that might help us debug this:
> [   67.123458]
> [   67.123474]
> [   67.123474] RCU used illegally from idle CPU!
> [   67.123474] rcu_scheduler_active = 1, debug_locks = 0
> [   67.123493] RCU used illegally from extended quiescent state!
> [   67.123507] 1 lock held by swapper/1/0:
> [   67.123516]  #0:  (&cpu_base->lock){-.-...}, at: [<c0000000000979b0>] .__hrtimer_start_range_ns+0x28c/0x524
> [   67.123555]
> [   67.123555] stack backtrace:
> [   67.123566] Call Trace:
> [   67.123576] [c0000001e2ccb920] [c00000000001275c] .show_stack+0x78/0x184 (unreliable)
> [   67.123599] [c0000001e2ccb9d0] [c0000000000c15a0] .lockdep_rcu_suspicious+0x120/0x148
> [   67.123619] [c0000001e2ccba70] [c00000000009601c] .enqueue_hrtimer+0x1c0/0x1c8
> [   67.123639] [c0000001e2ccbb00] [c000000000097aa0] .__hrtimer_start_range_ns+0x37c/0x524
> [   67.123660] [c0000001e2ccbc20] [c0000000005c9698] .menu_select+0x508/0x5bc
> [   67.123678] [c0000001e2ccbd20] [c0000000005c740c] .cpuidle_idle_call+0xa8/0x6e4
> [   67.123699] [c0000001e2ccbdd0] [c0000000000459a0] .pSeries_idle+0x10/0x34
> [   67.123717] [c0000001e2ccbe40] [c000000000014dc8] .cpu_idle+0x130/0x280
> [   67.123738] [c0000001e2ccbee0] [c0000000006ffa8c] .start_secondary+0x378/0x384
> [   67.123758] [c0000001e2ccbf90] [c00000000000936c] .start_secondary_prolog+0x10/0x14
>
> hrtimer_start was added in 198fd638 and ae515197. The patch below tries
> to use RCU_NONIDLE around it to avoid the above report.

Applied to the linux-next branch of the linux-pm.git tree as v3.8 material.

Thanks,
Rafael


> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Reviewed-by: Rik van Riel <riel@redhat.com>
> ---
>   drivers/cpuidle/governors/menu.c |   10 ++++++----
>   1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 2efee27..bd40b94 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -407,8 +407,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   		perfect_us = perfect_cstate_ms * 1000;
>   
>   		if (repeat && (4 * timer_us < data->expected_us)) {
> -			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
> -				HRTIMER_MODE_REL_PINNED);
> +			RCU_NONIDLE(hrtimer_start(hrtmr,
> +				ns_to_ktime(1000 * timer_us),
> +				HRTIMER_MODE_REL_PINNED));
>   			/* In repeat case, menu hrtimer is started */
>   			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_REPEAT;
>   		} else if (perfect_us < data->expected_us) {
> @@ -418,8 +419,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   			 * In that case, it makes sense to re-enter
>   			 * into a deeper C-state after some time.
>   			 */
> -			hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
> -				HRTIMER_MODE_REL_PINNED);
> +			RCU_NONIDLE(hrtimer_start(hrtmr,
> +				ns_to_ktime(1000 * timer_us),
> +				HRTIMER_MODE_REL_PINNED));
>   			/* In general case, menu hrtimer is started */
>   			per_cpu(hrtimer_status, cpu) = MENU_HRTIMER_GENERAL;
>   		}

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

end of thread, other threads:[~2012-11-22 23:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20  9:48 [PATCH linux-next] cpuidle: fix a suspicious RCU usage in menu governor Li Zhong
2012-11-20 15:34 ` Paul E. McKenney
2012-11-20 16:04 ` Rik van Riel
  -- strict thread matches above, loose matches on Subject: below --
2012-11-22  1:45 Li Zhong
2012-11-22 23:12 ` Rafael J. Wysocki

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