linux/kernel
Prarit Bhargava 8dcde9def5 kernel/watchdog.c: do not hardcode CPU 0 as the initial thread
When CONFIG_BOOTPARAM_HOTPLUG_CPU0 is enabled, the socket containing the
boot cpu can be replaced.  During the hot add event, the message

NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.

is output implying that the NMI watchdog was disabled at some point.  This
is not the case and the message has caused confusion for users of systems
that support the removal of the boot cpu socket.

The watchdog code is coded to assume that cpu 0 is always the first cpu to
initialize the watchdog, and the last to stop its watchdog thread.  That
is not the case for initializing if cpu 0 has been removed and added.  The
removal case has never been correct because the smpboot code will remove
the watchdog threads starting with the lowest cpu number.

This patch adds watchdog_cpus to track the number of cpus with active NMI
watchdog threads so that the first and last thread can be used to set and
clear the value of firstcpu_err.  firstcpu_err is set when the first
watchdog thread is enabled, and cleared when the last watchdog thread is
disabled.

Link: http://lkml.kernel.org/r/1480425321-32296-1-git-send-email-prarit@redhat.com
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joshua Hunt <johunt@akamai.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-22 16:41:27 -08:00
..
bpf bpf: make jited programs visible in traces 2017-02-17 13:40:05 -05:00
configs arch: Rename CONFIG_DEBUG_RODATA and CONFIG_DEBUG_MODULE_RONX 2017-02-07 12:32:52 -08:00
debug
events Linux 4.10-rc8 2017-02-14 07:29:14 +01:00
gcov
irq IOMMU Updates for Linux v4.11 2017-02-20 16:42:43 -08:00
livepatch
locking Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-02-20 13:23:30 -08:00
power This renames the (now inaccurate) CONFIG_DEBUG_RODATA and related config 2017-02-21 17:56:45 -08:00
printk printk: use rcuidle console tracepoint 2017-02-18 17:27:00 -08:00
rcu Merge branches 'doc.2017.01.15b', 'dyntick.2017.01.23a', 'fixes.2017.01.23a', 'srcu.2017.01.25a' and 'torture.2017.01.15b' into HEAD 2017-01-25 12:56:05 -08:00
sched sched/core: Fix build paravirt build on arm and arm64 2017-02-21 10:54:02 -08:00
time Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-02-20 12:52:55 -08:00
trace tracing: add __print_flags_u64() 2017-02-22 16:41:26 -08:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
Makefile
acct.c acct: Convert obsolete cputime type to nsecs 2017-02-01 09:13:51 +01:00
async.c
audit.c Merge branch 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit 2017-02-21 13:25:50 -08:00
audit.h Merge branch 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit 2017-02-21 13:25:50 -08:00
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c Merge branch 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit 2017-02-21 13:25:50 -08:00
backtracetest.c
bounds.c
capability.c
cgroup.c bpf: introduce BPF_F_ALLOW_OVERRIDE flag 2017-02-12 21:52:19 -05:00
cgroup_freezer.c
cgroup_pids.c
compat.c
configs.c
context_tracking.c
cpu.c cpu/hotplug: Remove unused but set variable in _cpu_down() 2017-01-18 11:55:09 +01:00
cpu_pm.c
cpuset.c
crash_dump.c
cred.c
delayacct.c delaycct: Convert obsolete cputime type to nsecs 2017-02-01 09:13:52 +01:00
dma.c
elfcore.c
exec_domain.c
exit.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2017-02-21 12:49:56 -08:00
extable.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-02-22 10:15:09 -08:00
fork.c Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-02-20 13:23:30 -08:00
freezer.c
futex.c futex: Move futex_init() to core_initcall 2017-02-13 16:12:22 +01:00
futex_compat.c
groups.c
hung_task.c
irq_work.c
jump_label.c
kallsyms.c bpf: make jited programs visible in traces 2017-02-17 13:40:05 -05:00
kcmp.c
kcov.c
kexec.c
kexec_core.c
kexec_file.c
kexec_internal.h
kmod.c Introduce STATIC_USERMODEHELPER to mediate call_usermodehelper() 2017-01-19 12:59:45 +01:00
kprobes.c powerpc updates for 4.11 part 1. 2017-02-22 10:30:38 -08:00
ksysfs.c
kthread.c time: Remove CONFIG_TIMER_STATS 2017-02-10 11:15:08 +01:00
latencytop.c
membarrier.c Fix: Disable sys_membarrier when nohz_full is enabled 2017-01-23 11:32:16 -08:00
memremap.c
module-internal.h
module.c This renames the (now inaccurate) CONFIG_DEBUG_RODATA and related config 2017-02-21 17:56:45 -08:00
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c kernel/panic.c: add missing \n 2017-01-24 16:26:14 -08:00
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c
range.c
reboot.c
relay.c
resource.c
seccomp.c seccomp: dump core when using SECCOMP_RET_KILL 2017-01-23 21:42:42 +11:00
signal.c signal: Convert obsolete cputime type to nsecs 2017-02-01 09:13:53 +01:00
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c stacktrace, lockdep: Fix address, newline ugliness 2017-02-08 08:21:31 +01:00
stop_machine.c
sys.c sched/cputime: Convert task/group cputime to nsecs 2017-02-01 09:13:49 +01:00
sys_ni.c
sysctl.c sched/rt: Show the 'sched_rr_timeslice' SCHED_RR timeslice tuning knob in milliseconds 2017-02-01 11:01:30 +01:00
sysctl_binary.c
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c
tsacct.c tsacct: Convert obsolete cputime type to nsecs 2017-02-01 09:13:52 +01:00
ucount.c kernel/ucount.c: mark user_header with kmemleak_ignore() 2017-02-08 15:41:43 -08:00
uid16.c
up.c
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c kernel/watchdog: prevent false hardlockup on overloaded system 2017-01-24 16:26:14 -08:00
watchdog_hld.c kernel/watchdog.c: do not hardcode CPU 0 as the initial thread 2017-02-22 16:41:27 -08:00
workqueue.c time: Remove CONFIG_TIMER_STATS 2017-02-10 11:15:08 +01:00
workqueue_internal.h