From: Tim Deegan Subject: Re: [PATCH] x86/watchdog: Use real timestamps for watchdog timeout Date: Fri, 24 May 2013 11:13:12 +0100 Message-ID: <20130524101312.GB54769@ocelot.phlegethon.org> References: <20130524093712.GA54769@ocelot.phlegethon.org> <519F3AED.2090209@citrix.com> <519F2E5D02000078000D8AA7@nat28.tlf.novell.com> <519F3994.7040008@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <519F3AED.2090209@citrix.com> <519F3994.7040008@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: "Keir (Xen.org)" , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 10:57 +0100 on 24 May (1369393060), Andrew Cooper wrote: > On 24/05/13 08:09, Jan Beulich wrote: > > You can't use NOW() here - while the time updating code is safe > > against normal interrupts, it's not atomic wrt NMIs. > > But NMIs are latched at the hardware level. If we get a nested NMI the > Xen will be toast on the exit path anyway. The problem is that an NMI can arrive while local_time_calibration() is writing its results, so calling NOW() in the NMI handler might return garbage. > > Handling this case it nice, but I wonder whether this patch ought to > > detect and report ludicrous NMI rates rather than silently ignoring > > them. I guess that's hard to do in an NMI handler, other than by > > adjusting the printk when we crash. Actually on second thoughts it's easier: as well as having this patch (or near equivalent) to avoid premature watchdog expiry, we cna detect the NMI rate in, say, the timer softirq and report if it's gone mad. Cheers, Tim.