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:	Mon, 03 Nov 2014 09:29:02 +0100
From:	Vlastimil Babka <vbabka@...e.cz>
To:	Joonsoo Kim <iamjoonsoo.kim@....com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Rik van Riel <riel@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Mel Gorman <mgorman@...e.de>,
	Johannes Weiner <hannes@...xchg.org>,
	Minchan Kim <minchan@...nel.org>,
	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
	Zhang Yanfei <zhangyanfei@...fujitsu.com>,
	Tang Chen <tangchen@...fujitsu.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Wen Congyang <wency@...fujitsu.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Michal Nazarewicz <mina86@...a86.com>,
	Laura Abbott <lauraa@...eaurora.org>,
	Heesub Shin <heesub.shin@...sung.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Ritesh Harjani <ritesh.list@...il.com>,
	t.stanislaws@...sung.com, Gioh Kim <gioh.kim@....com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH v5 4/4] mm/page_alloc: restrict max order of merging on
 isolated pageblock

On 11/03/2014 09:10 AM, Joonsoo Kim wrote:
> On Fri, Oct 31, 2014 at 03:39:13PM +0100, Vlastimil Babka wrote:
>>> +				__isolate_free_page(page, order);
>>> +				set_page_refcounted(page);
>>> +				isolated_page = page;
>>> +			}
>>> +		}
>>> +	}
>>>   	nr_pages = move_freepages_block(zone, page, migratetype);
>>
>> - this is a costly no-op when the whole pageblock is an isolated
>> page, right?
>
> Okay. I will fix it.
>
>>
>>>   	__mod_zone_freepage_state(zone, nr_pages, migratetype);
>>
>> - with isolated_page set, this means you increase freepage_state
>> here, and then the second time in __free_pages() below?
>> __isolate_free_page() won't decrease it as the pageblock is still
>> MIGRATE_ISOLATE, so the net result is overcounting?
>
> After __isolate_free_page(), freepage has no buddy flag and
> move_freepages_block() doesn't move and count it. So, freepage_state
> only increase in __free_pages(). So net result will be correct.

Ah right, I forgot that it gets nr_pages from the move_freepages_block() 
result (which is 0 in this case).

> Below is the update for your comment.
>
> Thanks.
>
> ------------>8----------------
>  From 4bf298908aba16935c7699589c60d00fa0cf389c Mon Sep 17 00:00:00 2001
> From: Joonsoo Kim <iamjoonsoo.kim@....com>
> Date: Mon, 25 Aug 2014 09:52:13 +0900
> Subject: [PATCH v6 4/4] mm/page_alloc: restrict max order of merging on isolated
>   pageblock
>
> Current pageblock isolation logic could isolate each pageblock
> individually. This causes freepage accounting problem if freepage with
> pageblock order on isolate pageblock is merged with other freepage on
> normal pageblock. We can prevent merging by restricting max order of
> merging to pageblock order if freepage is on isolate pageblock.
>
> Side-effect of this change is that there could be non-merged buddy
> freepage even if finishing pageblock isolation, because undoing pageblock
> isolation is just to move freepage from isolate buddy list to normal buddy
> list rather than to consider merging. So, the patch also makes undoing
> pageblock isolation consider freepage merge. When un-isolation, freepage
> with more than pageblock order and it's buddy are checked. If they are
> on normal pageblock, instead of just moving, we isolate the freepage and
> free it in order to get merged.
>
> Changes from v5:
> Avoid costly move_freepages_block() if there is no freepage.
> Some cosmetic changes.
>
> Changes from v4:
> Consider merging on un-isolation process.
>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>

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


--
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