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] [day] [month] [year] [list]
Message-ID: <20230414200702.GB4712@monkey>
Date:   Fri, 14 Apr 2023 13:07:02 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Mel Gorman <mgorman@...hsingularity.net>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Michal Hocko <mhocko@...e.com>,
        Oscar Salvador <OSalvador@...e.com>,
        Yuanxi Liu <y.liu@...uida.com>,
        David Hildenbrand <david@...hat.com>,
        Linux-MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: Assume huge tail pages are valid when
 allocating contiguous pages

On 04/14/23 12:06, Mike Kravetz wrote:
> Thanks Mel!
> Apologies for not noticing when the bug was posted to the list.  Otherwise,
> I would have jumped on it.
> 
> On 04/14/23 09:22, Mel Gorman wrote:
> > A bug was reported by Yuanxi Liu where allocating 1G pages at runtime is
> > taking an excessive amount of time for large amounts of memory. Further
> > testing allocating huge pages that the cost is linear i.e. if allocating
> > 1G pages in batches of 10 then the time to allocate nr_hugepages from
> > 10->20->30->etc increases linearly even though 10 pages are allocated at
> > each step. Profiles indicated that much of the time is spent checking the
> > validity within already existing huge pages and then attempting a migration
> > that fails after isolating the range, draining pages and a whole lot of
> > other useless work.
> > 
> > Commit eb14d4eefdc4 ("mm,page_alloc: drop unnecessary checks from
> > pfn_range_valid_contig") removed two checks, one which ignored huge pages
> > for contiguous allocations as huge pages can migrate. While there may be
> > value on migrating a 2M page to satisfy a 1G allocation, it's pointless
> > to move a 1G page for a new 1G allocation or scan for validity within an
> > existing huge page.
> 
> eb14d4eefdc4 was the last patch in Oscar's series "Make alloc_contig_range
> handle Hugetlb pages".
> https://lore.kernel.org/linux-mm/20210419075413.1064-1-osalvador@suse.de/
> 
> It seems bailing out of alloc_contig_range when experiencing hugetlb
> pages was an actual issue as the cover letter says:
> 

David correctly pointed out that I was confusing alloc_contig_range and
alloc_contig_pages.  Sorry!

-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ