debuggers.hg

changeset 21167:c9e8369e49be

Fix two issues for CPU online/offline.

Firstly, we should return if we fail to get spin lock in cpu_down.
Secondly, in credit scheduler, the idlers need be limited only to
online map.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 08 15:31:52 2010 +0100 (2010-04-08)
parents a33909be109c
children f12db0ad5f45
files xen/arch/x86/smpboot.c xen/common/sched_credit.c
line diff
     1.1 --- a/xen/arch/x86/smpboot.c	Thu Apr 08 15:31:21 2010 +0100
     1.2 +++ b/xen/arch/x86/smpboot.c	Thu Apr 08 15:31:52 2010 +0100
     1.3 @@ -1343,10 +1343,8 @@ int cpu_down(unsigned int cpu)
     1.4  	int err = 0;
     1.5  
     1.6  	/* spin_trylock() avoids deadlock with stop_machine_run(). */
     1.7 -	if (!spin_trylock(&cpu_add_remove_lock)) {
     1.8 -		err = -EBUSY;
     1.9 -		goto out;
    1.10 -	}
    1.11 +	if (!spin_trylock(&cpu_add_remove_lock))
    1.12 +		return -EBUSY;
    1.13  
    1.14  	if (num_online_cpus() == 1) {
    1.15  		err = -EBUSY;
     2.1 --- a/xen/common/sched_credit.c	Thu Apr 08 15:31:21 2010 +0100
     2.2 +++ b/xen/common/sched_credit.c	Thu Apr 08 15:31:52 2010 +0100
     2.3 @@ -428,7 +428,7 @@ static int
     2.4       * like run two VCPUs on co-hyperthreads while there are idle cores
     2.5       * or sockets.
     2.6       */
     2.7 -    idlers = csched_priv.idlers;
     2.8 +    cpus_and(idlers, cpu_online_map, csched_priv.idlers);
     2.9      cpu_set(cpu, idlers);
    2.10      cpus_and(cpus, cpus, idlers);
    2.11      cpu_clear(cpu, cpus);