* [PATCH] dax: Fix use of zero page
@ 2018-05-17 18:37 Matthew Wilcox
2018-05-17 19:24 ` Ross Zwisler
2018-05-17 19:32 ` Dan Williams
0 siblings, 2 replies; 11+ messages in thread
From: Matthew Wilcox @ 2018-05-17 18:37 UTC (permalink / raw)
To: linux-nvdimm
I plucked this patch from my XArray work. It seems self-contained enough
that it could go into the DAX tree for merging this cycle.
>From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
From: Matthew Wilcox <mawilcox@microsoft.com>
Date: Thu, 29 Mar 2018 22:41:18 -0400
Subject: [PATCH] dax: Fix use of zero page
Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
works on MIPS and s390.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
fs/dax.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 6a26626f20f3..f643e8fc34ee 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1006,17 +1006,9 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry,
struct inode *inode = mapping->host;
unsigned long vaddr = vmf->address;
vm_fault_t ret = VM_FAULT_NOPAGE;
- struct page *zero_page;
void *entry2;
- pfn_t pfn;
-
- zero_page = ZERO_PAGE(0);
- if (unlikely(!zero_page)) {
- ret = VM_FAULT_OOM;
- goto out;
- }
+ pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));
- pfn = page_to_pfn_t(zero_page);
entry2 = dax_insert_mapping_entry(mapping, vmf, entry, pfn,
DAX_ZERO_PAGE, false);
if (IS_ERR(entry2)) {
--
2.17.0
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 18:37 [PATCH] dax: Fix use of zero page Matthew Wilcox
@ 2018-05-17 19:24 ` Ross Zwisler
2018-05-17 19:29 ` Ross Zwisler
2018-05-17 19:32 ` Dan Williams
1 sibling, 1 reply; 11+ messages in thread
From: Ross Zwisler @ 2018-05-17 19:24 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 11:37:11AM -0700, Matthew Wilcox wrote:
>
> I plucked this patch from my XArray work. It seems self-contained enough
> that it could go into the DAX tree for merging this cycle.
>
> From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> From: Matthew Wilcox <mawilcox@microsoft.com>
> Date: Thu, 29 Mar 2018 22:41:18 -0400
> Subject: [PATCH] dax: Fix use of zero page
>
> Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> works on MIPS and s390.
>
> Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Yep, this looks fine.
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 19:24 ` Ross Zwisler
@ 2018-05-17 19:29 ` Ross Zwisler
2018-05-17 19:57 ` Matthew Wilcox
0 siblings, 1 reply; 11+ messages in thread
From: Ross Zwisler @ 2018-05-17 19:29 UTC (permalink / raw)
To: Ross Zwisler; +Cc: Matthew Wilcox, linux-nvdimm
On Thu, May 17, 2018 at 01:24:00PM -0600, Ross Zwisler wrote:
> On Thu, May 17, 2018 at 11:37:11AM -0700, Matthew Wilcox wrote:
> >
> > I plucked this patch from my XArray work. It seems self-contained enough
> > that it could go into the DAX tree for merging this cycle.
> >
> > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> > From: Matthew Wilcox <mawilcox@microsoft.com>
> > Date: Thu, 29 Mar 2018 22:41:18 -0400
> > Subject: [PATCH] dax: Fix use of zero page
> >
> > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> > works on MIPS and s390.
> >
> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> Yep, this looks fine.
>
> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Huh, actually, it looks like this relies on patch 01/63 of your full Xarray
series where you s/RADIX_DAX_ZERO_PAGE/DAX_ZERO_PAGE/g.
Ditto for the 2nd patch you sent today.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 19:29 ` Ross Zwisler
@ 2018-05-17 19:57 ` Matthew Wilcox
2018-05-17 20:48 ` Ross Zwisler
0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2018-05-17 19:57 UTC (permalink / raw)
To: Ross Zwisler; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 01:29:10PM -0600, Ross Zwisler wrote:
> On Thu, May 17, 2018 at 01:24:00PM -0600, Ross Zwisler wrote:
> > On Thu, May 17, 2018 at 11:37:11AM -0700, Matthew Wilcox wrote:
> > >
> > > I plucked this patch from my XArray work. It seems self-contained enough
> > > that it could go into the DAX tree for merging this cycle.
> > >
> > > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> > > From: Matthew Wilcox <mawilcox@microsoft.com>
> > > Date: Thu, 29 Mar 2018 22:41:18 -0400
> > > Subject: [PATCH] dax: Fix use of zero page
> > >
> > > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> > > works on MIPS and s390.
> > >
> > > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
> >
> > Yep, this looks fine.
> >
> > Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
>
> Huh, actually, it looks like this relies on patch 01/63 of your full Xarray
> series where you s/RADIX_DAX_ZERO_PAGE/DAX_ZERO_PAGE/g.
>
> Ditto for the 2nd patch you sent today.
Argh, thanks. I can respin them against linux-next if you like.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 19:57 ` Matthew Wilcox
@ 2018-05-17 20:48 ` Ross Zwisler
0 siblings, 0 replies; 11+ messages in thread
From: Ross Zwisler @ 2018-05-17 20:48 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 12:57:39PM -0700, Matthew Wilcox wrote:
> On Thu, May 17, 2018 at 01:29:10PM -0600, Ross Zwisler wrote:
> > On Thu, May 17, 2018 at 01:24:00PM -0600, Ross Zwisler wrote:
> > > On Thu, May 17, 2018 at 11:37:11AM -0700, Matthew Wilcox wrote:
> > > >
> > > > I plucked this patch from my XArray work. It seems self-contained enough
> > > > that it could go into the DAX tree for merging this cycle.
> > > >
> > > > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> > > > From: Matthew Wilcox <mawilcox@microsoft.com>
> > > > Date: Thu, 29 Mar 2018 22:41:18 -0400
> > > > Subject: [PATCH] dax: Fix use of zero page
> > > >
> > > > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> > > > works on MIPS and s390.
> > > >
> > > > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
> > >
> > > Yep, this looks fine.
> > >
> > > Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> >
> > Huh, actually, it looks like this relies on patch 01/63 of your full Xarray
> > series where you s/RADIX_DAX_ZERO_PAGE/DAX_ZERO_PAGE/g.
> >
> > Ditto for the 2nd patch you sent today.
>
> Argh, thanks. I can respin them against linux-next if you like.
Yep, that would be awesome, thanks.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 18:37 [PATCH] dax: Fix use of zero page Matthew Wilcox
2018-05-17 19:24 ` Ross Zwisler
@ 2018-05-17 19:32 ` Dan Williams
2018-05-17 19:56 ` Matthew Wilcox
1 sibling, 1 reply; 11+ messages in thread
From: Dan Williams @ 2018-05-17 19:32 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 11:37 AM, Matthew Wilcox <willy@infradead.org> wrote:
>
> I plucked this patch from my XArray work. It seems self-contained enough
> that it could go into the DAX tree for merging this cycle.
>
> From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> From: Matthew Wilcox <mawilcox@microsoft.com>
> Date: Thu, 29 Mar 2018 22:41:18 -0400
> Subject: [PATCH] dax: Fix use of zero page
>
> Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> works on MIPS and s390.
>
> Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
I'm being thick and / or lazy, what's the user visible effect of this fix?
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 19:32 ` Dan Williams
@ 2018-05-17 19:56 ` Matthew Wilcox
2018-05-17 20:03 ` Dan Williams
0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2018-05-17 19:56 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 12:32:07PM -0700, Dan Williams wrote:
> On Thu, May 17, 2018 at 11:37 AM, Matthew Wilcox <willy@infradead.org> wrote:
> >
> > I plucked this patch from my XArray work. It seems self-contained enough
> > that it could go into the DAX tree for merging this cycle.
> >
> > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> > From: Matthew Wilcox <mawilcox@microsoft.com>
> > Date: Thu, 29 Mar 2018 22:41:18 -0400
> > Subject: [PATCH] dax: Fix use of zero page
> >
> > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> > works on MIPS and s390.
> >
> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> I'm being thick and / or lazy, what's the user visible effect of this fix?
For s390 it appears to be a performance issue:
Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
Date: Mon Oct 25 16:10:07 2010 +0200
[S390] zero page cache synonyms
If the zero page is mapped to virtual user space addresses that differ
only in bit 2^12 or 2^13 we get L1 cache synonyms which can affect
performance. Follow the mips model and use multiple zero pages to avoid
the synonyms.
MIPS' use of multiple ZERO_PAGEs predates git history. Given the
history of MIPS' caches behaving in incredibly weird ways, I'd assume
that getting this wrong results in miniature black holes forming and/or
the CPU calculating the largest prime number.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 19:56 ` Matthew Wilcox
@ 2018-05-17 20:03 ` Dan Williams
2018-05-17 20:48 ` Ross Zwisler
0 siblings, 1 reply; 11+ messages in thread
From: Dan Williams @ 2018-05-17 20:03 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-nvdimm
On Thu, May 17, 2018 at 12:56 PM, Matthew Wilcox <willy@infradead.org> wrote:
> On Thu, May 17, 2018 at 12:32:07PM -0700, Dan Williams wrote:
>> On Thu, May 17, 2018 at 11:37 AM, Matthew Wilcox <willy@infradead.org> wrote:
>> >
>> > I plucked this patch from my XArray work. It seems self-contained enough
>> > that it could go into the DAX tree for merging this cycle.
>> >
>> > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
>> > From: Matthew Wilcox <mawilcox@microsoft.com>
>> > Date: Thu, 29 Mar 2018 22:41:18 -0400
>> > Subject: [PATCH] dax: Fix use of zero page
>> >
>> > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
>> > works on MIPS and s390.
>> >
>> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>>
>> I'm being thick and / or lazy, what's the user visible effect of this fix?
>
> For s390 it appears to be a performance issue:
>
> Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Date: Mon Oct 25 16:10:07 2010 +0200
>
> [S390] zero page cache synonyms
>
> If the zero page is mapped to virtual user space addresses that differ
> only in bit 2^12 or 2^13 we get L1 cache synonyms which can affect
> performance. Follow the mips model and use multiple zero pages to avoid
> the synonyms.
>
> MIPS' use of multiple ZERO_PAGEs predates git history. Given the
> history of MIPS' caches behaving in incredibly weird ways, I'd assume
> that getting this wrong results in miniature black holes forming and/or
> the CPU calculating the largest prime number.
Unless I am missing something I think this sounds like 4.18-rc1
material with a cc: stable. Last I heard no one is really using
dccssblk + dax, and MIPS has no way to describe pmem outside of
memmap= which is only a development tool.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-05-17 20:03 ` Dan Williams
@ 2018-05-17 20:48 ` Ross Zwisler
0 siblings, 0 replies; 11+ messages in thread
From: Ross Zwisler @ 2018-05-17 20:48 UTC (permalink / raw)
To: Dan Williams; +Cc: Matthew Wilcox, linux-nvdimm
On Thu, May 17, 2018 at 01:03:48PM -0700, Dan Williams wrote:
> On Thu, May 17, 2018 at 12:56 PM, Matthew Wilcox <willy@infradead.org> wrote:
> > On Thu, May 17, 2018 at 12:32:07PM -0700, Dan Williams wrote:
> >> On Thu, May 17, 2018 at 11:37 AM, Matthew Wilcox <willy@infradead.org> wrote:
> >> >
> >> > I plucked this patch from my XArray work. It seems self-contained enough
> >> > that it could go into the DAX tree for merging this cycle.
> >> >
> >> > From 8cb56f4ba36af38814ca7b8ba030a66384e59a21 Mon Sep 17 00:00:00 2001
> >> > From: Matthew Wilcox <mawilcox@microsoft.com>
> >> > Date: Thu, 29 Mar 2018 22:41:18 -0400
> >> > Subject: [PATCH] dax: Fix use of zero page
> >> >
> >> > Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> >> > works on MIPS and s390.
> >> >
> >> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
> >>
> >> I'm being thick and / or lazy, what's the user visible effect of this fix?
> >
> > For s390 it appears to be a performance issue:
> >
> > Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
> > Date: Mon Oct 25 16:10:07 2010 +0200
> >
> > [S390] zero page cache synonyms
> >
> > If the zero page is mapped to virtual user space addresses that differ
> > only in bit 2^12 or 2^13 we get L1 cache synonyms which can affect
> > performance. Follow the mips model and use multiple zero pages to avoid
> > the synonyms.
> >
> > MIPS' use of multiple ZERO_PAGEs predates git history. Given the
> > history of MIPS' caches behaving in incredibly weird ways, I'd assume
> > that getting this wrong results in miniature black holes forming and/or
> > the CPU calculating the largest prime number.
>
> Unless I am missing something I think this sounds like 4.18-rc1
> material with a cc: stable. Last I heard no one is really using
> dccssblk + dax, and MIPS has no way to describe pmem outside of
> memmap= which is only a development tool.
Yea, I agree that this is v4.18 material.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] dax: Fix use of zero page
@ 2018-08-30 16:20 Matthew Wilcox
2018-08-30 21:43 ` Dave Jiang
0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2018-08-30 16:20 UTC (permalink / raw)
To: linux-nvdimm
This patch got caught in the crossfire and didn't make it into 4.18
as planned. Can it make 4.19 please?
---- >8 ----
Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
works on MIPS and s390.
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
fs/dax.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 467601a134bc..c7917b46a75b 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1093,21 +1093,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry,
{
struct inode *inode = mapping->host;
unsigned long vaddr = vmf->address;
- vm_fault_t ret = VM_FAULT_NOPAGE;
- struct page *zero_page;
- pfn_t pfn;
-
- zero_page = ZERO_PAGE(0);
- if (unlikely(!zero_page)) {
- ret = VM_FAULT_OOM;
- goto out;
- }
+ pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));
+ vm_fault_t ret;
- pfn = page_to_pfn_t(zero_page);
dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE,
false);
ret = vmf_insert_mixed(vmf->vma, vaddr, pfn);
-out:
trace_dax_load_hole(inode, vmf, ret);
return ret;
}
--
2.17.1
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] dax: Fix use of zero page
2018-08-30 16:20 Matthew Wilcox
@ 2018-08-30 21:43 ` Dave Jiang
0 siblings, 0 replies; 11+ messages in thread
From: Dave Jiang @ 2018-08-30 21:43 UTC (permalink / raw)
To: Matthew Wilcox, linux-nvdimm
On 08/30/2018 09:20 AM, Matthew Wilcox wrote:
>
> This patch got caught in the crossfire and didn't make it into 4.18
> as planned. Can it make 4.19 please?
>
> ---- >8 ----
>
> Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it
> works on MIPS and s390.
>
> Signed-off-by: Matthew Wilcox <willy@infradead.org>
> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Applied
> ---
> fs/dax.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 467601a134bc..c7917b46a75b 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1093,21 +1093,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry,
> {
> struct inode *inode = mapping->host;
> unsigned long vaddr = vmf->address;
> - vm_fault_t ret = VM_FAULT_NOPAGE;
> - struct page *zero_page;
> - pfn_t pfn;
> -
> - zero_page = ZERO_PAGE(0);
> - if (unlikely(!zero_page)) {
> - ret = VM_FAULT_OOM;
> - goto out;
> - }
> + pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));
> + vm_fault_t ret;
>
> - pfn = page_to_pfn_t(zero_page);
> dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE,
> false);
> ret = vmf_insert_mixed(vmf->vma, vaddr, pfn);
> -out:
> trace_dax_load_hole(inode, vmf, ret);
> return ret;
> }
>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-08-30 21:43 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 18:37 [PATCH] dax: Fix use of zero page Matthew Wilcox
2018-05-17 19:24 ` Ross Zwisler
2018-05-17 19:29 ` Ross Zwisler
2018-05-17 19:57 ` Matthew Wilcox
2018-05-17 20:48 ` Ross Zwisler
2018-05-17 19:32 ` Dan Williams
2018-05-17 19:56 ` Matthew Wilcox
2018-05-17 20:03 ` Dan Williams
2018-05-17 20:48 ` Ross Zwisler
2018-08-30 16:20 Matthew Wilcox
2018-08-30 21:43 ` Dave Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).