Skip to contentSkip to conversation

SetPageForeign in netback

DISCUSSION Zang Hongyong 2 participants 2 messages Jun 15, 2008 – Jun 18, 2008

lore
Share & tools
lore
#0 lore raw

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.

so what's the meaning of SetPageForeign?
And when the function netif_page_release() will be called?

thanks in advance.

Zang Hongyong
[email protected]
2008-06-15

#1 lore raw
Quoted 5 lines

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'

Quoted 1 line

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.

Quoted 1 line

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)