linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: akpm@linux-foundation.org, jhubbard@nvidia.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org, ziy@nvidia.com
Subject: Re: [PATCH] mm/pages_alloc.c: Don't create ZONE_MOVABLE beyond the end of a node
Date: Wed, 16 Feb 2022 10:54:21 +0530	[thread overview]
Message-ID: <370f7851-98b9-5812-7e3d-fea8053fb82c@arm.com> (raw)
In-Reply-To: <87bkz8d6nc.fsf@nvdebian.thelocal>



On 2/15/22 10:46 AM, Alistair Popple wrote:
> Anshuman Khandual <anshuman.khandual@arm.com> writes:
> 
>> Hi Alistair,
>>
>> On 2/15/22 8:28 AM, Alistair Popple wrote:
>>> ZONE_MOVABLE uses the remaining memory in each node. It's starting pfn
>>> is also aligned to MAX_ORDER_NR_PAGES. It is possible for the remaining
>>> memory in a node to be less than MAX_ORDER_NR_PAGES, meaning there is
>>> not enough room for ZONE_MOVABLE on that node.
>>
>> How plausible is this scenario on normal systems ?
> 
> Probably not very. I happened to run into this on my development/test x86 VM
> which has 8GB and was booted with `numa=fake=4 kernelcore=60%` but in theory I
> guess any system that has a node with less than MAX_ORDER_NR_PAGES left over for
> ZONE_MOVABLE may be susceptible.
> 
> This was the RAM map:
> 
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
> [    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
> [    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffddfff] usable
> [    0.000000] BIOS-e820: [mem 0x000000007ffde000-0x000000007fffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000027fffffff] usable
> 
> [...]
> 
> [    0.065897] Early memory node ranges
> [    0.065898]   node   0: [mem 0x0000000000001000-0x000000000009efff]
> [    0.065900]   node   0: [mem 0x0000000000100000-0x000000007ffddfff]
> [    0.065902]   node   1: [mem 0x0000000100000000-0x000000017fffffff]
> [    0.065904]   node   2: [mem 0x0000000180000000-0x00000001ffffffff]
> [    0.065906]   node   3: [mem 0x0000000200000000-0x000000027fffffff]
> 
> Note the reserved range from 0x000000007ffde000 to 0x000000007fffffff resulting
> in node-0 ending at 0x000000007ffddfff.
> 
>> Should not the node always contain MAX_ORDER_NR_PAGES aligned pages ? Also all
>> zones which get created from that node should also be MAX_ORDER_NR_PAGES
>> aligned ?
> 
> I'm not sure why that would be case given page size and MAX_ORDER_NR_PAGES can
> be set via a kernel configuration parameter. Obviously it wasn't the case here

I assumed that in general that would be the case.

> or this situation would not arise. That said I don't know this code well, and
> this was where I decided to stop shaving this yak so it's possible there is an
> even deeper underlying issue.
> 
> Either way I don't *think* the fix should introduce any problems as it shouldn't
> do anything unless you were going to hit this issue anyway (which took sometime
> to track down as the cause wasn't obvious).

Fair enough.

> 
>> I am just curious how a node could end up being like this.
> 
> - Anshuman
> 


  reply	other threads:[~2022-02-16  5:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  2:58 [PATCH] mm/pages_alloc.c: Don't create ZONE_MOVABLE beyond the end of a node Alistair Popple
2022-02-15  4:47 ` Anshuman Khandual
2022-02-15  5:16   ` Alistair Popple
2022-02-16  5:24     ` Anshuman Khandual [this message]
2022-02-15  6:15   ` Oscar Salvador
2022-02-17  7:48 ` David Hildenbrand
2022-02-21 11:20 ` Mel Gorman

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=370f7851-98b9-5812-7e3d-fea8053fb82c@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ziy@nvidia.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).