[PATCH v3] x86, nmi_watchdog: Remove ARCH_HAS_NMI_WATCHDOG and rely on CONFIG_HARDLOCKUP_DETECTOR

Previous thread: [PATCH] tcp: cleanup of cwnd initialization in tcp_init_metrics() by Jiri Kosina on Wednesday, December 22, 2010 - 11:39 am. (6 messages)

Next thread: 2.6.37-next problems with fs dcache patches. by Valdis.Kletnieks on Wednesday, December 22, 2010 - 12:47 pm. (2 messages)
From: Don Zickus
Date: Wednesday, December 22, 2010 - 12:00 pm

The x86 arch has shifted its use of the nmi_watchdog from a local implementation
to the global one provide by kernel/watchdog.c.  This shift has caused a whole
bunch of compile problems under different config options.  I attempt to simplify
things with the patch below.

In order to simplify things, I had to come to terms with the meaning of two terms
ARCH_HAS_NMI_WATCHDOG and CONFIG_HARDLOCKUP_DETECTOR.  Basically they mean the
same thing, the former on a local level and the latter on a global level.

With the old x86 nmi watchdog gone, there is no need to rely on defining the
ARCH_HAS_NMI_WATCHDOG variable because it doesn't make sense any more.  x86 will
now use the global implementation.

The changes below do a few things.  First it changes the few places that relied on
ARCH_HAS_NMI_WATCHDOG to use CONFIG_X86_LOCAL_APIC (the former was an alias for
the latter anyway, so nothing unusual here).  Those pieces of code were relying more
on local apic functionality the nmi watchdog functionality, so the change should
make sense.

Second, I removed the x86 implementation of touch_nmi_watchdog().  It isn't need
now, instead x86 will rely on kernel/watchdog.c's implementation.

Third, I removed the #define ARCH_HAS_NMI_WATCHDOG itself from x86.  And tweaked
the include/linux/nmi.h file to tell users to look for an externally defined
touch_nmi_watchdog in the case of ARCH_HAS_NMI_WATCHDOG _or_ CONFIG_HARDLOCKUP_DETECTOR.
This changes removes some of the ugliness in that file.

Finally, I added a Kconfig dependency for CONFIG_HARDLOCKUP_DETECTOR that said you
can't have ARCH_HAS_NMI_WATCHDOG _and_ CONFIG_HARDLOCKUP_DETECTOR.  You can only have
one nmi_watchdog.

Tested with
ARCH=i386: allnoconfig, defconfig, allyesconfig, (various broken configs)
ARCH=x86_64: allnoconfig, defconfig, allyesconfig, (various broken configs)

Hopefully, after this patch I won't get any more compile broken emails. :-)

v3:
  changed a couple of 'linux/nmi.h' -> 'asm/nmi.h' to pick-up correct ...
From: tip-bot for Don Zickus
Date: Thursday, December 23, 2010 - 1:51 am

Commit-ID:  4a7863cc2eb5f9804f1c4e9156619a801cd7f14f
Gitweb:     http://git.kernel.org/tip/4a7863cc2eb5f9804f1c4e9156619a801cd7f14f
Author:     Don Zickus <dzickus@redhat.com>
AuthorDate: Wed, 22 Dec 2010 14:00:03 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 22 Dec 2010 22:15:32 +0100

x86, nmi_watchdog: Remove ARCH_HAS_NMI_WATCHDOG and rely on CONFIG_HARDLOCKUP_DETECTOR

The x86 arch has shifted its use of the nmi_watchdog from a
local implementation to the global one provide by
kernel/watchdog.c.  This shift has caused a whole bunch of
compile problems under different config options.  I attempt to
simplify things with the patch below.

In order to simplify things, I had to come to terms with the
meaning of two terms ARCH_HAS_NMI_WATCHDOG and
CONFIG_HARDLOCKUP_DETECTOR.  Basically they mean the same thing,
the former on a local level and the latter on a global level.

With the old x86 nmi watchdog gone, there is no need to rely on
defining the ARCH_HAS_NMI_WATCHDOG variable because it doesn't
make sense any more.  x86 will now use the global
implementation.

The changes below do a few things.  First it changes the few
places that relied on ARCH_HAS_NMI_WATCHDOG to use
CONFIG_X86_LOCAL_APIC (the former was an alias for the latter
anyway, so nothing unusual here).  Those pieces of code were
relying more on local apic functionality the nmi watchdog
functionality, so the change should make sense.

Second, I removed the x86 implementation of
touch_nmi_watchdog().  It isn't need now, instead x86 will rely
on kernel/watchdog.c's implementation.

Third, I removed the #define ARCH_HAS_NMI_WATCHDOG itself from
x86.  And tweaked the include/linux/nmi.h file to tell users to
look for an externally defined touch_nmi_watchdog in the case of
ARCH_HAS_NMI_WATCHDOG _or_ CONFIG_HARDLOCKUP_DETECTOR. This
changes removes some of the ugliness in that file.

Finally, I added a Kconfig dependency for
CONFIG_HARDLOCKUP_DETECTOR that said you can't ...
Previous thread: [PATCH] tcp: cleanup of cwnd initialization in tcp_init_metrics() by Jiri Kosina on Wednesday, December 22, 2010 - 11:39 am. (6 messages)

Next thread: 2.6.37-next problems with fs dcache patches. by Valdis.Kletnieks on Wednesday, December 22, 2010 - 12:47 pm. (2 messages)