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]
Date:   Mon, 18 Oct 2021 09:44:40 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Kent Overstreet <kent.overstreet@...il.com>,
        David Hildenbrand <david@...hat.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, linux-raid@...r.kernel.org,
        linux-block@...r.kernel.org, axboe@...nel.dk,
        alexander.h.duyck@...ux.intel.com,
        David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH 1/5] mm: Make free_area->nr_free per migratetype

On 10/14/21 16:45, Kent Overstreet wrote:
> On Wed, Oct 13, 2021 at 06:33:06PM +0200, David Hildenbrand wrote:
>> > @@ -9317,6 +9319,7 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
>> >  	struct page *page;
>> >  	struct zone *zone;
>> >  	unsigned int order;
>> > +	unsigned int migratetype;
>> >  	unsigned long flags;
>> >  
>> >  	offline_mem_sections(pfn, end_pfn);
>> > @@ -9346,7 +9349,8 @@ void __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
>> >  		BUG_ON(page_count(page));
>> >  		BUG_ON(!PageBuddy(page));
>> >  		order = buddy_order(page);
>> > -		del_page_from_free_list(page, zone, order);
>> > +		migratetype = get_pfnblock_migratetype(page, pfn);
>> 
>> As the free pages are isolated, theoretically this should be
>> MIGRATE_ISOLATE.
> 
> Thanks for noticing that - I somehow missed the fact that pageblock migratetypes
> change at runtime,

Not only that. Buddy merging will also merge pages from different
migratetypes. I think that's the main reason why nr_free is not per
migratetype. Your patch has been attempted few times already, e.g. here [1].

[1]
https://lore.kernel.org/all/alpine.DEB.2.10.1611161731350.17379@chino.kir.corp.google.com/

> so my patch is wrong. I'm going to have to rework my patch to
> store the migratetype of free pages in the page itself.

Yeah that would be the solution. Will likely bring some overhead to
alloc/free fastpaths, which would have to be worth it, so nobody attempted it.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ