From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965851AbbJVUsv (ORCPT ); Thu, 22 Oct 2015 16:48:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39101 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932530AbbJVUsu (ORCPT ); Thu, 22 Oct 2015 16:48:50 -0400 From: Jeff Moyer To: Dan Williams Cc: axboe@fb.com, jack@suse.cz, linux-nvdimm@ml01.01.org, Dave Hansen , david@fromorbit.com, linux-kernel@vger.kernel.org, hch@lst.de, akpm@linux-foundation.org Subject: Re: [PATCH v2 1/5] pmem, dax: clean up clear_pmem() References: <20151022171015.38343.72043.stgit@dwillia2-desk3.amr.corp.intel.com> <20151022171021.38343.65959.stgit@dwillia2-desk3.amr.corp.intel.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Thu, 22 Oct 2015 16:48:47 -0400 In-Reply-To: <20151022171021.38343.65959.stgit@dwillia2-desk3.amr.corp.intel.com> (Dan Williams's message of "Thu, 22 Oct 2015 13:10:21 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > Both, __dax_pmd_fault, and clear_pmem() were taking special steps to > clear memory a page at a time to take advantage of non-temporal > clear_page() implementations. However, x86_64 does not use > non-temporal instructions for clear_page(), and arch_clear_pmem() was > always incurring the cost of __arch_wb_cache_pmem(). > > Clean up the assumption that doing clear_pmem() a page at a time is more > performant. Wouldn't another solution be to actually use non-temporal stores? Why did you choose to punt? Cheers, Jeff > > Cc: Ross Zwisler > Reported-by: Dave Hansen > Signed-off-by: Dan Williams > --- > arch/x86/include/asm/pmem.h | 7 +------ > fs/dax.c | 4 +--- > 2 files changed, 2 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h > index d8ce3ec816ab..1544fabcd7f9 100644 > --- a/arch/x86/include/asm/pmem.h > +++ b/arch/x86/include/asm/pmem.h > @@ -132,12 +132,7 @@ static inline void arch_clear_pmem(void __pmem *addr, size_t size) > { > void *vaddr = (void __force *)addr; > > - /* TODO: implement the zeroing via non-temporal writes */ > - if (size == PAGE_SIZE && ((unsigned long)vaddr & ~PAGE_MASK) == 0) > - clear_page(vaddr); > - else > - memset(vaddr, 0, size); > - > + memset(vaddr, 0, size); > __arch_wb_cache_pmem(vaddr, size); > } > > diff --git a/fs/dax.c b/fs/dax.c > index a86d3cc2b389..5dc33d788d50 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -623,9 +623,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, > goto fallback; > > if (buffer_unwritten(&bh) || buffer_new(&bh)) { > - int i; > - for (i = 0; i < PTRS_PER_PMD; i++) > - clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE); > + clear_pmem(kaddr, HPAGE_SIZE); > wmb_pmem(); > count_vm_event(PGMAJFAULT); > mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT); > > _______________________________________________ > Linux-nvdimm mailing list > Linux-nvdimm@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm