Skip to content

RFC nmi watchdog: x86 32/64 cleanup

dzickus lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8nmi watchdog header cleanuparch/i386/kernel/apic.c arch/i386/kernel/io_apic.c arch/i386/kernel/nmi.c +10 more+53 -550 replies
2/8Add performance counter reservation framework for UP kernelsarch/i386/kernel/nmi.c arch/x86_64/kernel/nmi.c include/asm-i386/nmi.h +1 more+308 -730 replies
3/8Utilize performance counter reservation framework in oprofilearch/i386/oprofile/nmi_int.c arch/i386/oprofile/op_model_athlon.c arch/i386/oprofile/op_model_p4.c +2 more+199 -1140 replies
4/8Add SMP support on x86_64 to reservation frameworkarch/x86_64/kernel/apic.c arch/x86_64/kernel/nmi.c include/asm-x86_64/nmi.h+290 -1421 reply
5/8Add SMP support on i386 to reservation frameworkarch/i386/kernel/apic.c arch/i386/kernel/nmi.c arch/i386/kernel/traps.c +2 more+361 -1922 replies
6/8Cleanup NMI interrupt patharch/i386/kernel/nmi.c arch/i386/kernel/traps.c arch/x86_64/kernel/nmi.c +3 more+57 -290 replies
7/8Remove un/set_nmi_callback and reserve/release_lapic_nmi functionsarch/i386/kernel/nmi.c arch/i386/kernel/traps.c arch/i386/oprofile/nmi_int.c +6 more+80 -2570 replies
8/8Add abilty to enable/disable nmi watchdog from sysfsarch/i386/kernel/nmi.c arch/x86_64/kernel/nmi.c include/asm-i386/nmi.h +3 more+110 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/8] [RFC PATCH] nmi watchdog: x86 32/64 cleanup

A major cleanup of the nmi watchdog on the i386 and x86_64 archs.

This little project started out as a way to get unknown_nmi_panic working on an x86_64 SMP machine. But after Andi rejected my dirty little hack ;), it grew into a spring cleaning of the nmi watchdog.

The fix Andi wanted led to a conflict with how oprofile worked. This led to a reservation layer around the performance counters and a bunch of changes in oprofile startup. All the reservation layer consists of is reserving a bit that corresponds to a performance counter. The intent here is to prevent subsystems like oprofile and nmi watchdog from stomping on each other when trying to manipulate these counters. Currently, oprofile must stop the nmi watchdog before using the counters. This approach does not encourage any sharing. :)

During the testing of this reservation layer, I ran into more and more bugs from old hacks (notably in the SMP cases). As a result I found myself rewriting a lot of this code. I think I straightened everything out, except for enabling/disabling the nmi watchdog on an ioapic. The enable_irq/disable_irq macros don't seem to work for me and I don't know enough about the subsystem to figure it out either.

Of course the oprofile code is shared with the i386 arch, so all the changes I did in x86_64 had to be duplicated over there too.

I tested these changes on a Xeon (UP/SMP), P4 (32/64, UP/SMP) and under various boot-up defaults (nmi-watchdog=0,1,2). I also worked on some of these changes with Andi Kleen and the oprofile folks, so these ideas shouldn't be too surprising, just perhaps the implementation. :o

Any thoughts/feedback/criticism to clean this up more and probably fix some of my coding style would be appreciated.

Cheers,
Don

--