linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/rmap: fix the handling of device private page in try_to_unmap_one()
@ 2020-03-22 13:57 Pingfan Liu
  2020-03-23  7:34 ` Michal Hocko
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Pingfan Liu @ 2020-03-22 13:57 UTC (permalink / raw)
  To: linux-mm
  Cc: Pingfan Liu, Jérôme Glisse, Michal Hocko, John Hubbard,
	Kirill A . Shutemov, Aneesh Kumar, Andrew Morton

For zone_device, migration can only happen on is_device_private_page(page).
Correct the logic in try_to_unmap_one().

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
To: linux-mm@kvack.org
---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index b838647..ffadf3e 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1380,7 +1380,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,

 	if (IS_ENABLED(CONFIG_MIGRATION) && (flags & TTU_MIGRATION) &&
 	    is_zone_device_page(page) && !is_device_private_page(page))
-		return true;
+		return false;

 	if (flags & TTU_SPLIT_HUGE_PMD) {
 		split_huge_pmd_address(vma, address,
@@ -1487,7 +1487,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,

 		if (IS_ENABLED(CONFIG_MIGRATION) &&
 		    (flags & TTU_MIGRATION) &&
-		    is_zone_device_page(page)) {
+		    is_device_private_page(page)) {
 			swp_entry_t entry;
 			pte_t swp_pte;

--
2.7.5



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

end of thread, other threads:[~2020-04-02  7:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 13:57 [PATCH] mm/rmap: fix the handling of device private page in try_to_unmap_one() Pingfan Liu
2020-03-23  7:34 ` Michal Hocko
2020-03-23 23:32   ` John Hubbard
2020-03-24  3:50     ` Pingfan Liu
2020-03-24  0:20   ` Ralph Campbell
2020-03-24  4:21     ` Pingfan Liu
2020-03-24  3:47   ` Pingfan Liu
2020-03-24  9:14     ` Michal Hocko
2020-03-25 10:54       ` Pingfan Liu
2020-04-01 14:10         ` Pingfan Liu
2020-03-24  0:04 ` Balbir Singh
2020-03-24  3:55   ` Pingfan Liu
2020-04-01 14:17 ` [PATCH] mm/rmap: fix the handling of !private device " Pingfan Liu
2020-04-01 15:58   ` Michal Hocko
2020-04-02  7:40     ` Pingfan Liu

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).