From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946149AbbHGSlj (ORCPT ); Fri, 7 Aug 2015 14:41:39 -0400 Received: from mga09.intel.com ([134.134.136.24]:25161 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1945911AbbHGSli (ORCPT ); Fri, 7 Aug 2015 14:41:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,630,1432623600"; d="scan'208";a="621340387" Message-ID: <1438972897.2293.2.camel@linux.intel.com> Subject: Re: [PATCH 1/6] pmem: remove indirection layer arch_has_pmem_api() From: Ross Zwisler To: Dan Williams Cc: "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" , Christoph Hellwig Date: Fri, 07 Aug 2015 12:41:37 -0600 In-Reply-To: References: <1438883000-9011-1-git-send-email-ross.zwisler@linux.intel.com> <1438883000-9011-2-git-send-email-ross.zwisler@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-08-07 at 09:14 -0700, Dan Williams wrote: > On Thu, Aug 6, 2015 at 10:43 AM, Ross Zwisler > wrote: > > Prior to this change arch_has_wmb_pmem() was only called by > > arch_has_pmem_api(). Both arch_has_wmb_pmem() and arch_has_pmem_api() > > checked to make sure that CONFIG_ARCH_HAS_PMEM_API was enabled. > > > > Instead, remove one extra layer of indirection and the redundant > > CONFIG_ARCH_HAS_PMEM_API check, and just have arch_has_pmem_api() > > call __arch_has_wmb_pmem() directly. > > So I think this patch takes us further away from where we want to go > in the near term which is a finer grained pmem api. The class of > systems where (has_pmem_api() && !has_wmb_pmem()) is existing energy > backed nvdimm platforms. I'm assuming those platforms will want to > assert persistence guarantees in the absence of a pcommit-like > instruction, and that we want to stop gating arch_has_pmem_api() on > the presence of wmb_pmem() capability. In that case > arch_has_wmb_pmem() will be useful to have and that was the original > intent for including it, that intent did not seem to comprehended in > the changelog. I think that we should only keep around functions that are actually used and useful. I agree that there could potentially be a use for a distinction like the one you are talking about when we try and properly support ADR systems and stop lumping them in with "non-PCOMMIT" systems like we are doing now. Right now, though, arch_has_wmb_pmem() is just redundant. If/when we add that new support in, we'll have to properly update this code anyway - let's not keep around unneeded code until then.