lkml.org 
[lkml]   [2009]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Replace the watermark-related union in struct zone with a watermark[] array
On Mon, 27 Apr 2009, Mel Gorman wrote:

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index c1fa208..1ff59fd 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -163,6 +163,13 @@ static inline int is_unevictable_lru(enum lru_list l)
> #endif
> }
>
> +enum zone_watermarks {
> + WMARK_MIN,
> + WMARK_LOW,
> + WMARK_HIGH,
> + NR_WMARK
> +};
> +
> struct per_cpu_pages {
> int count; /* number of pages in the list */
> int high; /* high watermark, emptying needed */
> @@ -275,12 +282,9 @@ struct zone_reclaim_stat {
>
> struct zone {
> /* Fields commonly accessed by the page allocator */
> - union {
> - struct {
> - unsigned long pages_min, pages_low, pages_high;
> - };
> - unsigned long pages_mark[3];
> - };
> +
> + /* zone watermarks, indexed with WMARK_LOW, WMARK_MIN and WMARK_HIGH */
> + unsigned long watermark[NR_WMARK];
>
> /*
> * We don't know if the memory that we're going to allocate will be freeable

I thought the suggestion was for something like

#define zone_wmark_min(z) (z->pages_mark[WMARK_MIN])
...


\
 
 \ /
  Last update: 2009-04-27 22:55    [W:0.126 / U:0.168 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site