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]
Date:	Tue, 12 May 2015 09:54:51 +0200
From:	Vlastimil Babka <vbabka@...e.cz>
To:	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Mel Gorman <mgorman@...e.de>,
	Johannes Weiner <hannes@...xchg.org>,
	Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 1/3] mm/page_alloc: don't break highest order freepage
 if steal

On 05/12/2015 09:51 AM, Vlastimil Babka wrote:
>>    {
>>    	struct page *page;
>> +	bool steal_fallback;
>>
>> -retry_reserve:
>> +retry:
>>    	page = __rmqueue_smallest(zone, order, migratetype);
>>
>>    	if (unlikely(!page) && migratetype != MIGRATE_RESERVE) {
>>    		if (migratetype == MIGRATE_MOVABLE)
>>    			page = __rmqueue_cma_fallback(zone, order);
>>
>> -		if (!page)
>> -			page = __rmqueue_fallback(zone, order, migratetype);
>> +		if (page)
>> +			goto out;
>> +
>> +		steal_fallback = __rmqueue_fallback(zone, order, migratetype);

Oh and the variable can be probably replaced by calling 
__rmqueue_fallback directly in the if() below.

>>
>>    		/*
>>    		 * Use MIGRATE_RESERVE rather than fail an allocation. goto
>>    		 * is used because __rmqueue_smallest is an inline function
>>    		 * and we want just one call site
>>    		 */
>> -		if (!page) {
>> +		if (!steal_fallback)
>>    			migratetype = MIGRATE_RESERVE;
>> -			goto retry_reserve;
>> -		}
>> +
>> +		goto retry;
>>    	}
>>
>> +out:
>>    	trace_mm_page_alloc_zone_locked(page, order, migratetype);
>>    	return page;
>>    }
>>
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ