From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbdEHDBh convert rfc822-to-8bit (ORCPT ); Sun, 7 May 2017 23:01:37 -0400 Received: from g9t5009.houston.hpe.com ([15.241.48.73]:49269 "EHLO g9t5009.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751365AbdEHDBe (ORCPT ); Sun, 7 May 2017 23:01:34 -0400 X-Greylist: delayed 171850 seconds by postgrey-1.27 at vger.kernel.org; Sun, 07 May 2017 23:01:34 EDT From: "Kani, Toshimitsu" To: Ingo Molnar , Dan Williams CC: "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "jmoyer@redhat.com" , "tglx@linutronix.de" , "hch@lst.de" , "viro@zeniv.linux.org.uk" , "x86@kernel.org" , "mawilcox@microsoft.com" , "hpa@zytor.com" , "linux-nvdimm@lists.01.org" , "mingo@redhat.com" , "linux-fsdevel@vger.kernel.org" , "ross.zwisler@linux.intel.com" , "jack@suse.cz" Subject: RE: [PATCH v2] x86, uaccess: introduce copy_from_iter_wt for pmem / writethrough operations Thread-Topic: [PATCH v2] x86, uaccess: introduce copy_from_iter_wt for pmem / writethrough operations Thread-Index: AQHSwFf2pYpBQohMYEm6dbBc4FPj86HmPreAgAAdeoCAAAVzgIAAOwEAgAB+CwCAAEXzgIABPpcAgAEvQPA= Date: Mon, 8 May 2017 03:01:29 +0000 Message-ID: References: <20170427063054.soejyqocqqrihfdw@gmail.com> <149340820800.28724.16189291963486607562.stgit@dwillia2-desk3.amr.corp.intel.com> <1494016773.30303.69.camel@hpe.com> <1494024273.30303.71.camel@hpe.com> <20170506094652.sgiwijzursabbiab@gmail.com> <20170507085730.ykn5abjol5o66ond@gmail.com> In-Reply-To: <20170507085730.ykn5abjol5o66ond@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=hpe.com; x-originating-ip: [64.134.229.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DF4PR84MB0106;7:PYzw157XuZNERv57aIlv/UeguqugpSdlr3N1saQxgykuXVYsYReVS7XhM92myOi1m9zP4rFWfeFdm/dhgnCteiz8BGvPV/R27xNJmHoSIVxi0rmy5EgEC+NR0lDqNt9rEjZNHUlQ8gCAhRW7kkUxx9l5hr7/5KzMYr15CkJIuDZ55HDaq2PDWPCPPBjS/LVHalcC9LIFmZEiVU1jO5DZHhi0zEtDCvf9nP8cdA50z7j90Zsi/qOjCuR/jaYBITc77oNPVr+XSmhoXYtkh7vtichSrHTX475IRYGQgUOQnHcsUgBNZ+peGq2kjlcIKkQf2aWkCkDYph7KRfUJzR/qKg== x-ms-office365-filtering-correlation-id: 6bf1fc01-ec86-4e73-80bb-08d495be867e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:DF4PR84MB0106; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123562025)(6072148);SRVR:DF4PR84MB0106;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0106; x-forefront-prvs: 0301360BF5 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(39850400002)(39410400002)(39450400003)(39400400002)(24454002)(377424004)(377454003)(74316002)(5660300001)(33656002)(122556002)(305945005)(7736002)(3846002)(6116002)(102836003)(8676002)(81166006)(66066001)(229853002)(478600001)(8936002)(54356999)(50986999)(76176999)(6436002)(6506006)(93886004)(8666007)(189998001)(54906002)(77096006)(55016002)(7696004)(2900100001)(3660700001)(38730400002)(3280700002)(2906002)(9686003)(25786009)(53546009)(86362001)(53936002)(7416002)(2950100002)(4326008);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0106;H:DF4PR84MB0105.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2017 03:01:29.7594 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0106 X-OriginatorOrg: hpe.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > * Dan Williams wrote: > > > On Sat, May 6, 2017 at 2:46 AM, Ingo Molnar wrote: > > > > > > * Dan Williams wrote: > > > > > >> On Fri, May 5, 2017 at 3:44 PM, Kani, Toshimitsu > wrote: > > >> > On Fri, 2017-05-05 at 15:25 -0700, Dan Williams wrote: > > >> >> On Fri, May 5, 2017 at 1:39 PM, Kani, Toshimitsu > > > >> >> wrote: > > >> > : > > >> >> > > --- > > >> >> > > Changes since the initial RFC: > > >> >> > > * s/writethru/wt/ since we already have ioremap_wt(), > > >> >> > > set_memory_wt(), etc. (Ingo) > > >> >> > > > >> >> > Sorry I should have said earlier, but I think the term "wt" is > > >> >> > misleading. Non-temporal stores used in memcpy_wt() provide WC > > >> >> > semantics, not WT semantics. > > >> >> > > >> >> The non-temporal stores do, but memcpy_wt() is using a combination > of > > >> >> non-temporal stores and explicit cache flushing. > > >> >> > > >> >> > How about using "nocache" as it's been > > >> >> > used in __copy_user_nocache()? > > >> >> > > >> >> The difference in my mind is that the "_nocache" suffix indicates > > >> >> opportunistic / optional cache pollution avoidance whereas "_wt" > > >> >> strictly arranges for caches not to contain dirty data upon > > >> >> completion of the routine. For example, non-temporal stores on older > > >> >> x86 cpus could potentially leave dirty data in the cache, so > > >> >> memcpy_wt on those cpus would need to use explicit cache flushing. > > >> > > > >> > I see. I agree that its behavior is different from the existing one > > >> > with "_nocache". That said, I think "wt" or "write-through" generally > > >> > means that writes allocate cachelines and keep them clean by writing > to > > >> > memory. So, subsequent reads to the destination will hit the > > >> > cachelines. This is not the case with this interface. > > >> > > >> True... maybe _nocache_strict()? Or, leave it _wt() until someone > > >> comes along and is surprised that the cache is not warm for reads > > >> after memcpy_wt(), at which point we can ask "why not just use plain > > >> memcpy then?", or set the page-attributes to WT. > > > > > > Perhaps a _nocache_flush() postfix, to signal both that it's non-temporal > and that > > > no cache line is left around afterwards (dirty or clean)? > > > > Yes, I think "flush" belongs in the name, and to make it easily > > grep-able separate from _nocache we can call it _flushcache? An > > efficient implementation will use _nocache / non-temporal stores > > internally, but external consumers just care about the state of the > > cache after the call. > > _flushcache() works for me too. > Works for me too. Thanks, -Toshi