From: "Yinghai Lu" <yinghai@kernel.org>
To: "Shaohua Li" <shaohua.li@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Ingo Molnar" <mingo@redhat.com>
Subject: Re: [patch]x86: arch_add_memory round up address
Date: Wed, 8 Oct 2008 23:22:50 -0700 [thread overview]
Message-ID: <86802c440810082322s4eb7e7e6ib60f68de316b06bc@mail.gmail.com> (raw)
In-Reply-To: <1223532485.7312.0.camel@sli10-desk.sh.intel.com>
On Wed, Oct 8, 2008 at 11:08 PM, Shaohua Li <shaohua.li@intel.com> wrote:
> On Thu, 2008-10-09 at 14:04 +0800, Yinghai Lu wrote:
>> On Wed, Oct 8, 2008 at 10:31 PM, Shaohua Li <shaohua.li@intel.com> wrote:
>> > Round up address to a page, otherwise the last page isn't mapped.
>> >
>> > Signed-off-by: Shaohua Li <shaohua.li@intel.com>
>> > ---
>> > arch/x86/mm/init_64.c | 3 ++-
>> > 1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > Index: linux/arch/x86/mm/init_64.c
>> > ===================================================================
>> > --- linux.orig/arch/x86/mm/init_64.c 2008-10-09 11:42:33.000000000 +0800
>> > +++ linux/arch/x86/mm/init_64.c 2008-10-09 11:43:22.000000000 +0800
>> > @@ -721,7 +721,8 @@ int arch_add_memory(int nid, u64 start,
>> > unsigned long nr_pages = size >> PAGE_SHIFT;
>> > int ret;
>> >
>> > - last_mapped_pfn = init_memory_mapping(start, start + size-1);
>> > + last_mapped_pfn = init_memory_mapping(start,
>> > + round_up(start + size-1, PAGE_SIZE));
>> > if (last_mapped_pfn > max_pfn_mapped)
>> > max_pfn_mapped = last_mapped_pfn;
>>
>> should use
>>
>> last_mapped_pfn = init_memory_mapping(start, start + size);
> No, this still can't guarantee page aligned, though this works in my
> test
who will call arch_add_memory? that should be start and size already
be page aligned.
YH
next prev parent reply other threads:[~2008-10-09 6:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 5:31 Shaohua Li
2008-10-09 6:04 ` Yinghai Lu
2008-10-09 6:08 ` Shaohua Li
2008-10-09 6:22 ` Yinghai Lu [this message]
2008-10-09 6:28 ` Shaohua Li
2008-10-09 6:40 ` Yinghai Lu
2008-10-09 7:06 ` Shaohua Li
2008-10-14 5:16 ` Yasunori Goto
2008-10-14 7:30 ` Shaohua Li
2008-10-14 17:09 ` Yinghai Lu
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=86802c440810082322s4eb7e7e6ib60f68de316b06bc@mail.gmail.com \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=shaohua.li@intel.com \
/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
all inboxes | Powered by JetHome®