From: Ross Zwisler <ross.zwisler@linux.intel.com> To: linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, Dan Williams <dan.j.williams@intel.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, Christoph Hellwig <hch@lst.de> Subject: [PATCH v2 3/7] pmem: remove layer when calling arch_has_wmb_pmem() Date: Thu, 13 Aug 2015 10:51:07 -0600 [thread overview] Message-ID: <1439484671-15718-4-git-send-email-ross.zwisler@linux.intel.com> (raw) In-Reply-To: <1439484671-15718-1-git-send-email-ross.zwisler@linux.intel.com> 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 the old arch_has_wmb_pmem() wrapper to be rid of one extra layer of indirection and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> --- arch/x86/include/asm/pmem.h | 2 +- include/linux/pmem.h | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index f43462c..1e8dbb7 100644 --- a/arch/x86/include/asm/pmem.h +++ b/arch/x86/include/asm/pmem.h @@ -67,7 +67,7 @@ static inline void arch_wmb_pmem(void) pcommit_sfence(); } -static inline bool __arch_has_wmb_pmem(void) +static inline bool arch_has_wmb_pmem(void) { #ifdef CONFIG_X86_64 /* diff --git a/include/linux/pmem.h b/include/linux/pmem.h index 5dad6d1..9d619d2 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h @@ -23,7 +23,7 @@ static inline void arch_wmb_pmem(void) BUG(); } -static inline bool __arch_has_wmb_pmem(void) +static inline bool arch_has_wmb_pmem(void) { return false; } @@ -44,7 +44,7 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src, /* * Architectures that define ARCH_HAS_PMEM_API must provide * implementations for arch_memremap_pmem(), arch_memcpy_to_pmem(), - * arch_wmb_pmem(), and __arch_has_wmb_pmem(). + * arch_wmb_pmem(), and arch_has_wmb_pmem(). */ static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t size) @@ -58,7 +58,7 @@ static inline void memunmap_pmem(void __pmem *addr) } /** - * arch_has_wmb_pmem - true if wmb_pmem() ensures durability + * arch_has_pmem_api - true if wmb_pmem() ensures durability * * For a given cpu implementation within an architecture it is possible * that wmb_pmem() resolves to a nop. In the case this returns @@ -66,13 +66,6 @@ static inline void memunmap_pmem(void __pmem *addr) * fall back to a different data consistency model, or otherwise notify * the user. */ -static inline bool arch_has_wmb_pmem(void) -{ - if (IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)) - return __arch_has_wmb_pmem(); - return false; -} - static inline bool arch_has_pmem_api(void) { return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API) && arch_has_wmb_pmem(); -- 2.1.0
WARNING: multiple messages have this Message-ID (diff)
From: Ross Zwisler <ross.zwisler@linux.intel.com> To: linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, Dan Williams <dan.j.williams@intel.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, Christoph Hellwig <hch@lst.de> Subject: [PATCH v2 3/7] pmem: remove layer when calling arch_has_wmb_pmem() Date: Thu, 13 Aug 2015 10:51:07 -0600 [thread overview] Message-ID: <1439484671-15718-4-git-send-email-ross.zwisler@linux.intel.com> (raw) In-Reply-To: <1439484671-15718-1-git-send-email-ross.zwisler@linux.intel.com> 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 the old arch_has_wmb_pmem() wrapper to be rid of one extra layer of indirection and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> --- arch/x86/include/asm/pmem.h | 2 +- include/linux/pmem.h | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index f43462c..1e8dbb7 100644 --- a/arch/x86/include/asm/pmem.h +++ b/arch/x86/include/asm/pmem.h @@ -67,7 +67,7 @@ static inline void arch_wmb_pmem(void) pcommit_sfence(); } -static inline bool __arch_has_wmb_pmem(void) +static inline bool arch_has_wmb_pmem(void) { #ifdef CONFIG_X86_64 /* diff --git a/include/linux/pmem.h b/include/linux/pmem.h index 5dad6d1..9d619d2 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h @@ -23,7 +23,7 @@ static inline void arch_wmb_pmem(void) BUG(); } -static inline bool __arch_has_wmb_pmem(void) +static inline bool arch_has_wmb_pmem(void) { return false; } @@ -44,7 +44,7 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src, /* * Architectures that define ARCH_HAS_PMEM_API must provide * implementations for arch_memremap_pmem(), arch_memcpy_to_pmem(), - * arch_wmb_pmem(), and __arch_has_wmb_pmem(). + * arch_wmb_pmem(), and arch_has_wmb_pmem(). */ static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t size) @@ -58,7 +58,7 @@ static inline void memunmap_pmem(void __pmem *addr) } /** - * arch_has_wmb_pmem - true if wmb_pmem() ensures durability + * arch_has_pmem_api - true if wmb_pmem() ensures durability * * For a given cpu implementation within an architecture it is possible * that wmb_pmem() resolves to a nop. In the case this returns @@ -66,13 +66,6 @@ static inline void memunmap_pmem(void __pmem *addr) * fall back to a different data consistency model, or otherwise notify * the user. */ -static inline bool arch_has_wmb_pmem(void) -{ - if (IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)) - return __arch_has_wmb_pmem(); - return false; -} - static inline bool arch_has_pmem_api(void) { return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API) && arch_has_wmb_pmem(); -- 2.1.0
next prev parent reply other threads:[~2015-08-13 16:51 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-08-13 16:51 [PATCH v2 0/7] dax: I/O path enhancements Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 1/7] brd: make rd_size static Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 2/7] pmem, x86: move x86 PMEM API to new pmem.h header Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-15 8:58 ` Christoph Hellwig 2015-08-15 8:58 ` Christoph Hellwig 2015-08-13 16:51 ` Ross Zwisler [this message] 2015-08-13 16:51 ` [PATCH v2 3/7] pmem: remove layer when calling arch_has_wmb_pmem() Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 4/7] pmem, x86: clean up conditional pmem includes Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 5/7] pmem: add wb_cache_pmem() and clear_pmem() Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 6/7] dax: update I/O path to do proper PMEM flushing Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 21:11 ` Dan Williams 2015-08-13 21:11 ` Dan Williams 2015-08-14 16:48 ` Ross Zwisler 2015-08-14 16:48 ` Ross Zwisler 2015-08-13 16:51 ` [PATCH v2 7/7] pmem, dax: have direct_access use __pmem annotation Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 16:51 ` Ross Zwisler 2015-08-13 21:20 ` Dan Williams 2015-08-13 21:20 ` Dan Williams 2015-08-13 21:20 ` Dan Williams 2015-08-14 16:55 ` Ross Zwisler 2015-08-14 16:55 ` Ross Zwisler 2015-08-14 16:55 ` Ross Zwisler 2015-08-14 16:58 ` Dan Williams 2015-08-14 16:58 ` Dan Williams 2015-08-14 16:58 ` Dan Williams 2015-08-15 9:11 ` Christoph Hellwig 2015-08-15 9:11 ` Christoph Hellwig 2015-08-15 9:11 ` Christoph Hellwig 2015-08-15 15:49 ` Dan Williams 2015-08-15 15:49 ` Dan Williams 2015-08-15 15:49 ` Dan Williams 2015-08-15 9:19 ` Christoph Hellwig 2015-08-15 9:19 ` Christoph Hellwig 2015-08-15 9:19 ` Christoph Hellwig 2015-08-15 15:44 ` Dan Williams 2015-08-15 15:44 ` Dan Williams 2015-08-15 15:44 ` Dan Williams 2015-08-15 16:00 ` Christoph Hellwig 2015-08-15 16:00 ` Christoph Hellwig 2015-08-15 16:00 ` Christoph Hellwig 2015-08-15 18:05 ` Dan Williams 2015-08-15 18:05 ` Dan Williams 2015-08-15 18:05 ` Dan Williams 2015-08-17 20:07 ` Ross Zwisler 2015-08-17 20:07 ` Ross Zwisler 2015-08-17 20:07 ` Ross Zwisler
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1439484671-15718-4-git-send-email-ross.zwisler@linux.intel.com \ --to=ross.zwisler@linux.intel.com \ --cc=dan.j.williams@intel.com \ --cc=hch@lst.de \ --cc=hpa@zytor.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=mingo@redhat.com \ --cc=tglx@linutronix.de \ --cc=x86@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.