linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] MADVISE_FREE, THP: Fix madvise_free_huge_pmd return value after splitting
@ 2016-06-28 17:36 Huang, Ying
  2016-06-28 17:36 ` [PATCH 2/2] mm, THP: Clean up return value of madvise_free_huge_pmd Huang, Ying
  2016-06-29  7:26 ` [PATCH 1/2] MADVISE_FREE, THP: Fix madvise_free_huge_pmd return value after splitting Minchan Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Huang, Ying @ 2016-06-28 17:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Huang Ying, Minchan Kim, Kirill A. Shutemov, Vlastimil Babka,
	Jerome Marchand, Andrea Arcangeli, Ebru Akagunduz, linux-mm,
	linux-kernel

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

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.

Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
---
 mm/huge_memory.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 848c16c..546cd21 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1287,14 +1287,9 @@ int madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
 	if (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;
 	}
 
-- 
2.8.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-29  7:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-28 17:36 [PATCH 1/2] MADVISE_FREE, THP: Fix madvise_free_huge_pmd return value after splitting Huang, Ying
2016-06-28 17:36 ` [PATCH 2/2] mm, THP: Clean up return value of madvise_free_huge_pmd Huang, Ying
2016-06-29  7:27   ` Minchan Kim
2016-06-29  7:26 ` [PATCH 1/2] MADVISE_FREE, THP: Fix madvise_free_huge_pmd return value after splitting Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).