Bug 681410

Summary: nmi_watchdog settings is not preserved during suspend/resume
Product: Red Hat Enterprise Linux 6 Reporter: Travis Gummels <tgummels>
Component: kernelAssignee: Don Zickus <dzickus>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: arozansk, ddumas, woodard, ypu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-17 13:34:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Travis Gummels 2011-03-02 03:05:09 UTC
Description of problem:

On resume powertop continues suggesting disabling nmi_watchdog after it has already been disabled.

Version-Release number of selected component (if applicable):

powertop-1.11-3.1.el6

How reproducible:

1) Start powertop

2) Follow its instructions for conserving power. One will be to disable nmi_watchdog

3) Disable nmi_watchdog when powertop makes the suggestion to do so.
   Verify that it is disabled from another shell:
   cat /proc/sys/kernel/nmi_watchdog

4) Suspend the laptop by closing the lid or some other action that causes suspend.

5) Open the laptop and note that powertop gives you the suggestion to disable  nmi_watchdog.
  
Actual results:

The powertop program continues to suggest disabling nmi_watchdog after it has already been disabled.

Expected results:

The powertop program no longer suggests disabling the nmi_watchdog.

Additional info:

Comment 1 Jaroslav Škarvada 2011-03-03 11:24:47 UTC
I am unable to reproduce it.

Could you recheck that the nmi_watchdog is still disabled after the resume (by cat /proc/sys/kernel/nmi_watchdog)? Was the powertop running during the suspend or did you restart it after resume?

Comment 2 Ben Woodard 2011-03-03 16:05:53 UTC
OK here it is:

[root@snog Desktop]# cat /proc/sys/kernel/nmi_watchdog
1
[root@snog Desktop]# echo 0 > /proc/sys/kernel/nmi_watchdog
[root@snog Desktop]# cat /proc/sys/kernel/nmi_watchdog
0

<suspend, then resume>

[root@snog Desktop]# cat /proc/sys/kernel/nmi_watchdog
1
[root@snog Desktop]#

Comment 3 Jaroslav Škarvada 2011-03-03 16:35:58 UTC
Thanks, so it seems the PowerTOP is right, because the nmi_watchdog is really enabled on your machine after resume. However I am still unable to reproduce this on my test machine (T400).

Maybe it is kernel or something else who is re-enabling the nmi_watchdog on your machine, thus it is not the PowerTOP fault.

Comment 4 Ben Woodard 2011-03-03 17:01:20 UTC
I never thought it was powertop.

I believe that suspend/resume however that works needs to save the state of the nmi_watchdog during the suspend and restore it after resume. For some reason that is not working right ATM.

Are you disabling nmi_watchdog using the like I did in the original example command line in rc.local or in the kernel command line?

Comment 5 Jaroslav Škarvada 2011-03-04 20:05:39 UTC
> I never thought it was powertop.
> 
It should be reassigned to kernel or elsewhere. I can not handle this in PowerTOP.

> I believe that suspend/resume however that works needs to save the state of the
> nmi_watchdog during the suspend and restore it after resume. For some reason
> that is not working right ATM.
> 
I think it should be handled by kernel. It is also possible to create the pm-utils suspend hook, but I do not like such user-space hacks.

> Are you disabling nmi_watchdog using the like I did in the original example
> command line in rc.local or in the kernel command line?
>
I used same steps as in comment 2 but I was not able to reproduce this on my HW (RHEL-6.1 nightly).

Comment 6 Jaroslav Škarvada 2011-03-14 10:24:54 UTC
Reproduced on T500, steps to reproduce:

# cat /proc/sys/kernel/nmi_watchdog
1
# echo 0 > /proc/sys/kernel/nmi_watchdog
# cat /proc/sys/kernel/nmi_watchdog
0
# echo mem > /sys/power/state
...
[resume]
# cat /proc/sys/kernel/nmi_watchdog
1

Tested in runlevels 1, 3, 5. Reassigning to kernel for further investigation.

Comment 7 Joy Pu 2011-03-14 10:41:26 UTC
 Find the same problem in RHEL 6.1 guest in KVM test.
The guest kernel always report "NMI watchdog disabled for cpu0: unable to
create perf event: -2" even when NI watchdog is disable in RHEL 6.1 guest in
AMD host, but not find this problem in INTEL host.

Comment 8 Don Zickus 2011-03-18 14:20:54 UTC
I think the patches I submitted for bz684649 will fix this.  I need to double check.

I am brewing building those patches, it should be done in about an hour if someone wants to quickly test to see if it resolves their issue.

http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3187569

Cheers,
Don

Comment 9 Don Zickus 2011-04-13 20:10:10 UTC
Can someone try the -128.el6 kernel or later and see if the problem still exists?

Cheers,
Don

Comment 11 Don Zickus 2011-06-14 19:57:29 UTC
Hi,

Can people test RHEL-6.1 to see if this is fixed.  I believe it is.

Cheers,
Don

Comment 13 Don Zickus 2011-06-17 13:34:48 UTC
Thanks Ben.

Closing this out as fix already.

Cheers,
Don