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

Re: [Xen-devel] [PATCH 3/3] xenpm: use new Cx statistics interface



>>> On 05.03.14 at 18:05, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
> On 03/05/2014 10:53 AM, Jan Beulich wrote:
>>>>> On 05.03.14 at 16:47, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
>>> On 03/05/2014 05:37 AM, Jan Beulich wrote:
>>>> +                for ( n = 0; n < MAX_PKG_RESIDENCIES; ++n )
>>>> +                {
>>>> +                    if ( n >= cxstat_end[j].nr_pc )
>>>> +                        continue;
>>>> +                    res = cxstat_end[j].pc[n];
>>>> +                    if ( n < cxstat_start[j].nr_pc )
>>>> +                        res -= cxstat_start[j].pc[n];
>>> Is it possible to have  cxstat_end[j].nr_pc != cxstat_start[j].nr_pc ?
>> Yes - see the previous patch: It bumps the count only if the
>> respective hw_res field was non-zero.
> 
> You mean this?

Yes.

> +
> +#define PUT_xC(what, n) do { \
> +        if ( stat->nr_##what >= n && \
> +             copy_to_guest_offset(stat->what, n - 1, &hw_res.what##n, 1) ) \
> +            return -EFAULT; \
> +        if ( hw_res.what##n ) \
> +            nr_##what = n; \
> +    } while ( 0 )
> +#define PUT_PC(n) PUT_xC(pc, n)
> 
> This reminds me of another question I had about this patch: this 
> fragment appears to assume that you call it in order.

Right. A pretty trivial requirement on the use of these scope
restricted macros.

Jan


_______________________________________________
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®.