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-next>] [day] [month] [year] [list]
Message-ID: <b95505ab-8206-2a00-e199-e3defecd9d72@suse.cz>
Date:   Wed, 8 Feb 2023 17:07:11 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Yajun Deng <yajun.deng@...ux.dev>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Zi Yan <ziy@...dia.com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        David Hildenbrand <david@...hat.com>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Oscar Salvador <osalvador@...e.de>
Subject: Re: [PATCH] mm/page_alloc: reduce fallbacks to (MIGRATE_PCPTYPES - 1)

On 2/3/23 23:23, Andrew Morton wrote:
> On Fri,  3 Feb 2023 18:01:32 +0800 Yajun Deng <yajun.deng@...ux.dev> wrote:
> 
>> The commit 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable
>> pageblocks with others") has removed MIGRATE_CMA and MIGRATE_ISOLATE from
>> fallbacks list. so there is no need to add an element at the end of every
>> type.
>> 
>> Reduce fallbacks to (MIGRATE_PCPTYPES - 1).


Acked-by: Vlastimil Babka <vbabka@...e.cz>

> Thanks.  `git log' suggests who should be cc'ed when fixing things...
> 
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -2603,10 +2603,10 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
>>   *
>>   * The other migratetypes do not have fallbacks.
>>   */
>> -static int fallbacks[MIGRATE_TYPES][3] = {
>> -	[MIGRATE_UNMOVABLE]   = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE,   MIGRATE_TYPES },
>> -	[MIGRATE_MOVABLE]     = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_TYPES },
>> -	[MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE,   MIGRATE_MOVABLE,   MIGRATE_TYPES },
>> +static int fallbacks[MIGRATE_TYPES][MIGRATE_PCPTYPES - 1] = {

Why not also reduce the first index size from [MIGRATE_TYPES] to
[MIGRATE_PCPTYPES] ?

>> +	[MIGRATE_UNMOVABLE]   = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE   },
>> +	[MIGRATE_MOVABLE]     = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE },
>> +	[MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE,   MIGRATE_MOVABLE   },
>>  };
>>  
>>  #ifdef CONFIG_CMA
>> @@ -2865,11 +2865,8 @@ int find_suitable_fallback(struct free_area *area, unsigned int order,
>>  		return -1;
>>  
>>  	*can_steal = false;
>> -	for (i = 0;; i++) {
>> +	for (i = 0; i < MIGRATE_PCPTYPES - 1 ; i++) {
>>  		fallback_mt = fallbacks[migratetype][i];
>> -		if (fallback_mt == MIGRATE_TYPES)
>> -			break;
>> -
>>  		if (free_area_empty(area, fallback_mt))
>>  			continue;
>>  
>> -- 
>> 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ