All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <boaz@plexistor.com>
To: Brian Boylston <brian.boylston@hpe.com>, linux-nvdimm@lists.01.org
Cc: oliver.moreno@hpe.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem()
Date: Wed, 26 Oct 2016 22:57:04 +0300	[thread overview]
Message-ID: <58110A90.9070900@plexistor.com> (raw)
In-Reply-To: <20161026155021.20892-4-brian.boylston@hpe.com>

On 10/26/2016 06:50 PM, Brian Boylston wrote:
> copy_from_iter_nocache() now uses nocache copies for all types of iovecs
> on x86, so the flush in arch_copy_from_iter_pmem() is no longer needed.
> 
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: <x86@kernel.org>
> Cc: Al Viro <viro@ZenIV.linux.org.uk>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Brian Boylston <brian.boylston@hpe.com>
> Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
> Reported-by: Oliver Moreno <oliver.moreno@hpe.com>
> ---
>  arch/x86/include/asm/pmem.h | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h
> index 643eba4..2fbf4ae 100644
> --- a/arch/x86/include/asm/pmem.h
> +++ b/arch/x86/include/asm/pmem.h
> @@ -72,15 +72,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
> @@ -92,15 +83,7 @@ static inline bool __iter_needs_pmem_wb(struct iov_iter *i)
>  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);
> -
> -	return len;
> +	return copy_from_iter_nocache(addr, bytes, i);

I wish you would remove all this completely. Don't see the point for it anymore 

Thanks a lot for doing this. I have this patch for ages in my trees and was too
lasy to fight them through. Yes it is a big boost for many workloads.

Lots of gratitude
Boaz

>  }
>  
>  /**
> 

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: Boaz Harrosh <boaz@plexistor.com>
To: Brian Boylston <brian.boylston@hpe.com>, linux-nvdimm@ml01.01.org
Cc: oliver.moreno@hpe.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem()
Date: Wed, 26 Oct 2016 22:57:04 +0300	[thread overview]
Message-ID: <58110A90.9070900@plexistor.com> (raw)
In-Reply-To: <20161026155021.20892-4-brian.boylston@hpe.com>

On 10/26/2016 06:50 PM, Brian Boylston wrote:
> copy_from_iter_nocache() now uses nocache copies for all types of iovecs
> on x86, so the flush in arch_copy_from_iter_pmem() is no longer needed.
> 
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: <x86@kernel.org>
> Cc: Al Viro <viro@ZenIV.linux.org.uk>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Brian Boylston <brian.boylston@hpe.com>
> Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
> Reported-by: Oliver Moreno <oliver.moreno@hpe.com>
> ---
>  arch/x86/include/asm/pmem.h | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h
> index 643eba4..2fbf4ae 100644
> --- a/arch/x86/include/asm/pmem.h
> +++ b/arch/x86/include/asm/pmem.h
> @@ -72,15 +72,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
> @@ -92,15 +83,7 @@ static inline bool __iter_needs_pmem_wb(struct iov_iter *i)
>  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);
> -
> -	return len;
> +	return copy_from_iter_nocache(addr, bytes, i);

I wish you would remove all this completely. Don't see the point for it anymore 

Thanks a lot for doing this. I have this patch for ages in my trees and was too
lasy to fight them through. Yes it is a big boost for many workloads.

Lots of gratitude
Boaz

>  }
>  
>  /**
> 

  reply	other threads:[~2016-10-26 19:57 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 15:50 [PATCH v2 0/3] use nocache copy in copy_from_iter_nocache() Brian Boylston
2016-10-26 15:50 ` Brian Boylston
2016-10-26 15:50 ` [PATCH v2 1/3] introduce memcpy_nocache() Brian Boylston
2016-10-26 15:50   ` Brian Boylston
2016-10-26 19:30   ` Thomas Gleixner
2016-10-28  1:52     ` Boylston, Brian
2016-10-28  1:52       ` Boylston, Brian
2016-10-26 19:51   ` Boaz Harrosh
2016-10-26 19:51     ` Boaz Harrosh
2016-10-28  1:54     ` Boylston, Brian
2016-10-28  1:54       ` Boylston, Brian
2016-11-01 14:25       ` Boaz Harrosh
2016-11-01 14:25         ` Boaz Harrosh
2016-12-28 23:43         ` Al Viro
2016-12-28 23:43           ` Al Viro
2016-12-29 18:23           ` Dan Williams
2016-12-29 18:23             ` Dan Williams
2016-12-30  3:52             ` Al Viro
2016-12-30  3:52               ` Al Viro
2016-12-30  4:56               ` Dan Williams
2016-12-30  4:56                 ` Dan Williams
2016-12-31  2:25                 ` [RFC] memcpy_nocache() and memcpy_writethrough() Al Viro
2016-12-31  2:25                   ` Al Viro
2017-01-02  2:35                   ` Elliott, Robert (Persistent Memory)
2017-01-02  2:35                     ` Elliott, Robert (Persistent Memory)
2017-01-02  5:09                     ` Al Viro
2017-01-02  5:09                       ` Al Viro
2017-01-03 21:14                       ` Dan Williams
2017-01-03 21:14                         ` Dan Williams
2017-01-03 23:22                         ` Al Viro
2017-01-03 23:22                           ` Al Viro
2017-01-03 23:46                           ` Linus Torvalds
2017-01-03 23:46                             ` Linus Torvalds
2017-01-04  0:57                             ` Dan Williams
2017-01-04  0:57                               ` Dan Williams
2017-01-04  1:38                           ` Dan Williams
2017-01-04  1:38                             ` Dan Williams
2017-01-04  1:59                             ` Al Viro
2017-01-04  1:59                               ` Al Viro
2017-01-04  2:14                               ` Dan Williams
2017-01-04  2:14                                 ` Dan Williams
2016-10-26 15:50 ` [PATCH v2 2/3] use a nocache copy for bvecs and kvecs in copy_from_iter_nocache() Brian Boylston
2016-10-26 15:50   ` Brian Boylston
2016-10-27  4:46   ` Ross Zwisler
2016-10-27  4:46     ` Ross Zwisler
2016-10-26 15:50 ` [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem() Brian Boylston
2016-10-26 15:50   ` Brian Boylston
2016-10-26 19:57   ` Boaz Harrosh [this message]
2016-10-26 19:57     ` Boaz Harrosh
2016-10-28  1:58     ` Boylston, Brian
2016-10-28  1:58       ` Boylston, Brian

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=58110A90.9070900@plexistor.com \
    --to=boaz@plexistor.com \
    --cc=brian.boylston@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mingo@redhat.com \
    --cc=oliver.moreno@hpe.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 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.