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

Re: [Xen-devel] [PATCH v2 8/8] x86: enable CQM monitoring for each domain RMID



On 25/11/13 07:22, Xu, Dongxiao wrote:
>> -----Original Message-----
>> From: Andrew Cooper [mailto:andrew.cooper3@xxxxxxxxxx]
>> Sent: Thursday, November 21, 2013 10:19 PM
>> To: Xu, Dongxiao
>> Cc: xen-devel@xxxxxxxxxxxxx
>> Subject: Re: [Xen-devel] [PATCH v2 8/8] x86: enable CQM monitoring for each
>> domain RMID
>>
>> On 21/11/13 07:20, dongxiao.xu@xxxxxxxxx wrote:
>>> From: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
>>>
>>> If the CQM service is attached to a domain, its related RMID will be set
>>> to hardware for monitoring when the domain's vcpu is scheduled in. When
>>> the domain's vcpu is scheduled out, RMID 0 (system reserved) will be set
>>> for monitoring.
>>>
>>> Signed-off-by: Jiongxi Li <jiongxi.li@xxxxxxxxx>
>>> Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
>>> ---
>>>  xen/arch/x86/domain.c           |    5 +++++
>>>  xen/arch/x86/pqos.c             |   21 ++++++++++++++++++++-
>>>  xen/include/asm-x86/msr-index.h |    1 +
>>>  xen/include/asm-x86/pqos.h      |    1 +
>>>  4 files changed, 27 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
>>> index 9725649..1eda0ab 100644
>>> --- a/xen/arch/x86/domain.c
>>> +++ b/xen/arch/x86/domain.c
>>> @@ -1372,6 +1372,8 @@ static void __context_switch(void)
>>>      {
>>>          memcpy(&p->arch.user_regs, stack_regs,
>> CTXT_SWITCH_STACK_BYTES);
>>>          vcpu_save_fpu(p);
>>> +        if ( system_supports_cqm() )
>>> +            cqm_assoc_rmid(0);
>> So actions from the idle domain are accounted against the previously
>> scheduled vcpu?
> No. Considering the following cases:
>  - Context switch from a normal domain vcpu (p) to an idle domain vcpu (n), 
> then we will associate RMID=0 to the CPU hardware on ctxt_switch_from(p), so 
> that idle domain is accounted to RMID=0;
>  - Context switch from an idle domain vcpu (p) to a normal domain vcpu (n), 
> then we will associate the domain's RMID on ctxt_switch_to(n).

Ah of course.

>
>>>          p->arch.ctxt_switch_from(p);
>>>      }
>>>
>>> @@ -1396,6 +1398,9 @@ static void __context_switch(void)
>>>          }
>>>          vcpu_restore_fpu_eager(n);
>>>          n->arch.ctxt_switch_to(n);
>>> +
>>> +        if ( system_supports_cqm() && n->domain->arch.pqos_cqm_rmid >
>> 0 )
>>
>> n->domain->arch.pqos_cqm_rmid can only be greater than 0 if the system
>> already supports cqm()
> This should be changed on v2 patch, sorry.
>
>>> +            cqm_assoc_rmid(n->domain->arch.pqos_cqm_rmid);
>> What happens to subsequent Xen accesses before returning to the guest?
>>
>> What happens for Xen accesses in interrupt handlers?
> The measurement is not that accurate for CQM feature.
> CQM is somewhat like xentop, where xentop doesn't exactly differentiate the 
> context switch cost and interrupt handling cost, so we adopt the similar 
> logics to CQM.

Ok.

~Andrew

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


 


Rackspace

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