[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v13 05/10] x86: dynamically attach/detach QoS monitoring service for a guest
On 04/08/14 03:17, Dongxiao Xu wrote: > +/* Called with domain lock held, no pqos specific lock needed */ > +int pqos_monitor_alloc_rmid(struct domain *d) > +{ > + unsigned int rmid; > + > + ASSERT(pqos_monitor_enabled()); > + > + if ( d->arch.pqos_rmid > 0 ) > + return -EEXIST; > + > + for ( rmid = pqosm->rmid_min; rmid <= pqosm->rmid_max; rmid++ ) > + { > + if ( pqosm->rmid_to_dom[rmid] != DOMID_INVALID) > + continue; > + > + pqosm->rmid_to_dom[rmid] = d->domain_id; > + break; > + } > + > + /* No RMID available, assign RMID=0 by default */ > + if ( rmid > pqosm->rmid_max ) > + { > + d->arch.pqos_rmid = 0; > + return -EUSERS; > + } > + else > + pqosm->rmid_inuse++; This rmid_inuse needs some concurrency protection; the domain lock is not suitable. Probably best to make it an atomic_t and use atomic_inc/dec() ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |