From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-nvdimm@lists.01.org
Subject: Re: [PATCH] dax: put back __GFP_IO in the dax fault handler
Date: Tue, 24 Jan 2017 11:31:46 -0700 [thread overview]
Message-ID: <20170124183146.GA28860@linux.intel.com> (raw)
In-Reply-To: <148521639006.25631.4184774582309071957.stgit@djiang5-desk3.ch.intel.com>
On Mon, Jan 23, 2017 at 05:06:30PM -0700, Dave Jiang wrote:
> __GFP_IO got accidentally dropped in the dax fault handler during the
> vmf parameter conversion. Putting it back.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
I don't see why this is needed? We already have an overly generous gfp_mask
that explicitly includes both __GFP_FS (which is probably wrong), and
__GFP_IO. I ran a quick test to verify this, and when I get a PMD fault my
mask does indeed include both __GFP_IO and __GFP_FS. The test was done with
the current mmots/master and this patch.
The mask is set up in __handle_mm_fault() => __get_fault_gfp_mask().
So, no need to mess with the mask. Also, the patch is wrong because if
__GFP_IO *was* already part of the gfp_mask, this patch would re-add it, then
unconditionally remove it. So, with the current code we would end up with a
more restrictive mask when we exited the PMD fault handler. Really if we
wanted to do something like this we would need to save and restore, not just
OR in a value and then mask it back out.
> ---
> fs/dax.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 2e90f7a..20e9db8 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1332,6 +1332,7 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
> loff_t pos;
> int error;
>
> + vmf->gfp_mask |= __GFP_IO;
> /*
> * Check whether offset isn't beyond end of file now. Caller is
> * supposed to hold locks serializing us with truncate / punch hole so
> @@ -1423,6 +1424,7 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
> }
> out:
> trace_dax_pmd_fault_done(inode, vmf, max_pgoff, result);
> + vmf->gfp_mask &= ~__GFP_IO;
> return result;
> }
> #else
>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2017-01-24 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 0:06 [PATCH] dax: put back __GFP_IO in the dax fault handler Dave Jiang
2017-01-24 18:31 ` Ross Zwisler [this message]
2017-01-24 18:42 ` Jiang, Dave
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=20170124183146.GA28860@linux.intel.com \
--to=ross.zwisler@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-nvdimm@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.