lkml.org 
[lkml]   [2001]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] 2.4.1-ac1 UP-APIC/NMI watchdog fixes
Maciej W. Rozycki writes:
> I've forgotten to cc you when sending Ingo my patch-2.4.0-ac12-upapic-19
> fixes a few days ago, my apologies. Since the two patches conflict with
> each other, I've merged them together and provide the result below.
> Please check if it is fine for you.

Looks fine to me.

> I'm unsure about the K7_NMI_EVENT macro -- I think it should go into
> include/asm-i386/msr.h, but the comment should remain here. It should get
> reworded a bit in this case, I suppose, though.

I'd prefer to keep it in nmi.c -- it doesn't really have any relevance
elsewhere. I made a macro of it so that I wouldn't need any #ifdef:s
or long explanations in the code proper.

There is one thing which bothers me. Look at the end of the NMI handler:

> + if (cpu_has_apic && (nmi_watchdog == NMI_LOCAL_APIC))
> + wrmsr(nmi_perfctr_msr, -(cpu_khz/HZ*1000), -1);

This becomes a series of loads and tests. Ideally, a _single_ test should suffice
to inform the NMI handler whether we're in NMI_LOCAL_APIC mode or not. One problem
is that we aren't resetting nmi_watchdog to NMI_NONE if we fail to detect or
initialise the local APIC; if we did, we could kill the cpu_has_apic test.

... however, nmi_perfctr_msr could serve this purpose since it will be
non-zero if and only if (cpu_has_apic && nmi_watchdog == NMI_LOCAL_APIC).
So I would actually suggest something like:

if (nmi_perfctr_msr)
wrmsr(nmi_perfctr_msr, -(cpu_khz/HZ*1000), -1);

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.051 / U:13.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site