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: Re: [Xen-devel] SetPageForeign in netback

To: "gm281" <gm281@xxxxxxxxx>
Subject: Re: Re: [Xen-devel] SetPageForeign in netback
From: "Zang Hongyong" <zanghongyong@xxxxxxxxxx>
Date: Wed, 18 Jun 2008 19:37:59 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 18 Jun 2008 04:39:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Many thanks!
And that is, when tx, after the data page is sent by native Nic driver in dom0, 
the data page will be freed, then netif_page_release() called which indicates 
netback to unmap the page offered by domU, and moves on its tx response.

Is that so?
If so, how about a bad NIC driver which doen't call free_page() after sending 
data out of machine ?

and Why mmap_pages is allocated by 
alloc_empty_pages_and_pagevec(MAX_PENDING_REQS)?
can  mmap_pages be allocated by alloc_vm_area() and vmalloc_to_page() ??

Forgive my silly questions above please.
        

======= 2008-06-18 18:52:27 您在来信中写道:=======

>> hi,
>>  in netback init mmap_pages,
>>                SetPageForeign(page, netif_page_release);
>>  that is, page->index = netif_page_release
>>  while netif_page_release is a function.
>
>netif_page_release is a function, and therefore:
>page->index = netif_page_release
>will store netif_page_release function pointer in 'index'
>
>>  so what's the meaning of SetPageForeign?
>
>Setting a page foreign means that the page is owned by another domain,
>and that some care needs to be taken when freeing it.
>
>>  And when the function  netif_page_release() will be called?
>
>Whenever PageForeignDestructor is called (as it calls the destructor
>function stored in the 'index' field).
>PageForeignDestructor is called from:
>__free_pages_ok
>and
>free_hot_cold_page
>
>Hope this helps.
>
>Cheers
>Gr(z)egor(z)
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-devel
>
>

= = = = = = = = = = = = = = = = = = = =
Zang Hongyong
zanghongyong@xxxxxxxxxx
2008-06-18

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