From: John Hubbard <jhubbard@nvidia.com>
To: Chris Metcalf <cmetcalf@ezchip.com>
Cc: john.hubbard@gmail.com, Frederic Weisbecker <fweisbec@gmail.com>,
Don Zickus <dzickus@redhat.com>, Ingo Molnar <mingo@kernel.org>,
Ulrich Obergfell <uobergfe@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org
Subject: Re: [PATCH] cpuidle: Fix a watchdog crash in some configurations
Date: Mon, 4 May 2015 16:13:07 -0700 [thread overview]
Message-ID: <alpine.LNX.2.03.1505041610210.22418@nvidia.com> (raw)
In-Reply-To: <5547EB7F.4060006@ezchip.com>
[-- Attachment #1: Type: text/plain, Size: 2721 bytes --]
Re-sending from a proper text-only email client. Sorry for the extra
email.
On Mon, 4 May 2015, Chris Metcalf wrote:
> On 5/2/2015 4:10 AM, 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_init pointer.
>
> This is because the above commit uses tick_nohz_full_init
> (in lockup_detector_init), if CONFIG_NO_HZ_FULL is set, but
> tick_nohz_full_init 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 the allocation site (case a, above):
> allocate tick_nohz_full_init whenever CONFIG_NO_HZ_FULL is set.
> Also, change the enclosing function name to more accurately
> reflect its current role.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>
>
> (Note that you say "tick_nohz_full_init" in your text a couple of times
> where you mean "tick_nohz_full_mask".)
Yes, you're correct. I'll fix that.
>
> This looks plausible to me, but I know that Frederic was thinking of
> doing something deeper by making tick_nohz_full_mask a mask
> that was available in all configurations, like cpu_possible_mask etc:
>
> https://lkml.org/lkml/2015/4/14/347
>
> Another way to fix this would be to fix lockup_detector_init() to
> test dynamically like this:
>
> 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);
> }
>
> This would avoid looking at the NULL cpumask pointer and is more
> consistent with how other nohz_full code works, for better or worse.
>
OK, right, I see now that the NO_HZ code usually does this check:
#ifdef CONFIG_NO_HZ_FULL
if (tick_nohz_full_enabled())
...and the new code in lockup_detector_init() simply lacked the second
line, so your fix is probably the better way to go. I just retested and
all is well with that approach. I'll send an updated fix separately (so
that whitespace is preserved) in a moment.
> I didn't see this since by default I don't have CPUMASK_OFFLINE.
> --
> Chris Metcalf, EZChip Semiconductor
> http://www.ezchip.com
>
>
thanks,
John H.
prev parent reply other threads:[~2015-05-04 23:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-02 8:10 [PATCH] cpuidle: Fix a watchdog crash in some configurations john.hubbard
[not found] ` <5547EB7F.4060006@ezchip.com>
2015-05-04 23:13 ` John Hubbard [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=alpine.LNX.2.03.1505041610210.22418@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=cmetcalf@ezchip.com \
--cc=dzickus@redhat.com \
--cc=fweisbec@gmail.com \
--cc=john.hubbard@gmail.com \
--cc=linux-next@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
--cc=uobergfe@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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