Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933145AbcJZPw0 (ORCPT ); Wed, 26 Oct 2016 11:52:26 -0400 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:48723 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755066AbcJZPwU (ORCPT ); Wed, 26 Oct 2016 11:52:20 -0400 From: Brian Boylston To: linux-nvdimm@ml01.01.org Cc: linux-kernel@vger.kernel.org, toshi.kani@hpe.com, oliver.moreno@hpe.com, Brian Boylston , Ross Zwisler , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Al Viro , Dan Williams Subject: [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem() Date: Wed, 26 Oct 2016 10:50:21 -0500 Message-Id: <20161026155021.20892-4-brian.boylston@hpe.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20161026155021.20892-1-brian.boylston@hpe.com> References: <20161026155021.20892-1-brian.boylston@hpe.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1779 Lines: 56 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 Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Cc: Al Viro Cc: Dan Williams Signed-off-by: Brian Boylston Reviewed-by: Toshi Kani Reported-by: Oliver Moreno --- 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); } /** -- 2.8.3