linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: mel@skynet.ie (Mel Gorman)
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lee.Schermerhorn@hp.com, akpm@linux-foundation.org, ak@suse.de,
	clameter@sgi.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH 4/6] Embed zone_id information within the zonelist->zones pointer
Date: Wed, 12 Sep 2007 09:32:04 +0100	[thread overview]
Message-ID: <20070912083203.GA5005@skynet.ie> (raw)
In-Reply-To: <20070912165138.5deb4db4.kamezawa.hiroyu@jp.fujitsu.com>

On (12/09/07 16:51), KAMEZAWA Hiroyuki didst pronounce:
> On Tue, 11 Sep 2007 22:31:27 +0100 (IST)
> Mel Gorman <mel@csn.ul.ie> wrote:
> 
> > Using two zonelists per node requires very frequent use of zone_idx(). This
> > is costly as it involves a lookup of another structure and a substraction
> > operation. As struct zone is always word aligned and normally cache-line
> > aligned, the pointer values have a number of 0's at the least significant
> > bits of the address.
> > 
> > This patch embeds the zone_id of a zone in the zonelist->zones pointers.
> > The real zone pointer is retrieved using the zonelist_zone() helper function.
> > The ID of the zone is found using zonelist_zone_idx().  To avoid accidental
> > references, the zones field is renamed to _zones and the type changed to
> > unsigned long.
> > 
> At first, I welcome this patch. thanks!.
> 
> 
> A comment after reading all is, how about defining zonelist as following
> instead of encoding in pointer ?
> ==
> struct zone_pointer {
> 	struct zone *zone;
> 	int	     node_id;  
> 	int	     zone_idx;
> };
> 
> struct zonelist {
> 	struct zone_pointer	_zones[MAX_ZONES_PER_ZONELIST + 1];
> };
> 
> #define zonelist_zone(zl)      (zl)->zone
> #define zonelist_zone_idx(zl)  (zl)->zone_idx
> #ifdef CONFIG_NUMA
> #define zonelist_zone_nid(zl)  (zl)->node_id
> #else
> #define zonelist_zone_nid(zl, i)  (0)
> ==
> 

That is an interesting idea. I'll try it out and see what happens.
Thanks

> If we really want to avoid unnecessary access to "zone" while walking zonelist,
> above may do something good.  Cons is this makes sizeof zonlist bigger.
> 

While this is true, it might not affect the size of struct zone because
of padding. One way to find out

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-09-12  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11 21:30 [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v5 (resend) Mel Gorman
2007-09-11 21:30 ` [PATCH 1/6] Use zonelists instead of zones when direct reclaiming pages Mel Gorman
2007-09-11 21:30 ` [PATCH 2/6] Introduce node_zonelist() for accessing the zonelist for a GFP mask Mel Gorman
2007-09-11 21:31 ` [PATCH 3/6] Use two zonelist that are filtered by " Mel Gorman
2007-09-11 21:31 ` [PATCH 4/6] Embed zone_id information within the zonelist->zones pointer Mel Gorman
2007-09-12  7:51   ` KAMEZAWA Hiroyuki
2007-09-12  8:32     ` Mel Gorman [this message]
2007-09-12 17:06     ` Christoph Lameter
2007-09-11 21:31 ` [PATCH 5/6] Filter based on a nodemask as well as a gfp_mask Mel Gorman
2007-09-11 21:32 ` [PATCH 6/6] Use one zonelist that is filtered by nodemask Mel Gorman
2007-09-12 20:27 ` [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v5 (resend) Lee Schermerhorn
2007-09-13 10:11   ` Mel Gorman
  -- strict thread matches above, loose matches on Subject: below --
2007-09-11 15:19 [PATCH 0/6] Use one zonelist per node instead of multiple zonelists v5 Mel Gorman
2007-09-11 15:20 ` [PATCH 4/6] Embed zone_id information within the zonelist->zones pointer Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070912083203.GA5005@skynet.ie \
    --to=mel@skynet.ie \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox