linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mlangsdo@redhat.com (Mark Langsdorf)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] arm64: vmemmap: use virtual projection of linear region
Date: Tue, 8 Mar 2016 07:17:42 -0600	[thread overview]
Message-ID: <56DED0F6.8040602@redhat.com> (raw)
In-Reply-To: <CAKv+Gu9mwj0qscQJSH8wEi0zYC0anrr1hBYbdFE83iN+oQLnRQ@mail.gmail.com>

On 03/08/2016 04:31 AM, Ard Biesheuvel wrote:
> On 8 March 2016 at 09:15, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>
>>
>>> On 8 mrt. 2016, at 08:07, David Daney <ddaney.cavm@gmail.com> wrote:
>>>
>>>> On 02/26/2016 08:57 AM, Ard Biesheuvel wrote:
>>>> Commit dd006da21646 ("arm64: mm: increase VA range of identity map") made
>>>> some changes to the memory mapping code to allow physical memory to reside
>>>> at an offset that exceeds the size of the virtual mapping.
>>>>
>>>> However, since the size of the vmemmap area is proportional to the size of
>>>> the VA area, but it is populated relative to the physical space, we may
>>>> end up with the struct page array being mapped outside of the vmemmap
>>>> region. For instance, on my Seattle A0 box, I can see the following output
>>>> in the dmesg log.
>>>>
>>>>     vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000   (     8 GB maximum)
>>>>               0xffffffbfc0000000 - 0xffffffbfd0000000   (   256 MB actual)
>>>>
>>>> We can fix this by deciding that the vmemmap region is not a projection of
>>>> the physical space, but of the virtual space above PAGE_OFFSET, i.e., the
>>>> linear region. This way, we are guaranteed that the vmemmap region is of
>>>> sufficient size, and we can even reduce the size by half.
>>>>
>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>
>>> I see this commit now in Linus' kernel.org tree in v4.5-rc7.
>>>
>>> FYI:  I am seeing a crash that goes away when I revert this.  My kernel has some other modifications (our NUMA patches) so I haven't yet fully tracked this down on an unmodified kernel, but this is what I am getting:
>>>
>>
>
> I managed to reproduce and diagnose this. The problem is that vmemmap
> is no longer zone aligned, which causes trouble in the zone based
> rounding that occurs in memory_present. The below patch fixes this by
> rounding down the subtracted offset. Since this implies that the
> region could stick off the other end, it also reverts the halving of
> the region size.

This fixes the bug on my Seattle B0 system.

Tested-by: Mark Langsdorf <mlangsdo@redhat.com>

--Mark Langsdorf

  reply	other threads:[~2016-03-08 13:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 16:57 [PATCH v2 0/2] vmemmap fix for bug introduced by extending VA range Ard Biesheuvel
2016-02-26 16:57 ` [PATCH v2 1/2] arm64: vmemmap: use virtual projection of linear region Ard Biesheuvel
2016-03-08  1:07   ` David Daney
2016-03-08  2:15     ` Ard Biesheuvel
2016-03-08 10:31       ` Ard Biesheuvel
2016-03-08 13:17         ` Mark Langsdorf [this message]
2016-03-08 15:21           ` Ard Biesheuvel
2016-03-09 11:32         ` Robert Richter
2016-03-09 11:36           ` Robert Richter
2016-02-26 16:57 ` [PATCH v2 2/2] arm64: mm: treat memstart_addr as a signed quantity Ard Biesheuvel
2016-02-29 12:39   ` Ard Biesheuvel
2016-02-29 18:36   ` Catalin Marinas

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=56DED0F6.8040602@redhat.com \
    --to=mlangsdo@redhat.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 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).