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

Re: [Xen-devel] [PATCH 2 of 3] RFC: mem_event: use wait queue when ring is full


  • To: Jan Beulich <JBeulich@xxxxxxxx>, Olaf Hering <olaf@xxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Wed, 23 Nov 2011 09:01:19 +0000
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 23 Nov 2011 09:02:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acypvnbdii1ONf9Yk0iaOWR0NjmHsg==
  • Thread-topic: [Xen-devel] [PATCH 2 of 3] RFC: mem_event: use wait queue when ring is full

On 23/11/2011 08:49, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>>>> On 22.11.11 at 22:13, Olaf Hering <olaf@xxxxxxxxx> wrote:
>> --- a/xen/include/xen/sched.h
>> +++ b/xen/include/xen/sched.h
>> @@ -14,6 +14,7 @@
>>  #include <xen/nodemask.h>
>>  #include <xen/radix-tree.h>
>>  #include <xen/multicall.h>
>> +#include <xen/wait.h>
>>  #include <public/xen.h>
>>  #include <public/domctl.h>
>>  #include <public/sysctl.h>
>> @@ -192,6 +193,10 @@ struct mem_event_domain
>>      mem_event_front_ring_t front_ring;
>>      /* event channel port (vcpu0 only) */
>>      int xen_port;
>> +    /* mem_event bit for vcpu->pause_flags */
>> +    int mem_event_bit;
> 
> Perhaps pause_bit would be a better name here? Or at least, as for
> the first patch, the mem_ prefix should go away (or really the
> mem_event_ one, but that would just leave "bit", which is how I got
> to the above proposal).

Yes, mem_event_bit is a lazy name here. Doesn't really describe what the bit
is actually for. It's obviously mem_event related because of the struct it
is a member of.

>> +    /* list of vcpus waiting for room in the ring */
>> +    struct waitqueue_head wq;
>>  };
>>  
>>  struct mem_event_per_domain
>> @@ -615,9 +620,12 @@ static inline struct domain *next_domain
>>   /* VCPU affinity has changed: migrating to a new CPU. */
>>  #define _VPF_migrating       3
>>  #define VPF_migrating        (1UL<<_VPF_migrating)
>> - /* VCPU is blocked on memory-event ring. */
>> -#define _VPF_mem_event       4
>> -#define VPF_mem_event        (1UL<<_VPF_mem_event)
>> + /* VCPU is blocked on mem_paging ring. */
>> +#define _VPF_me_mem_paging   4
>> +#define VPF_me_mem_paging    (1UL<<_VPF_me_mem_paging)
>> + /* VCPU is blocked on mem_access ring. */
>> +#define _VPF_me_mem_access   5
>> +#define VPF_me_mem_access    (1UL<<_VPF_me_mem_access)
> 
> Same here - the mem_ seems superfluous.

Mem_event-related flags in a more general grouping do require a mem_ prefix
imo. The names need to stand on their own and still be descriptive.

 -- Keir

> Jan
> 
>>  
>>  static inline int vcpu_runnable(struct vcpu *v)
>>  {
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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