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

Re: [Xen-devel] [PATCH v5 12/21] xen/arm: move is_vcpu_running function to sched.h



On 06/19/2014 11:58 AM, Vijay Kilari wrote:
> Hi Julien, Stefano, Jan,
> 
> On Mon, Jun 16, 2014 at 2:04 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>>> On 15.06.14 at 18:26, <julien.grall@xxxxxxxxxx> wrote:
>>>> --- a/xen/include/xen/sched.h
>>>> +++ b/xen/include/xen/sched.h
>>>> @@ -826,6 +826,22 @@ void watchdog_domain_destroy(struct domain *d);
>>>>   #define need_iommu(d)    (0)
>>>>   #endif
>>>>
>>>> +static inline int is_vcpu_running(struct domain *d, int vcpuid)
>>>> +{
>>>> +    struct vcpu *v;
>>>> +
>>>> +    if ( vcpuid >= d->max_vcpus )
>>>> +        return 0;
>>>> +
>>>> +    v = d->vcpu[vcpuid];
>>>> +    if ( v == NULL )
>>>> +        return 0;
>>>> +    if (test_bit(_VPF_down, &v->pause_flags) )
>>>> +        return 0;
>>>> +
>>>> +    return 1;
>>>> +}
>>
>> If this function was to become common code, you'd have to not only
>> justify it (as requested by Julien), but also
>> - name it according to its function (VPF_down not set doesn't mean
>>   "running", it merely means "up")
> 
> IMO, is_vcpu_running() usage in vgic.c is just to check if vcpu is runnable
> and not down. So checking apart from VPF_down is enough.
> If so, we should change the name of this function

You are wrong, the usage in vgic.c is to check that the VCPU is online.
So we don't inject an IRQ to this VCPU.

We don't care if the VCPU is block/runnable or whatever.

What Jan was asking is to rename the function in is_vcpu_up (or smth
similar).

Regards,

-- 
Julien Grall

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