Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3441229pxk; Mon, 5 Oct 2020 09:42:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG/E9k64TiPmD4nzBFbYgarfgyDXC3w9Rt0Q1fSDdJWHTWBYuhuBgAqqO+UETrYpmAoYF+ X-Received: by 2002:a17:906:4306:: with SMTP id j6mr574167ejm.523.1601916157468; Mon, 05 Oct 2020 09:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601916157; cv=none; d=google.com; s=arc-20160816; b=yvHFxW3qp+RooAi79U1USk2xZ9rFeEqX+NuVFPxhCDWX49f2Kre2MB+OkuTfi0N2tX xXAWeLWPDPnHi3WuFWxr9gsxr15ccURuLb/E0oGfHIv/CLOJ8ba92cnA+/Px/ujKCh/v 3RLAKGHthzxvCZ1uJdDjdoVm++iYMBNZqj4IjSv3I7H0eWChi0BOYax7XJimb+lf/j6c pd6NLdhrarrw6yVfEtSaaj11EYHhzH3qNKRz6erkM9YxIki2g6Cj5snKzIoizRLl76ya XbDkwlh2AAZcRpjk+zv4qxLYsNCUt6nnHWkihBDIcleGDRmeE7EPploN8tIpFzadnvnw JKWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uKk/1IMmMSP6NJytgKSyNjisbvF89JkxZoPEU8aydWg=; b=xVmTXSqa/VmDqMxdmXIi9QAA/yQXjQ/XqsvETez+medf5jm2EYlpyTCZLJdfcmPxp2 XoSriv15Ydm/YRBxKVfJ7oAmJ4SUCcEARddoQhcDeKvZABzsHJrkrgWevt0+2DsrtDCr hxnmQk9ZYffMJfotQ/lVYWp8/DQ4DJM38w/JYJSNwnJazkm46XHuioiLDKnjUEc6+4wS MTRd56kP+igK5JNR4yr9CXXj0kF7FP/WlsWQ5pimScXRI2Z1mZoL1GkztEk4KQYDbFcz 0OW4rdFZ1UJ+4d58FPwKgq324qhDzXKulNEbBhqZ19QUX6sTD9nf1zTbu78J6w6jMK4v 4yXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=MIWNyI7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si410953edj.203.2020.10.05.09.42.12; Mon, 05 Oct 2020 09:42:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=MIWNyI7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727816AbgJEQkM (ORCPT + 99 others); Mon, 5 Oct 2020 12:40:12 -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.