[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0904271400450.11972@chino.kir.corp.google.com>
Date: Mon, 27 Apr 2009 14:04:03 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Mel Gorman <mel@....ul.ie>
cc: Linux Memory Management List <linux-mm@...ck.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] Replace the watermark-related union in struct zone with
a watermark[] array
On Mon, 27 Apr 2009, Mel Gorman wrote:
> > I thought the suggestion was for something like
> >
> > #define zone_wmark_min(z) (z->pages_mark[WMARK_MIN])
> > ...
>
> Was it the only suggestion? I thought just replacing the union with an
> array would be an option as well.
>
> The #define approach also requires setter versions like
>
> static inline set_zone_wmark_min(struct zone *z, unsigned long val)
> {
> z->pages_mark[WMARK_MIN] = val;
> }
>
> and you need one of those for each watermark if you are to avoid weirdness like
>
> zone_wmark_min(z) = val;
>
> which looks all wrong.
Agreed, but we only set watermarks in a couple of different locations and
they really have no reason to change otherwise, so I don't think it's
necessary to care too much about how the setter looks.
Adding individual get/set functions for each watermark seems like
overkill.
I personally had no problem with the union struct aliasing the array, I
think ->pages_min, ->pages_low, etc. are already very familiar.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists