linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm: hugetlbfs: fix hugetlbfs optimization v2
@ 2013-11-15 17:47 Andrea Arcangeli
  2013-11-15 17:47 ` [PATCH 1/3] mm: hugetlbfs: fix hugetlbfs optimization Andrea Arcangeli
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Andrea Arcangeli @ 2013-11-15 17:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Khalid Aziz, Pravin Shelar,
	Greg Kroah-Hartman, Ben Hutchings, Christoph Lameter,
	Johannes Weiner, Mel Gorman, Rik van Riel, Andi Kleen,
	Minchan Kim, Linus Torvalds

Hi,

1/3 is a bugfix so it should be applied more urgently. 1/3 is not as
fast as the current upstream code in the hugetlbfs + directio extreme
8GB/sec benchmark (but 3/3 should fill the gap later). The code is
identical to the one I posted in v1 just rebased on upstream and was
developed in collaboration with Khalid who already tested it.

2/3 and 3/3 had very little testing yet, and they're incremental
optimization. 2/3 is minor and most certainly worth applying later.

3/3 instead complicates things a bit and adds more branches to the THP
fast paths, so it should only be applied if the benchmarks of
hugetlbfs + directio show that it is very worthwhile (that has not
been verified yet). If it's not worthwhile 3/3 should be dropped (and
the gap should be filled in some other way if the gap is not caused by
the _mapcount mangling as I guessed). Ideally this should bring even
more performance than current upstream code, as current upstream code
still increased the _mapcount in gup_fast by mistake, while this
eliminates the locked op on the tail page cacheline in gup_fast too
(which is required for correctness too).

As a side note: the _mapcount refcounting on tail pages is only needed
for THP as it is a fundamental information required for
split_huge_page_refcount to be able to distribute the head refcounts
during the split. And it is done on _mapcount instead of the _count,
because the _count would screwup badly with the get_page_unless_zero
speculative pagecache accesses.

Andrea Arcangeli (3):
  mm: hugetlbfs: fix hugetlbfs optimization
  mm: hugetlb: use get_page_foll in follow_hugetlb_page
  mm: tail page refcounting optimization for slab and hugetlbfs

 include/linux/mm.h |  30 ++++++++-
 mm/hugetlb.c       |  19 +++++-
 mm/internal.h      |   3 +-
 mm/swap.c          | 187 ++++++++++++++++++++++++++++++++++-------------------
 4 files changed, 170 insertions(+), 69 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-11-20  0:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15 17:47 [PATCH 0/3] mm: hugetlbfs: fix hugetlbfs optimization v2 Andrea Arcangeli
2013-11-15 17:47 ` [PATCH 1/3] mm: hugetlbfs: fix hugetlbfs optimization Andrea Arcangeli
2013-11-19 23:11   ` Andrew Morton
2013-11-20  0:26     ` Andrea Arcangeli
2013-11-15 17:47 ` [PATCH 2/3] mm: hugetlb: use get_page_foll in follow_hugetlb_page Andrea Arcangeli
2013-11-19 21:27   ` Khalid Aziz
2013-11-15 17:47 ` [PATCH 3/3] mm: tail page refcounting optimization for slab and hugetlbfs Andrea Arcangeli
2013-11-19 21:27   ` Khalid Aziz
2013-11-19 23:14   ` Andrew Morton
2013-11-20  0:20     ` Andrea Arcangeli
2013-11-18 18:04 ` [PATCH 0/3] mm: hugetlbfs: fix hugetlbfs optimization v2 Khalid Aziz
2013-11-19 20:27   ` Khalid Aziz
2013-11-19 22:52     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).