Hello All, The SetPageForeign() macro takes a pointer to a destructor function. Can someone please explain the responsibilities of this destructor? Thanks for your time, -steve _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2 Dec 2005, at 00:54, King, Steven R wrote:> The SetPageForeign() macro takes a pointer to a destructor function. > Can someone please explain the responsibilities of this destructor? > Thanks for your time,The ''Foreign'' in this context is supposed to refer to a foreign heap. That is, the page was not originally allocated from page_alloc.c. So the destructor is entirely responsible for cleaning up that page of memory (e.g., in netback.c it unmaps a domU page and sends a packet-transmitted response to the domU netfront driver). After calling the destructore, page_alloc.c will not touch that page any more (it will immediately bail). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thanks Keir, this is helpful -- Just to be definitive: the only *required* activity in the destructor is to unmap the foreign page from the domain. Additional cleanup is use case dependent. Correct? -----Original Message----- From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] Sent: Friday, December 02, 2005 2:19 AM To: King, Steven R Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] foreign mapping destructor On 2 Dec 2005, at 00:54, King, Steven R wrote:> The SetPageForeign() macro takes a pointer to a destructor function. > Can someone please explain the responsibilities of this destructor? > Thanks for your time,The ''Foreign'' in this context is supposed to refer to a foreign heap. That is, the page was not originally allocated from page_alloc.c. So the destructor is entirely responsible for cleaning up that page of memory (e.g., in netback.c it unmaps a domU page and sends a packet-transmitted response to the domU netfront driver). After calling the destructore, page_alloc.c will not touch that page any more (it will immediately bail). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2 Dec 2005, at 21:25, King, Steven R wrote:> Thanks Keir, this is helpful -- Just to be definitive: the only > *required* activity in the destructor is to unmap the foreign page from > the domain. Additional cleanup is use case dependent. > > Correct?As I said, ''foreign'' in this case means simply that the page doesn''t belong to page_alloc.c. It may be that another domain''s page is mapped at that address (in fact that''s the most common usage) but there are other uses, -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel