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: <20160204164226.GA16895@esperanza>
Date:	Thu, 4 Feb 2016 19:42:26 +0300
From:	Vladimir Davydov <vdavydov@...tuozzo.com>
To:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Konstantin Khlebnikov <koct9i@...il.com>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>,
	Naoya Horiguchi <nao.horiguchi@...il.com>
Subject: Re: [PATCH v1 1/3] /proc/kpageflags: return KPF_BUDDY for "tail"
 buddy pages

On Thu, Feb 04, 2016 at 04:08:01PM +0900, Naoya Horiguchi wrote:
> Currently /proc/kpageflags returns nothing for "tail" buddy pages, which
> is inconvenient when grasping how free pages are distributed. This patch
> sets KPF_BUDDY for such pages.

Looks reasonable to me,

Reviewed-by: Vladimir Davydov <vdavydov@...tuozzo.com>

> 
> With this patch:
> 
>   $ grep MemFree /proc/meminfo ; tools/vm/page-types -b buddy
>   MemFree:         3134992 kB
>                flags      page-count       MB  symbolic-flags                     long-symbolic-flags
>   0x0000000000000400          779272     3044  __________B_______________________________ buddy
>   0x0000000000000c00            4385       17  __________BM______________________________ buddy,mmap
>                total          783657     3061

Why are buddy pages reported as mmapped? That looks weird. Shouldn't we
fix it? Something like this, may be?
--
From: Vladimir Davydov <vdavydov@...tuozzo.com>
Subject: [PATCH] proc: kpageflags: do not report buddy and balloon pages as
 mapped

PageBuddy and PageBalloon are not usual page flags - they are identified
by a special negative (so as not to confuse with mapped pages) value of
page->_mapcount. Since /proc/kpageflags uses page_mapcount helper to
check if a page is mapped, it reports pages of these kinds as being
mapped, which is confusing. Fix that by replacing page_mapcount with
page_mapped.

Signed-off-by: Vladimir Davydov <vdavydov@...tuozzo.com>

diff --git a/fs/proc/page.c b/fs/proc/page.c
index b2855eea5405..332450d87ea4 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -105,7 +105,7 @@ u64 stable_page_flags(struct page *page)
 	 * Note that page->_mapcount is overloaded in SLOB/SLUB/SLQB, so the
 	 * simple test in page_mapcount() is not enough.
 	 */
-	if (!PageSlab(page) && page_mapcount(page))
+	if (!PageSlab(page) && page_mapped(page))
 		u |= 1 << KPF_MMAP;
 	if (PageAnon(page))
 		u |= 1 << KPF_ANON;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ