linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: linux-mm@kvack.org, pavel@suse.cz, kravetz@us.ibm.com
Subject: Re: [PATCH] [RFC] for_each_page_in_zone [1/1]
Date: Sat, 25 Feb 2006 10:24:43 +0900	[thread overview]
Message-ID: <20060225102443.22b5727e.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <1140795826.8697.86.camel@localhost.localdomain>

On Fri, 24 Feb 2006 07:43:45 -0800
Dave Hansen <haveblue@us.ibm.com> wrote:

> On Fri, 2006-02-24 at 17:15 +0900, KAMEZAWA Hiroyuki wrote:
> > +struct page *next_page_in_zone(struct page *page, struct zone *zone)
> > +{
> > +       unsigned long pfn = page_to_pfn(page);
> > +
> > +       if (!populated_zone(zone))
> > +               return NULL;
> > +
> > +       pfn = next_valid_pfn(pfn, zone->zone_start_pfn + zone->spanned_pages);
> > +
> > +       if (pfn == END_PFN)
> > +               return NULL;
> > +
> > +       return pfn_to_page(pfn);
> > +} 
> 
> If there can be a case where a node spans other nodes, then I don't
> think this patch will work.  The next_valid_pfn() could be a pfn in
> another zone.  I believe that you may have to do a pfn_to_page() and
> check the zone on each one.  
> 
Oh......maybe this code is ok?
--
do {
	pfn = next_valid_pfn(pfn, zone->zone_start_pfn + zone->zone->spanned_pages);
}while(page_zone(pfn_to_page(pfn)) !-= zone);
--
I think powerpc uses SPARSEMEM when NUMA, so pfn is efficientlly skipped.


> There are some ppc64 machines which have memory laid out like this:
> 
>   0-100 MB Node0
> 100-200 MB Node1
> 200-300 MB Node0
> 
Interesting....

--Kame

--
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:[~2006-02-25  1:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-24  8:15 KAMEZAWA Hiroyuki
2006-02-24 10:52 ` Pavel Machek
2006-02-24 11:59   ` KAMEZAWA Hiroyuki
2006-02-24 15:43 ` Dave Hansen
2006-02-25  1:24   ` KAMEZAWA Hiroyuki [this message]
2006-02-25  1:31     ` KAMEZAWA Hiroyuki

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=20060225102443.22b5727e.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=haveblue@us.ibm.com \
    --cc=kravetz@us.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=pavel@suse.cz \
    /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