On 09.08.2019 16:57, Juergen Gross wrote:
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -250,7 +250,8 @@ static inline void vcpu_runstate_change(
>  
>  void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
>  {
> -    spinlock_t *lock = likely(v == current) ? NULL : 
> vcpu_schedule_lock_irq(v);
> +    spinlock_t *lock = likely(v == current)
> +                       ? NULL : unit_schedule_lock_irq(v->sched_unit);
>      s_time_t delta;
>  
>      memcpy(runstate, &v->runstate, sizeof(*runstate));
> @@ -259,7 +260,7 @@ void vcpu_runstate_get(struct vcpu *v, struct 
> vcpu_runstate_info *runstate)
>          runstate->time[runstate->state] += delta;
>  
>      if ( unlikely(lock != NULL) )
> -        vcpu_schedule_unlock_irq(lock, v);
> +        unit_schedule_unlock_irq(lock, v->sched_unit);
>  }

At the example of this: The more coarse granularity of the lock
means that no two vCPU-s within a unit can obtain their runstate
in parallel. While this may be acceptable for core scheduling,
I'm afraid it's too restrictive for sockets or nodes as units.
Therefore I think this lock needs to either be split (I'm not
sure that's feasible) or become an r/w lock.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to