From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7D48121A1348D for ; Fri, 5 May 2017 13:39:45 -0700 (PDT) From: "Kani, Toshimitsu" Subject: Re: [PATCH v2] x86, uaccess: introduce copy_from_iter_wt for pmem / writethrough operations Date: Fri, 5 May 2017 20:39:40 +0000 Message-ID: <1494016773.30303.69.camel@hpe.com> References: <20170427063054.soejyqocqqrihfdw@gmail.com> <149340820800.28724.16189291963486607562.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149340820800.28724.16189291963486607562.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Language: en-US Content-ID: <969868269BC7374CABDDB2EE1A515FB9@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: "dan.j.williams@intel.com" , "viro@zeniv.linux.org.uk" Cc: "jack@suse.cz" , "mawilcox@microsoft.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "mingo@redhat.com" , "hpa@zytor.com" , "linux-fsdevel@vger.kernel.org" , "tglx@linutronix.de" , "hch@lst.de" List-ID: On Fri, 2017-04-28 at 12:39 -0700, Dan Williams wrote: > The pmem driver has a need to transfer data with a persistent memory > destination and be able to rely on the fact that the destination > writes are not cached. It is sufficient for the writes to be flushed > to a cpu-store-buffer (non-temporal / "movnt" in x86 terms), as we > expect userspace to call fsync() to ensure data-writes have reached a > power-fail-safe zone in the platform. The fsync() triggers a REQ_FUA > or REQ_FLUSH to the pmem driver which will turn around and fence > previous writes with an "sfence". > > Implement a __copy_from_user_inatomic_wt, memcpy_page_wt, and > memcpy_wt, that guarantee that the destination buffer is not dirty in > the cpu cache on completion. The new copy_from_iter_wt and sub- > routines will be used to replace the "pmem api" (include/linux/pmem.h > + arch/x86/include/asm/pmem.h). The availability of > copy_from_iter_wt() and memcpy_wt() are gated by the > CONFIG_ARCH_HAS_UACCESS_WT config symbol, and fallback to > copy_from_iter_nocache() and plain memcpy() otherwise. > > This is meant to satisfy the concern from Linus that if a driver > wants to do something beyond the normal nocache semantics it should > be something private to that driver [1], and Al's concern that > anything uaccess related belongs with the rest of the uaccess code > [2]. > > [1]: https://lists.01.org/pipermail/linux-nvdimm/2017-January/008364. > html > [2]: https://lists.01.org/pipermail/linux-nvdimm/2017-April/009942.ht > ml > > Cc: > Cc: Jan Kara > Cc: Jeff Moyer > Cc: Ingo Molnar > Cc: Christoph Hellwig > Cc: "H. Peter Anvin" > Cc: Al Viro > Cc: Thomas Gleixner > Cc: Matthew Wilcox > Cc: Ross Zwisler > Signed-off-by: Dan Williams > --- > 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. How about using "nocache" as it's been used in __copy_user_nocache()? Thanks, -Toshi _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm