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: <201208210555.41312.ptesarik@suse.cz>
Date:	Tue, 21 Aug 2012 05:55:40 +0200
From:	Petr Tesarik <ptesarik@...e.cz>
To:	wujianguo <wujianguo106@...il.com>
Cc:	tony.luck@...el.com, fenghua.yu@...el.com, dhowells@...hat.com,
	tj@...nel.org, mgorman@...e.de, yinghai@...nel.org,
	minchan.kim@...il.com, akpm@...ux-foundation.org,
	viro@...iv.linux.org.uk, aarcange@...hat.com, davem@...emloft.net,
	hannes@...xchg.org, liuj97@...il.com, wency@...fujitsu.com,
	rientjes@...gle.com, kamezawa.hiroyu@...fujitsu.com,
	mhocko@...e.cz, linux-ia64@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	jiang.liu@...wei.com, guohanjun@...wei.com, qiuxishi@...wei.com
Subject: Re: [PATCH]mm: fix-up zone present pages

Dne Po 20. srpna 2012 08:38:10 wujianguo napsal(a):
> From: Jianguo Wu <wujianguo@...wei.com>
> 
> Hi all,
> 	I think zone->present_pages indicates pages that buddy system can
> management, it should be:
> 	zone->present_pages = spanned pages - absent pages - bootmem pages,
> but now:
> 	zone->present_pages = spanned pages - absent pages - memmap pages.
> spanned pages:total size, including holes.
> absent pages: holes.
> bootmem pages: pages used in system boot, managed by bootmem allocator.
> memmap pages: pages used by page structs.

Absolutely. The memory allocated to page structs should be counted in.

> This may cause zone->present_pages less than it should be.
> For example, numa node 1 has ZONE_NORMAL and ZONE_MOVABLE,
> it's memmap and other bootmem will be allocated from ZONE_MOVABLE,
> so ZONE_NORMAL's present_pages should be spanned pages - absent pages,
> but now it also minus memmap pages(free_area_init_core), which are actually
> allocated from ZONE_MOVABLE. When offline all memory of a zone, This will
> cause zone->present_pages less than 0, because present_pages is unsigned
> long type, it is actually a very large integer, it indirectly caused
> zone->watermark[WMARK_MIN] become a large
> integer(setup_per_zone_wmarks()), than cause totalreserve_pages become a
> large integer(calculate_totalreserve_pages()), and finally cause memory
> allocating failure when fork process(__vm_enough_memory()).
> 
> [root@...alhost ~]# dmesg
> -bash: fork: Cannot allocate memory
> 
> I think bug described in http://marc.info/?l=linux-mm&m=134502182714186&w=2
> is also caused by wrong zone present pages.

And yes, I can confirm that the bug I reported is caused by a too low number 
for the present pages counter. Your patch does fix the bug for me.

Thanks!
Petr Tesarik
--
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