Re: [PATCH v2] watchdog: Fix a watchdog crash in some configurations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  5 May 2015 12:38:11 -0700 john.hubbard@xxxxxxxxx wrote:

> From: John Hubbard <jhubbard@xxxxxxxxxx>
> 
> Commit 8fcf2cc768acd845c1fed837bf9cfe2d7106336d in linux-next
> introduced a regression in some configurations. Specifically,
> with CONFIG_NO_HZ_FULL set, and CONFIG_NO_HZ_FULL_ALL *not* set,
> the kernel will crash in lockup_detector_init(), due to a
> NULL tick_nohz_full_mask pointer.
> 
> This is because the above commit uses tick_nohz_full_mask
> (in lockup_detector_init), if CONFIG_NO_HZ_FULL is set, but
> tick_nohz_full_mask only gets allocated if either:
> 
>     a) CONFIG_NO_HZ_FULL_ALL is set, or
> 
>     b) Someone passes in nohz_full=<any_value> on the boot
>       args line.
> 
> To correct this, change lockup_detector_init so that it does
> a runtime check instead of the ifdef check. This fix is
> simpler than my original proposed fix, thanks to Chris Metcalf
> for that.
> 
> ...
>
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -920,14 +920,14 @@ void __init lockup_detector_init(void)
>  {
>  	set_sample_period();
>  
> -#ifdef CONFIG_NO_HZ_FULL
> -	if (!cpumask_empty(tick_nohz_full_mask))
> -		pr_info("Disabling watchdog on nohz_full cores by default\n");
> -	cpumask_andnot(&watchdog_cpumask, cpu_possible_mask,
> -		       tick_nohz_full_mask);
> -#else
> -	cpumask_copy(&watchdog_cpumask, cpu_possible_mask);
> -#endif
> +	if (tick_nohz_full_enabled()) {
> +		if (!cpumask_empty(tick_nohz_full_mask))
> +			pr_info("Disabling watchdog on nohz_full cores by default\n");
> +		cpumask_andnot(&watchdog_cpumask, cpu_possible_mask,
> +			       tick_nohz_full_mask);
> +	}
> +	else
> +		cpumask_copy(&watchdog_cpumask, cpu_possible_mask);

Breaks x86_64 allmodconfig:

kernel/watchdog.c: In function 'lockup_detector_init':
kernel/watchdog.c:924: error: 'tick_nohz_full_mask' undeclared (first use in this function)


--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux