All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 077/119] mm, THP, swap: add THP swapping out fallback counting
@ 2017-09-06 23:22 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-09-06 23:22 UTC (permalink / raw)
  To: aarcange, akpm, axboe, dan.j.williams, hannes, hughd,
	kirill.shutemov, mhocko, minchan, mm-commits, riel, ross.zwisler,
	shli, torvalds, vishal.l.verma, ying.huang

From: Huang Ying <ying.huang@intel.com>
Subject: mm, THP, swap: add THP swapping out fallback counting

When swapping out THP (Transparent Huge Page), instead of swapping out the
THP as a whole, sometimes we have to fallback to split the THP into normal
pages before swapping, because no free swap clusters are available, or
cgroup limit is exceeded, etc.  To count the number of the fallback, a new
VM event THP_SWPOUT_FALLBACK is added, and counted when we fallback to
split the THP.

Link: http://lkml.kernel.org/r/20170724051840.2309-13-ying.huang@intel.com
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Shaohua Li <shli@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ross Zwisler <ross.zwisler@intel.com> [for brd.c, zram_drv.c, pmem.c]
Cc: Vishal L Verma <vishal.l.verma@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/vm_event_item.h |    1 +
 mm/vmscan.c                   |    3 +++
 mm/vmstat.c                   |    1 +
 3 files changed, 5 insertions(+)

diff -puN include/linux/vm_event_item.h~mm-thp-swap-add-thp-swapping-out-fallback-counting include/linux/vm_event_item.h
--- a/include/linux/vm_event_item.h~mm-thp-swap-add-thp-swapping-out-fallback-counting
+++ a/include/linux/vm_event_item.h
@@ -86,6 +86,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS
 		THP_ZERO_PAGE_ALLOC,
 		THP_ZERO_PAGE_ALLOC_FAILED,
 		THP_SWPOUT,
+		THP_SWPOUT_FALLBACK,
 #endif
 #ifdef CONFIG_MEMORY_BALLOON
 		BALLOON_INFLATE,
diff -puN mm/vmscan.c~mm-thp-swap-add-thp-swapping-out-fallback-counting mm/vmscan.c
--- a/mm/vmscan.c~mm-thp-swap-add-thp-swapping-out-fallback-counting
+++ a/mm/vmscan.c
@@ -1154,6 +1154,9 @@ static unsigned long shrink_page_list(st
 					if (split_huge_page_to_list(page,
 								    page_list))
 						goto activate_locked;
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+					count_vm_event(THP_SWPOUT_FALLBACK);
+#endif
 					if (!add_to_swap(page))
 						goto activate_locked;
 				}
diff -puN mm/vmstat.c~mm-thp-swap-add-thp-swapping-out-fallback-counting mm/vmstat.c
--- a/mm/vmstat.c~mm-thp-swap-add-thp-swapping-out-fallback-counting
+++ a/mm/vmstat.c
@@ -1072,6 +1072,7 @@ const char * const vmstat_text[] = {
 	"thp_zero_page_alloc",
 	"thp_zero_page_alloc_failed",
 	"thp_swpout",
+	"thp_swpout_fallback",
 #endif
 #ifdef CONFIG_MEMORY_BALLOON
 	"balloon_inflate",
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-06 23:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 23:22 [patch 077/119] mm, THP, swap: add THP swapping out fallback counting akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.