From: Wei Yang <richard.weiyang@linux.alibaba.com>
To: dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, tglx@linutronix.de
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Wei Yang <richard.weiyang@linux.alibaba.com>,
Baoquan He <bhe@redhat.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Subject: [PATCH] x86/mm: calculate the proper boundary in register_page_bootmem_memmap()
Date: Tue, 30 Jun 2020 11:22:04 +0800 [thread overview]
Message-ID: <20200630032204.45639-1-richard.weiyang@linux.alibaba.com> (raw)
It would be proper to jump to end boundary of the proper level instead
of always jump to the end boundary of a PAGE.
Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
CC: Baoquan He <bhe@redhat.com>
CC: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
arch/x86/mm/init_64.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index f902fbd17f27..45eddb755eaa 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1536,21 +1536,21 @@ void register_page_bootmem_memmap(unsigned long section_nr,
pgd = pgd_offset_k(addr);
if (pgd_none(*pgd)) {
- next = (addr + PAGE_SIZE) & PAGE_MASK;
+ next = pgd_addr_end(addr, end);
continue;
}
get_page_bootmem(section_nr, pgd_page(*pgd), MIX_SECTION_INFO);
p4d = p4d_offset(pgd, addr);
if (p4d_none(*p4d)) {
- next = (addr + PAGE_SIZE) & PAGE_MASK;
+ next = p4d_addr_end(addr, end);
continue;
}
get_page_bootmem(section_nr, p4d_page(*p4d), MIX_SECTION_INFO);
pud = pud_offset(p4d, addr);
if (pud_none(*pud)) {
- next = (addr + PAGE_SIZE) & PAGE_MASK;
+ next = pud_addr_end(addr, end);
continue;
}
get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
--
2.20.1 (Apple Git-117)
reply other threads:[~2020-06-30 3:22 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=20200630032204.45639-1-richard.weiyang@linux.alibaba.com \
--to=richard.weiyang@linux.alibaba.com \
--cc=bhe@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@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
all inboxes | Powered by JetHome®