Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752731AbbH1UWP (ORCPT ); Fri, 28 Aug 2015 16:22:15 -0400 Received: from mga01.intel.com ([192.55.52.88]:7267 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752164AbbH1UWO (ORCPT ); Fri, 28 Aug 2015 16:22:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,426,1437462000"; d="scan'208";a="792985543" Date: Fri, 28 Aug 2015 14:22:11 -0600 From: Ross Zwisler To: "Williams, Dan J" Cc: "hch@lst.de" , "toshi.kani@hp.com" , "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "linux-mm@kvack.org" , "tglx@linutronix.de" , "hpa@zytor.com" , "linux-nvdimm@lists.01.org" , "mingo@redhat.com" , "ross.zwisler@linux.intel.com" , "boaz@plexistor.com" , "david@fromorbit.com" Subject: Re: [PATCH v2 5/9] x86, pmem: push fallback handling to arch code Message-ID: <20150828202211.GA21699@linux.intel.com> References: <20150826010220.8851.18077.stgit@dwillia2-desk3.amr.corp.intel.com> <20150826012751.8851.78564.stgit@dwillia2-desk3.amr.corp.intel.com> <20150826124124.GA7613@lst.de> <1440624859.31365.17.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440624859.31365.17.camel@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2465 Lines: 54 On Wed, Aug 26, 2015 at 09:34:20PM +0000, Williams, Dan J wrote: > On Wed, 2015-08-26 at 14:41 +0200, Christoph Hellwig wrote: > > I like the intent behind this, but not the implementation. > > > > I think the right approach is to keep the defaults in linux/pmem.h > > and simply not set CONFIG_ARCH_HAS_PMEM_API for x86-32. > > Yes, that makes things much cleaner. Revised patch and changelog below: > > 8<---- > Subject: x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB > > From: Dan Williams > > Given that a write-back (WB) mapping plus non-temporal stores is > expected to be the most efficient way to access PMEM, update the > definition of ARCH_HAS_PMEM_API to imply arch support for > WB-mapped-PMEM. This is needed as a pre-requisite for adding PMEM to > the direct map and mapping it with struct page. > > The above clarification for X86_64 means that memcpy_to_pmem() is > permitted to use the non-temporal arch_memcpy_to_pmem() rather than > needlessly fall back to default_memcpy_to_pmem() when the pcommit > instruction is not available. When arch_memcpy_to_pmem() is not > guaranteed to flush writes out of cache, i.e. on older X86_32 > implementations where non-temporal stores may just dirty cache, > ARCH_HAS_PMEM_API is simply disabled. > > The default fall back for persistent memory handling remains. Namely, > map it with the WT (write-through) cache-type and hope for the best. > > arch_has_pmem_api() is updated to only indicate whether the arch > provides the proper helpers to meet the minimum "writes are visible > outside the cache hierarchy after memcpy_to_pmem() + wmb_pmem()". Code > that cares whether wmb_pmem() actually flushes writes to pmem must now > call arch_has_wmb_pmem() directly. > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Toshi Kani > Cc: Ross Zwisler > Cc: Christoph Hellwig > [hch: set ARCH_HAS_PMEM_API=n on X86_32] > Signed-off-by: Dan Williams Yep, this seems like a good change. Reviewed-by: Ross Zwisler -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/