linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: akpm@linux-foundation.org, jack@suse.cz,
	linux-nvdimm@lists.01.org, hch@lst.de, linux-mm@kvack.org,
	tytso@mit.edu, ross.zwisler@linux.intel.com,
	dan.j.williams@intel.com
Subject: Re: [PATCH v4 1/3] dax: masking off __GFP_FS in fs DAX handlers
Date: Fri, 16 Dec 2016 12:07:30 +1100	[thread overview]
Message-ID: <20161216010730.GY4219@dastard> (raw)
In-Reply-To: <148184524161.184728.14005697153880489871.stgit@djiang5-desk3.ch.intel.com>

On Thu, Dec 15, 2016 at 04:40:41PM -0700, Dave Jiang wrote:
> The caller into dax needs to clear __GFP_FS mask bit since it's
> responsible for acquiring locks / transactions that blocks __GFP_FS
> allocation.  The caller will restore the original mask when dax function
> returns.

What's the allocation problem you're working around here? Can you
please describe the call chain that is the problem?

>  	xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
>  
>  	if (IS_DAX(inode)) {
> +		gfp_t old_gfp = vmf->gfp_mask;
> +
> +		vmf->gfp_mask &= ~__GFP_FS;
>  		ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
> +		vmf->gfp_mask = old_gfp;

I really have to say that I hate code that clears and restores flags
without any explanation of why the code needs to play flag tricks. I
take one look at the XFS fault handling code and ask myself now "why
the hell do we need to clear those flags?" Especially as the other
paths into generic fault handlers /don't/ require us to do this.
What does DAX do that require us to treat memory allocation contexts
differently to the filemap_fault() path?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
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>

  parent reply	other threads:[~2016-12-16  1:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 23:40 [PATCH v4 1/3] dax: masking off __GFP_FS in fs DAX handlers Dave Jiang
2016-12-15 23:40 ` [PATCH v4 2/3] mm, dax: make pmd_fault() and friends to be the same as fault() Dave Jiang
2016-12-15 23:40 ` [PATCH v4 3/3] mm, dax: move pmd_fault() to take only vmf parameter Dave Jiang
2016-12-19 17:41   ` Jan Kara
2016-12-16  1:07 ` Dave Chinner [this message]
2016-12-16 16:19   ` [PATCH v4 1/3] dax: masking off __GFP_FS in fs DAX handlers Ross Zwisler
2016-12-16 22:04     ` Dave Chinner
2016-12-19 17:56       ` Jiang, Dave
2016-12-19 19:53       ` Jan Kara
2016-12-19 21:17         ` Dave Chinner
2016-12-20 10:13           ` Michal Hocko
2016-12-21 12:36             ` Jan Kara

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