ia64/xen-unstable

changeset 4409:e0ebda45aae6

bitkeeper revision 1.1236.1.177 (424c6d618owgwMOuAqt8Gn8X7pnDCw)

Merge
author iap10@freefall.cl.cam.ac.uk
date Thu Mar 31 21:36:33 2005 +0000 (2005-03-31)
parents c0a3bd2e46cb fead3d49dca1
children bba86f62fccf
files xen/common/dom0_ops.c
line diff
     1.1 --- a/xen/common/dom0_ops.c	Thu Mar 31 17:02:55 2005 +0000
     1.2 +++ b/xen/common/dom0_ops.c	Thu Mar 31 21:36:33 2005 +0000
     1.3 @@ -162,7 +162,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     1.4      case DOM0_CREATEDOMAIN:
     1.5      {
     1.6          struct domain *d;
     1.7 -        unsigned int   pro = 0;
     1.8 +        unsigned int   pro;
     1.9          domid_t        dom;
    1.10  
    1.11          dom = op->u.createdomain.domain;
    1.12 @@ -180,7 +180,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.13              /* Do an initial placement. Pick the least-populated CPU. */
    1.14              struct domain *d;
    1.15              struct exec_domain *ed;
    1.16 -            unsigned int i, cnt[NR_CPUS] = { 0 };
    1.17 +            unsigned int i, ht, cnt[NR_CPUS] = { 0 };
    1.18  
    1.19              read_lock(&domlist_lock);
    1.20              for_each_domain ( d ) {
    1.21 @@ -189,9 +189,15 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.22              }
    1.23              read_unlock(&domlist_lock);
    1.24  
    1.25 -            for ( i = 0; i < smp_num_cpus; i++ )
    1.26 -                if ( cnt[i] < cnt[pro] )
    1.27 -                    pro = i;
    1.28 +            /* If we're on a HT system, we only use the first HT for dom0,
    1.29 +               other domains will all share the second HT of each CPU.
    1.30 +	       Since dom0 is on CPU 0, we favour high numbered CPUs in
    1.31 +	       the event of a tie */
    1.32 +            ht = opt_noht ? 1 : ht_per_core;
    1.33 +            pro = ht-1;
    1.34 +            for ( i = pro; i < smp_num_cpus; i += ht )
    1.35 +		if ( cnt[i] <= cnt[pro] )
    1.36 +		    pro = i;
    1.37          }
    1.38          else
    1.39              pro = op->u.createdomain.cpu % smp_num_cpus;