lkml.org 
[lkml]   [2009]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 18/22] Use allocation flags as an index to the zone watermark
From
Date
On Wed, 2009-04-22 at 14:53 +0100, Mel Gorman wrote:
> struct zone {
> /* Fields commonly accessed by the page allocator */
> - unsigned long pages_min, pages_low, pages_high;
> + union {
> + struct {
> + unsigned long pages_min, pages_low, pages_high;
> + };
> + unsigned long pages_mark[3];
> + };

Why the union? It's a bit obfuscated for me. Why not just have a
couple of these:

static inline unsigned long zone_pages_min(struct zone *zone)
{
return zone->pages_mark[ALLOC_WMARK_MIN];
}

and s/zone->pages_min/zone_pages_min(zone)/

?

-- Dave



\
 
 \ /
  Last update: 2009-04-22 19:15    [W:0.275 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site