Skip to contentSkip to conversation

Power driver patches to avoid lockdep complaints

DISCUSSION Paul E. McKenney 4 participants 14 messages Jun 15, 2016 – Sep 15, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Thanx, Paul

#1 lore raw

Hi,

Quoted 6 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

Quoted 7 lines

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

Regards,

Tony

#2 lore raw
Quoted 14 lines · Tony Lindgren

Hi,

Quoted 11 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

Quoted 6 lines
Quoted 2 lines

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Thanks,
Rafael

#3 lore raw
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

Regards,

Tony

#4 lore raw
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Thanks,
Rafael

author Tested-by Tony Lindgren Tested-by Guenter Roeck
#5 lore raw
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Strange. When I do "git show 13e698e68f75" in my local -rcu repo, I get the following. I get the same from my test repository that pulls from kernel.org, and also when I "git clone" a fresh image of -rcu.

So maybe a fresh clone of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git?

I have added the other two commits as attachments, so feel free to apply them from this email, if that works better for you.

Thanx, Paul

------------------------------------------------------------------------

commit 13e698e68f75708c45241a2dad23cd6b65181056

Author: Paul E. McKenney <[email protected]>
Date:   Tue Apr 26 10:42:25 2016 -0700

power: Use _rcuidle for suspend/resume tracepoints

Further testing with false negatives suppressed by commit 293e2421fe25 ("rcu: Remove superfluous versions of rcu_read_lock_sched_held()") identified a few more unprotected uses of RCU from the idle loop. Because RCU actively ignores idle-loop code (for energy-efficiency reasons, among other things), using RCU from the idle loop can result in too-short grace periods, in turn resulting in arbitrary misbehavior.

The affected function is rpm_suspend().

The resulting lockdep-RCU splat is as follows:

------------------------------------------------------------------------

Warning from omap3
===============================
[ INFO: suspicious RCU usage. ]
4.6.0-rc5-next-20160426+ #1112 Not tainted
-------------------------------
include/trace/events/rpm.h:63 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 0
RCU used illegally from extended quiescent state!
1 lock held by swapper/0/0:
#0: (&(&dev->power.lock)->rlock){-.-...}, at: [<c052ee24>] __pm_runtime_suspend+0x54/0x84

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1112 Hardware name: Generic OMAP36xx (Flattened Device Tree)
[<c0110308>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14) [<c010c3a8>] (show_stack) from [<c047fec8>] (dump_stack+0xb0/0xe4) [<c047fec8>] (dump_stack) from [<c052d7b4>] (rpm_suspend+0x604/0x7e4) [<c052d7b4>] (rpm_suspend) from [<c052ee34>] (__pm_runtime_suspend+0x64/0x84) [<c052ee34>] (__pm_runtime_suspend) from [<c04bf3bc>] (omap2_gpio_prepare_for_idle+0x5c/0x70) [<c04bf3bc>] (omap2_gpio_prepare_for_idle) from [<c01255e8>] (omap_sram_idle+0x140/0x244) [<c01255e8>] (omap_sram_idle) from [<c0126b48>] (omap3_enter_idle_bm+0xfc/0x1ec) [<c0126b48>] (omap3_enter_idle_bm) from [<c0601db8>] (cpuidle_enter_state+0x80/0x3d4) [<c0601db8>] (cpuidle_enter_state) from [<c0183c74>] (cpu_startup_entry+0x198/0x3a0) [<c0183c74>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8) [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)

------------------------------------------------------------------------

drivers/base/power/runtime.c +2 -2
index fd553d0cbb6b..15b6d5b199d4 100644
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval;
 
-	trace_rpm_suspend(dev, rpmflags);
+	trace_rpm_suspend_rcuidle(dev, rpmflags);
 
  repeat:
 	retval = rpm_check_suspend_allowed(dev);
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	}
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;
 

commit 320e2a2d081b6c519f80fca9377b8fb90db7bb9c

Author: Paul E. McKenney <[email protected]>
Date:   Tue Apr 26 13:38:55 2016 -0700
    power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
    
    This commit applies another _rcuidle suffix to fix an RCU use from
    idle.
    
    > ===============================
    > [ INFO: suspicious RCU usage. ]
    > 4.6.0-rc5-next-20160426+ #1122 Not tainted
    > -------------------------------
    > include/trace/events/rpm.h:69 suspicious rcu_dereference_check() usage!
    >
    > other info that might help us debug this:
    >
    >
    > RCU used illegally from idle CPU!
    > rcu_scheduler_active = 1, debug_locks = 0
    > RCU used illegally from extended quiescent state!
    > 1 lock held by swapper/0/0:
    >  #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052e3dc>] __pm_runtime_resume+0x3c/0x64
    >
    > stack backtrace:
    > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1122
    > Hardware name: Generic OMAP36xx (Flattened Device Tree)
    > [<c0110290>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
    > [<c010c3a8>] (show_stack) from [<c047fd68>] (dump_stack+0xb0/0xe4)
    > [<c047fd68>] (dump_stack) from [<c052e178>] (rpm_resume+0x5cc/0x7f4)
    > [<c052e178>] (rpm_resume) from [<c052e3ec>] (__pm_runtime_resume+0x4c/0x64)
    > [<c052e3ec>] (__pm_runtime_resume) from [<c04bf2c4>] (omap2_gpio_resume_after_idle+0x54/0x68)
    > [<c04bf2c4>] (omap2_gpio_resume_after_idle) from [<c01269dc>] (omap3_enter_idle_bm+0xfc/0x1ec)
    > [<c01269dc>] (omap3_enter_idle_bm) from [<c060198c>] (cpuidle_enter_state+0x80/0x3d4)
    > [<c060198c>] (cpuidle_enter_state) from [<c0183b08>] (cpu_startup_entry+0x198/0x3a0)
    > [<c0183b08>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
    > [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)
    
    Reported-by: Tony Lindgren <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Tested-by: Tony Lindgren <[email protected]>
    Tested-by: Guenter Roeck <[email protected]>
    Cc: Russell King <[email protected]>
    Cc: Steven Rostedt <[email protected]>
    Cc: "Rafael J. Wysocki" <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
drivers/base/power/runtime.c +2 -2
index da38ecf022f7..fd553d0cbb6b 100644
@@ -601,7 +601,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval = 0;
 
-	trace_rpm_resume(dev, rpmflags);
+	trace_rpm_resume_rcuidle(dev, rpmflags);
 
  repeat:
 	if (dev->power.runtime_error)
@@ -764,7 +764,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 		spin_lock_irq(&dev->power.lock);
 	}
 
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;
 }

commit b72aadb1d082d3935cbffd60e979238252045971

Author: Paul E. McKenney <[email protected]>
Date:   Tue Apr 26 13:03:51 2016 -0700
    power: Add _rcuidle suffix to allow rpm_idle() use from idle
    
    This commit appends a few _rcuidle suffixes to fix the following
    RCU-used-from-idle bug:
    
    > ===============================
    > [ INFO: suspicious RCU usage. ]
    > 4.6.0-rc5-next-20160426+ #1116 Not tainted
    > -------------------------------
    > include/trace/events/rpm.h:95 suspicious rcu_dereference_check() usage!
    >
    > other info that might help us debug this:
    >
    >
    > RCU used illegally from idle CPU!
    > rcu_scheduler_active = 1, debug_locks = 0
    > RCU used illegally from extended quiescent state!
    > 1 lock held by swapper/0/0:
    >  #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052cc2c>] __rpm_callback+0x58/0x60
    >
    > stack backtrace:
    > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1116
    > Hardware name: Generic OMAP36xx (Flattened Device Tree)
    > [<c0110290>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
    > [<c010c3a8>] (show_stack) from [<c047fd68>] (dump_stack+0xb0/0xe4)
    > [<c047fd68>] (dump_stack) from [<c052d5d0>] (rpm_suspend+0x580/0x768)
    > [<c052d5d0>] (rpm_suspend) from [<c052ec58>] (__pm_runtime_suspend+0x64/0x84)
    > [<c052ec58>] (__pm_runtime_suspend) from [<c04bf25c>] (omap2_gpio_prepare_for_idle+0x5c/0x70)
    > [<c04bf25c>] (omap2_gpio_prepare_for_idle) from [<c0125568>] (omap_sram_idle+0x140/0x244)
    > [<c0125568>] (omap_sram_idle) from [<c01269dc>] (omap3_enter_idle_bm+0xfc/0x1ec)
    > [<c01269dc>] (omap3_enter_idle_bm) from [<c0601bdc>] (cpuidle_enter_state+0x80/0x3d4)
    > [<c0601bdc>] (cpuidle_enter_state) from [<c0183b08>] (cpu_startup_entry+0x198/0x3a0)
    > [<c0183b08>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
    > [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)
    
    In the immortal words of Steven Rostedt, "*Whack* *Whack* *Whack*!!!"
    
    Reported-by: Tony Lindgren <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Tested-by: Tony Lindgren <[email protected]>
    Tested-by: Guenter Roeck <[email protected]>
    Cc: Russell King <[email protected]>
    WhACKED-by: Steven Rostedt <[email protected]>
    Cc: "Rafael J. Wysocki" <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
drivers/base/power/runtime.c +3 -3
index 4c7055009bd6..da38ecf022f7 100644
@@ -301,7 +301,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	int (*callback)(struct device *);
 	int retval;
 
-	trace_rpm_idle(dev, rpmflags);
+	trace_rpm_idle_rcuidle(dev, rpmflags);
 	retval = rpm_check_suspend_allowed(dev);
 	if (retval < 0)
 		;	/* Conditions are wrong. */
@@ -337,7 +337,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 			dev->power.request_pending = true;
 			queue_work(pm_wq, &dev->power.work);
 		}
-		trace_rpm_return_int(dev, _THIS_IP_, 0);
+		trace_rpm_return_int_rcuidle(dev, _THIS_IP_, 0);
 		return 0;
 	}
 
@@ -352,7 +352,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	wake_up_all(&dev->power.wait_queue);
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 	return retval ? retval : rpm_suspend(dev, rpmflags | RPM_AUTO);
 }
 
#6 lore raw
In reply to Rafael J. Wysocki
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably some easy way to do that temporarily too :)

But now doing git fetch --no-tags rcu here with produces this for me:
...

 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

Paul, do you have 13e698e68f75 still somewhere or want me to push out a branch with that?

Regards,

Tony

#7 lore raw
Quoted 61 lines · Tony Lindgren
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably some easy way to do that temporarily too :)

Quoted 7 lines

But now doing git fetch --no-tags rcu here with produces this for me:
...

 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

The trick is that rcu/dev and rcu/next simply mark my current development branch and the stuff I want Stephen Rothwell to pull into -next, respectively.

Quoted 2 lines

Paul, do you have 13e698e68f75 still somewhere or want me to push out a branch with that?

The permanent branch name for those changes is power.2016.06.15a, so those should be pullable from anywhere.

Or please do feel free to push from your tree if that works better. However they get where they need to go, I am good! ;-)

Thanx, Paul

#8 lore raw
Quoted 74 lines · Paul E. McKenney
Quoted 61 lines · Tony Lindgren
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably some easy way to do that temporarily too :)

Quoted 7 lines

But now doing git fetch --no-tags rcu here with produces this for me:
...

 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

The trick is that rcu/dev and rcu/next simply mark my current development branch and the stuff I want Stephen Rothwell to pull into -next, respectively.

Quoted 8 lines
Quoted 2 lines

Paul, do you have 13e698e68f75 still somewhere or want me to push out a branch with that?

The permanent branch name for those changes is power.2016.06.15a, so those should be pullable from anywhere.

Or please do feel free to push from your tree if that works better. However they get where they need to go, I am good! ;-)

I guess I'll just apply the patches you've sent directly then.

Thanks,
Rafael

#9 lore raw
Quoted 78 lines · Rafael J. Wysocki
Quoted 77 lines · Paul E. McKenney
Quoted 61 lines · Tony Lindgren
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably some easy way to do that temporarily too :)

Quoted 7 lines

But now doing git fetch --no-tags rcu here with produces this for me:
...

 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

The trick is that rcu/dev and rcu/next simply mark my current development branch and the stuff I want Stephen Rothwell to pull into -next, respectively.

Quoted 2 lines

Paul, do you have 13e698e68f75 still somewhere or want me to push out a branch with that?

Quoted 7 lines
Quoted 5 lines

The permanent branch name for those changes is power.2016.06.15a, so those should be pullable from anywhere.

Or please do feel free to push from your tree if that works better. However they get where they need to go, I am good! ;-)

I guess I'll just apply the patches you've sent directly then.

Works for me!

Thanx, Paul

#10 lore raw

Hi,

Quoted 82 lines · Paul E. McKenney
Quoted 81 lines · Rafael J. Wysocki
Quoted 80 lines · Paul E. McKenney
Quoted 61 lines · Tony Lindgren
Quoted 43 lines · Rafael J. Wysocki
Quoted 28 lines · Tony Lindgren
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Tony Lindgren

Hi,

Quoted 13 lines · Paul E. McKenney

Hello!

Ingo was not comfortable taking these through -tip, which is understandable, given that they don't depend on each other or on anything else not already in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for suspend/resume tracepoints) in my -rcu tree:

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Quoted 6 lines
Quoted 3 lines

Rafael, looks like commit 13e698e68f75 is still missing from the mainline tree. Care to merge it to your fixes so I don't have to keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from. The above gives me "Already up-to-date."

Here are the ones still missing:

Quoted 7 lines
$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

Quoted 7 lines
$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably some easy way to do that temporarily too :)

Quoted 7 lines

But now doing git fetch --no-tags rcu here with produces this for me:
...

 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

The trick is that rcu/dev and rcu/next simply mark my current development branch and the stuff I want Stephen Rothwell to pull into -next, respectively.

Quoted 2 lines

Paul, do you have 13e698e68f75 still somewhere or want me to push out a branch with that?

The permanent branch name for those changes is power.2016.06.15a, so those should be pullable from anywhere.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Or please do feel free to push from your tree if that works better. However they get where they need to go, I am good! ;-)

I guess I'll just apply the patches you've sent directly then.

Works for me!

Rafael, I'm still not seeing these applied, care to check?

Regards,

Tony

#11 lore raw
Quoted 1 line · Tony Lindgren

Rafael, I'm still not seeing these applied, care to check?

Sorry looks like only one of the three fixes is missing from current mainline:

13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")

So I'm still getting warning out of box with omap2plus_defconfig.

Regards,

Tony

#12 lore raw
Quoted 9 lines · Tony Lindgren
Quoted 1 line · Tony Lindgren

Rafael, I'm still not seeing these applied, care to check?

Sorry looks like only one of the three fixes is missing from current mainline:

13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")

So I'm still getting warning out of box with omap2plus_defconfig.

It's not been applied, because I was unaware of it.

Care to send it to me as a patch?

Thanks,
Rafael

Tested-by Tested-by Guenter Roeck
#13 lore raw
Quoted 4 lines · Rafael J. Wysocki
Quoted 3 lines · Tony Lindgren
Quoted 1 line · Tony Lindgren

Rafael, I'm still not seeing these applied, care to check?

Quoted 8 lines
Quoted 6 lines

Sorry looks like only one of the three fixes is missing from current mainline:

13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")

So I'm still getting warning out of box with omap2plus_defconfig.

It's not been applied, because I was unaware of it.

OK well good thing I bugged you then :)

Quoted 1 line

Care to send it to me as a patch?

Below produced with git show --pretty=email 13e698e68f75.

Regards,

Tony

8< ------------------------

Quoted 1 line

From 13e698e68f75708c45241a2dad23cd6b65181056 Mon Sep 17 00:00:00 2001

From: "Paul E. McKenney" <[email protected]>
Date: Tue, 26 Apr 2016 10:42:25 -0700
Subject: [PATCH] power: Use _rcuidle for suspend/resume tracepoints

Further testing with false negatives suppressed by commit 293e2421fe25 ("rcu: Remove superfluous versions of rcu_read_lock_sched_held()") identified a few more unprotected uses of RCU from the idle loop. Because RCU actively ignores idle-loop code (for energy-efficiency reasons, among other things), using RCU from the idle loop can result in too-short grace periods, in turn resulting in arbitrary misbehavior.

The affected function is rpm_suspend().

The resulting lockdep-RCU splat is as follows:

------------------------------------------------------------------------

Warning from omap3
===============================
[ INFO: suspicious RCU usage. ]
4.6.0-rc5-next-20160426+ #1112 Not tainted
-------------------------------
include/trace/events/rpm.h:63 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 0
RCU used illegally from extended quiescent state!
1 lock held by swapper/0/0:
#0: (&(&dev->power.lock)->rlock){-.-...}, at: [<c052ee24>] __pm_runtime_suspend+0x54/0x84

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1112
Hardware name: Generic OMAP36xx (Flattened Device Tree)
[<c0110308>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
[<c010c3a8>] (show_stack) from [<c047fec8>] (dump_stack+0xb0/0xe4)
[<c047fec8>] (dump_stack) from [<c052d7b4>] (rpm_suspend+0x604/0x7e4)
[<c052d7b4>] (rpm_suspend) from [<c052ee34>] (__pm_runtime_suspend+0x64/0x84)
[<c052ee34>] (__pm_runtime_suspend) from [<c04bf3bc>] (omap2_gpio_prepare_for_idle+0x5c/0x70)
[<c04bf3bc>] (omap2_gpio_prepare_for_idle) from [<c01255e8>] (omap_sram_idle+0x140/0x244)
[<c01255e8>] (omap_sram_idle) from [<c0126b48>] (omap3_enter_idle_bm+0xfc/0x1ec)
[<c0126b48>] (omap3_enter_idle_bm) from [<c0601db8>] (cpuidle_enter_state+0x80/0x3d4)
[<c0601db8>] (cpuidle_enter_state) from [<c0183c74>] (cpu_startup_entry+0x198/0x3a0)
[<c0183c74>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)

[<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)

------------------------------------------------------------------------

drivers/base/power/runtime.c +2 -2
index fd553d0..15b6d5b 100644
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval;
 
-	trace_rpm_suspend(dev, rpmflags);
+	trace_rpm_suspend_rcuidle(dev, rpmflags);
 
  repeat:
 	retval = rpm_check_suspend_allowed(dev);
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	}
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;