direct-io.hg

changeset 7597:5ed53e973b83

Changeset 7419 introduced a check for DOM0 before setting a bit in the
cpu_present map. This prevents domU SMP kernels without HOTPLUG_CPU
support from booting. Secondary cpus need to be present and online
before init/main.c:do_basic_setup() calls init_workqueues() (which
initializes per-cpu workqueues).

Without this patch, non HOTPLUG_CPU enabled kernels hang when flushing
cpu workqueues as the spinlock in the structure is never initialized (it
has a default value of zero which means the lock has been acquired on
x86).

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 02 00:08:01 2005 +0100 (2005-11-02)
parents ae2e13795c63
children c31edd72086d
files linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 01 19:13:06 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Wed Nov 02 00:08:01 2005 +0100
     1.3 @@ -236,8 +236,12 @@ void __init smp_prepare_cpus(unsigned in
     1.4  		make_page_readonly((void *)cpu_gdt_descr[cpu].address);
     1.5  
     1.6  		cpu_set(cpu, cpu_possible_map);
     1.7 +#ifdef CONFIG_HOTPLUG_CPU
     1.8  		if (xen_start_info->flags & SIF_INITDOMAIN)
     1.9  			cpu_set(cpu, cpu_present_map);
    1.10 +#else
    1.11 +		cpu_set(cpu, cpu_present_map);
    1.12 +#endif
    1.13  
    1.14  		vcpu_prepare(cpu);
    1.15  	}
    1.16 @@ -265,6 +269,8 @@ void __devinit smp_prepare_boot_cpu(void
    1.17  	cpu_online_map   = cpumask_of_cpu(0);
    1.18  }
    1.19  
    1.20 +#ifdef CONFIG_HOTPLUG_CPU
    1.21 +
    1.22  static void vcpu_hotplug(unsigned int cpu)
    1.23  {
    1.24  	int err;
    1.25 @@ -284,11 +290,7 @@ static void vcpu_hotplug(unsigned int cp
    1.26  		cpu_set(cpu, cpu_present_map);
    1.27  		(void)cpu_up(cpu);
    1.28  	} else if (strcmp(state, "offline") == 0) {
    1.29 -#ifdef CONFIG_HOTPLUG_CPU
    1.30  		(void)cpu_down(cpu);
    1.31 -#else
    1.32 -		printk(KERN_INFO "Ignoring CPU%d hotplug request\n", cpu);
    1.33 -#endif
    1.34  	} else {
    1.35  		printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n",
    1.36  		       state, cpu);
    1.37 @@ -338,8 +340,6 @@ static int __init setup_vcpu_hotplug_eve
    1.38  
    1.39  subsys_initcall(setup_vcpu_hotplug_event);
    1.40  
    1.41 -#ifdef CONFIG_HOTPLUG_CPU
    1.42 -
    1.43  int __cpu_disable(void)
    1.44  {
    1.45  	cpumask_t map = cpu_online_map;