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]
Message-ID: <8cb02c0b-0825-d180-8ce3-dce6e584fc48@suse.cz>
Date:   Mon, 26 Sep 2016 10:52:42 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Xishi Qiu <qiuxishi@...wei.com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Michal Hocko <mhocko@...e.com>,
        Johannes Weiner <hannes@...xchg.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, Linux MM <linux-mm@...ck.org>,
        Yisheng Xie <xieyisheng1@...wei.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [RFC] mm: a question about high-order check in
 __zone_watermark_ok()

[+CC Joonsoo Kim]

On 09/26/2016 10:47 AM, Xishi Qiu wrote:
> commit 97a16fc82a7c5b0cfce95c05dfb9561e306ca1b1
> (mm, page_alloc: only enforce watermarks for order-0 allocations)
> rewrite the high-order check in __zone_watermark_ok(), but I think it
> quietly fix a bug. Please see the following.
>
> Before this patch, the high-order check is this:
> __zone_watermark_ok()
> 	...
> 	for (o = 0; o < order; o++) {
> 		/* At the next order, this order's pages become unavailable */
> 		free_pages -= z->free_area[o].nr_free << o;
>
> 		/* Require fewer higher order pages to be free */
> 		min >>= 1;
>
> 		if (free_pages <= min)
> 			return false;
> 	}
> 	...
>
> If we have cma memory, and we alloc a high-order movable page, then it's right.
>
> But if we alloc a high-order unmovable page(e.g. alloc kernel stack in dup_task_struct()),
> and there are a lot of high-order cma pages, but little high-order unmovable
> pages, the it is still return *true*, but we will alloc *failed* finally, because
> we cannot fallback from migrate_unmovable to migrate_cma, right?

Yeah I think this limitation was known to CMA people.

> Also if we doing __alloc_pages_slowpath(), the compact will not work, because
> __zone_watermark_ok() always return true, and it lead to alloc a high-order
> unmovable page failed, then do direct reclaim.

I guess that can happen as well.

> Thanks,
> Xishi Qiu
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ