From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: nmi_watchdog suspicious
Date: Mon, 16 Jun 2008 21:00:00 +0400 [thread overview]
Message-ID: <20080616170000.GC7273@cvg> (raw)
In-Reply-To: <Pine.LNX.4.55.0806160040270.11995@cliff.in.clinika.pl>
[Maciej W. Rozycki - Mon, Jun 16, 2008 at 12:49:00AM +0100]
| On Tue, 10 Jun 2008, Cyrill Gorcunov wrote:
|
| > On 64bit mode nmi_watchdog=NMI_NONE by default (in case if APIC enabled).
| > On 32bit mode nmi_watchdog=NMI_DEFAULT was by default (in any case,
| > but could be set to NMI_NONE in check_timer(), but we don't take
| > this case now).
|
| I haven't tracked the 64-bit port, but for plain i386 the watchdog used
| to be on by default, then proved problematic with too many broken pieces
| of equipment (typically because of bugs in the SMM firmware) and thus set
| to off.
|
| > So lets take a look on touch_nmi_watchdog().
| > There is the condition
| >
| > if (nmi_watchdog > 0)
| > ...tell to reset counters in nmi_watchdog_tick()
| >
| > this condition is not taken on 64bit mode, but *was* taken on
| > 32bit mode by default! So who was right then? 64bit version or 32bit?
| >
| > Maciej, could you take a look please? Maybe I just missing figure
| > in general - ie how nmi_watchdog _should_ work.
|
| Well, values >= NMI_INVALID are never used, so the condition is correct.
| It is meant to be positive whenever a working watchdog has been selected.
| Obviously nmi_watchdog should be a signed int though, so there is a bug
| there. You better audit all the uses of the variable...
|
| Maciej
|
Maciej, I think nmi_watchdog could (and probably should) be defined as
unsigned. Here my points of why (fix me please if I'm wrong):
- if we remain it as unsigned we could simplify setup_nmi_watchdog() to
just check for 'if (nmi >= NMI_INVALID)'
- current code does check for NMI_NONE _and_ NMI_DISABLED at once in most
cases (only the case it dont is - proc_nmi_enabled() wich could be simplified too)
- the only affected of such sign/unsign contention I found is
touch_nmi_watchdog() for which I suggested the patch (already in Ingo's tip tree)
http://lkml.org/lkml/2008/6/12/200
So there could be some 'useless counters resetting' but it could happen for
quite short time while APIC in initialization phase.
So I think the only problem could be is - simplification. Maybe some checks
should be isolated in helper functions. Will take a look (and of course will
keep community in touch ;)
- Cyrill -
next prev parent reply other threads:[~2008-06-16 17:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 18:57 nmi_watchdog suspicious Cyrill Gorcunov
2008-06-10 19:10 ` Cyrill Gorcunov
2008-06-15 23:49 ` Maciej W. Rozycki
2008-06-16 17:00 ` Cyrill Gorcunov [this message]
2008-06-16 23:20 ` Maciej W. Rozycki
2008-06-17 15:51 ` Cyrill Gorcunov
2008-06-18 16:06 ` Maciej W. Rozycki
2008-06-18 16:39 ` Cyrill Gorcunov
2008-06-18 16:54 ` Maciej W. Rozycki
2008-06-18 17:23 ` Cyrill Gorcunov
2008-06-21 1:54 ` Maciej W. Rozycki
2008-06-21 8:04 ` Cyrill Gorcunov
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=20080616170000.GC7273@cvg \
--to=gorcunov@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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