From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E1AAC10DCE for ; Mon, 23 Mar 2020 23:32:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D77FF206C3 for ; Mon, 23 Mar 2020 23:32:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="gOt41DQX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D77FF206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4458C6B0005; Mon, 23 Mar 2020 19:32:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CD506B0006; Mon, 23 Mar 2020 19:32:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 294AF6B0007; Mon, 23 Mar 2020 19:32:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id 0E48E6B0005 for ; Mon, 23 Mar 2020 19:32:14 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E10EF46170 for ; Mon, 23 Mar 2020 23:32:13 +0000 (UTC) X-FDA: 76628227746.28.tooth15_307e6091c0549 X-HE-Tag: tooth15_307e6091c0549 X-Filterd-Recvd-Size: 5204 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Mar 2020 23:32:13 +0000 (UTC) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 23 Mar 2020 16:31:27 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 23 Mar 2020 16:32:11 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 23 Mar 2020 16:32:11 -0700 Received: from [10.2.48.195] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Mar 2020 23:32:11 +0000 Subject: Re: [PATCH] mm/rmap: fix the handling of device private page in try_to_unmap_one() To: Michal Hocko , Pingfan Liu CC: , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Kirill A . Shutemov" , Aneesh Kumar , Andrew Morton , Dan Williams , Ralph Campbell References: <1584885427-4952-1-git-send-email-kernelfans@gmail.com> <20200323073408.GA7524@dhcp22.suse.cz> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Mon, 23 Mar 2020 16:32:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200323073408.GA7524@dhcp22.suse.cz> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1585006287; bh=BydJBC0oEr2tWQOP544o9ufn+QuISaww44blXJbKEgI=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=gOt41DQXIc7AeQiCKyno0euDZfFjvpnY+YIczyS3/Y2rYkJ6g2GNWmXAdSxTbgyQ8 sQXxtBTbHTnXEYIBND8VwS3EcZzTmjC6tF4KHONKck94jJ4/81glC/ah0OuG4bXJGp fGhsrXjczfZVbImd5+tYxm9Ee4WvCZLheXIKtfzhW5pYJ8QiJVgR9HldVaU3vVFBtA UzCIZdMDAB0571XiNe0YUn5hqR0iCfXdcaY3sZhxAekrddWyPgpn2Q7DlyW5PZ/FEe ukC9mWUmyA1RR3WoMpkVZmaPJB3/yRsvkYriCGC01CZ0N2gbf73v0grNITU6yp5/zW 3ep+Q9+f+z9DQ== 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: On 3/23/20 12:34 AM, Michal Hocko wrote: > On Sun 22-03-20 21:57:07, Pingfan Liu wrote: >> For zone_device, migration can only happen on is_device_private_page(pag= e). >> Correct the logic in try_to_unmap_one(). >=20 > Maybe it is just me lacking knowledge in the zone_device ZOO. But > this really deserves a much more detailed explanation IMHO. It seems > a5430dda8a3a ("mm/migrate: support un-addressable ZONE_DEVICE page in > migration") deliberately made the decision to allow unmapping these > pages? Is the check just wrong, inncomplete? Why? >=20 > What is the real user visible problem here? > =20 I was going to guess that someone was having trouble with the behavior on non-device-private ZONE_DEVICE pages, but...I am also at a loss as to what triggered this patch. So, I have the exact same questions as Michal, plus really wondering what tests you are running, and on what hardware conf= ig. It's hard to get the right CC's, but probably Dan Williams and Ralph Campbe= ll should also be added, if you are sure you need this. (I'm adding them now.) thanks, --=20 John Hubbard NVIDIA >> Signed-off-by: Pingfan Liu >> Cc: J=C3=A9r=C3=B4me 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(-) >> >> 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, st= ruct 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, st= ruct 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 >=20