|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v11 5/9] x86: dynamically attach/detach QoS monitoring service for a guest
>>> On 20.06.14 at 16:31, <dongxiao.xu@xxxxxxxxx> wrote:
> +int pqos_monitor_alloc_rmid(struct domain *d)
> +{
> + int rc = 0;
> + unsigned int rmid;
> +
> + ASSERT(pqos_monitor_enabled());
> +
> + spin_lock(&pqosm->pqosm_lock);
> +
> + if ( d->arch.pqos_rmid > 0 )
> + {
> + rc = -EEXIST;
> + goto out;
> + }
Does this check really need to be inside the locked region? You're
already protected against races by the domctl lock.
> +void pqos_monitor_free_rmid(struct domain *d)
> +{
> + unsigned int rmid;
> +
> + spin_lock(&pqosm->pqosm_lock);
> + rmid = d->arch.pqos_rmid;
> + /* We do not free system reserved "RMID=0" */
> + if ( rmid == 0 )
> + goto out;
Similarly here.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |