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, 22 Jun 2015 13:22:06 +0300
From:	"Kirill A. Shutemov" <kirill@...temov.name>
To:	Vlastimil Babka <vbabka@...e.cz>
Cc:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Hugh Dickins <hughd@...gle.com>,
	Dave Hansen <dave.hansen@...el.com>,
	Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
	Christoph Lameter <cl@...two.org>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Steve Capper <steve.capper@...aro.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Michal Hocko <mhocko@...e.cz>,
	Jerome Marchand <jmarchan@...hat.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCHv6 26/36] mm: rework mapcount accounting to enable 4k
 mapping of THPs

On Wed, Jun 10, 2015 at 03:47:06PM +0200, Vlastimil Babka wrote:
> On 06/03/2015 07:05 PM, Kirill A. Shutemov wrote:
> >@@ -415,8 +428,17 @@ static inline void page_mapcount_reset(struct page *page)
> >
> >  static inline int page_mapcount(struct page *page)
> >  {
> >+	int ret;
> >  	VM_BUG_ON_PAGE(PageSlab(page), page);
> >-	return atomic_read(&page->_mapcount) + 1;
> >+
> >+	ret = atomic_read(&page->_mapcount) + 1;
> >+	if (PageCompound(page)) {
> >+		page = compound_head(page);
> >+		ret += compound_mapcount(page);
> 
> compound_mapcount() means another PageCompound() and compound_head(), which
> you just did. I've tried this to see the effect on a function that "calls"
> (inlines) page_mapcount() once:
> 
> -               ret += compound_mapcount(page);
> +               ret += atomic_read(compound_mapcount_ptr(page)) + 1;
> 
> bloat-o-meter on compaction.o:
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-59 (-59)
> function                                     old     new   delta
> isolate_migratepages_block                  1769    1710     -59

Okay, fair enough.

> >diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> >index 74b7cece1dfa..a8d47c1edf6a 100644
> >--- a/include/linux/page-flags.h
> >+++ b/include/linux/page-flags.h
> >@@ -127,6 +127,9 @@ enum pageflags {
> >
> >  	/* SLOB */
> >  	PG_slob_free = PG_private,
> >+
> >+	/* THP. Stored in first tail page's flags */
> >+	PG_double_map = PG_private_2,
> 
> Well, not just THP. Any user of compound pages must make sure not to use
> PG_private_2 on the first tail page. At least where the page is going to be
> user-mapped. And same thing about fields that are in union with
> compound_mapcount. Should that be documented more prominently somewhere?

I would substitute "THP" for "Compound pages".

> I guess there's no such user so far, right?

I believe so.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ