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

Re: [Xen-devel] [PATCH v4 09/14] argo: implement the sendv op; evtchn: expose send_guest_global_virq



>>> On 15.01.19 at 16:49, <roger.pau@xxxxxxxxxx> wrote:
> On Tue, Jan 15, 2019 at 01:27:41AM -0800, Christopher Clark wrote:
>> +static int
>> +pending_requeue(const struct domain *d, struct argo_ring_info *ring_info,
>> +                domid_t src_id, unsigned int len)
>> +{
>> +    struct hlist_node *node;
>> +    struct pending_ent *ent;
>> +
>> +    ASSERT(LOCKING_L3(d, ring_info));
>> +
>> +    hlist_for_each_entry(ent, node, &ring_info->pending, node)
>> +    {
>> +        if ( ent->domain_id == src_id )
>> +        {
>> +            /*
>> +             * Reuse an existing queue entry for a notification rather than 
>> add
>> +             * another. If the existing entry is waiting for a smaller size 
>> than
>> +             * the current message then adjust the record to wait for the
>> +             * current (larger) size to be available before triggering a
>> +             * notification.
>> +             * This assists the waiting sender by ensuring that whenever a
>> +             * notification is triggered, there is sufficient space 
>> available
>> +             * for (at least) any one of the messages awaiting transmission.
>> +             */
>> +            if ( ent->len < len )
>> +                ent->len = len;
> 
> Nit:
> 
> ent->len = max(ent->len, len);

I don't think use of max() should be a requirement in cases where
one of the items compared is also the value to update. I'm not
even convinced it helps readability of the sources, let alone the
quality of generated code.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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