linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	Jan Kara <jack@suse.cz>, Matthew Wilcox <mawilcox@microsoft.com>,
	X86 ML <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>, Jeff Moyer <jmoyer@redhat.com>,
	Ingo Molnar <mingo@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 03/13] x86, dax, pmem: introduce 'copy_from_iter' dax operation
Date: Thu, 16 Feb 2017 19:56:34 -0800	[thread overview]
Message-ID: <CAPcyv4h7CXenpDkb=d3RN8wo-rSfrQ_ioLoBPV3U+a_r3W9CEg@mail.gmail.com> (raw)
In-Reply-To: <20170217035233.GB27382@linux.intel.com>

On Thu, Feb 16, 2017 at 7:52 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> On Thu, Jan 19, 2017 at 07:50:29PM -0800, Dan Williams wrote:
>> The direct-I/O write path for a pmem device must ensure that data is flushed
>> to a power-fail safe zone when the operation is complete. However, other
>> dax capable block devices, like brd, do not have this requirement.
>> Introduce a 'copy_from_iter' dax operation so that pmem can inject
>> cache management without imposing this overhead on other dax capable
>> block_device drivers.
>>
>> Cc: <x86@kernel.org>
>> Cc: Jan Kara <jack@suse.cz>
>> Cc: Jeff Moyer <jmoyer@redhat.com>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: Al Viro <viro@zeniv.linux.org.uk>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Matthew Wilcox <mawilcox@microsoft.com>
>> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>> ---
>>  arch/x86/include/asm/pmem.h |   31 -------------------------------
>>  drivers/nvdimm/pmem.c       |   10 ++++++++++
>>  fs/dax.c                    |   11 ++++++++++-
>>  include/linux/blkdev.h      |    1 +
>>  include/linux/pmem.h        |   24 ------------------------
>>  5 files changed, 21 insertions(+), 56 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h
>> index f26ba430d853..0ca5e693f4a2 100644
>> --- a/arch/x86/include/asm/pmem.h
>> +++ b/arch/x86/include/asm/pmem.h
>> @@ -64,37 +64,6 @@ static inline void arch_wb_cache_pmem(void *addr, size_t size)
>>               clwb(p);
>>  }
>>
>> -/*
>> - * copy_from_iter_nocache() on x86 only uses non-temporal stores for iovec
>> - * iterators, so for other types (bvec & kvec) we must do a cache write-back.
>> - */
>> -static inline bool __iter_needs_pmem_wb(struct iov_iter *i)
>> -{
>> -     return iter_is_iovec(i) == false;
>> -}
>> -
>> -/**
>> - * arch_copy_from_iter_pmem - copy data from an iterator to PMEM
>> - * @addr:    PMEM destination address
>> - * @bytes:   number of bytes to copy
>> - * @i:               iterator with source data
>> - *
>> - * Copy data from the iterator 'i' to the PMEM buffer starting at 'addr'.
>> - */
>> -static inline size_t arch_copy_from_iter_pmem(void *addr, size_t bytes,
>> -             struct iov_iter *i)
>> -{
>> -     size_t len;
>> -
>> -     /* TODO: skip the write-back by always using non-temporal stores */
>> -     len = copy_from_iter_nocache(addr, bytes, i);
>> -
>> -     if (__iter_needs_pmem_wb(i))
>> -             arch_wb_cache_pmem(addr, bytes);
>
> This writeback is no longer conditional in the pmem_copy_from_iter() version,
> which means that for iovec iterators you do a non-temporal store and then
> afterwards take the time to loop through and flush the cachelines?  This seems
> incorrect, and I wonder if this could be the cause of the performance
> regression reported by 0-day?

I'm pretty sure you're right. What I was planning for the next version
of this patch is to handle the unaligned case in the local assembly so
that we never need to do a flush loop after the fact.

  reply	other threads:[~2017-02-17  3:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  3:50 [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm Dan Williams
2017-01-20  3:50 ` [PATCH 01/13] x86, dax, pmem: remove indirection around memcpy_from_pmem() Dan Williams
2017-01-20  3:50 ` [PATCH 02/13] block, dax: introduce dax_operations Dan Williams
2017-01-20 17:28   ` Dan Williams
2017-01-20  3:50 ` [PATCH 03/13] x86, dax, pmem: introduce 'copy_from_iter' dax operation Dan Williams
2017-02-03  1:52   ` [lkp-robot] [x86, dax, pmem] 2e12109d1c: fio.write_bw_MBps -75% regression kernel test robot
2017-02-17  3:52   ` [PATCH 03/13] x86, dax, pmem: introduce 'copy_from_iter' dax operation Ross Zwisler
2017-02-17  3:56     ` Dan Williams [this message]
2017-01-20  3:50 ` [PATCH 04/13] dax, pmem: introduce an optional 'flush' " Dan Williams
2017-01-20  3:50 ` [PATCH 05/13] x86, dax: replace clear_pmem() with open coded memset + dax_ops->flush Dan Williams
2017-01-20 10:27   ` Jan Kara
2017-01-20 15:33     ` Dan Williams
2017-01-20  3:50 ` [PATCH 06/13] x86, dax, libnvdimm: move wb_cache_pmem() to libnvdimm Dan Williams
2017-01-20  3:50 ` [PATCH 07/13] x86, libnvdimm, pmem: move arch_invalidate_pmem() " Dan Williams
2017-01-20  3:50 ` [PATCH 08/13] x86, libnvdimm, dax: stop abusing __copy_user_nocache Dan Williams
2017-03-28 16:21   ` Ross Zwisler
2017-03-28 16:26     ` Dan Williams
2017-01-20  3:51 ` [PATCH 09/13] libnvdimm, pmem: implement cache bypass for all copy_from_iter() operations Dan Williams
2017-01-20  3:51 ` [PATCH 10/13] libnvdimm, pmem: fix persistence warning Dan Williams
2017-01-20  3:51 ` [PATCH 11/13] libnvdimm, nfit: enable support for volatile ranges Dan Williams
2017-01-20  3:51 ` [PATCH 12/13] libnvdimm, pmem: disable dax flushing when pmem is fronting a volatile region Dan Williams
2017-01-20  3:51 ` [PATCH 13/13] libnvdimm, pmem: disable dax flushing for 'cache flush on fail' platforms Dan Williams
2017-01-21 16:28 ` [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm Matthew Wilcox
2017-01-21 17:52   ` Christoph Hellwig
2017-01-22 15:43     ` Matthew Wilcox
2017-01-22 16:29       ` Christoph Hellwig
2017-01-22 18:19         ` Matthew Wilcox
2017-01-22 18:30           ` Christoph Hellwig
2017-01-22 18:39             ` Matthew Wilcox
2017-01-22 18:44               ` Christoph Hellwig
2017-01-23  6:37                 ` Matthew Wilcox
2017-01-23  7:10                   ` Dan Williams
2017-01-23 16:00                     ` Christoph Hellwig
2017-01-23 17:14                       ` Dan Williams
2017-01-23 18:03                         ` Christoph Hellwig
2017-01-23 18:31                           ` Dan Williams
2017-01-23 15:58                   ` Christoph Hellwig
2017-01-22 17:30     ` Dan Williams
2017-01-23 16:01       ` 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='CAPcyv4h7CXenpDkb=d3RN8wo-rSfrQ_ioLoBPV3U+a_r3W9CEg@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=hpa@zytor.com \
    --cc=jack@suse.cz \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=mawilcox@microsoft.com \
    --cc=mingo@redhat.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.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 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).