linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Li Zhijian <lizhijian@cn.fujitsu.com>
Cc: linux-mm@kvack.org, linux-rdma@vger.kernel.org,
	akpm@linux-foundation.org, jglisse@redhat.com,
	yishaih@nvidia.com, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled
Date: Fri, 27 Aug 2021 13:28:52 -0300	[thread overview]
Message-ID: <20210827162852.GL1200268@ziepe.ca> (raw)
In-Reply-To: <20210827144500.2148-1-lizhijian@cn.fujitsu.com>

On Fri, Aug 27, 2021 at 10:45:00PM +0800, Li Zhijian wrote:
> Previously, we noticed the one rpma example was failed[1] since 36f30e486d,
> where it will use ODP feature to do RDMA WRITE between fsdax files.
> 
> After digging into the code, we found hmm_vma_handle_pte() will still
> return EFAULT even though all the its requesting flags has been
> fulfilled. That's because a DAX page will be marked as
> (_PAGE_SPECIAL | PAGE_DEVMAP) by pte_mkdevmap().
> 
> [1]: https://github.com/pmem/rpma/issues/1142
> 
> CC: stable@vger.kernel.org
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>

You need to add a 

Fixes: 405506274922 ("mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling")

> diff --git a/mm/hmm.c b/mm/hmm.c
> index fad6be2bf072..4766bdefb6c3 100644
> +++ b/mm/hmm.c
> @@ -294,6 +294,12 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
>  	if (required_fault)
>  		goto fault;
>  
> +	/*
> +	 * just bypass devmap pte such as DAX page when all pfn requested
> +	 * flags(pfn_req_flags) are fulfilled.
> +	 */
> +	if (pte_devmap(pte))
> +		goto out;

I liked your ealier version better where this was added to the
pte_special test - logically this is about disambiguating the
pte_special and the devmap case as they are different things.

Jason

  reply	other threads:[~2021-08-27 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 14:45 [PATCH] mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled Li Zhijian
2021-08-27 16:28 ` Jason Gunthorpe [this message]
2021-08-27 17:45   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210827162852.GL1200268@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=akpm@linux-foundation.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=stable@vger.kernel.org \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).