public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Om.Turyx" <om.turyx@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: regarding mem_map in NUMA
Date: Sun, 09 Jul 2006 15:08:18 +0530	[thread overview]
Message-ID: <44B0CE8A.3090401@gmail.com> (raw)

Hi,
While going through Mel gorman's book, I read that mem_map for NUMA
systems is  treated as a virtual array at PAGE_OFFSET. I could 
understand the the explanation  as follows.

mem_map[pfn] should not be accessed as it is. calculate the actual
node corresponding to pfn and access the page as
pglist_data[A]->node_zonelists[B]->zone_mem_map[C], where,
A : node_id, calculated using pfn,
B : offset in the zonelist calculated using pfn and,
C : offset in the local mem_map calculated using pfn.

Searching google resulted in http://lwn.net/Articles/9188/ Under other 
memory management work, it states mem_map[x] is not recommended in NUMA. 
Instead pfn_to_page() must be used.
from include/asm-i386/mmzone.h,
#define pfn_to_page(pfn)                        \
({\
    unsigned long __pfn = pfn;\
    int __node  = pfn_to_nid(__pfn);\
    &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];\
})
Means, pfn is used to traverse nodeid, and node_mem_map.
But even now I have not found where mem_map is initialized to 
PAGE_OFFSET, neither the significance of it.

Now, why should the mem_map be initialized to PAGE_OFFSET? Where is it
done? In page_alloc.c, I found mem_map = NODE_DATA(0)->node_mem_map;
when CONFIG_FLAT_NODE_MEM_MAP  is defined (non numa case).  If my
understanding is correct, this case should hold for NUMA as well.


Regards,
Om.

                 reply	other threads:[~2006-07-09 22:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=44B0CE8A.3090401@gmail.com \
    --to=om.turyx@gmail.com \
    --cc=linux-kernel@vger.kernel.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