direct-io.hg

changeset 11088:c09d6e997f05

[LINUX] Oney 'nosmp' and 'max_cpus=' command line options.
Based on a patch from Jan Beulich.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Aug 14 16:12:43 2006 +0100 (2006-08-14)
parents f8c53e937b30
children eb7e5d95e7ea
files linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Mon Aug 14 15:26:37 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Mon Aug 14 16:12:43 2006 +0100
     1.3 @@ -255,7 +255,14 @@ void __init smp_prepare_cpus(unsigned in
     1.4  
     1.5  	xen_smp_intr_init(0);
     1.6  
     1.7 -	for_each_cpu_mask (cpu, cpu_possible_map) {
     1.8 +	/* Restrict the possible_map according to max_cpus. */
     1.9 +	while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
    1.10 +		for (cpu = NR_CPUS-1; !cpu_isset(cpu, cpu_possible_map); cpu--)
    1.11 +			continue;
    1.12 +		cpu_clear(cpu, cpu_possible_map);
    1.13 +	}
    1.14 +
    1.15 +	for_each_cpu (cpu) {
    1.16  		if (cpu == 0)
    1.17  			continue;
    1.18  
    1.19 @@ -266,7 +273,8 @@ void __init smp_prepare_cpus(unsigned in
    1.20  #endif
    1.21  		gdt_descr->address = get_zeroed_page(GFP_KERNEL);
    1.22  		if (unlikely(!gdt_descr->address)) {
    1.23 -			printk(KERN_CRIT "CPU%d failed to allocate GDT\n", cpu);
    1.24 +			printk(KERN_CRIT "CPU%d failed to allocate GDT\n",
    1.25 +			       cpu);
    1.26  			continue;
    1.27  		}
    1.28  		gdt_descr->size = GDT_SIZE;
    1.29 @@ -305,12 +313,6 @@ void __init smp_prepare_cpus(unsigned in
    1.30  
    1.31  	init_xenbus_allowed_cpumask();
    1.32  
    1.33 -	/* Currently, Xen gives no dynamic NUMA/HT info. */
    1.34 -	for (cpu = 1; cpu < NR_CPUS; cpu++) {
    1.35 -		cpu_sibling_map[cpu] = cpumask_of_cpu(cpu);
    1.36 -		cpu_core_map[cpu]    = cpumask_of_cpu(cpu);
    1.37 -	}
    1.38 -
    1.39  #ifdef CONFIG_X86_IO_APIC
    1.40  	/*
    1.41  	 * Here we can be sure that there is an IO-APIC in the system. Let's