linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/8] Avoid cache trashing on clearing huge/gigantic page
@ 2012-08-20 13:52 Kirill A. Shutemov
  2012-08-20 13:52 ` [PATCH v4 1/8] THP: Use real address for NUMA policy Kirill A. Shutemov
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Kirill A. Shutemov @ 2012-08-20 13:52 UTC (permalink / raw)
  To: linux-mm
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andi Kleen,
	Kirill A. Shutemov, Tim Chen, Alex Shi, Jan Beulich,
	Robert Richter, Andy Lutomirski, Andrew Morton, Andrea Arcangeli,
	Johannes Weiner, Hugh Dickins, KAMEZAWA Hiroyuki, Mel Gorman,
	linux-kernel, linuxppc-dev, linux-mips, linux-sh, sparclinux

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

Clearing a 2MB huge page will typically blow away several levels of CPU
caches.  To avoid this only cache clear the 4K area around the fault
address and use a cache avoiding clears for the rest of the 2MB area.

This patchset implements cache avoiding version of clear_page only for
x86. If an architecture wants to provide cache avoiding version of
clear_page it should to define ARCH_HAS_USER_NOCACHE to 1 and implement
clear_page_nocache() and clear_user_highpage_nocache().

v4:
  - vm.clear_huge_page_nocache sysctl;
  - rework page iteration in clear_{huge,gigantic}_page according to
    Andrea Arcangeli suggestion;
v3:
  - Rebased to current Linus' tree. kmap_atomic() build issue is fixed;
  - Pass fault address to clear_huge_page(). v2 had problem with clearing
    for sizes other than HPAGE_SIZE;
  - x86: fix 32bit variant. Fallback version of clear_page_nocache() has
    been added for non-SSE2 systems;
  - x86: clear_page_nocache() moved to clear_page_{32,64}.S;
  - x86: use pushq_cfi/popq_cfi instead of push/pop;
v2:
  - No code change. Only commit messages are updated;
  - RFC mark is dropped;

Andi Kleen (5):
  THP: Use real address for NUMA policy
  THP: Pass fault address to __do_huge_pmd_anonymous_page()
  x86: Add clear_page_nocache
  mm: make clear_huge_page cache clear only around the fault address
  x86: switch the 64bit uncached page clear to SSE/AVX v2

Kirill A. Shutemov (3):
  hugetlb: pass fault address to hugetlb_no_page()
  mm: pass fault address to clear_huge_page()
  mm: implement vm.clear_huge_page_nocache sysctl

 Documentation/sysctl/vm.txt      |   13 ++++++
 arch/x86/include/asm/page.h      |    2 +
 arch/x86/include/asm/string_32.h |    5 ++
 arch/x86/include/asm/string_64.h |    5 ++
 arch/x86/lib/Makefile            |    3 +-
 arch/x86/lib/clear_page_32.S     |   72 +++++++++++++++++++++++++++++++++++
 arch/x86/lib/clear_page_64.S     |   78 ++++++++++++++++++++++++++++++++++++++
 arch/x86/mm/fault.c              |    7 +++
 include/linux/mm.h               |    7 +++-
 kernel/sysctl.c                  |   12 ++++++
 mm/huge_memory.c                 |   17 ++++----
 mm/hugetlb.c                     |   39 ++++++++++---------
 mm/memory.c                      |   72 ++++++++++++++++++++++++++++++----
 13 files changed, 294 insertions(+), 38 deletions(-)
 create mode 100644 arch/x86/lib/clear_page_32.S

-- 
1.7.7.6


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

end of thread, other threads:[~2012-09-25 19:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-20 13:52 [PATCH v4 0/8] Avoid cache trashing on clearing huge/gigantic page Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 1/8] THP: Use real address for NUMA policy Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 2/8] THP: Pass fault address to __do_huge_pmd_anonymous_page() Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 3/8] hugetlb: pass fault address to hugetlb_no_page() Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 4/8] mm: pass fault address to clear_huge_page() Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 5/8] x86: Add clear_page_nocache Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 6/8] mm: make clear_huge_page cache clear only around the fault address Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 7/8] x86: switch the 64bit uncached page clear to SSE/AVX v2 Kirill A. Shutemov
2012-08-20 13:52 ` [PATCH v4 8/8] mm: implement vm.clear_huge_page_nocache sysctl Kirill A. Shutemov
2012-09-12 10:09 ` [PATCH v4 0/8] Avoid cache trashing on clearing huge/gigantic page Kirill A. Shutemov
2012-09-13 23:05 ` Andrew Morton
2012-09-14  5:52   ` Ingo Molnar
2012-09-25 14:27     ` Kirill A. Shutemov
2012-09-25 19:33       ` 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).