+ mm-migrate-fix-double-call-of-radix_tree_replace_slot.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: migrate: fix double call of radix_tree_replace_slot()
has been added to the -mm tree.  Its filename is
     mm-migrate-fix-double-call-of-radix_tree_replace_slot.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-migrate-fix-double-call-of-radix_tree_replace_slot.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-migrate-fix-double-call-of-radix_tree_replace_slot.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
Subject: mm: migrate: fix double call of radix_tree_replace_slot()

radix_tree_replace_slot() is called twice for head page, it's obviously a
bug.  Let's fix it.

Link: http://lkml.kernel.org/r/20180423072101.GA12157@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: e71769ae5260 ("mm: enable thp migration for shmem thp")
Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
Reported-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxxxx>
Cc: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx>
Cc: Zi Yan <zi.yan@xxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/migrate.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN mm/migrate.c~mm-migrate-fix-double-call-of-radix_tree_replace_slot mm/migrate.c
--- a/mm/migrate.c~mm-migrate-fix-double-call-of-radix_tree_replace_slot
+++ a/mm/migrate.c
@@ -528,14 +528,12 @@ int migrate_page_move_mapping(struct add
 		int i;
 		int index = page_index(page);
 
-		for (i = 0; i < HPAGE_PMD_NR; i++) {
+		for (i = 1; i < HPAGE_PMD_NR; i++) {
 			pslot = radix_tree_lookup_slot(&mapping->i_pages,
 						       index + i);
 			radix_tree_replace_slot(&mapping->i_pages, pslot,
 						newpage + i);
 		}
-	} else {
-		radix_tree_replace_slot(&mapping->i_pages, pslot, newpage);
 	}
 
 	/*
_

Patches currently in -mm which might be from n-horiguchi@xxxxxxxxxxxxx are

mm-migrate-fix-double-call-of-radix_tree_replace_slot.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux