[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] shrink ia64 struct page_info.
# HG changeset patch # User Isaku Yamahata <yamahata@xxxxxxxxxxxxx> # Date 1234491796 -32400 # Node ID 726b56720b16e5e0effe24fbddac78d8af4c2125 # Parent af0da711bbdb5f9c631aeca85b21eaf1bfb3eddb [IA64] shrink ia64 struct page_info. This patch is the ia64 counter part of 19107:0858f961c77a, 19132:5848b49b74fc and 19136:162cdb596b9a. This patch shrink ia64 struct page_info and rearrange its members. The shrinking is made compile time option in config.h with default off becuase physical address size is architected to 50bit by ia64 and mfn isn't always addressed by 32bits with 16KB page size. Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- xen/arch/ia64/Rules.mk | 13 +++++++++++++ xen/arch/ia64/xen/domain.c | 21 +++++++++++++++++++-- xen/include/asm-ia64/mm.h | 27 +++++++++++++++++++++------ 3 files changed, 53 insertions(+), 8 deletions(-) diff -r af0da711bbdb -r 726b56720b16 xen/arch/ia64/Rules.mk --- a/xen/arch/ia64/Rules.mk Fri Feb 13 11:22:59 2009 +0900 +++ b/xen/arch/ia64/Rules.mk Fri Feb 13 11:23:16 2009 +0900 @@ -15,6 +15,13 @@ xen_ia64_tlb_track_cnt ?= n xen_ia64_tlb_track_cnt ?= n xen_ia64_tlbflush_clock ?= y xen_ia64_disable_optvfault ?= n + +# If they are enabled, +# shrink struct page_info assuming all mfn can be addressed by 32 bits. +# However, with 50bit ia64 architected physical address and 16KB page size, +# mfn isn't always assessed by 32bit. So they are disabled by default. +xen_ia64_shrink_page_list ?= n +xen_ia64_pickle_domain ?= n # Used only by linux/Makefile. AFLAGS_KERNEL += -mconstant-gp -nostdinc $(CPPFLAGS) @@ -71,5 +78,11 @@ ifeq ($(xen_ia64_disable_optvfault),y) ifeq ($(xen_ia64_disable_optvfault),y) CFLAGS += -DCONFIG_XEN_IA64_DISABLE_OPTVFAULT endif +ifeq ($(xen_ia64_shrink_page_list),y) +CFLAGS += -DCONFIG_IA64_SHRINK_PAGE_LIST +endif +ifeq ($(xen_ia64_pickle_domain),y) +CFLAGS += -DCONFIG_IA64_PICKLE_DOMAIN +endif LDFLAGS = -g diff -r af0da711bbdb -r 726b56720b16 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Fri Feb 13 11:22:59 2009 +0900 +++ b/xen/arch/ia64/xen/domain.c Fri Feb 13 11:23:16 2009 +0900 @@ -407,12 +407,29 @@ void relinquish_vcpu_resources(struct vc struct domain *alloc_domain_struct(void) { - return xmalloc(struct domain); +#ifdef CONFIG_IA64_PICKLE_DOMAIN + struct domain *d; + /* + * We pack the MFN of the domain structure into a 32-bit field within + * the page_info structure. Hence the MEMF_bits() restriction. + */ + d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)), + MEMF_bits(32 + PAGE_SHIFT)); + if ( d != NULL ) + memset(d, 0, sizeof(*d)); + return d; +#else + return xmalloc(struct domain); +#endif } void free_domain_struct(struct domain *d) { - xfree(d); +#ifdef CONFIG_IA64_PICKLE_DOMAIN + free_xenheap_pages(d, get_order_from_bytes(sizeof(*d))); +#else + xfree(d); +#endif } struct vcpu *alloc_vcpu_struct(void) diff -r af0da711bbdb -r 726b56720b16 xen/include/asm-ia64/mm.h --- a/xen/include/asm-ia64/mm.h Fri Feb 13 11:22:59 2009 +0900 +++ b/xen/include/asm-ia64/mm.h Fri Feb 13 11:23:16 2009 +0900 @@ -39,17 +39,24 @@ typedef unsigned long page_flags_t; #define PRtype_info "016lx" -#if 0 +#ifdef CONFIG_IA64_SHRINK_PAGE_LIST /* * See include/xen/mm.h. - * For now, abandon to compress struct page_info - * seeing IA64_MAX_PHYS_BITS and page size. + * To compress page_list_entry, all the physical address must + * be addressed by (32 + PAGE_SHIFT) . + * However this is lower than IA64_MAX_PHYS_BITS = 50. */ #undef page_list_entry struct page_list_entry { - unsigned long next, prev; + u32 next, prev; }; +#endif + +#ifdef CONFIG_IA64_PICKLE_DOMAIN +typedef u32 __ia64_domain_t; +#else +typedef unsigned long __ia64_domain_t; #endif struct page_info @@ -65,10 +72,10 @@ struct page_info /* Page is in use: ((count_info & PGC_count_mask) != 0). */ struct { - /* Owner of this page (NULL if page is anonymous). */ - unsigned long _domain; /* pickled format */ /* Type reference count and various PGT_xxx flags and fields. */ unsigned long type_info; + /* Owner of this page (NULL if page is anonymous). */ + __ia64_domain_t _domain; /* pickled format */ } inuse; /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */ @@ -132,8 +139,16 @@ struct page_info #define is_xen_heap_mfn(mfn) (mfn_valid(mfn) && \ is_xen_heap_page(mfn_to_page(mfn))) +#ifdef CONFIG_IA64_PICKLE_DOMAIN +#define page_get_owner(_p) \ + ((struct domain *)((_p)->v.inuse._domain ? \ + mfn_to_virt((_p)->v.inuse._domain) : NULL)) +#define page_set_owner(_p,_d) \ + ((_p)->v.inuse._domain = (_d) ? virt_to_mfn(_d) : 0) +#else #define page_get_owner(_p) ((struct domain *)(_p)->u.inuse._domain) #define page_set_owner(_p, _d) ((_p)->u.inuse._domain = (unsigned long)(_d)) +#endif #define XENSHARE_writable 0 #define XENSHARE_readonly 1 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |