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

Re: [Xen-devel] [PATCH 1 of 2] mem_event: pass mem_event_domain pointer to mem_event functions



Hi, 

At 14:15 +0200 on 07 Sep (1315404929), Olaf Hering wrote:
> mem_event: pass mem_event_domain pointer to mem_event functions
> 
> Pass a struct mem_event_domain pointer to the various mem_event
> functions.  This will be used in a subsequent patch which creates
> different ring buffers for the memshare, xenpaging and memaccess
> functionality.

This looks basically sound, except that in mem_event_check_ring(): 

> -int mem_event_check_ring(struct domain *d)
> +int mem_event_check_ring(struct mem_event_domain *med, domid_t dom_id)
>  {
>      struct vcpu *curr = current;
>      int free_requests;
>      int ring_full = 1;
>  
> -    if ( !d->mem_event.ring_page )
> +    if ( !med->ring_page )
>          return -1;
>  
> -    mem_event_ring_lock(d);
> +    mem_event_ring_lock(med);
>  
> -    free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
> -    if ( d->mem_event.req_producers < free_requests )
> +    free_requests = RING_FREE_REQUESTS(&med->front_ring);
> +    if ( med->req_producers < free_requests )
>      {
> -        d->mem_event.req_producers++;
> +        med->req_producers++;
>          ring_full = 0;
>      }
>  
> -    if ( (curr->domain->domain_id == d->domain_id) && ring_full )
> +    if ( (curr->domain->domain_id == dom_id) && ring_full )
>          mem_event_mark_and_pause(curr);

I think you should just have it take a domain and a med like the otehr
functions, and have this check be ( curr->domain == d ).

I'm pretty sure that checking for equal domain IDs here is just a slight
oddity of the original code and not something subtle. :)

Cheers,

Tim.

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