From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: memblock limit must be pmd-aligned
Date: Tue, 27 Jun 2017 18:14:45 +0100 [thread overview]
Message-ID: <20170627171445.GG30002@leverpostej> (raw)
In-Reply-To: <b55726c8-0e36-fa50-78cb-6e488ef9bf31@gmail.com>
On Tue, Jun 27, 2017 at 09:57:17AM -0700, Doug Berger wrote:
> On 06/27/2017 03:59 AM, Mark Rutland wrote:
> > On Mon, Jun 26, 2017 at 05:50:03PM -0700, Doug Berger wrote:
> >> On 06/26/2017 04:43 PM, Laura Abbott wrote:
> >>> On 06/26/2017 10:23 AM, Doug Berger wrote:
> >>>> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> >>>> index 31af3cb59a60..2ae4f9c9d757 100644
> >>>> --- a/arch/arm/mm/mmu.c
> >>>> +++ b/arch/arm/mm/mmu.c
> >>>> @@ -1226,7 +1226,7 @@ void __init adjust_lowmem_bounds(void)
> >>>> if (memblock_limit)
> >>>> memblock_limit = round_down(memblock_limit, PMD_SIZE);
> >>>> if (!memblock_limit)
> >>>> - memblock_limit = arm_lowmem_limit;
> >>>> + memblock_limit = round_down(arm_lowmem_limit, PMD_SIZE);
> >>>>
> >
> > Given we're always going to do the rounding, how about we move that out
> > of the existing conditional, i.e. get rid of the first if, and have:
> >
> > if (!memblock_limit)
> > memblock_limit = arm_lowmem_limit;
> >
> > /*
> > * Round the memblock limit down to a pmd size. This
> > * helps to ensure that we will allocate memory from the
> > * last full pmd, which should be mapped.
> > */
> > memblock_limit = round_down(memblock_limit, PMD_SIZE);
> >
> > Thanks,
> > Mark.
> That makes perfect sense to me. I will submit a v2 with this code
> change. Should I add your Signed-off-by since it is your change?
Since you're writing the patch, there's no need.
Feel free to add my Suggested-by if you want, but I'm not too worried
either way.
Thanks,
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Doug Berger <opendmb@gmail.com>
Cc: Laura Abbott <labbott@redhat.com>,
linux@armlinux.org.uk, nicolas.pitre@linaro.org, tixy@linaro.org,
f.fainelli@gmail.com, keescook@chromium.org,
ard.biesheuvel@linaro.org, marc.zyngier@arm.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: memblock limit must be pmd-aligned
Date: Tue, 27 Jun 2017 18:14:45 +0100 [thread overview]
Message-ID: <20170627171445.GG30002@leverpostej> (raw)
In-Reply-To: <b55726c8-0e36-fa50-78cb-6e488ef9bf31@gmail.com>
On Tue, Jun 27, 2017 at 09:57:17AM -0700, Doug Berger wrote:
> On 06/27/2017 03:59 AM, Mark Rutland wrote:
> > On Mon, Jun 26, 2017 at 05:50:03PM -0700, Doug Berger wrote:
> >> On 06/26/2017 04:43 PM, Laura Abbott wrote:
> >>> On 06/26/2017 10:23 AM, Doug Berger wrote:
> >>>> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> >>>> index 31af3cb59a60..2ae4f9c9d757 100644
> >>>> --- a/arch/arm/mm/mmu.c
> >>>> +++ b/arch/arm/mm/mmu.c
> >>>> @@ -1226,7 +1226,7 @@ void __init adjust_lowmem_bounds(void)
> >>>> if (memblock_limit)
> >>>> memblock_limit = round_down(memblock_limit, PMD_SIZE);
> >>>> if (!memblock_limit)
> >>>> - memblock_limit = arm_lowmem_limit;
> >>>> + memblock_limit = round_down(arm_lowmem_limit, PMD_SIZE);
> >>>>
> >
> > Given we're always going to do the rounding, how about we move that out
> > of the existing conditional, i.e. get rid of the first if, and have:
> >
> > if (!memblock_limit)
> > memblock_limit = arm_lowmem_limit;
> >
> > /*
> > * Round the memblock limit down to a pmd size. This
> > * helps to ensure that we will allocate memory from the
> > * last full pmd, which should be mapped.
> > */
> > memblock_limit = round_down(memblock_limit, PMD_SIZE);
> >
> > Thanks,
> > Mark.
> That makes perfect sense to me. I will submit a v2 with this code
> change. Should I add your Signed-off-by since it is your change?
Since you're writing the patch, there's no need.
Feel free to add my Suggested-by if you want, but I'm not too worried
either way.
Thanks,
Mark.
next prev parent reply other threads:[~2017-06-27 17:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 17:23 [PATCH] ARM: memblock limit must be pmd-aligned Doug Berger
2017-06-26 17:23 ` Doug Berger
2017-06-26 23:43 ` Laura Abbott
2017-06-26 23:43 ` Laura Abbott
2017-06-27 0:50 ` Doug Berger
2017-06-27 0:50 ` Doug Berger
2017-06-27 10:59 ` Mark Rutland
2017-06-27 10:59 ` Mark Rutland
2017-06-27 16:57 ` Doug Berger
2017-06-27 16:57 ` Doug Berger
2017-06-27 17:03 ` Russell King - ARM Linux
2017-06-27 17:03 ` Russell King - ARM Linux
2017-06-27 17:14 ` Mark Rutland [this message]
2017-06-27 17:14 ` Mark Rutland
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=20170627171445.GG30002@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.