Linux PG_arch_1 conflict
Quoted 30 lines
From: Isaku Yamahata
Sent: 2006年3月14日 12:43Quoted 18 lines
Quoted 18 lines
What do you think of the followings? Too hacky?
extern struct
address_spacexen_ia64_foreign_dummy_mapping;#define PageForeign(page) \ (page->mapping == &xen_ia64_foreign_dummy_mapping)#define SetPageForeign(page, dtor) do { \ set_page_private((page), (unsigned long)dtor); \ (page)->mapping = &xen_ia64_foreign_dummy_mapping; \ } while (0)#define ClearPageForeign(page) do { \ (page)->mapping = NULL; \ set_page_private((page), 0); \ } while (0)Quoted 6 lines
Quoted 3 lines
#define PageForeignDestructor(page) \ ( (void (*) (struct page *)) page_private((page)) )Hi, Isaku,
(page)->mapping is used to keep special destructor since thatforeign page needs to be freed differently as normal linux pages, as you see in
foreign_page.h. Your hack only ensures the check. Agree right way to go to proposePG_foreignupstream.
Quoted 7 lines
A special destructor is kept in
page->privatebyset_page_private()and get bypage_private().page->privateis unsigned long so that it can hold pointer value.They are just defined as
#definepage_private(page)((page)->private)
#defineset_page_private(page, v)((page)->private = (v))
Oops, I didn't note that. :-)
Thanks,
Kevin