Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitb1caa95

Browse files
kiryltorvalds
authored andcommitted
khugepaged: ignore pmd tables with THP mapped with ptes
Prepare khugepaged to see compound pages mapped with pte. For now wewon't collapse the pmd table with such pte.khugepaged is subject for future rework wrt new refcounting.Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>Tested-by: Sasha Levin <sasha.levin@oracle.com>Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Acked-by: Jerome Marchand <jmarchan@redhat.com>Acked-by: Vlastimil Babka <vbabka@suse.cz>Cc: Andrea Arcangeli <aarcange@redhat.com>Cc: Hugh Dickins <hughd@google.com>Cc: Dave Hansen <dave.hansen@intel.com>Cc: Mel Gorman <mgorman@suse.de>Cc: Rik van Riel <riel@redhat.com>Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>Cc: Steve Capper <steve.capper@linaro.org>Cc: Johannes Weiner <hannes@cmpxchg.org>Cc: Michal Hocko <mhocko@suse.cz>Cc: Christoph Lameter <cl@linux.com>Cc: David Rientjes <rientjes@google.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent7479df6 commitb1caa95

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎include/trace/events/huge_memory.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
EM( SCAN_PAGE_LRU,"page_not_in_lru")\
2323
EM( SCAN_PAGE_LOCK,"page_locked")\
2424
EM( SCAN_PAGE_ANON,"page_not_anon")\
25+
EM( SCAN_PAGE_COMPOUND,"page_compound")\
2526
EM( SCAN_ANY_PROCESS,"no_process_for_page")\
2627
EM( SCAN_VMA_NULL,"vma_null")\
2728
EM( SCAN_VMA_CHECK,"vma_check_failed")\

‎mm/huge_memory.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum scan_result {
4545
SCAN_PAGE_LRU,
4646
SCAN_PAGE_LOCK,
4747
SCAN_PAGE_ANON,
48+
SCAN_PAGE_COMPOUND,
4849
SCAN_ANY_PROCESS,
4950
SCAN_VMA_NULL,
5051
SCAN_VMA_CHECK,
@@ -2770,6 +2771,13 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
27702771
result=SCAN_PAGE_NULL;
27712772
gotoout_unmap;
27722773
}
2774+
2775+
/* TODO: teach khugepaged to collapse THP mapped with pte */
2776+
if (PageCompound(page)) {
2777+
result=SCAN_PAGE_COMPOUND;
2778+
gotoout_unmap;
2779+
}
2780+
27732781
/*
27742782
* Record which node the original page is from and save this
27752783
* information to khugepaged_node_load[].
@@ -2782,7 +2790,6 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
27822790
gotoout_unmap;
27832791
}
27842792
khugepaged_node_load[node]++;
2785-
VM_BUG_ON_PAGE(PageCompound(page),page);
27862793
if (!PageLRU(page)) {
27872794
result=SCAN_SCAN_ABORT;
27882795
gotoout_unmap;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp