[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/6] grantable and address conversion patches



Hi,

Do you have any problems if you make all architectures use
this approach? It would be better to use the same approach.


> # HG changeset patch
> # User yamahata@xxxxxxxxxxxxx
> # Node ID f490d7d1ecce78acc40dda7644e59e7840c68ef4
> # Parent  3434966aa3d1aca4c6f04323c9d2e900a1084417
> PageForeign() uses PG_arch_1. However Linux/ia64, Linux/ppc already use
> the flag for their own purpose. So the flag can't be used.
> This patch is a work around for it.
> PATCHNAME: foreign_page_dont_use_pg_arch_1
> 
> Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
> 
> diff -r 3434966aa3d1 -r f490d7d1ecce 
> linux-2.6-xen-sparse/include/xen/foreign_page.h
> --- a/linux-2.6-xen-sparse/include/xen/foreign_page.h Mon Apr 10 16:39:12 
> 2006 +0900
> +++ b/linux-2.6-xen-sparse/include/xen/foreign_page.h Mon Apr 10 16:39:49 
> 2006 +0900
> @@ -5,10 +5,39 @@
>   * not the normal buddy allocator in page_alloc.c
>   * 
>   * Copyright (c) 2004, K A Fraser
> + *
> + * CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE work around
> + * Copyright (c) 2006 Isaku Yamahata
> + *                    VA Linux Systems Japan K.K.
>   */
>  
>  #ifndef __ASM_XEN_FOREIGN_PAGE_H__
>  #define __ASM_XEN_FOREIGN_PAGE_H__
> +
> +#ifdef CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE
> +
> +// Linux/ia64 and Linux/PPC use PG_arch_1 for their own purpose.
> +// PG_arch_1 can't be used.
> +extern struct address_space xen_foreign_dummy_mapping;
> +#define PageForeign(page)                            \
> +     ((page)->mapping == &xen_foreign_dummy_mapping)
> +
> +#define SetPageForeign(page, dtor)                                   \
> +     do {                                                            \
> +             set_page_private((page), (unsigned long)(dtor));        \
> +             (page)->mapping = &xen_foreign_dummy_mapping;           \
> +     } while (0)
> +
> +#define ClearPageForeign(page)                       \
> +     do {                                    \
> +             (page)->mapping = NULL;         \
> +             set_page_private((page), 0);    \
> +     } while (0)
> +
> +#define PageForeignDestructor(page)                          \
> +     ( (void (*) (struct page *)) page_private(page) )
> +
> +#else
>  
>  #define PG_foreign           PG_arch_1
>  
> @@ -27,6 +56,8 @@
>  #define PageForeignDestructor(page)  \
>       ( (void (*) (struct page *)) (page)->mapping )
>  
> +#endif
> +
>  #endif /* __ASM_XEN_FOREIGN_PAGE_H__ */
>  
>  /*
> diff -r 3434966aa3d1 -r f490d7d1ecce linux-2.6-xen-sparse/mm/page_alloc.c
> --- a/linux-2.6-xen-sparse/mm/page_alloc.c    Mon Apr 10 16:39:12 2006 +0900
> +++ b/linux-2.6-xen-sparse/mm/page_alloc.c    Mon Apr 10 16:39:49 2006 +0900
> @@ -85,6 +85,10 @@ int min_free_kbytes = 1024;
>  
>  unsigned long __initdata nr_kernel_pages;
>  unsigned long __initdata nr_all_pages;
> +
> +#ifdef CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE
> +struct address_space xen_foreign_dummy_mapping;
> +#endif
>  
>  #ifdef CONFIG_DEBUG_VM
>  static int page_outside_zone_boundaries(struct zone *zone, struct page *page)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.