linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@lst.de>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.com>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, linux-nvdimm@lists.01.org,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range
Date: Mon, 3 Oct 2016 11:55:18 +0200	[thread overview]
Message-ID: <20161003095518.GM6457@quack2.suse.cz> (raw)
In-Reply-To: <1475189370-31634-8-git-send-email-ross.zwisler@linux.intel.com>

On Thu 29-09-16 16:49:25, Ross Zwisler wrote:
> DAX radix tree locking currently locks entries based on the unique
> combination of the 'mapping' pointer and the pgoff_t 'index' for the entry.
> This works for PTEs, but as we move to PMDs we will need to have all the
> offsets within the range covered by the PMD to map to the same bit lock.
> To accomplish this, for ranges covered by a PMD entry we will instead lock
> based on the page offset of the beginning of the PMD entry.  The 'mapping'
> pointer is still used in the same way.
> 
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  fs/dax.c            | 37 ++++++++++++++++++++++++-------------
>  include/linux/dax.h |  2 +-
>  mm/filemap.c        |  2 +-
>  3 files changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index baef586..406feea 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -64,10 +64,17 @@ static int __init init_dax_wait_table(void)
>  }
>  fs_initcall(init_dax_wait_table);
>  
> +static pgoff_t dax_entry_start(pgoff_t index, void *entry)
> +{
> +	if (RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD)
> +		index &= (PMD_MASK >> PAGE_SHIFT);

Hum, but if we shift right, top bits of PMD_MASK will become zero - not
something we want I guess... You rather want to mask with something like:
	~((1UL << (PMD_SHIFT - PAGE_SHIFT)) - 1)

> @@ -447,10 +457,11 @@ restart:
>  	return entry;
>  }
>  
> -void dax_wake_mapping_entry_waiter(struct address_space *mapping,
> +void dax_wake_mapping_entry_waiter(void *entry, struct address_space *mapping,
>  				   pgoff_t index, bool wake_all)

Nitpick: Ordering of arguments would look more logical to me like:

dax_wake_mapping_entry_waiter(mapping, index, entry, wake_all)

Other than that the patch looks good to me.

								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>

  parent reply	other threads:[~2016-10-03  9:55 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 22:49 [PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler
2016-09-29 22:49 ` [PATCH v4 02/12] ext4: tell DAX the size of allocation holes Ross Zwisler
2016-09-29 22:49 ` [PATCH v4 03/12] dax: remove buffer_size_valid() Ross Zwisler
2016-09-30  8:49   ` Christoph Hellwig
     [not found] ` <1475189370-31634-1-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-29 22:49   ` [PATCH v4 01/12] ext4: allow DAX writeback for hole punch Ross Zwisler
2016-09-29 22:49   ` [PATCH v4 04/12] ext2: remove support for DAX PMD faults Ross Zwisler
     [not found]     ` <1475189370-31634-5-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-30  8:49       ` Christoph Hellwig
2016-10-03  9:35     ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 05/12] dax: make 'wait_table' global variable static Ross Zwisler
2016-09-30  8:50     ` Christoph Hellwig
     [not found]     ` <1475189370-31634-6-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-10-03  9:36       ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 06/12] dax: consistent variable naming for DAX entries Ross Zwisler
     [not found]     ` <1475189370-31634-7-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-30  8:50       ` Christoph Hellwig
2016-10-03  9:37       ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range Ross Zwisler
2016-09-30  9:44     ` Christoph Hellwig
2016-10-03  9:55     ` Jan Kara [this message]
     [not found]       ` <20161003095518.GM6457-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-10-03 18:40         ` Ross Zwisler
2016-09-29 22:49   ` [PATCH v4 08/12] dax: remove dax_pmd_fault() Ross Zwisler
     [not found]     ` <1475189370-31634-9-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-30  8:50       ` Christoph Hellwig
2016-10-03  9:56     ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 09/12] dax: correct dax iomap code namespace Ross Zwisler
2016-09-30  8:51     ` Christoph Hellwig
2016-10-03  9:57     ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler
     [not found]     ` <1475189370-31634-11-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-30  9:56       ` Christoph Hellwig
     [not found]         ` <20160930095627.GB5299-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-10-03 21:16           ` Ross Zwisler
2016-10-03 10:59     ` Jan Kara
2016-10-03 16:37       ` Christoph Hellwig
2016-10-03 21:05       ` Ross Zwisler
2016-10-04  5:55         ` Jan Kara
2016-10-04 15:39           ` Ross Zwisler
     [not found]             ` <20161004153948.GA21248-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-10-05  5:50               ` Jan Kara
     [not found]         ` <20161003210557.GA28177-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-10-06 21:34           ` Ross Zwisler
2016-10-07  2:58             ` Ross Zwisler
     [not found]               ` <20161007025833.GA2934-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-10-07  7:24                 ` Jan Kara
2016-09-29 22:49   ` [PATCH v4 12/12] dax: remove "depends on BROKEN" from FS_DAX_PMD Ross Zwisler
2016-09-29 23:43   ` [PATCH v4 00/12] re-enable DAX PMD support Dave Chinner
2016-09-30  3:03     ` Ross Zwisler
2016-09-30  4:00       ` Darrick J. Wong
2016-10-03 18:54         ` Ross Zwisler
2016-09-30  6:48       ` Dave Chinner
2016-10-03 21:11         ` Ross Zwisler
2016-10-03 23:05     ` Ross Zwisler
2016-09-29 22:49 ` [PATCH v4 11/12] xfs: use struct iomap based DAX PMD fault path Ross Zwisler
2016-09-30 11:46 ` [PATCH v4 00/12] re-enable DAX PMD support 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=20161003095518.GM6457@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).