WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 2] mem_event: pass mem_event_domain pointer to mem_event functions
From: Tim Deegan <tim@xxxxxxx>
Date: Wed, 7 Sep 2011 15:40:42 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 07 Sep 2011 07:41:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4e7bcc14b76a8e37bc8e.1315397729@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1315397728@xxxxxxxxxxxx> <4e7bcc14b76a8e37bc8e.1315397729@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
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