android_kernel_google_msm/arch/x86/kernel
Feng Tang b9909d5051 x86/reboot: Fix a warning message triggered by stop_other_cpus()
commit 55c844a4dd upstream.

When rebooting our 24 CPU Westmere servers with 3.4-rc6, we
always see this warning msg:

Restarting system.
machine restart
------------[ cut here ]------------
WARNING: at arch/x86/kernel/smp.c:125
native_smp_send_reschedule+0x74/0xa7() Hardware name: X8DTN
Modules linked in: igb [last unloaded: scsi_wait_scan]
Pid: 1, comm: systemd-shutdow Not tainted 3.4.0-rc6+ #22
Call Trace:
 <IRQ>  [<ffffffff8102a41f>] warn_slowpath_common+0x7e/0x96
 [<ffffffff8102a44c>] warn_slowpath_null+0x15/0x17
 [<ffffffff81018cf7>] native_smp_send_reschedule+0x74/0xa7
 [<ffffffff810561c1>] trigger_load_balance+0x279/0x2a6
 [<ffffffff81050112>] scheduler_tick+0xe0/0xe9
 [<ffffffff81036768>] update_process_times+0x60/0x70
 [<ffffffff81062f2f>] tick_sched_timer+0x68/0x92
 [<ffffffff81046e33>] __run_hrtimer+0xb3/0x13c
 [<ffffffff81062ec7>] ? tick_nohz_handler+0xd0/0xd0
 [<ffffffff810474f2>] hrtimer_interrupt+0xdb/0x198
 [<ffffffff81019a35>] smp_apic_timer_interrupt+0x81/0x94
 [<ffffffff81655187>] apic_timer_interrupt+0x67/0x70
 <EOI>  [<ffffffff8101a3c4>] ? default_send_IPI_mask_allbutself_phys+0xb4/0xc4
 [<ffffffff8101c680>] physflat_send_IPI_allbutself+0x12/0x14
 [<ffffffff81018db4>] native_nmi_stop_other_cpus+0x8a/0xd6
 [<ffffffff810188ba>] native_machine_shutdown+0x50/0x67
 [<ffffffff81018926>] machine_shutdown+0xa/0xc
 [<ffffffff8101897e>] native_machine_restart+0x20/0x32
 [<ffffffff810189b0>] machine_restart+0xa/0xc
 [<ffffffff8103b196>] kernel_restart+0x47/0x4c
 [<ffffffff8103b2e6>] sys_reboot+0x13e/0x17c
 [<ffffffff8164e436>] ? _raw_spin_unlock_bh+0x10/0x12
 [<ffffffff810fcac9>] ? bdi_queue_work+0xcf/0xd8
 [<ffffffff810fe82f>] ? __bdi_start_writeback+0xae/0xb7
 [<ffffffff810e0d64>] ? iterate_supers+0xa3/0xb7
 [<ffffffff816547a2>] system_call_fastpath+0x16/0x1b
---[ end trace 320af5cb1cb60c5b ]---

The root cause seems to be the
default_send_IPI_mask_allbutself_phys() takes quite some time (I
measured it could be several ms) to complete sending NMIs to all
the other 23 CPUs, and for HZ=250/1000 system, the time is long
enough for a timer interrupt to happen, which will in turn
trigger to kick load balance to a stopped CPU and cause this
warning in native_smp_send_reschedule().

So disabling the local irq before stop_other_cpu() can fix this
problem (tested 25 times reboot ok), and it is fine as there
should be nobody caring the timer interrupt in such reboot
stage.

The latest 3.4 kernel slightly changes this behavior by sending
REBOOT_VECTOR first and only send NMI_VECTOR if the REBOOT_VCTOR
fails, and this patch is still needed to prevent the problem.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120530231541.4c13433a@feng-i7
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Vinson Lee <vlee@twopensource.com>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-19 11:40:31 +08:00
..
acpi ACPI: Add a quirk for "AMILO PRO V2030" to ignore the timer overriding 2012-07-16 09:04:07 -07:00
apic x86, apic: Handle a bad TSC more gracefully 2015-02-02 17:05:03 +08:00
cpu x86, cpu, amd: Add workaround for family 16h, erratum 793 2015-04-14 17:34:03 +08:00
.gitignore
alternative.c x86/alternatives: Fix p6 nops on non-modular kernels 2012-10-07 08:32:29 -07:00
amd_gart_64.c
amd_nb.c
apb_timer.c
aperture_64.c
apm_32.c
asm-offsets.c
asm-offsets_32.c
asm-offsets_64.c
audit_64.c
bootflag.c
check.c
cpuid.c
crash.c x86/apic: Disable I/O APIC before shutdown of the local APIC 2014-06-07 16:02:08 -07:00
crash_dump_32.c
crash_dump_64.c
devicetree.c
doublefault_32.c
dumpstack.c
dumpstack_32.c
dumpstack_64.c x86_64, traps: Stop using IST for #SS 2015-02-02 17:05:23 +08:00
e820.c x86, mm: Trim memory in memblock to be page aligned 2012-10-31 10:02:56 -07:00
early-quirks.c
early_printk.c
entry_32.S x86, espfix: Make it possible to disable 16-bit support 2014-08-07 12:00:11 -07:00
entry_64.S x86/asm/entry/64: Remove a bogus 'ret_from_fork' optimization 2015-06-19 11:40:21 +08:00
espfix_64.c x86/espfix/xen: Fix allocation of pages for paravirt page tables 2014-08-07 12:00:11 -07:00
ftrace.c
head.c x86: Make sure we can boot in the case the BDA contains pure garbage 2013-03-04 06:06:39 +08:00
head32.c
head64.c
head_32.S
head_64.S
hpet.c x86: hpet: Fix masking of MSI interrupts 2012-12-17 10:37:44 -08:00
hw_breakpoint.c
i386_ksyms_32.c
i387.c x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz 2013-08-11 15:38:43 -07:00
i8237.c
i8253.c
i8259.c
init_task.c
io_delay.c
ioport.c
irq.c x86: Eliminate irq_mis_count counted in arch_irq_stat 2013-05-07 19:51:57 -07:00
irq_32.c
irq_64.c
irq_work.c
irqinit.c
jump_label.c
kdebugfs.c
kgdb.c
kprobes-common.h
kprobes-opt.c
kprobes.c ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing 2015-04-14 17:33:53 +08:00
kvm.c x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit 2015-02-02 17:05:24 +08:00
kvmclock.c x86, kvm: Clear paravirt_enabled on KVM guests for espfix32's benefit 2015-02-02 17:05:24 +08:00
ldt.c x86, espfix: Make it possible to disable 16-bit support 2014-08-07 12:00:11 -07:00
machine_kexec_32.c
machine_kexec_64.c
Makefile x86, espfix: Make espfix64 a Kconfig option, fix UML 2014-08-07 12:00:11 -07:00
mca_32.c
microcode_amd.c x86/microcode/amd: Tone down printk(), don't treat a missing firmware file as an error 2013-11-29 10:50:35 -08:00
microcode_core.c x86, microcode: Sanitize per-cpu microcode reloading interface 2012-08-15 08:10:31 -07:00
microcode_intel.c
mmconf-fam10h_64.c
module.c
mpparse.c
msr.c x86/msr: Add capabilities check 2013-02-03 18:24:42 -06:00
nmi.c x86: Reset the debug_stack update counter 2012-06-10 00:36:12 +09:00
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal 2013-04-16 21:27:27 -07:00
paravirt_patch_32.c
paravirt_patch_64.c x86_64/entry/xen: Do not invoke espfix64 on Xen 2014-08-07 12:00:11 -07:00
pci-calgary_64.c
pci-dma.c
pci-iommu_table.c
pci-nommu.c
pci-swiotlb.c
pcspeaker.c
probe_roms.c
process.c
process_32.c
process_64.c x86_64, switch_to(): Load TLS descriptors before switching DS and ES 2015-04-14 17:33:46 +08:00
ptrace.c x86-32: Export kernel_stack_pointer() for modules 2012-12-05 18:38:34 -08:00
pvclock.c
quirks.c x86/amd/numa: Fix northbridge quirk to assign correct NUMA node 2014-03-23 21:37:05 -07:00
reboot.c x86/reboot: Fix a warning message triggered by stop_other_cpus() 2015-06-19 11:40:31 +08:00
reboot_32.S
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S x86: Fix typo in kexec register clearing 2013-06-20 11:58:46 -07:00
resource.c
rtc.c
setup.c x86/Sandy Bridge: mark arrays in __init functions as __initconst 2014-06-07 16:02:09 -07:00
setup_percpu.c
signal.c
smp.c
smpboot.c sched: Fix unreleased llc_shared_mask bit during CPU hotplug 2014-12-01 18:02:37 +08:00
stacktrace.c
step.c ptrace/x86: Partly fix set_task_blockstep()->update_debugctlmsr() logic 2014-06-07 16:02:09 -07:00
sys_i386_32.c
sys_x86_64.c x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member 2014-06-07 16:02:09 -07:00
syscall_32.c
syscall_64.c
tboot.c
tce_64.c
test_nx.c
test_rodata.c
time.c
tls.c x86/tls: Don't validate lm in set_thread_area() after all 2015-04-14 17:33:46 +08:00
tls.h
topology.c
trampoline.c
trampoline_32.S
trampoline_64.S
traps.c x86/asm/entry/32: Fix user_mode() misuses 2015-06-19 11:40:26 +08:00
tsc.c x86, apic: Handle a bad TSC more gracefully 2015-02-02 17:05:03 +08:00
tsc_sync.c
verify_cpu.S
vm86_32.c
vmlinux.lds.S
vsmp_64.c
vsyscall_64.c
vsyscall_emu_64.S
vsyscall_trace.h
x86_init.c
x8664_ksyms_64.c
xsave.c