linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wang YanQing <udknight@gmail.com>
To: mgorman@suse.de
Cc: linux-mm@kvack.org, bob.picco@hp.com
Subject: [RFC]about commit "[PATCH] Align the node_mem_map endpoints to a MAX_ORDER boundary"
Date: Wed, 20 Mar 2013 17:35:36 +0800	[thread overview]
Message-ID: <20130320093536.GA2295@udknight> (raw)

Hi Mel Gorman and all, could you explain the code snippet below in
commit e984bb43f7450312ba66fe0e67a99efa6be3b246
"[PATCH] Align the node_mem_map endpoints to a MAX_ORDER boundary"
this commit had getted your ack-by.

"
start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1);
end = pgdat->node_start_pfn + pgdat->node_spanned_pages;
end = ALIGN(end, MAX_ORDER_NR_PAGES);
size =  (end - start) * sizeof(struct page);
map = alloc_remap(pgdat->node_id, size);
if (!map)
        map = alloc_bootmem_node(pgdat, size);
pgdat->node_mem_map = map + (pgdat->node_start_pfn - start);
"


MY QUESTION IS WHY WE NEED THIS TWO LINES BELOW:

"
start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1);
"
and
"
pgdat->node_mem_map = map + (pgdat->node_start_pfn - start);
"

Maybe we don't need this trick and can save some hundred bytes.

Thanks.

--
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:[~2013-03-20  9:36 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=20130320093536.GA2295@udknight \
    --to=udknight@gmail.com \
    --cc=bob.picco@hp.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).