Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650227

[PATCH -mm 13/13] mm, THP, swap: Add THP swapping out fallback counting

From "Huang, Ying" <ying.huang@intel.com>
Newsgroups linux.kernel
Subject [PATCH -mm 13/13] mm, THP, swap: Add THP swapping out fallback counting
Date 2017-05-25 08:50 +0200
Message-ID <tKUKT-4K0-29@gated-at.bofh.it> (permalink)
References <tKUKR-4K0-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Huang Ying <ying.huang@intel.com>

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.

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>
---
 include/linux/vm_event_item.h | 1 +
 mm/vmscan.c                   | 3 +++
 mm/vmstat.c                   | 1 +
 3 files changed, 5 insertions(+)

diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 5b5b0f094060..66effbadc9b8 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -85,6 +85,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		THP_ZERO_PAGE_ALLOC,
 		THP_ZERO_PAGE_ALLOC_FAILED,
 		THP_SWPOUT,
+		THP_SWPOUT_FALLBACK,
 #endif
 #ifdef CONFIG_MEMORY_BALLOON
 		BALLOON_INFLATE,
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 510e709aecd4..0f5a6bfc5e65 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1153,6 +1153,9 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 					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 --git a/mm/vmstat.c b/mm/vmstat.c
index ebfd79df1008..9400c915e9a2 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1071,6 +1071,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",
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -mm 00/13] mm, THP, swap: Delay splitting THP after swapped out "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 08:50 +0200
  [PATCH -mm 06/13] block: Increase BIO_MAX_PAGES to PMD size if THP_SWAP enabled "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 08:50 +0200
    Re: [PATCH -mm 06/13] block: Increase BIO_MAX_PAGES to PMD size if  THP_SWAP enabled Ming Lei <ming.lei@redhat.com> - 2017-05-25 10:50 +0200
      Re: [PATCH -mm 06/13] block: Increase BIO_MAX_PAGES to PMD size if THP_SWAP enabled "Huang\, Ying" <ying.huang@intel.com> - 2017-05-26 03:00 +0200
  [PATCH -mm 01/13] mm, THP, swap: Support to clear swap cache flag for THP swapped out "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 08:50 +0200
  [PATCH -mm 13/13] mm, THP, swap: Add THP swapping out fallback counting "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 08:50 +0200
  [PATCH -mm 09/13] memcg, THP, swap: Support move mem cgroup charge for THP swapped out "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 08:50 +0200
  [PATCH -mm 04/13] mm, THP, swap: Don't allocate huge cluster for file backed swap device "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 09:00 +0200
  [PATCH -mm 05/13] block, THP: Make block_device_operations.rw_page support THP "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 09:00 +0200
    Re: [PATCH -mm 05/13] block, THP: Make  block_device_operations.rw_page support THP Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-06-02 08:00 +0200
      Re: [PATCH -mm 05/13] block, THP: Make block_device_operations.rw_page support THP "Huang\, Ying" <ying.huang@intel.com> - 2017-06-05 03:10 +0200
  [PATCH -mm 03/13] mm, THP, swap: Make reuse_swap_page() works for THP swapped out "Huang, Ying" <ying.huang@intel.com> - 2017-05-25 09:00 +0200

csiph-web