From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Baoquan He <bhe@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"the arch/x86 maintainers" <x86@kernel.org>,
Kees Cook <keescook@chromium.org>,
Thomas Garnier <thgarnie@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Yasuaki Ishimatsu <yasu.isimatu@gmail.com>,
Jinbum Park <jinb.park7@gmail.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds
Date: Mon, 1 May 2017 15:08:00 -0700 [thread overview]
Message-ID: <CAE9FiQWfO=U1gxMWpfOL+XJRMX347jan=Q3eYcqdhvXprhpBog@mail.gmail.com> (raw)
In-Reply-To: <20170501193214.fbozpx6dlrapsma3@gmail.com>
On Mon, May 1, 2017 at 12:32 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Baoquan He <bhe@redhat.com> wrote:
>
>> arch/x86/mm/init_64.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
>> index 15173d3..dfa9edb 100644
>> --- a/arch/x86/mm/init_64.c
>> +++ b/arch/x86/mm/init_64.c
>> @@ -96,7 +96,9 @@ void sync_global_pgds(unsigned long start, unsigned long end)
>> {
>> unsigned long address;
>>
>> - for (address = start; address <= end; address += PGDIR_SIZE) {
>> + for (address = start; address <= end;
>> + address = ALIGN(address + 1, PGDIR_SIZE)) {
>> +
>> const pgd_t *pgd_ref = pgd_offset_k(address);
>> struct page *page;
>
> This patch does not apply cleanly to tip:master.
>
> You can avoid the col80 problems by renaming 'address' to the canonical 'addr'
> name, the loop will become:
>
> for (addr = start; addr <= end; addr = ALIGN(addr + 1, PGDIR_SIZE)) {
>
> ... which fits into 80 cols.
would be more readable to make sync_global_pgds() loop is more like that in
kernel_physical_mapping_init() ?
vaddr_start = vaddr;
for (; vaddr < vaddr_end; vaddr = vaddr_next) {
...
vaddr_next = (vaddr & PGDIR_MASK) + PGDIR_SIZE;
Yinghai
prev parent reply other threads:[~2017-05-01 22:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-01 15:55 [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds Baoquan He
2017-05-01 16:00 ` Dan Williams
2017-05-01 19:32 ` Ingo Molnar
2017-05-01 22:08 ` Yinghai Lu [this message]
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='CAE9FiQWfO=U1gxMWpfOL+XJRMX347jan=Q3eYcqdhvXprhpBog@mail.gmail.com' \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=jinb.park7@gmail.com \
--cc=keescook@chromium.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=thgarnie@google.com \
--cc=x86@kernel.org \
--cc=yasu.isimatu@gmail.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;
as well as URLs for NNTP newsgroup(s).