Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034327AbcJ1B6d (ORCPT ); Thu, 27 Oct 2016 21:58:33 -0400 Received: from mail-co1nam03on0100.outbound.protection.outlook.com ([104.47.40.100]:10144 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030357AbcJ1B6b (ORCPT ); Thu, 27 Oct 2016 21:58:31 -0400 X-Greylist: delayed 342 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Oct 2016 21:58:31 EDT From: "Boylston, Brian" To: Boaz Harrosh , "linux-nvdimm@lists.01.org" CC: "Moreno, Oliver" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Ingo Molnar , Al Viro , "H. Peter Anvin" , Thomas Gleixner , "boylston@burromesa.net" Subject: RE: [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem() Thread-Topic: [PATCH v2 3/3] x86: remove unneeded flush in arch_copy_from_iter_pmem() Thread-Index: AQHSL6D0q3Z//bg+lk6VAbyBMEa1Z6C7Jv0AgAH2QVA= Date: Fri, 28 Oct 2016 01:58:29 +0000 Message-ID: References: <20161026155021.20892-1-brian.boylston@hpe.com> <20161026155021.20892-4-brian.boylston@hpe.com> <58110A90.9070900@plexistor.com> In-Reply-To: <58110A90.9070900@plexistor.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=brian.boylston@hpe.com; x-originating-ip: [98.26.140.10] x-ms-office365-filtering-correlation-id: 0dbbbcbe-81ef-4286-e5ee-08d3fed5ea04 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0293;7:UFIvRAZGYaqqhTIZwiFzyp0FFG849cO24LZ4YO5Y/UYw1dJB1VBW1PEHSZHvN2ow0s5edf8PL/zohGERSiqNqq9uPbcSdRg16alUwXd5XZHZVjx/Ihyp1xxwEDYXoNz8XYdl/ciqSMq1swnDc0FraItqfvW3IkkL8FLDJSlV2F/n9JnCUdIGk/IbWbwIFoGm7ISQPgwwDCXptjkDaZAjJxgLc7WzSQapw8jW86gPA5ZKf/TcZ4jOOPqxcdxMW7sw1uazPgAS0joWf61DBSj52dgc8WMIlSa+p7PeUTvLDJz60ESHzGHKOthFCYNd9ZNDjm7h2WfOpKvSKfCJNHOwuOZdTkky6pVUE+3WsWMcv0I= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0293; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:CS1PR84MB0293;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0293; x-forefront-prvs: 0109D382B0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(377424004)(189002)(377454003)(24454002)(97736004)(122556002)(5001770100001)(3280700002)(305945005)(7736002)(4326007)(8936002)(7846002)(4001150100001)(11100500001)(92566002)(81166006)(101416001)(81156014)(106356001)(7696004)(2501003)(50986999)(76176999)(106116001)(2906002)(54356999)(6116002)(99286002)(105586002)(68736007)(74316002)(10400500002)(8676002)(5660300001)(87936001)(9686002)(102836003)(3846002)(33656002)(19580395003)(2900100001)(586003)(3660700001)(19580405001)(66066001)(2950100002)(189998001)(77096005)(5002640100001)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0293;H:CS1PR84MB0119.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2016 01:58:29.5979 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0293 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u9S1wbK4011765 Content-Length: 2577 Lines: 71 Boaz Harrosh wrote on 2016-10-26: > 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 >> 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); > > I wish you would remove all this completely. Don't see the point for it anymore > At first, I was just targeting bvecs for the splice() case, so I had left the check and the flush in there for kvecs. When doing this v2 of the patch set, I made kvecs nocache as well, so removed the check and flush, but didn't follow through completely as you suggest. Will revisit. Thanks! Brian > 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 > >> } >> /**