ia64/xen-unstable

changeset 3023:cf2447c5a0c6

bitkeeper revision 1.1159.1.430 (419b8a184G5YMMZLkh4hHAhTI-Bxvg)

Merge
author cl349@arcadians.cl.cam.ac.uk
date Wed Nov 17 17:27:52 2004 +0000 (2004-11-17)
parents f0fe276ae088 687594c02d83
children 1ee592c35e61
files .hgtags .rootkeys BitKeeper/etc/ignore BitKeeper/etc/logging_ok linux-2.6.9-xen-sparse/arch/xen/Kconfig linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig linux-2.6.9-xen-sparse/arch/xen/configs/xenU_defconfig linux-2.6.9-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.9-xen-sparse/include/asm-xen/foreign_page.h linux-2.6.9-xen-sparse/include/linux/gfp.h linux-2.6.9-xen-sparse/include/linux/page-flags.h linux-2.6.9-xen-sparse/mm/page_alloc.c tools/python/xen/xend/server/netif.py xen/Makefile xen/Rules.mk xen/arch/x86/Rules.mk
line diff
     1.1 --- a/.hgtags	Wed Nov 17 10:16:18 2004 +0000
     1.2 +++ b/.hgtags	Wed Nov 17 17:27:52 2004 +0000
     1.3 @@ -1,3 +1,5 @@
     1.4 +42882b3e0dda89f3a8ec00da568f86e9b3c230f1 RELEASE-2.0.0
     1.5 +475a162b66e2c19b1e9468b234a4ba705334905e RELEASE-2.0.1
     1.6  487b2ee37d1cecb5f3e7a546b05ad097a0226f2f beta1
     1.7  3d330e41f41ce1bc118c02346e18949ad5d67f6b latest-semistable
     1.8  30c521db4c71960b0cf1d9c9e1b658e77b535a3e latest-stable
     2.1 --- a/.rootkeys	Wed Nov 17 10:16:18 2004 +0000
     2.2 +++ b/.rootkeys	Wed Nov 17 17:27:52 2004 +0000
     2.3 @@ -242,6 +242,7 @@ 41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6
     2.4  40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/xor.h
     2.5  40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.9-xen-sparse/include/asm-xen/ctrl_if.h
     2.6  40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h
     2.7 +419b4e9367PjTEvdjwavWN12BeBBXg linux-2.6.9-xen-sparse/include/asm-xen/foreign_page.h
     2.8  412dfaeazclyNDM0cpnp60Yo4xulpQ linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h
     2.9  40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
    2.10  3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h
    2.11 @@ -250,7 +251,7 @@ 40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6
    2.12  4122466356eIBnC9ot44WSVVIFyhQA linux-2.6.9-xen-sparse/include/asm-xen/queues.h
    2.13  3f689063BoW-HWV3auUJ-OqXfcGArw linux-2.6.9-xen-sparse/include/asm-xen/xen_proc.h
    2.14  4124d8c4aocX7A-jIbuGraWN84pxGQ linux-2.6.9-xen-sparse/include/linux/bio.h
    2.15 -4124f66fp5QwbDHEfoUIa7pqO5Xhag linux-2.6.9-xen-sparse/include/linux/page-flags.h
    2.16 +419b4e93z2S0gR17XTy8wg09JEwAhg linux-2.6.9-xen-sparse/include/linux/gfp.h
    2.17  4124f66f4NaKNa0xPiGGykn9QaZk3w linux-2.6.9-xen-sparse/include/linux/skbuff.h
    2.18  40f56a0ddHCSs3501MY4hRf22tctOw linux-2.6.9-xen-sparse/mkbuildtree
    2.19  412f46c0LJuKAgSPGoC0Z1DEkLfuLA linux-2.6.9-xen-sparse/mm/memory.c
     3.1 --- a/BitKeeper/etc/ignore	Wed Nov 17 10:16:18 2004 +0000
     3.2 +++ b/BitKeeper/etc/ignore	Wed Nov 17 17:27:52 2004 +0000
     3.3 @@ -76,7 +76,6 @@ xen/xen
     3.4  xen/xen-syms
     3.5  xen/xen.*
     3.6  install/*
     3.7 -
     3.8  patches/ebtables-brnf-5_vs_2.4.25.diff
     3.9  patches/ebtables.diff
    3.10  tools/x2d2/minixend
     4.1 --- a/BitKeeper/etc/logging_ok	Wed Nov 17 10:16:18 2004 +0000
     4.2 +++ b/BitKeeper/etc/logging_ok	Wed Nov 17 17:27:52 2004 +0000
     4.3 @@ -10,6 +10,7 @@ br260@br260.wolfson.cam.ac.uk
     4.4  br260@labyrinth.cl.cam.ac.uk
     4.5  br260@laudney.cl.cam.ac.uk
     4.6  bren@anvil.research
     4.7 +cl349@arcadians.cl.cam.ac.uk
     4.8  cl349@freefall.cl.cam.ac.uk
     4.9  cl349@labyrinth.cl.cam.ac.uk
    4.10  cwc22@centipede.cl.cam.ac.uk
     5.1 --- a/linux-2.6.9-xen-sparse/arch/xen/Kconfig	Wed Nov 17 10:16:18 2004 +0000
     5.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/Kconfig	Wed Nov 17 17:27:52 2004 +0000
     5.3 @@ -111,10 +111,6 @@ config XEN_SCRUB_PAGES
     5.4  
     5.5  endmenu
     5.6  
     5.7 -config FOREIGN_PAGES
     5.8 -	bool
     5.9 -	default y
    5.10 -
    5.11  config HAVE_ARCH_DEV_ALLOC_SKB
    5.12  	bool
    5.13  	default y
     6.1 --- a/linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig	Wed Nov 17 10:16:18 2004 +0000
     6.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig	Wed Nov 17 17:27:52 2004 +0000
     6.3 @@ -19,7 +19,6 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     6.4  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
     6.5  CONFIG_XEN_WRITABLE_PAGETABLES=y
     6.6  CONFIG_XEN_SCRUB_PAGES=y
     6.7 -CONFIG_FOREIGN_PAGES=y
     6.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     6.9  CONFIG_X86=y
    6.10  # CONFIG_X86_64 is not set
    6.11 @@ -158,7 +157,7 @@ CONFIG_MAGIC_SYSRQ=y
    6.12  # CONFIG_DEBUG_INFO is not set
    6.13  # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
    6.14  # CONFIG_FRAME_POINTER is not set
    6.15 -CONFIG_4KSTACKS=y
    6.16 +# CONFIG_4KSTACKS is not set
    6.17  CONFIG_X86_BIOS_REBOOT=y
    6.18  CONFIG_X86_STD_RESOURCES=y
    6.19  CONFIG_PC=y
     7.1 --- a/linux-2.6.9-xen-sparse/arch/xen/configs/xenU_defconfig	Wed Nov 17 10:16:18 2004 +0000
     7.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/configs/xenU_defconfig	Wed Nov 17 17:27:52 2004 +0000
     7.3 @@ -19,7 +19,6 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     7.4  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
     7.5  CONFIG_XEN_WRITABLE_PAGETABLES=y
     7.6  CONFIG_XEN_SCRUB_PAGES=y
     7.7 -CONFIG_FOREIGN_PAGES=y
     7.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     7.9  CONFIG_X86=y
    7.10  # CONFIG_X86_64 is not set
    7.11 @@ -119,7 +118,7 @@ CONFIG_HAVE_DEC_LOCK=y
    7.12  CONFIG_EARLY_PRINTK=y
    7.13  # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
    7.14  # CONFIG_FRAME_POINTER is not set
    7.15 -CONFIG_4KSTACKS=y
    7.16 +# CONFIG_4KSTACKS is not set
    7.17  CONFIG_X86_BIOS_REBOOT=y
    7.18  CONFIG_X86_STD_RESOURCES=y
    7.19  CONFIG_PC=y
     8.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/pgtable.c	Wed Nov 17 10:16:18 2004 +0000
     8.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/pgtable.c	Wed Nov 17 17:27:52 2004 +0000
     8.3 @@ -23,6 +23,8 @@
     8.4  #include <asm/tlbflush.h>
     8.5  #include <asm/io.h>
     8.6  
     8.7 +#include <asm-xen/foreign_page.h>
     8.8 +
     8.9  void show_mem(void)
    8.10  {
    8.11  	int total = 0, reserved = 0;
     9.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Wed Nov 17 10:16:18 2004 +0000
     9.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Wed Nov 17 17:27:52 2004 +0000
     9.3 @@ -16,6 +16,15 @@
     9.4  #include <linux/string.h>
     9.5  #include <linux/types.h>
     9.6  #include <asm-xen/xen-public/xen.h>
     9.7 +#include <asm-xen/foreign_page.h>
     9.8 +
     9.9 +#define arch_free_page(_page,_order)			\
    9.10 +({	int foreign = PageForeign(_page);		\
    9.11 +	if (foreign)					\
    9.12 +		(PageForeignDestructor(_page))(_page);	\
    9.13 +	foreign;					\
    9.14 +})
    9.15 +#define HAVE_ARCH_FREE_PAGE
    9.16  
    9.17  #ifdef CONFIG_XEN_SCRUB_PAGES
    9.18  #define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/foreign_page.h	Wed Nov 17 17:27:52 2004 +0000
    10.3 @@ -0,0 +1,33 @@
    10.4 +/******************************************************************************
    10.5 + * foreign_page.h
    10.6 + * 
    10.7 + * Provide a "foreign" page type, that is owned by a foreign allocator and 
    10.8 + * not the normal buddy allocator in page_alloc.c
    10.9 + * 
   10.10 + * Copyright (c) 2004, K A Fraser
   10.11 + */
   10.12 +
   10.13 +#ifndef __ASM_XEN_FOREIGN_PAGE_H__
   10.14 +#define __ASM_XEN_FOREIGN_PAGE_H__
   10.15 +
   10.16 +/*
   10.17 + * NOTE: PG_foreign must not conflict with any PG_ definition in page-flags.h!!
   10.18 + */
   10.19 +#define PG_foreign		25
   10.20 +
   10.21 +#define PageForeign(page)	test_bit(PG_foreign, &(page)->flags)
   10.22 +
   10.23 +#define SetPageForeign(page, dtor) do {		\
   10.24 +	set_bit(PG_foreign, &(page)->flags);	\
   10.25 +	(page)->mapping = (void *)dtor;		\
   10.26 +} while (0)
   10.27 +
   10.28 +#define ClearPageForeign(page) do {		\
   10.29 +	clear_bit(PG_foreign, &(page)->flags);	\
   10.30 +	(page)->mapping = NULL;			\
   10.31 +} while (0)
   10.32 +
   10.33 +#define PageForeignDestructor(page)	\
   10.34 +	( (void (*) (struct page *)) (page)->mapping )
   10.35 +
   10.36 +#endif /* __ASM_XEN_FOREIGN_PAGE_H__ */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/linux-2.6.9-xen-sparse/include/linux/gfp.h	Wed Nov 17 17:27:52 2004 +0000
    11.3 @@ -0,0 +1,141 @@
    11.4 +#ifndef __LINUX_GFP_H
    11.5 +#define __LINUX_GFP_H
    11.6 +
    11.7 +#include <linux/mmzone.h>
    11.8 +#include <linux/stddef.h>
    11.9 +#include <linux/linkage.h>
   11.10 +#include <linux/config.h>
   11.11 +
   11.12 +struct vm_area_struct;
   11.13 +
   11.14 +/*
   11.15 + * GFP bitmasks..
   11.16 + */
   11.17 +/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */
   11.18 +#define __GFP_DMA	0x01
   11.19 +#define __GFP_HIGHMEM	0x02
   11.20 +
   11.21 +/*
   11.22 + * Action modifiers - doesn't change the zoning
   11.23 + *
   11.24 + * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt
   11.25 + * _might_ fail.  This depends upon the particular VM implementation.
   11.26 + *
   11.27 + * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
   11.28 + * cannot handle allocation failures.
   11.29 + *
   11.30 + * __GFP_NORETRY: The VM implementation must not retry indefinitely.
   11.31 + */
   11.32 +#define __GFP_WAIT	0x10	/* Can wait and reschedule? */
   11.33 +#define __GFP_HIGH	0x20	/* Should access emergency pools? */
   11.34 +#define __GFP_IO	0x40	/* Can start physical IO? */
   11.35 +#define __GFP_FS	0x80	/* Can call down to low-level FS? */
   11.36 +#define __GFP_COLD	0x100	/* Cache-cold page required */
   11.37 +#define __GFP_NOWARN	0x200	/* Suppress page allocation failure warning */
   11.38 +#define __GFP_REPEAT	0x400	/* Retry the allocation.  Might fail */
   11.39 +#define __GFP_NOFAIL	0x800	/* Retry for ever.  Cannot fail */
   11.40 +#define __GFP_NORETRY	0x1000	/* Do not retry.  Might fail */
   11.41 +#define __GFP_NO_GROW	0x2000	/* Slab internal usage */
   11.42 +#define __GFP_COMP	0x4000	/* Add compound page metadata */
   11.43 +
   11.44 +#define __GFP_BITS_SHIFT 16	/* Room for 16 __GFP_FOO bits */
   11.45 +#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
   11.46 +
   11.47 +/* if you forget to add the bitmask here kernel will crash, period */
   11.48 +#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
   11.49 +			__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
   11.50 +			__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP)
   11.51 +
   11.52 +#define GFP_ATOMIC	(__GFP_HIGH)
   11.53 +#define GFP_NOIO	(__GFP_WAIT)
   11.54 +#define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
   11.55 +#define GFP_KERNEL	(__GFP_WAIT | __GFP_IO | __GFP_FS)
   11.56 +#define GFP_USER	(__GFP_WAIT | __GFP_IO | __GFP_FS)
   11.57 +#define GFP_HIGHUSER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM)
   11.58 +
   11.59 +/* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
   11.60 +   platforms, used as appropriate on others */
   11.61 +
   11.62 +#define GFP_DMA		__GFP_DMA
   11.63 +
   11.64 +
   11.65 +/*
   11.66 + * There is only one page-allocator function, and two main namespaces to
   11.67 + * it. The alloc_page*() variants return 'struct page *' and as such
   11.68 + * can allocate highmem pages, the *get*page*() variants return
   11.69 + * virtual kernel addresses to the allocated page(s).
   11.70 + */
   11.71 +
   11.72 +/*
   11.73 + * We get the zone list from the current node and the gfp_mask.
   11.74 + * This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.
   11.75 + *
   11.76 + * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
   11.77 + * optimized to &contig_page_data at compile-time.
   11.78 + */
   11.79 +
   11.80 +/*
   11.81 + * If arch_free_page returns non-zero then the generic free_page code can
   11.82 + * immediately bail: the arch-specific function has done all the work.
   11.83 + */
   11.84 +#ifndef HAVE_ARCH_FREE_PAGE
   11.85 +static inline int arch_free_page(struct page *page, int order)
   11.86 +{
   11.87 +	/* Generic free_page must do the work. */
   11.88 +	return 0;
   11.89 +}
   11.90 +#endif
   11.91 +
   11.92 +extern struct page *
   11.93 +FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *));
   11.94 +
   11.95 +static inline struct page *alloc_pages_node(int nid, unsigned int gfp_mask,
   11.96 +						unsigned int order)
   11.97 +{
   11.98 +	if (unlikely(order >= MAX_ORDER))
   11.99 +		return NULL;
  11.100 +
  11.101 +	return __alloc_pages(gfp_mask, order,
  11.102 +		NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK));
  11.103 +}
  11.104 +
  11.105 +#ifdef CONFIG_NUMA
  11.106 +extern struct page *alloc_pages_current(unsigned gfp_mask, unsigned order);
  11.107 +
  11.108 +static inline struct page *
  11.109 +alloc_pages(unsigned int gfp_mask, unsigned int order)
  11.110 +{
  11.111 +	if (unlikely(order >= MAX_ORDER))
  11.112 +		return NULL;
  11.113 +
  11.114 +	return alloc_pages_current(gfp_mask, order);
  11.115 +}
  11.116 +extern struct page *alloc_page_vma(unsigned gfp_mask,
  11.117 +			struct vm_area_struct *vma, unsigned long addr);
  11.118 +#else
  11.119 +#define alloc_pages(gfp_mask, order) \
  11.120 +		alloc_pages_node(numa_node_id(), gfp_mask, order)
  11.121 +#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
  11.122 +#endif
  11.123 +#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
  11.124 +
  11.125 +extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order));
  11.126 +extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
  11.127 +
  11.128 +#define __get_free_page(gfp_mask) \
  11.129 +		__get_free_pages((gfp_mask),0)
  11.130 +
  11.131 +#define __get_dma_pages(gfp_mask, order) \
  11.132 +		__get_free_pages((gfp_mask) | GFP_DMA,(order))
  11.133 +
  11.134 +extern void FASTCALL(__free_pages(struct page *page, unsigned int order));
  11.135 +extern void FASTCALL(free_pages(unsigned long addr, unsigned int order));
  11.136 +extern void FASTCALL(free_hot_page(struct page *page));
  11.137 +extern void FASTCALL(free_cold_page(struct page *page));
  11.138 +
  11.139 +#define __free_page(page) __free_pages((page), 0)
  11.140 +#define free_page(addr) free_pages((addr),0)
  11.141 +
  11.142 +void page_alloc_init(void);
  11.143 +
  11.144 +#endif /* __LINUX_GFP_H */
    12.1 --- a/linux-2.6.9-xen-sparse/include/linux/page-flags.h	Wed Nov 17 10:16:18 2004 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,338 +0,0 @@
    12.4 -/*
    12.5 - * Macros for manipulating and testing page->flags
    12.6 - */
    12.7 -
    12.8 -#ifndef PAGE_FLAGS_H
    12.9 -#define PAGE_FLAGS_H
   12.10 -
   12.11 -#include <linux/percpu.h>
   12.12 -#include <linux/cache.h>
   12.13 -#include <asm/pgtable.h>
   12.14 -
   12.15 -/*
   12.16 - * Various page->flags bits:
   12.17 - *
   12.18 - * PG_reserved is set for special pages, which can never be swapped out. Some
   12.19 - * of them might not even exist (eg empty_bad_page)...
   12.20 - *
   12.21 - * The PG_private bitflag is set if page->private contains a valid value.
   12.22 - *
   12.23 - * During disk I/O, PG_locked is used. This bit is set before I/O and
   12.24 - * reset when I/O completes. page_waitqueue(page) is a wait queue of all tasks
   12.25 - * waiting for the I/O on this page to complete.
   12.26 - *
   12.27 - * PG_uptodate tells whether the page's contents is valid.  When a read
   12.28 - * completes, the page becomes uptodate, unless a disk I/O error happened.
   12.29 - *
   12.30 - * For choosing which pages to swap out, inode pages carry a PG_referenced bit,
   12.31 - * which is set any time the system accesses that page through the (mapping,
   12.32 - * index) hash table.  This referenced bit, together with the referenced bit
   12.33 - * in the page tables, is used to manipulate page->age and move the page across
   12.34 - * the active, inactive_dirty and inactive_clean lists.
   12.35 - *
   12.36 - * Note that the referenced bit, the page->lru list_head and the active,
   12.37 - * inactive_dirty and inactive_clean lists are protected by the
   12.38 - * zone->lru_lock, and *NOT* by the usual PG_locked bit!
   12.39 - *
   12.40 - * PG_error is set to indicate that an I/O error occurred on this page.
   12.41 - *
   12.42 - * PG_arch_1 is an architecture specific page state bit.  The generic code
   12.43 - * guarantees that this bit is cleared for a page when it first is entered into
   12.44 - * the page cache.
   12.45 - *
   12.46 - * PG_highmem pages are not permanently mapped into the kernel virtual address
   12.47 - * space, they need to be kmapped separately for doing IO on the pages.  The
   12.48 - * struct page (these bits with information) are always mapped into kernel
   12.49 - * address space...
   12.50 - */
   12.51 -
   12.52 -/*
   12.53 - * Don't use the *_dontuse flags.  Use the macros.  Otherwise you'll break
   12.54 - * locked- and dirty-page accounting.  The top eight bits of page->flags are
   12.55 - * used for page->zone, so putting flag bits there doesn't work.
   12.56 - */
   12.57 -#define PG_locked	 	 0	/* Page is locked. Don't touch. */
   12.58 -#define PG_error		 1
   12.59 -#define PG_referenced		 2
   12.60 -#define PG_uptodate		 3
   12.61 -
   12.62 -#define PG_dirty	 	 4
   12.63 -#define PG_lru			 5
   12.64 -#define PG_active		 6
   12.65 -#define PG_slab			 7	/* slab debug (Suparna wants this) */
   12.66 -
   12.67 -#define PG_highmem		 8
   12.68 -#define PG_checked		 9	/* kill me in 2.5.<early>. */
   12.69 -#define PG_arch_1		10
   12.70 -#define PG_reserved		11
   12.71 -
   12.72 -#define PG_private		12	/* Has something at ->private */
   12.73 -#define PG_writeback		13	/* Page is under writeback */
   12.74 -#define PG_nosave		14	/* Used for system suspend/resume */
   12.75 -#define PG_compound		15	/* Part of a compound page */
   12.76 -
   12.77 -#define PG_swapcache		16	/* Swap page: swp_entry_t in private */
   12.78 -#define PG_mappedtodisk		17	/* Has blocks allocated on-disk */
   12.79 -#define PG_reclaim		18	/* To be reclaimed asap */
   12.80 -
   12.81 -#define PG_foreign		21	/* Page belongs to foreign allocator */
   12.82 -
   12.83 -
   12.84 -/*
   12.85 - * Global page accounting.  One instance per CPU.  Only unsigned longs are
   12.86 - * allowed.
   12.87 - */
   12.88 -struct page_state {
   12.89 -	unsigned long nr_dirty;		/* Dirty writeable pages */
   12.90 -	unsigned long nr_writeback;	/* Pages under writeback */
   12.91 -	unsigned long nr_unstable;	/* NFS unstable pages */
   12.92 -	unsigned long nr_page_table_pages;/* Pages used for pagetables */
   12.93 -	unsigned long nr_mapped;	/* mapped into pagetables */
   12.94 -	unsigned long nr_slab;		/* In slab */
   12.95 -#define GET_PAGE_STATE_LAST nr_slab
   12.96 -
   12.97 -	/*
   12.98 -	 * The below are zeroed by get_page_state().  Use get_full_page_state()
   12.99 -	 * to add up all these.
  12.100 -	 */
  12.101 -	unsigned long pgpgin;		/* Disk reads */
  12.102 -	unsigned long pgpgout;		/* Disk writes */
  12.103 -	unsigned long pswpin;		/* swap reads */
  12.104 -	unsigned long pswpout;		/* swap writes */
  12.105 -	unsigned long pgalloc_high;	/* page allocations */
  12.106 -
  12.107 -	unsigned long pgalloc_normal;
  12.108 -	unsigned long pgalloc_dma;
  12.109 -	unsigned long pgfree;		/* page freeings */
  12.110 -	unsigned long pgactivate;	/* pages moved inactive->active */
  12.111 -	unsigned long pgdeactivate;	/* pages moved active->inactive */
  12.112 -
  12.113 -	unsigned long pgfault;		/* faults (major+minor) */
  12.114 -	unsigned long pgmajfault;	/* faults (major only) */
  12.115 -	unsigned long pgrefill_high;	/* inspected in refill_inactive_zone */
  12.116 -	unsigned long pgrefill_normal;
  12.117 -	unsigned long pgrefill_dma;
  12.118 -
  12.119 -	unsigned long pgsteal_high;	/* total highmem pages reclaimed */
  12.120 -	unsigned long pgsteal_normal;
  12.121 -	unsigned long pgsteal_dma;
  12.122 -	unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
  12.123 -	unsigned long pgscan_kswapd_normal;
  12.124 -
  12.125 -	unsigned long pgscan_kswapd_dma;
  12.126 -	unsigned long pgscan_direct_high;/* total highmem pages scanned */
  12.127 -	unsigned long pgscan_direct_normal;
  12.128 -	unsigned long pgscan_direct_dma;
  12.129 -	unsigned long pginodesteal;	/* pages reclaimed via inode freeing */
  12.130 -
  12.131 -	unsigned long slabs_scanned;	/* slab objects scanned */
  12.132 -	unsigned long kswapd_steal;	/* pages reclaimed by kswapd */
  12.133 -	unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
  12.134 -	unsigned long pageoutrun;	/* kswapd's calls to page reclaim */
  12.135 -	unsigned long allocstall;	/* direct reclaim calls */
  12.136 -
  12.137 -	unsigned long pgrotated;	/* pages rotated to tail of the LRU */
  12.138 -};
  12.139 -
  12.140 -DECLARE_PER_CPU(struct page_state, page_states);
  12.141 -
  12.142 -extern void get_page_state(struct page_state *ret);
  12.143 -extern void get_full_page_state(struct page_state *ret);
  12.144 -extern unsigned long __read_page_state(unsigned offset);
  12.145 -
  12.146 -#define read_page_state(member) \
  12.147 -	__read_page_state(offsetof(struct page_state, member))
  12.148 -
  12.149 -#define mod_page_state(member, delta)					\
  12.150 -	do {								\
  12.151 -		unsigned long flags;					\
  12.152 -		local_irq_save(flags);					\
  12.153 -		__get_cpu_var(page_states).member += (delta);		\
  12.154 -		local_irq_restore(flags);				\
  12.155 -	} while (0)
  12.156 -
  12.157 -
  12.158 -#define inc_page_state(member)	mod_page_state(member, 1UL)
  12.159 -#define dec_page_state(member)	mod_page_state(member, 0UL - 1)
  12.160 -#define add_page_state(member,delta) mod_page_state(member, (delta))
  12.161 -#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
  12.162 -
  12.163 -#define mod_page_state_zone(zone, member, delta)			\
  12.164 -	do {								\
  12.165 -		unsigned long flags;					\
  12.166 -		local_irq_save(flags);					\
  12.167 -		if (is_highmem(zone))					\
  12.168 -			__get_cpu_var(page_states).member##_high += (delta);\
  12.169 -		else if (is_normal(zone))				\
  12.170 -			__get_cpu_var(page_states).member##_normal += (delta);\
  12.171 -		else							\
  12.172 -			__get_cpu_var(page_states).member##_dma += (delta);\
  12.173 -		local_irq_restore(flags);				\
  12.174 -	} while (0)
  12.175 -
  12.176 -/*
  12.177 - * Manipulation of page state flags
  12.178 - */
  12.179 -#define PageLocked(page)		\
  12.180 -		test_bit(PG_locked, &(page)->flags)
  12.181 -#define SetPageLocked(page)		\
  12.182 -		set_bit(PG_locked, &(page)->flags)
  12.183 -#define TestSetPageLocked(page)		\
  12.184 -		test_and_set_bit(PG_locked, &(page)->flags)
  12.185 -#define ClearPageLocked(page)		\
  12.186 -		clear_bit(PG_locked, &(page)->flags)
  12.187 -#define TestClearPageLocked(page)	\
  12.188 -		test_and_clear_bit(PG_locked, &(page)->flags)
  12.189 -
  12.190 -#define PageError(page)		test_bit(PG_error, &(page)->flags)
  12.191 -#define SetPageError(page)	set_bit(PG_error, &(page)->flags)
  12.192 -#define ClearPageError(page)	clear_bit(PG_error, &(page)->flags)
  12.193 -
  12.194 -#define PageReferenced(page)	test_bit(PG_referenced, &(page)->flags)
  12.195 -#define SetPageReferenced(page)	set_bit(PG_referenced, &(page)->flags)
  12.196 -#define ClearPageReferenced(page)	clear_bit(PG_referenced, &(page)->flags)
  12.197 -#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
  12.198 -
  12.199 -#define PageUptodate(page)	test_bit(PG_uptodate, &(page)->flags)
  12.200 -#ifndef SetPageUptodate
  12.201 -#define SetPageUptodate(page)	set_bit(PG_uptodate, &(page)->flags)
  12.202 -#endif
  12.203 -#define ClearPageUptodate(page)	clear_bit(PG_uptodate, &(page)->flags)
  12.204 -
  12.205 -#define PageDirty(page)		test_bit(PG_dirty, &(page)->flags)
  12.206 -#define SetPageDirty(page)	set_bit(PG_dirty, &(page)->flags)
  12.207 -#define TestSetPageDirty(page)	test_and_set_bit(PG_dirty, &(page)->flags)
  12.208 -#define ClearPageDirty(page)	clear_bit(PG_dirty, &(page)->flags)
  12.209 -#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags)
  12.210 -
  12.211 -#define SetPageLRU(page)	set_bit(PG_lru, &(page)->flags)
  12.212 -#define PageLRU(page)		test_bit(PG_lru, &(page)->flags)
  12.213 -#define TestSetPageLRU(page)	test_and_set_bit(PG_lru, &(page)->flags)
  12.214 -#define TestClearPageLRU(page)	test_and_clear_bit(PG_lru, &(page)->flags)
  12.215 -
  12.216 -#define PageActive(page)	test_bit(PG_active, &(page)->flags)
  12.217 -#define SetPageActive(page)	set_bit(PG_active, &(page)->flags)
  12.218 -#define ClearPageActive(page)	clear_bit(PG_active, &(page)->flags)
  12.219 -#define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags)
  12.220 -#define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags)
  12.221 -
  12.222 -#define PageSlab(page)		test_bit(PG_slab, &(page)->flags)
  12.223 -#define SetPageSlab(page)	set_bit(PG_slab, &(page)->flags)
  12.224 -#define ClearPageSlab(page)	clear_bit(PG_slab, &(page)->flags)
  12.225 -#define TestClearPageSlab(page)	test_and_clear_bit(PG_slab, &(page)->flags)
  12.226 -#define TestSetPageSlab(page)	test_and_set_bit(PG_slab, &(page)->flags)
  12.227 -
  12.228 -#ifdef CONFIG_HIGHMEM
  12.229 -#define PageHighMem(page)	test_bit(PG_highmem, &(page)->flags)
  12.230 -#else
  12.231 -#define PageHighMem(page)	0 /* needed to optimize away at compile time */
  12.232 -#endif
  12.233 -
  12.234 -#define PageChecked(page)	test_bit(PG_checked, &(page)->flags)
  12.235 -#define SetPageChecked(page)	set_bit(PG_checked, &(page)->flags)
  12.236 -#define ClearPageChecked(page)	clear_bit(PG_checked, &(page)->flags)
  12.237 -
  12.238 -#define PageReserved(page)	test_bit(PG_reserved, &(page)->flags)
  12.239 -#define SetPageReserved(page)	set_bit(PG_reserved, &(page)->flags)
  12.240 -#define ClearPageReserved(page)	clear_bit(PG_reserved, &(page)->flags)
  12.241 -#define __ClearPageReserved(page)	__clear_bit(PG_reserved, &(page)->flags)
  12.242 -
  12.243 -#define SetPagePrivate(page)	set_bit(PG_private, &(page)->flags)
  12.244 -#define ClearPagePrivate(page)	clear_bit(PG_private, &(page)->flags)
  12.245 -#define PagePrivate(page)	test_bit(PG_private, &(page)->flags)
  12.246 -
  12.247 -#define PageWriteback(page)	test_bit(PG_writeback, &(page)->flags)
  12.248 -#define SetPageWriteback(page)						\
  12.249 -	do {								\
  12.250 -		if (!test_and_set_bit(PG_writeback,			\
  12.251 -				&(page)->flags))			\
  12.252 -			inc_page_state(nr_writeback);			\
  12.253 -	} while (0)
  12.254 -#define TestSetPageWriteback(page)					\
  12.255 -	({								\
  12.256 -		int ret;						\
  12.257 -		ret = test_and_set_bit(PG_writeback,			\
  12.258 -					&(page)->flags);		\
  12.259 -		if (!ret)						\
  12.260 -			inc_page_state(nr_writeback);			\
  12.261 -		ret;							\
  12.262 -	})
  12.263 -#define ClearPageWriteback(page)					\
  12.264 -	do {								\
  12.265 -		if (test_and_clear_bit(PG_writeback,			\
  12.266 -				&(page)->flags))			\
  12.267 -			dec_page_state(nr_writeback);			\
  12.268 -	} while (0)
  12.269 -#define TestClearPageWriteback(page)					\
  12.270 -	({								\
  12.271 -		int ret;						\
  12.272 -		ret = test_and_clear_bit(PG_writeback,			\
  12.273 -				&(page)->flags);			\
  12.274 -		if (ret)						\
  12.275 -			dec_page_state(nr_writeback);			\
  12.276 -		ret;							\
  12.277 -	})
  12.278 -
  12.279 -#define PageNosave(page)	test_bit(PG_nosave, &(page)->flags)
  12.280 -#define SetPageNosave(page)	set_bit(PG_nosave, &(page)->flags)
  12.281 -#define TestSetPageNosave(page)	test_and_set_bit(PG_nosave, &(page)->flags)
  12.282 -#define ClearPageNosave(page)		clear_bit(PG_nosave, &(page)->flags)
  12.283 -#define TestClearPageNosave(page)	test_and_clear_bit(PG_nosave, &(page)->flags)
  12.284 -
  12.285 -#define PageMappedToDisk(page)	test_bit(PG_mappedtodisk, &(page)->flags)
  12.286 -#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
  12.287 -#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
  12.288 -
  12.289 -#define PageReclaim(page)	test_bit(PG_reclaim, &(page)->flags)
  12.290 -#define SetPageReclaim(page)	set_bit(PG_reclaim, &(page)->flags)
  12.291 -#define ClearPageReclaim(page)	clear_bit(PG_reclaim, &(page)->flags)
  12.292 -#define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags)
  12.293 -
  12.294 -#define PageCompound(page)	test_bit(PG_compound, &(page)->flags)
  12.295 -#define SetPageCompound(page)	set_bit(PG_compound, &(page)->flags)
  12.296 -#define ClearPageCompound(page)	clear_bit(PG_compound, &(page)->flags)
  12.297 -
  12.298 -/* A foreign page uses a custom destructor rather than the buddy allocator. */
  12.299 -#ifdef CONFIG_FOREIGN_PAGES
  12.300 -#define PageForeign(page)	test_bit(PG_foreign, &(page)->flags)
  12.301 -#define SetPageForeign(page, dtor) do {		\
  12.302 -	set_bit(PG_foreign, &(page)->flags);	\
  12.303 -	(page)->mapping = (void *)dtor;		\
  12.304 -} while (0)
  12.305 -#define ClearPageForeign(page) do {		\
  12.306 -	clear_bit(PG_foreign, &(page)->flags);	\
  12.307 -	(page)->mapping = NULL;			\
  12.308 -} while (0)
  12.309 -#define PageForeignDestructor(page)	\
  12.310 -	( (void (*) (struct page *)) (page)->mapping )
  12.311 -#else
  12.312 -#define PageForeign(page)	0
  12.313 -#define PageForeignDestructor(page)	void
  12.314 -#endif
  12.315 -
  12.316 -#ifdef CONFIG_SWAP
  12.317 -#define PageSwapCache(page)	test_bit(PG_swapcache, &(page)->flags)
  12.318 -#define SetPageSwapCache(page)	set_bit(PG_swapcache, &(page)->flags)
  12.319 -#define ClearPageSwapCache(page) clear_bit(PG_swapcache, &(page)->flags)
  12.320 -#else
  12.321 -#define PageSwapCache(page)	0
  12.322 -#endif
  12.323 -
  12.324 -struct page;	/* forward declaration */
  12.325 -
  12.326 -int test_clear_page_dirty(struct page *page);
  12.327 -int __clear_page_dirty(struct page *page);
  12.328 -int test_clear_page_writeback(struct page *page);
  12.329 -int test_set_page_writeback(struct page *page);
  12.330 -
  12.331 -static inline void clear_page_dirty(struct page *page)
  12.332 -{
  12.333 -	test_clear_page_dirty(page);
  12.334 -}
  12.335 -
  12.336 -static inline void set_page_writeback(struct page *page)
  12.337 -{
  12.338 -	test_set_page_writeback(page);
  12.339 -}
  12.340 -
  12.341 -#endif	/* PAGE_FLAGS_H */
    13.1 --- a/linux-2.6.9-xen-sparse/mm/page_alloc.c	Wed Nov 17 10:16:18 2004 +0000
    13.2 +++ b/linux-2.6.9-xen-sparse/mm/page_alloc.c	Wed Nov 17 17:27:52 2004 +0000
    13.3 @@ -275,7 +275,8 @@ void __free_pages_ok(struct page *page, 
    13.4  	LIST_HEAD(list);
    13.5  	int i;
    13.6  
    13.7 -	arch_free_page(page, order);
    13.8 +	if (arch_free_page(page, order))
    13.9 +		return;
   13.10  
   13.11  	mod_page_state(pgfree, 1 << order);
   13.12  	for (i = 0 ; i < (1 << order) ; ++i)
   13.13 @@ -505,10 +506,8 @@ static void fastcall free_hot_cold_page(
   13.14  	struct per_cpu_pages *pcp;
   13.15  	unsigned long flags;
   13.16  
   13.17 -	if (PageForeign(page))
   13.18 -		return (PageForeignDestructor(page))(page);
   13.19 -
   13.20 -	arch_free_page(page, 0);
   13.21 +	if (arch_free_page(page, 0))
   13.22 +		return;
   13.23  
   13.24  	kernel_map_pages(page, 1, 0);
   13.25  	inc_page_state(pgfree);
    14.1 --- a/tools/python/xen/xend/server/netif.py	Wed Nov 17 10:16:18 2004 +0000
    14.2 +++ b/tools/python/xen/xend/server/netif.py	Wed Nov 17 17:27:52 2004 +0000
    14.3 @@ -307,7 +307,7 @@ class NetDev(controller.SplitDev):
    14.4      
    14.5      def recv_fe_interface_connect(self, val, req):
    14.6          if not req: return
    14.7 -        self.evtchn = channel.eventChannel(self.dom, self.controller.dom)
    14.8 +        self.evtchn = channel.eventChannel(self.backendDomain, self.controller.dom)
    14.9          msg = packMsg('netif_be_connect_t',
   14.10                        { 'domid'          : self.controller.dom,
   14.11                          'netif_handle'   : self.vif,