Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753424AbdFSCC6 (ORCPT ); Sun, 18 Jun 2017 22:02:58 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:34046 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289AbdFSCCz (ORCPT ); Sun, 18 Jun 2017 22:02:55 -0400 MIME-Version: 1.0 In-Reply-To: <20170618082841.GA26456@lst.de> References: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> <149703983098.20620.14791162611225792317.stgit@dwillia2-desk3.amr.corp.intel.com> <20170618082841.GA26456@lst.de> From: Dan Williams Date: Sun, 18 Jun 2017 19:02:54 -0700 Message-ID: Subject: Re: [PATCH v3 01/14] x86, uaccess: introduce copy_from_iter_flushcache for pmem / cache-bypass operations To: Christoph Hellwig Cc: "linux-nvdimm@lists.01.org" , Jan Kara , dm-devel@redhat.com, Toshi Kani , Matthew Wilcox , X86 ML , "linux-kernel@vger.kernel.org" , Jeff Moyer , Ingo Molnar , Al Viro , "H. Peter Anvin" , linux-fsdevel , Thomas Gleixner , Ross Zwisler Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1451 Lines: 29 On Sun, Jun 18, 2017 at 1:28 AM, Christoph Hellwig wrote: > On Fri, Jun 09, 2017 at 01:23:51PM -0700, Dan Williams wrote: >> Implement a __copy_from_user_inatomic_flushcache, memcpy_page_flushcache, and >> memcpy_flushcache, that guarantee that the destination buffer is not dirty in >> the cpu cache on completion. The new copy_from_iter_flushcache and sub-routines > > Wouldn't writethrough be a better name? I started with _writethrough, Ingo suggested _wt, and then Toshi rightly pointed out that _wt might lead applications to assume that the involved cache-lines are valid on return which may not be true. So we settled on _flushcache in this thread [1]. [1]: https://lkml.org/lkml/2017/5/6/99 >> will be used to replace the "pmem api" (include/linux/pmem.h + >> arch/x86/include/asm/pmem.h). The availability of copy_from_iter_flushcache() >> and memcpy_flushcache() are gated by the CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE >> config symbol, and fallback to copy_from_iter_nocache() and plain memcpy() >> otherwise. > > What is UACCESS about memcpy_flushcache? The uaccess part comes from the fact that the conversion provides all the _flushcache versions of the copy_from_iter() operations (__copy_from_user_flushcache, memcpy_page_flushcache, memcpy_flushcache). It also stems from Al asking that __copy_user_flushcache() live in arch/x86/lib/usercopy_64.c. That said, I wouldn't object to a different name for the config symbol.