lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a458a933-91c7-9fb5-d7f8-b9a7af93a11c@suse.cz>
Date:   Thu, 25 Feb 2021 19:38:44 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Mike Rapoport <rppt@...ux.ibm.com>
Cc:     Mike Rapoport <rppt@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Baoquan He <bhe@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Chris Wilson <chris@...is-wilson.co.uk>,
        David Hildenbrand <david@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Ɓukasz Majczak <lma@...ihalf.com>,
        Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
        Qian Cai <cai@....pw>,
        "Sarvela, Tomi P" <tomi.p.sarvela@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        stable@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct
 page for holes in memory layout

On 2/25/21 7:05 PM, Mike Rapoport wrote:
> On Thu, Feb 25, 2021 at 06:51:53PM +0100, Vlastimil Babka wrote:
>> > 
>> > unset zone link in struct page will trigger
>> > 
>> > 	VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page);
>> 
>> ... in set_pfnblock_flags_mask() when called with a struct page from the
>> "Unknown E820 type" range.
> 
> "... in set_pfnblock_flags_mask() when called with a struct page from a range
> other than E820_TYPE_RAM"
> 
> then :)

Better :)

>> > because there are pages in both ZONE_DMA32 and ZONE_DMA (unset zone link
>> > in struct page) in the same pageblock.
>> 
>> I would say "there are apparently pages" ... "and ZONE_DMA does not span this range"
> 
> I'd rephrase it differently, something like
> 
> "because there are pages in the range of ZONE_DMA32 but the unset zone link
> in struct page makes them appear as a part of ZONE_DMA"

Much better, thanks!

>> > Interleave initialization of the unavailable pages with the normal
>> > initialization of memory map, so that zone and node information will be
>> > properly set on struct pages that are not backed by the actual memory.
>> > 
>> > With this change the pages for holes inside a zone will get proper
>> > zone/node links and the pages that are not spanned by any node will get
>> > links to the adjacent zone/node.
>> 
>> What if two zones are adjacent? I.e. if the hole was at a boundary between two
>> zones.
> 
> What do you mean by "adjacent zones"? If there is a hole near the zone
> boundary, zone span would be clamped to exclude the hole.

Yeah, zone span should exclude those pages, but you still somehow handle them?
That's how I read "pages that are not spanned by any node will get links to the
adjacent zone/node."
So is it always a unique zone/node can be determined?

Let's say we have:

<memory on node 0>
---- pageblock boundary ----
<more memory on node 0>
<a hole>
<memory on node 1>
---- pageblock boundary ----

Now I hope such configurations don't really exist :) But if we simulated them in
QEMU, what would be the linkage in struct pages in that hole?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ