All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: A crash on ARM64 in move_freepages_block due to uninitialized pages in reserved memory
Date: Thu, 30 Aug 2018 17:11:37 +0100	[thread overview]
Message-ID: <20180830161137.GC13005@arm.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1808301148260.18300@file01.intranet.prod.int.rdu2.redhat.com>

On Thu, Aug 30, 2018 at 11:58:19AM -0400, Mikulas Patocka wrote:
> On Wed, 29 Aug 2018, James Morse wrote:
> > HOLES_IN_ZONE is similar, if some memory is smaller than MAX_ORDER_NR_PAGES,
> > possibly due to nomap holes.
> > 
> > 6d526ee26ccd only enabled it for NUMA systems on arm64, because the NUMA code
> > was first to fall foul of this, but there is nothing NUMA specific about nomap
> > holes within a MAX_ORDER_NR_PAGES region.
> > 
> > I'm convinced arm64 should always enable HOLES_IN_ZONE because nomap pages can
> > occur anywhere. I'll post a fix.
> 
> But x86 had the same bug -
> https://bugzilla.redhat.com/show_bug.cgi?id=1598462

Yeah, that's not readable and lkml.org is down. Any idea what x86 did?

> And x86 fixed it without enabling HOLES_IN_ZONE. On x86, the BIOS can also 
> reserve any memory range - so you can have arbitrary holes there that are 
> not predictable when the kernel is compiled.

What happens when the BIOS reserves a page on x86? Is it still mapped by
the kernel (and therefore has a valid struct page) or is it treated like
NOMAP?

> Currently HOLES_IN_ZONE is selected only for ia64, mips/octeon - so does 
> it mean that all the other architectures don't have holes in the memory 
> map?

Possibly. Note also that arm64 already selects HOLES_IN_ZONE if NUMA.

> What should be architecture-independent way how to handle the holes?

Until firmware is architecture-independent, I think handling this
generically is a lost cause.

Will

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: James Morse <james.morse@arm.com>,
	Michal Hocko <mhocko@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	Pavel Tatashin <Pavel.Tatashin@microsoft.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: A crash on ARM64 in move_freepages_block due to uninitialized pages in reserved memory
Date: Thu, 30 Aug 2018 17:11:37 +0100	[thread overview]
Message-ID: <20180830161137.GC13005@arm.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1808301148260.18300@file01.intranet.prod.int.rdu2.redhat.com>

On Thu, Aug 30, 2018 at 11:58:19AM -0400, Mikulas Patocka wrote:
> On Wed, 29 Aug 2018, James Morse wrote:
> > HOLES_IN_ZONE is similar, if some memory is smaller than MAX_ORDER_NR_PAGES,
> > possibly due to nomap holes.
> > 
> > 6d526ee26ccd only enabled it for NUMA systems on arm64, because the NUMA code
> > was first to fall foul of this, but there is nothing NUMA specific about nomap
> > holes within a MAX_ORDER_NR_PAGES region.
> > 
> > I'm convinced arm64 should always enable HOLES_IN_ZONE because nomap pages can
> > occur anywhere. I'll post a fix.
> 
> But x86 had the same bug -
> https://bugzilla.redhat.com/show_bug.cgi?id=1598462

Yeah, that's not readable and lkml.org is down. Any idea what x86 did?

> And x86 fixed it without enabling HOLES_IN_ZONE. On x86, the BIOS can also 
> reserve any memory range - so you can have arbitrary holes there that are 
> not predictable when the kernel is compiled.

What happens when the BIOS reserves a page on x86? Is it still mapped by
the kernel (and therefore has a valid struct page) or is it treated like
NOMAP?

> Currently HOLES_IN_ZONE is selected only for ia64, mips/octeon - so does 
> it mean that all the other architectures don't have holes in the memory 
> map?

Possibly. Note also that arm64 already selects HOLES_IN_ZONE if NUMA.

> What should be architecture-independent way how to handle the holes?

Until firmware is architecture-independent, I think handling this
generically is a lost cause.

Will

  reply	other threads:[~2018-08-30 16:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 19:44 A crash on ARM64 in move_freepages_block due to uninitialized pages in reserved memory Mikulas Patocka
2018-08-17 19:44 ` Mikulas Patocka
2018-08-21 10:44 ` Michal Hocko
2018-08-21 10:44   ` Michal Hocko
2018-08-21 12:58   ` James Morse
2018-08-21 12:58     ` James Morse
2018-08-23 11:02     ` Mikulas Patocka
2018-08-23 11:02       ` Mikulas Patocka
2018-08-23 11:10       ` Michal Hocko
2018-08-23 11:10         ` Michal Hocko
2018-08-23 11:16         ` Mikulas Patocka
2018-08-23 11:16           ` Mikulas Patocka
2018-08-23 11:23           ` Michal Hocko
2018-08-23 11:23             ` Michal Hocko
2018-08-23 13:13             ` Pasha Tatashin
2018-08-23 13:13               ` Pasha Tatashin
2018-08-23 13:14               ` Pasha Tatashin
2018-08-23 13:14                 ` Pasha Tatashin
2018-08-23 14:34               ` Mikulas Patocka
2018-08-23 14:34                 ` Mikulas Patocka
2018-08-23 14:06       ` James Morse
2018-08-23 14:06         ` James Morse
2018-08-24 11:41         ` Michal Hocko
2018-08-24 11:41           ` Michal Hocko
2018-08-29 17:37           ` James Morse
2018-08-29 17:37             ` James Morse
2018-08-30 15:58             ` Mikulas Patocka
2018-08-30 15:58               ` Mikulas Patocka
2018-08-30 16:11               ` Will Deacon [this message]
2018-08-30 16:11                 ` Will Deacon
2018-08-30 16:25               ` James Morse
2018-08-30 16:25                 ` James Morse
2018-09-03 19:33             ` Michal Hocko
2018-09-03 19:33               ` Michal Hocko
2018-09-07 17:47               ` James Morse
2018-09-07 17:47                 ` James Morse

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=20180830161137.GC13005@arm.com \
    --to=will.deacon@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.