X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fmmzone.h;h=a2b35dbc84f7dc79bc59f0eb7ded44119e3e901c;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=7c36a10f6720ab7a051a8a04680df7773077cebc;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 7c36a10f6..a2b35dbc8 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -22,7 +22,7 @@ struct free_area { struct list_head free_list; - unsigned long *map; + unsigned long nr_free; }; struct pglist_data; @@ -35,7 +35,7 @@ struct pglist_data; */ #if defined(CONFIG_SMP) struct zone_padding { - int x; + char x[0]; } ____cacheline_maxaligned_in_smp; #define ZONE_PADDING(name) struct zone_padding name; #else @@ -108,28 +108,31 @@ struct per_cpu_pageset { */ struct zone { - /* - * Commonly accessed fields: - */ - spinlock_t lock; + /* Fields commonly accessed by the page allocator */ unsigned long free_pages; unsigned long pages_min, pages_low, pages_high; /* - * protection[] is a pre-calculated number of extra pages that must be - * available in a zone in order for __alloc_pages() to allocate memory - * from the zone. i.e., for a GFP_KERNEL alloc of "order" there must - * be "(1<> PAGE_SHIFT */ unsigned long zone_start_pfn; + unsigned long spanned_pages; /* total size, including holes */ + unsigned long present_pages; /* amount of memory (excluding holes) */ + /* * rarely used fields: */ char *name; - unsigned long spanned_pages; /* total size, including holes */ - unsigned long present_pages; /* amount of memory (excluding holes) */ } ____cacheline_maxaligned_in_smp; @@ -262,14 +259,14 @@ typedef struct pglist_data { range, including holes */ int node_id; struct pglist_data *pgdat_next; - wait_queue_head_t kswapd_wait; + wait_queue_head_t kswapd_wait; struct task_struct *kswapd; + int kswapd_max_order; } pg_data_t; #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) #define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) -extern int numnodes; extern struct pglist_data *pgdat_list; void __get_zone_counts(unsigned long *active, unsigned long *inactive, @@ -277,7 +274,9 @@ void __get_zone_counts(unsigned long *active, unsigned long *inactive, void get_zone_counts(unsigned long *active, unsigned long *inactive, unsigned long *free); void build_all_zonelists(void); -void wakeup_kswapd(struct zone *zone); +void wakeup_kswapd(struct zone *zone, int order); +int zone_watermark_ok(struct zone *z, int order, unsigned long mark, + int alloc_type, int can_try_harder, int gfp_high); /* * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc. @@ -306,7 +305,7 @@ static inline struct zone *next_zone(struct zone *zone) { pg_data_t *pgdat = zone->zone_pgdat; - if (zone - pgdat->node_zones < MAX_NR_ZONES - 1) + if (zone < pgdat->node_zones + MAX_NR_ZONES - 1) zone++; else if (pgdat->pgdat_next) { pgdat = pgdat->pgdat_next; @@ -352,12 +351,12 @@ static inline int is_normal_idx(int idx) */ static inline int is_highmem(struct zone *zone) { - return (is_highmem_idx(zone - zone->zone_pgdat->node_zones)); + return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; } static inline int is_normal(struct zone *zone) { - return (is_normal_idx(zone - zone->zone_pgdat->node_zones)); + return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; } /* These two functions are used to setup the per zone pages min values */ @@ -365,12 +364,13 @@ struct ctl_table; struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); -int lower_zone_protection_sysctl_handler(struct ctl_table *, int, struct file *, +extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; +int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); #include /* Returns the number of the current Node. */ -#define numa_node_id() (cpu_to_node(smp_processor_id())) +#define numa_node_id() (cpu_to_node(_smp_processor_id())) #ifndef CONFIG_DISCONTIGMEM @@ -410,35 +410,6 @@ extern struct pglist_data contig_page_data; #error ZONES_SHIFT > MAX_ZONES_SHIFT #endif -extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES); - -#if defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA) - -#define node_online(node) test_bit(node, node_online_map) -#define node_set_online(node) set_bit(node, node_online_map) -#define node_set_offline(node) clear_bit(node, node_online_map) -static inline unsigned int num_online_nodes(void) -{ - int i, num = 0; - - for(i = 0; i < MAX_NUMNODES; i++){ - if (node_online(i)) - num++; - } - return num; -} - -#else /* !CONFIG_DISCONTIGMEM && !CONFIG_NUMA */ - -#define node_online(node) \ - ({ BUG_ON((node) != 0); test_bit(node, node_online_map); }) -#define node_set_online(node) \ - ({ BUG_ON((node) != 0); set_bit(node, node_online_map); }) -#define node_set_offline(node) \ - ({ BUG_ON((node) != 0); clear_bit(node, node_online_map); }) -#define num_online_nodes() 1 - -#endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */ #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _LINUX_MMZONE_H */