[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/4] xen: sched: improve checking soft-affinity



On 09/15/2017 06:35 PM, Dario Faggioli wrote:
> Whether or not a vCPU has a soft-affinity which is
> effective, i.e., with the power of actually affecting
> the scheduling of the vCPU itself, happens in an
> helper function, called has_soft_affinity().
> 
> Such function takes a custom cpumask as its third
> parameter, for better flexibility, but that mask is
> different from the vCPU's hard-affinity only in one
> case. Getting rid of that parameter, not only simplify
> the function, but enables for optimizing the soft
> affinity check (which will happen, in a subsequent
> commit).
> 
> This commit, therefore, does that. It's mostly
> mechanical, with the only exception _csched_cpu_pick()
> (in Credit1 code).
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
> ---
> Cc: George Dunlap <george.dunlap@xxxxxxxxxx>
> Cc: Anshul Makkar <anshulmakkar@xxxxxxxxx>
> ---
>  xen/common/sched_credit.c  |   79 
> +++++++++++++++++++++-----------------------
>  xen/common/sched_credit2.c |   10 ++----
>  xen/common/sched_null.c    |    8 ++--
>  xen/include/xen/sched-if.h |    8 ++--
>  4 files changed, 48 insertions(+), 57 deletions(-)
> 
> diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> index 3efbfc8..35d0c98 100644
> --- a/xen/common/sched_credit.c
> +++ b/xen/common/sched_credit.c
> @@ -410,8 +410,7 @@ static inline void __runq_tickle(struct csched_vcpu *new)
>              int new_idlers_empty;
>  
>              if ( balance_step == BALANCE_SOFT_AFFINITY
> -                 && !has_soft_affinity(new->vcpu,
> -                                       new->vcpu->cpu_hard_affinity) )
> +                 && !has_soft_affinity(new->vcpu) )
>                  continue;
>  
>              /* Are there idlers suitable for new (for this balance step)? */
> @@ -743,50 +742,42 @@ __csched_vcpu_is_migrateable(struct vcpu *vc, int 
> dest_cpu, cpumask_t *mask)
>  static int
>  _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
>  {
> -    cpumask_t cpus;

Is there a reason you couldn't use cpumask_t *cpus=cpumask_scratch_cpu()?

Other than that, looks good.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.