linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/watchdog.c: Only output hw-PMU message once
@ 2016-11-21 16:35 Prarit Bhargava
  2016-11-21 17:48 ` Don Zickus
  0 siblings, 1 reply; 3+ messages in thread
From: Prarit Bhargava @ 2016-11-21 16:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, Borislav Petkov, Tejun Heo, Don Zickus,
	Hidehiro Kawai, Thomas Gleixner, Andi Kleen, Joshua Hunt,
	Ingo Molnar

When CONFIG_BOOTPARAM_HOTPLUG_CPU0 is enabled, the socket containing the
boot cpu can be replaced.  During the hot add event, the message

NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.

is output implying that the NMI was disabled at some point.  This is not the
case and the message has caused confusion for users of systems that support
socket removal.

This patch modifies the message so that it only outputs a single time
during runtime.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joshua Hunt <johunt@akamai.com>
Cc: Ingo Molnar <mingo@kernel.org>
---
 kernel/watchdog.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 9acb29f280ec..560414692c01 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -615,7 +615,7 @@ static int watchdog_nmi_enable(unsigned int cpu)
 	if (!IS_ERR(event)) {
 		/* only print for cpu0 or different than cpu0 */
 		if (cpu == 0 || cpu0_err)
-			pr_info("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
+			pr_info_once("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
 		goto out_save;
 	}
 
-- 
1.7.9.3

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

* Re: [PATCH] kernel/watchdog.c: Only output hw-PMU message once
  2016-11-21 16:35 [PATCH] kernel/watchdog.c: Only output hw-PMU message once Prarit Bhargava
@ 2016-11-21 17:48 ` Don Zickus
  2016-11-21 17:59   ` Prarit Bhargava
  0 siblings, 1 reply; 3+ messages in thread
From: Don Zickus @ 2016-11-21 17:48 UTC (permalink / raw)
  To: Prarit Bhargava
  Cc: linux-kernel, Borislav Petkov, Tejun Heo, Hidehiro Kawai,
	Thomas Gleixner, Andi Kleen, Joshua Hunt, Ingo Molnar

On Mon, Nov 21, 2016 at 11:35:19AM -0500, Prarit Bhargava wrote:
> When CONFIG_BOOTPARAM_HOTPLUG_CPU0 is enabled, the socket containing the
> boot cpu can be replaced.  During the hot add event, the message
> 
> NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
> 
> is output implying that the NMI was disabled at some point.  This is not the
> case and the message has caused confusion for users of systems that support
> socket removal.
> 
> This patch modifies the message so that it only outputs a single time
> during runtime.

Hmm, it occurred to me, with pr_info_once, what happens if you disable and
re-enable, is this still printed?

echo 0 > /proc/sys/kernel/watchdog
echo 1 > /proc/sys/kernel/watchdog

Cheers,
Don

> 
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Don Zickus <dzickus@redhat.com>
> Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Joshua Hunt <johunt@akamai.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> ---
>  kernel/watchdog.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 9acb29f280ec..560414692c01 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -615,7 +615,7 @@ static int watchdog_nmi_enable(unsigned int cpu)
>  	if (!IS_ERR(event)) {
>  		/* only print for cpu0 or different than cpu0 */
>  		if (cpu == 0 || cpu0_err)
> -			pr_info("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
> +			pr_info_once("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
>  		goto out_save;
>  	}
>  
> -- 
> 1.7.9.3
> 

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

* Re: [PATCH] kernel/watchdog.c: Only output hw-PMU message once
  2016-11-21 17:48 ` Don Zickus
@ 2016-11-21 17:59   ` Prarit Bhargava
  0 siblings, 0 replies; 3+ messages in thread
From: Prarit Bhargava @ 2016-11-21 17:59 UTC (permalink / raw)
  To: Don Zickus
  Cc: linux-kernel, Borislav Petkov, Tejun Heo, Hidehiro Kawai,
	Thomas Gleixner, Andi Kleen, Joshua Hunt, Ingo Molnar



On 11/21/2016 12:48 PM, Don Zickus wrote:
> On Mon, Nov 21, 2016 at 11:35:19AM -0500, Prarit Bhargava wrote:
>> When CONFIG_BOOTPARAM_HOTPLUG_CPU0 is enabled, the socket containing the
>> boot cpu can be replaced.  During the hot add event, the message
>>
>> NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
>>
>> is output implying that the NMI was disabled at some point.  This is not the
>> case and the message has caused confusion for users of systems that support
>> socket removal.
>>
>> This patch modifies the message so that it only outputs a single time
>> during runtime.
> 
> Hmm, it occurred to me, with pr_info_once, what happens if you disable and
> re-enable, is this still printed?
> 
> echo 0 > /proc/sys/kernel/watchdog
> echo 1 > /proc/sys/kernel/watchdog

With my patch, the message is not printed using the above steps.  I'll go back
and see if I can figure something out.

P.

> 
> Cheers,
> Don
> 
>>
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Cc: Borislav Petkov <bp@suse.de>
>> Cc: Tejun Heo <tj@kernel.org>
>> Cc: Don Zickus <dzickus@redhat.com>
>> Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Joshua Hunt <johunt@akamai.com>
>> Cc: Ingo Molnar <mingo@kernel.org>
>> ---
>>  kernel/watchdog.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
>> index 9acb29f280ec..560414692c01 100644
>> --- a/kernel/watchdog.c
>> +++ b/kernel/watchdog.c
>> @@ -615,7 +615,7 @@ static int watchdog_nmi_enable(unsigned int cpu)
>>  	if (!IS_ERR(event)) {
>>  		/* only print for cpu0 or different than cpu0 */
>>  		if (cpu == 0 || cpu0_err)
>> -			pr_info("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
>> +			pr_info_once("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
>>  		goto out_save;
>>  	}
>>  
>> -- 
>> 1.7.9.3
>>

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

end of thread, other threads:[~2016-11-21 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-21 16:35 [PATCH] kernel/watchdog.c: Only output hw-PMU message once Prarit Bhargava
2016-11-21 17:48 ` Don Zickus
2016-11-21 17:59   ` Prarit Bhargava

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