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

Re: [Xen-devel] [PATCH v2 2/8] x86: handle CQM resource when creating/destroying guests

On 25/11/13 03:21, Xu, Dongxiao wrote:
>>> +
>>> +    spin_lock_irqsave(&cqm_lock, flags);
>>> +    /* We do not free system reserved "RMID=0" */
>>> +    if ( rmid > 0 )
>>> +    {
>>> +        cqm_res_array[rmid].inuse = 0;
>>> +        cqm_res_array[rmid].domain_id = 0;
>> Would DOMID_INVALID be more appropriate here? 0 is valid domain
>> identifier.  It would also mean that you could remove the inuse flag
>> from the structure, and the structure itself degrades to an array of
>> domid_t's
>> You can then further use cmpxchg() and avoid the spinlock.
>> I guess this all depends on whether you are expecting to add new
>> information into the structure or not.
> Per my understanding, DOMID_xxx is somewhat related with memory management, 
> e.g., DOMID_INVALID is used to identify pages with unknown owner. Is it 
> appropriate to use it in CQM feature?
> According to your proposal:
>  - DOMID_INVALID is for RMIDs that are not allocated yet;
>  - A valid domain number stands for the RMID is used for a certain domain;
>  - Maybe DOMID_SELF or DOMID_XEN for the system reserved RMID=0?
> Do you think it is OK if we introduce extra meanings (CQM specific) for those 
> macros?

CC'ing the relevant maintainers for their opinion.

I would suggest that DOMID_INVALID should have its formal meaning
expanded to any case where there can logically be a domid needing a
specific invalid state.


Xen-devel mailing list



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