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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 9232CC4363A for ; Mon, 5 Oct 2020 16:40:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F5842076E for ; Mon, 5 Oct 2020 16:40:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="MIWNyI7H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727844AbgJEQkN (ORCPT ); Mon, 5 Oct 2020 12:40:13 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:18558 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbgJEQkL (ORCPT ); Mon, 5 Oct 2020 12:40:11 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 05 Oct 2020 09:39:58 -0700 Received: from rcampbell-dev.nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 5 Oct 2020 16:40:07 +0000 Subject: Re: [RFC PATCH v3 2/2] mm: remove extra ZONE_DEVICE struct page refcount To: Christoph Hellwig CC: , , , , Dan Williams , Ira Weiny , Matthew Wilcox , Jerome Glisse , John Hubbard , Alistair Popple , Jason Gunthorpe , Bharata B Rao , Zi Yan , "Kirill A . Shutemov" , Yang Shi , Paul Mackerras , Ben Skeggs , Andrew Morton References: <20201001181715.17416-1-rcampbell@nvidia.com> <20201001181715.17416-3-rcampbell@nvidia.com> <20201002055930.GB8891@lst.de> From: Ralph Campbell X-Nvconfidentiality: public Message-ID: <1fbc3d0c-327a-6a8c-31c9-bb4c43e97b88@nvidia.com> Date: Mon, 5 Oct 2020 09:40:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20201002055930.GB8891@lst.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601915998; bh=uKk/1IMmMSP6NJytgKSyNjisbvF89JkxZoPEU8aydWg=; h=Subject:To:CC:References:From:X-Nvconfidentiality:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=MIWNyI7HClm4jhRQdfRz7T5k7m1C6oRm/K3Sbl/0D+sGPVRFTpx4DVJpBcgbpPz1l /pRYAjUFHz0djJLBCDe92VgnQbmDyuNmFDU20/JVkkQgTDlRs/a2tIqq1ZMOixgje7 +/NWmFXXwkKqD2JkbomwOFqAzE7b3zFzQ5BBD8RBQZ2EzRmT5pQWrbnNzGTGpq1Mmb zMnZ1eFh9iJ1oqF6a76KsYr2tdEIFvkTtTXaW6OlVfiAvbyu82wQr9W7T4y+s4b7tH oRR5zYqhwtb2SE4ti+rOPZz8spWn+dVkbicrVU7RtalMQSMhj1VyesNlw3Hs8YQu1F tIOY2k74rpwyQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/1/20 10:59 PM, Christoph Hellwig wrote: > On Thu, Oct 01, 2020 at 11:17:15AM -0700, Ralph Campbell wrote: >> ZONE_DEVICE struct pages have an extra reference count that complicates the >> code for put_page() and several places in the kernel that need to check the >> reference count to see that a page is not being used (gup, compaction, >> migration, etc.). Clean up the code so the reference count doesn't need to >> be treated specially for ZONE_DEVICE. >> >> Signed-off-by: Ralph Campbell > > Looks good, > > Reviewed-by: Christoph Hellwig Thanks for the review. I still have reservations about making this an official patch. Did you see the updated cover letter? Basically, I'm concerned about ZONE_DEVICE struct pages being inserted into the process page table with a zero reference count with vmf_insert_mixed(). If it is to be a non-zero reference count, then DAX, pmem, and other uses of ZONE_DEVICE pages need to be changed (or vmf_insert_mixed()) to inc/dec in appropriate places but I don't feel I know that code well enough to make those changes.