lkml.org 
[lkml]   [2013]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86: make reboot task only run on the appropriate processor
From
Date
We should, yes, if cpu 0 is available.

Vivek Goyal <vgoyal@redhat.com> wrote:
>On Tue, Nov 05, 2013 at 05:16:07PM +0800, Baoquan He wrote:
>> Currently system always reboot after below message when execute
>"kexec -e".
>>
>> [ 0.572119] smpboot: Booting Node 0, Processors # 1 OK
>>
>
>So is it same problem were we reboot on non-boot cpu and sending INIT
>to boot cpu in second kernel brings down the machine?
>
>I think for x86, it makes sense to reboot on boot cpu.
>
>Thanks
>Vivek
>
>> In commit 1b3a5d02ee070c8f9943333b9b6370f486601e0f, reboot= handling
>was
>> moved to kerne/reboot.c. However, the code to migrate current thread
>to
>> reboot cpu was removed. That cause this incorrect kexec behavior.
>>
>> Now add that code block back.
>>
>> Reported-by: Matthew Whitehead <mwhitehe@redhat.com>
>> Reported-by: Dave Young <dyoung@redhat.com>
>> Tested-by: WANG Chao <chaowang@redhat.com>
>> Signed-off-by: Baoquan He <bhe@redhat.com>
>> ---
>> arch/x86/kernel/reboot.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
>> index 7e920bf..3049de9 100644
>> --- a/arch/x86/kernel/reboot.c
>> +++ b/arch/x86/kernel/reboot.c
>> @@ -551,6 +551,21 @@ void native_machine_shutdown(void)
>> {
>> /* Stop the cpus and apics */
>> #ifdef CONFIG_SMP
>> + /* The boot cpu is always logical cpu 0 */
>> + int reboot_cpu_id = 0;
>> +
>> + /* See if there has been given a command line override */
>> + if ((reboot_cpu != -1) && (reboot_cpu < nr_cpu_ids) &&
>> + cpu_online(reboot_cpu))
>> + reboot_cpu_id = reboot_cpu;
>> +
>> + /* Make certain the cpu I'm about to reboot on is online */
>> + if (!cpu_online(reboot_cpu_id))
>> + reboot_cpu_id = smp_processor_id();
>> +
>> + /* Make certain I only run on the appropriate processor */
>> + set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id));
>> +
>> /*
>> * Stop all of the others. Also disable the local irq to
>> * not receive the per-cpu timer interrupt which may trigger
>> --
>> 1.8.3.1

--
Sent from my mobile phone. Please pardon brevity and lack of formatting.


\
 
 \ /
  Last update: 2013-11-05 23:01    [W:0.130 / U:2.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site