From patchwork Sun Mar 22 13:57:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11451805 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9252159A for ; Sun, 22 Mar 2020 13:59:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9A6AE2072E for ; Sun, 22 Mar 2020 13:59:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GGhPPEd0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A6AE2072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9B21E6B0005; Sun, 22 Mar 2020 09:59:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 962BB6B0006; Sun, 22 Mar 2020 09:59:37 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 852496B0007; Sun, 22 Mar 2020 09:59:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 69ECF6B0005 for ; Sun, 22 Mar 2020 09:59:37 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1E95E4995ED for ; Sun, 22 Mar 2020 13:59:37 +0000 (UTC) X-FDA: 76623155994.26.toe76_53eedb05c9133 X-Spam-Summary: 2,0,0,d14ee9d4d9c2c6af,d41d8cd98f00b204,kernelfans@gmail.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:5007:6261:6653:7514:9413:10004:10400:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12895:13069:13311:13357:13846:13894:14096:14097:14181:14394:14659:14687:14721:21080:21444:21451:21627:21666:21990:30003:30054:30064,0,RBL:209.85.216.65:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:30,LUA_SUMMARY:none X-HE-Tag: toe76_53eedb05c9133 X-Filterd-Recvd-Size: 4350 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Sun, 22 Mar 2020 13:59:36 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id q16so4867053pje.1 for ; Sun, 22 Mar 2020 06:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ErbU1Pl3FyoNVgMmAuU1geFNdNYAU7fQOVTZXUK989o=; b=GGhPPEd0/rE7OgSdG2SeTPCquWkn/lshOxcSq+O00WhJIWaKA5xqto8+VohswQi2pu ZPgM5QN1GGnbeuLByWewMiymfZ936/miT3jEi1ls8pKMJekWvkKXn0Z26PTODZJw4bz0 moVbW4i9z69G/z/OKQFjG4q6ZcLQv+J1Se606MWhLVm0ykzl0J/sEbSWY3gfqq98Z2MA KFlWHCFQhVYCFIXzY2qYVpqJ/4Z0JzRxtAAXqrwb3mkVh/LOy4/KyD38oij1T6vPBtEt uDDn/nOne6PmnxFdDGDrv8mqNoWaRJFqtfRVq281X2nBpXUSaP40AHW41r2POjVEfjNJ cAMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ErbU1Pl3FyoNVgMmAuU1geFNdNYAU7fQOVTZXUK989o=; b=qqc4Hax11pbMeZqSqlRq1gd/WHotfVj0fYIf+GvBeYj8LOaIyuz4lmp1LdF7uGSDNI eeYZWvDrglDJYGXGxv7qT03ZBeE1x+w3X17jDCkzM2MDaa+mJM/mlVFc2Yv45NnJSOdG SwHZW727zmkMmRO8IAGGUzrrwvhA2BPgESSufVLEA5ChKTWpnma4+W1yUnXydFSyvtYF Hege7r6aHKJ+g3EBcF9Dm877tghchekegCjn0buZlaLjNqT6zPAL9SWyLe6V4lDA5D+y 1ahBKeheoo+rcctVV/qox8WDoO2swtgjkgALJ55HQHlphsvJVs4ftz0ovIRcs1cVl2kE Pt/A== X-Gm-Message-State: ANhLgQ0d5zrOolbq50HGsaTFcPRQG5sV0b8xO21tEGcgzJYnsaGoauhq k8XG7dhYU9qm9ivu1kOAV+5YJlc= X-Google-Smtp-Source: ADFU+vtAQHxPOhZgk2fRmPzxQqGFhDKvDpFS+cvDtPZgoqLYxKKvY7Xzgm5Uh1lXBthZwwaHrSvyJA== X-Received: by 2002:a17:90a:1954:: with SMTP id 20mr20715462pjh.106.1584885575278; Sun, 22 Mar 2020 06:59:35 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id mu15sm1707595pjb.30.2020.03.22.06.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2020 06:59:34 -0700 (PDT) From: Pingfan Liu To: linux-mm@kvack.org Cc: Pingfan Liu , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Michal Hocko , John Hubbard , "Kirill A . Shutemov" , Aneesh Kumar , Andrew Morton Subject: [PATCH] mm/rmap: fix the handling of device private page in try_to_unmap_one() Date: Sun, 22 Mar 2020 21:57:07 +0800 Message-Id: <1584885427-4952-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Cc: Jérôme Glisse Cc: Michal Hocko Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Aneesh Kumar Cc: Andrew Morton To: linux-mm@kvack.org --- mm/rmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.5 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;