public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation•org>
To: john.hubbard@gmail•com
Cc: Don Zickus <dzickus@redhat•com>,
	Chris Metcalf <cmetcalf@ezchip•com>,
	Ingo Molnar <mingo@kernel•org>,
	Ulrich Obergfell <uobergfe@redhat•com>,
	Thomas Gleixner <tglx@linutronix•de>,
	Peter Zijlstra <peterz@infradead•org>,
	Stephen Rothwell <sfr@canb•auug.org.au>,
	linux-next@vger•kernel.org, John Hubbard <jhubbard@nvidia•com>
Subject: Re: [PATCH v2] watchdog: Fix a watchdog crash in some configurations
Date: Tue, 5 May 2015 15:12:10 -0700	[thread overview]
Message-ID: <20150505151210.feb7379f2e2a1e68e732a571@linux-foundation.org> (raw)
In-Reply-To: <1430854691-9628-1-git-send-email-jhubbard@nvidia.com>

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

> From: John Hubbard <jhubbard@nvidia•com>
> 
> 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)

      reply	other threads:[~2015-05-05 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 23:17 [PATCH] watchdog: Fix a watchdog crash in some configurations john.hubbard
2015-05-05 13:35 ` Don Zickus
2015-05-05 13:44   ` Chris Metcalf
2015-05-05 14:06     ` Don Zickus
2015-05-05 19:38       ` [PATCH v2] " john.hubbard
2015-05-05 22:12         ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150505151210.feb7379f2e2a1e68e732a571@linux-foundation.org \
    --to=akpm@linux-foundation$(echo .)org \
    --cc=cmetcalf@ezchip$(echo .)com \
    --cc=dzickus@redhat$(echo .)com \
    --cc=jhubbard@nvidia$(echo .)com \
    --cc=john.hubbard@gmail$(echo .)com \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=mingo@kernel$(echo .)org \
    --cc=peterz@infradead$(echo .)org \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=tglx@linutronix$(echo .)de \
    --cc=uobergfe@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox