[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4gZkx9zRsKkVhrmPG7SyjPEycp0neFnECmSADZNLuDOpQ@mail.gmail.com>
Date: Mon, 3 Dec 2018 11:47:37 -0800
From: Dan Williams <dan.j.williams@...el.com>
To: alexander.h.duyck@...ux.intel.com
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Zhang Yi <yi.z.zhang@...ux.intel.com>,
Barret Rhoden <brho@...gle.com>,
KVM list <kvm@...r.kernel.org>,
linux-nvdimm <linux-nvdimm@...ts.01.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>,
Dave Jiang <dave.jiang@...el.com>,
"Zhang, Yu C" <yu.c.zhang@...el.com>,
Pankaj Gupta <pagupta@...hat.com>,
David Hildenbrand <david@...hat.com>, Jan Kara <jack@...e.cz>,
Christoph Hellwig <hch@....de>, rkrcmar@...hat.com,
Jérôme Glisse <jglisse@...hat.com>
Subject: Re: [PATCH RFC 2/3] mm: Add support for exposing if dev_pagemap
supports refcount pinning
On Mon, Dec 3, 2018 at 11:25 AM Alexander Duyck
<alexander.h.duyck@...ux.intel.com> 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 <alexander.h.duyck@...ux.intel.com>
> ---
> 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?
Powered by blists - more mailing lists