From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B9FC321194888 for ; Mon, 3 Dec 2018 11:47:50 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id 40so12818214oth.4 for ; Mon, 03 Dec 2018 11:47:50 -0800 (PST) MIME-Version: 1.0 References: <154386493754.27193.1300965403157243427.stgit@ahduyck-desk1.amr.corp.intel.com> <154386513120.27193.7977541941078967487.stgit@ahduyck-desk1.amr.corp.intel.com> In-Reply-To: <154386513120.27193.7977541941078967487.stgit@ahduyck-desk1.amr.corp.intel.com> From: Dan Williams Date: Mon, 3 Dec 2018 11:47:37 -0800 Message-ID: Subject: Re: [PATCH RFC 2/3] mm: Add support for exposing if dev_pagemap supports refcount pinning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: alexander.h.duyck@linux.intel.com Cc: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Barret Rhoden , "Zhang, Yu C" , KVM list , linux-nvdimm , Jan Kara , David Hildenbrand , Linux Kernel Mailing List , Linux MM , rkrcmar@redhat.com, Paolo Bonzini , Christoph Hellwig List-ID: On Mon, Dec 3, 2018 at 11:25 AM Alexander Duyck wrote: > > Add a means of exposing if a pagemap supports refcount pinning. I am doing > this to expose if a given pagemap has backing struct pages that will allow > for the reference count of the page to be incremented to lock the page > into place. > > The KVM code already has several spots where it was trying to use a > pfn_valid check combined with a PageReserved check to determien if it could > take a reference on the page. I am adding this check so in the case of the > page having the reserved flag checked we can check the pagemap for the page > to determine if we might fall into the special DAX case. > > Signed-off-by: Alexander Duyck > --- > drivers/nvdimm/pfn_devs.c | 2 ++ > include/linux/memremap.h | 5 ++++- > include/linux/mm.h | 11 +++++++++++ > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c > index 6f22272e8d80..7a4a85bcf7f4 100644 > --- a/drivers/nvdimm/pfn_devs.c > +++ b/drivers/nvdimm/pfn_devs.c > @@ -640,6 +640,8 @@ static int __nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap) > } else > return -ENXIO; > > + pgmap->support_refcount_pinning = true; > + There should be no dev_pagemap instance instance where this isn't true, so I'm missing why this is needed? _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm