mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watchdog: ignore nohz_full cores in new cpumask
@ 2021-11-12  5:14 Zqiang
  2021-11-15 15:31 ` Petr Mladek
  0 siblings, 1 reply; 3+ messages in thread
From: Zqiang @ 2021-11-12  5:14 UTC (permalink / raw)
  To: pmladek, akpm, frederic; +Cc: linux-kernel, Zqiang

If the nohz_full is enabled, when update watchdog_mask, the
nohz_full cores should be ignored.

Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
 kernel/watchdog.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index ad912511a0c0..3ef11a94783c 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -628,7 +628,9 @@ void lockup_detector_soft_poweroff(void)
 static void proc_watchdog_update(void)
 {
 	/* Remove impossible cpus to keep sysctl output clean. */
-	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
+	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, housekeeping_cpumask(HK_FLAG_TIMER));
+	if (cpumask_empty(&watchdog_cpumask))
+		return;
 	lockup_detector_reconfigure();
 }
 
-- 
2.17.1


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

* Re: [PATCH] watchdog: ignore nohz_full cores in new cpumask
  2021-11-12  5:14 [PATCH] watchdog: ignore nohz_full cores in new cpumask Zqiang
@ 2021-11-15 15:31 ` Petr Mladek
  2021-11-16  6:04   ` Zqiang
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Mladek @ 2021-11-15 15:31 UTC (permalink / raw)
  To: Zqiang; +Cc: akpm, frederic, linux-kernel

On Fri 2021-11-12 13:14:34, Zqiang wrote:
> If the nohz_full is enabled, when update watchdog_mask, the
> nohz_full cores should be ignored.
> 
> Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
> ---
>  kernel/watchdog.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index ad912511a0c0..3ef11a94783c 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -628,7 +628,9 @@ void lockup_detector_soft_poweroff(void)
>  static void proc_watchdog_update(void)
>  {
>  	/* Remove impossible cpus to keep sysctl output clean. */
> -	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
> +	cpumask_and(&watchdog_cpumask, &watchdog_cpumask,
> housekeeping_cpumask(HK_FLAG_TIMER));

I am not familiar with nozh_full code but this looks fine.


> +	if (cpumask_empty(&watchdog_cpumask))
> +		return;

But this looks looks wrong. Is there any reason for this?

We need to stop the watchdog when it was running before.

I mean that lockup_detector_reconfigure() must be called anytime
when the mask has changed even when it became empty.


>  	lockup_detector_reconfigure();
>  }

Best Regards,
Petr

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

* Re: [PATCH] watchdog: ignore nohz_full cores in new cpumask
  2021-11-15 15:31 ` Petr Mladek
@ 2021-11-16  6:04   ` Zqiang
  0 siblings, 0 replies; 3+ messages in thread
From: Zqiang @ 2021-11-16  6:04 UTC (permalink / raw)
  To: Petr Mladek; +Cc: akpm, frederic, linux-kernel


On 2021/11/15 下午11:31, Petr Mladek wrote:
> On Fri 2021-11-12 13:14:34, Zqiang wrote:
>> If the nohz_full is enabled, when update watchdog_mask, the
>> nohz_full cores should be ignored.
>>
>> Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
>> ---
>>   kernel/watchdog.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
>> index ad912511a0c0..3ef11a94783c 100644
>> --- a/kernel/watchdog.c
>> +++ b/kernel/watchdog.c
>> @@ -628,7 +628,9 @@ void lockup_detector_soft_poweroff(void)
>>   static void proc_watchdog_update(void)
>>   {
>>   	/* Remove impossible cpus to keep sysctl output clean. */
>> -	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
>> +	cpumask_and(&watchdog_cpumask, &watchdog_cpumask,
>> housekeeping_cpumask(HK_FLAG_TIMER));
> I am not familiar with nozh_full code but this looks fine.
>
>
>> +	if (cpumask_empty(&watchdog_cpumask))
>> +		return;
> But this looks looks wrong. Is there any reason for this?
>
> We need to stop the watchdog when it was running before.
>
> I mean that lockup_detector_reconfigure() must be called anytime
> when the mask has changed even when it became empty.

Thanks Petr

I will resend patch v2.

>
>
>>   	lockup_detector_reconfigure();
>>   }
> Best Regards,
> Petr

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

end of thread, other threads:[~2021-11-16  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  5:14 [PATCH] watchdog: ignore nohz_full cores in new cpumask Zqiang
2021-11-15 15:31 ` Petr Mladek
2021-11-16  6:04   ` Zqiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®