linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dave Jiang <dave.jiang@intel.com>
Cc: Jan Kara <jack@suse.cz>,
	akpm@linux-foundation.org, linux-nvdimm@lists.01.org,
	david@fromorbit.com, linux-mm@kvack.org,
	ross.zwisler@linux.intel.com, dan.j.williams@intel.com,
	hch@lst.de
Subject: Re: [PATCH 1/2] mm, dax: make pmd_fault() and friends to be the same as fault()
Date: Wed, 14 Dec 2016 10:57:19 +0100	[thread overview]
Message-ID: <20161214095719.GA18624@quack2.suse.cz> (raw)
In-Reply-To: <e41d16fb-672d-1d61-b60d-6fd3a2201e41@intel.com>

On Tue 13-12-16 11:29:54, Dave Jiang wrote:
> 
> 
> On 12/13/2016 05:15 AM, Jan Kara wrote:
> > On Thu 08-12-16 14:34:21, Dave Jiang wrote:
> >> Instead of passing in multiple parameters in the pmd_fault() handler,
> >> a vmf can be passed in just like a fault() handler. This will simplify
> >> code and remove the need for the actual pmd fault handlers to allocate a
> >> vmf. Related functions are also modified to do the same.
> >>
> >> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> >> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> > 
> > I like the idea however see below:
> > 
> >> @@ -1377,21 +1376,20 @@ int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address,
> >>  	if (iomap.offset + iomap.length < pos + PMD_SIZE)
> >>  		goto unlock_entry;
> >>  
> >> -	vmf.pgoff = pgoff;
> >> -	vmf.flags = flags;
> >> -	vmf.gfp_mask = mapping_gfp_mask(mapping) | __GFP_IO;
> >> +	vmf->pgoff = pgoff;
> >> +	vmf->gfp_mask = mapping_gfp_mask(mapping) | __GFP_IO;
> > 
> > But now it's really unexpected that you change pgoff and gfp_mask because
> > that will propagate back to the caller and if we return VM_FAULT_FALLBACK
> > we may fault in wrong PTE because of this. So dax_iomap_pmd_fault() should
> > not modify the passed gfp_mask, just make its callers clear __GFP_FS from
> > it because *they* are responsible for acquiring locks / transactions that
> > block __GFP_FS allocations. They are also responsible for restoring
> > original gfp_mask once dax_iomap_pmd_fault() returns.
> 
> Ok will fix.
> 
> > 
> > dax_iomap_pmd_fault() needs to modify pgoff however it must restore it to
> > the original value before it returns.
> 
> Need clarification here. Do you mean "If" dax_iomap_pmd_fault() needs to
> modify.... and right now it doesn't appear to need to modify pgoff so
> nothing needs to be done? Thanks.

How come? I can see:

	pgoff = linear_page_index(vma, pmd_addr);

a few lines above - we need to modify pgoff to contain huge page aligned
file index instead of only page aligned...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-12-14  9:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 21:34 [PATCH 1/2] mm, dax: make pmd_fault() and friends to be the same as fault() Dave Jiang
2016-12-08 21:34 ` [PATCH 2/2] mm, dax: move pmd_fault() to take only vmf parameter Dave Jiang
2016-12-13 12:15 ` [PATCH 1/2] mm, dax: make pmd_fault() and friends to be the same as fault() Jan Kara
2016-12-13 18:29   ` Dave Jiang
2016-12-14  9:57     ` Jan Kara [this message]
2016-12-14 16:57       ` Dave Jiang

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=20161214095719.GA18624@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=ross.zwisler@linux.intel.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).