Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306970 > unrolled thread

[PATCH] bugfix dax fault page should be no cache

Started by<chenjie6@huawei.com>
First post2016-01-12 04:50 +0100
Last post2016-01-13 17:40 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bugfix dax fault page should be no cache <chenjie6@huawei.com> - 2016-01-12 04:50 +0100
    Re: [PATCH] bugfix dax fault page should be no cache Matthew Wilcox <willy@linux.intel.com> - 2016-01-12 14:00 +0100
      Re: [PATCH] bugfix dax fault page should be no cache "Chenjie (K)" <chenjie6@huawei.com> - 2016-01-13 04:50 +0100
        Re: [PATCH] bugfix dax fault page should be no cache Matthew Wilcox <willy@linux.intel.com> - 2016-01-13 17:40 +0100

#1306970 — [PATCH] bugfix dax fault page should be no cache

From<chenjie6@huawei.com>
Date2016-01-12 04:50 +0100
Subject[PATCH] bugfix dax fault page should be no cache
Message-ID<qPY81-3Kg-5@gated-at.bofh.it>
From: chenjie <chenjie6@huawei.com>

We show the pte: 
	*pte=01600000159c8fd3
The page should be no_cache attr,it will be better. 

Cc: <stable@vger.kernel.org>
Signed-off-by: chenjie <chenjie6@huawei.com>
---
 fs/dax.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/dax.c b/fs/dax.c
index 43671b6..179ced6 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -328,6 +328,8 @@ static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh,
 		wmb_pmem();
 	}
 
+	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+
 	error = vm_insert_mixed(vma, vaddr, pfn);
 
  out:
-- 
1.8.0

[toc] | [next] | [standalone]


#1307382

FromMatthew Wilcox <willy@linux.intel.com>
Date2016-01-12 14:00 +0100
Message-ID<qQ6Ih-11c-5@gated-at.bofh.it>
In reply to#1306970
On Tue, Jan 12, 2016 at 07:43:45PM +0800, chenjie6@huawei.com wrote:
> From: chenjie <chenjie6@huawei.com>
> 
> We show the pte: 
> 	*pte=01600000159c8fd3
> The page should be no_cache attr,it will be better. 

I disagree.  What data do you have to show that the WC attribute would
be better than WB?

Even if we agree to that, this is the wrong place to change that
attribute, so the patch is NAKed.  But you need more than "it will
be better".

[toc] | [prev] | [next] | [standalone]


#1308021

From"Chenjie (K)" <chenjie6@huawei.com>
Date2016-01-13 04:50 +0100
Message-ID<qQkBA-2i0-15@gated-at.bofh.it>
In reply to#1307382
The DAX means Direct Access for files,if the pages have cache,
the file is not direct access. But in normal condition,
we can not find the problem directly.

  In our case, we use ext2 filesystem with dax on the reserved mem.
we mmap the file and write some things ,the file is not changed immediately.

this is the wrong place to change that attribute:
	Do you mean
add
	ext4_file_mmap/ext2_file_mmap

	if (IS_DAX(file_inode(file))) {
		vma->vm_ops = &ext4_dax_vm_ops;
		vma->vm_flags |= VM_MIXEDMAP;
+	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
	} else {
like this ???

On 2016/1/12 20:51, Matthew Wilcox wrote:
> On Tue, Jan 12, 2016 at 07:43:45PM +0800, chenjie6@huawei.com wrote:
>> From: chenjie <chenjie6@huawei.com>
>>
>> We show the pte:
>> 	*pte=01600000159c8fd3
>> The page should be no_cache attr,it will be better.
>
> I disagree.  What data do you have to show that the WC attribute would
> be better than WB?
>
> Even if we agree to that, this is the wrong place to change that
> attribute, so the patch is NAKed.  But you need more than "it will
> be better".
>
> .
>

[toc] | [prev] | [next] | [standalone]


#1308582

FromMatthew Wilcox <willy@linux.intel.com>
Date2016-01-13 17:40 +0100
Message-ID<qQwCL-2o0-31@gated-at.bofh.it>
In reply to#1308021
On Wed, Jan 13, 2016 at 11:47:12AM +0800, Chenjie (K) wrote:
> The DAX means Direct Access for files,if the pages have cache,
> the file is not direct access. But in normal condition,
> we can not find the problem directly.

The file absolutely is direct accessed.  The CPU cache is critical to
performance, and should not be bypassed lightly.  We have instructions to
flush the cache, and a library (see http://pmem.io/) so that applications
don't have to use them directly.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web