mm: make optimistic check for swapin readahead
Subsystems (3)
[email protected]
maintainerPATCH 82/126 mm: make optimistic check for swapin readahead
From: Ebru Akagunduz <[email protected]>
Subject: mm: make optimistic check for swapin readahead
Introduce a new sysfs integer knob /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_swap which makes optimistic check for swapin readahead to increase thp collapse rate. Before getting swapped out pages to memory, checks them and allows up to a certain number. It also prints out using tracepoints amount of unmapped ptes.
[[email protected]: fix scan not aborted on SCAN_EXCEED_SWAP_PTE]
[[email protected]: build fix]
Signed-off-by Ebru Akagunduz <[email protected]>
Acked-by Rik van Riel <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Xie XiuQi <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Mel Gorman <[email protected]>
Cc David Rientjes <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Aneesh Kumar K.V <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>
Signed-off-by Stephen Rothwell <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
include/trace/events/huge_memory.h | 14 +++++--- mm/huge_memory.c | 45 +++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 8 deletions(-)
include/trace/events/huge_memory.h renamed from include/trace/events/huge_memory.h~mm-make-optimistic-check-for-swapin-readahead +9 -5
@@ -28,7 +28,8 @@ EM( SCAN_SWAP_CACHE_PAGE, "page_swap_cache") \ EM( SCAN_DEL_PAGE_LRU, "could_not_delete_page_from_lru")\ EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \ - EMe( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") + EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \ + EMe( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte")#undef EM#undef EMe
@@ -45,9 +46,9 @@ SCAN_STATUS TRACE_EVENT(mm_khugepaged_scan_pmd, TP_PROTO(struct mm_struct *mm, struct page *page, bool writable, - bool referenced, int none_or_zero, int status), + bool referenced, int none_or_zero, int status, int unmapped), - TP_ARGS(mm, page, writable, referenced, none_or_zero, status), + TP_ARGS(mm, page, writable, referenced, none_or_zero, status, unmapped), TP_STRUCT__entry( __field(struct mm_struct *, mm)
@@ -56,6 +57,7 @@ TRACE_EVENT(mm_khugepaged_scan_pmd, __field(bool, referenced) __field(int, none_or_zero) __field(int, status) +__field (int, unmapped) ), TP_fast_assign(
@@ -65,15 +67,17 @@ TRACE_EVENT(mm_khugepaged_scan_pmd, __entry->referenced = referenced; __entry->none_or_zero = none_or_zero; __entry->status = status; + __entry->unmapped = unmapped; ), -TP_printk ("mm=%p, scan_pfn=0x%lx, writable=%d, referenced=%d, none_or_zero=%d, status=%s" , +TP_printk ("mm=%p, scan_pfn=0x%lx, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d" , __entry->mm, __entry->pfn, __entry->writable, __entry->referenced, __entry->none_or_zero, -__print_symbolic (__entry->status,SCAN_STATUS )) +__print_symbolic (__entry->status,SCAN_STATUS ), + __entry->unmapped) ); TRACE_EVENT(mm_collapse_huge_page,
mm/huge_memory.c renamed from mm/huge_memory.c~mm-make-optimistic-check-for-swapin-readahead +42 -3
93 lines not on this page · raw message
_