madvise_free, thp: fix madvise_free_huge_pmd return value after splitting
Subsystems (2)
[email protected]
maintainerPATCH 9/20 madvise_free, thp: fix madvise_free_huge_pmd return value after splitting
From: Huang Ying <[email protected]>
Subject: madvise_free, thp: fix madvise_free_huge_pmd return value after splitting
madvise_free_huge_pmd should return 0 if the fallback PTE operations are required. In madvise_free_huge_pmd, if part pages of THP are discarded, the THP will be split and fallback PTE operations should be used if splitting succeeds. But the original code will make fallback PTE operations skipped, after splitting succeeds. Fix that via make madvise_free_huge_pmd return 0 after splitting successfully, so that the fallback PTE operations will be done.
Signed-off-by "Huang, Ying" <[email protected]>
Acked-by Minchan Kim <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Jerome Marchand <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Ebru Akagunduz <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/huge_memory.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
mm/huge_memory.c renamed from mm/huge_memory.c~madvise_free-thp-fix-madvise_free_huge_pmd-return-value-after-splitting +1 -6
@@ -1624,14 +1624,9 @@ int madvise_free_huge_pmd(struct mmu_gatif (next - addr !=HPAGE_PMD_SIZE ) {get_page (page);spin_unlock (ptl); -if (split_huge_page (page)) { -put_page (page); -unlock_page (page); - goto out_unlocked; - } +split_huge_page (page);put_page (page);unlock_page (page); - ret =1 ; goto out_unlocked; }
_