From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <55E58A54.8040805@plexistor.com> Date: Tue, 01 Sep 2015 14:21:56 +0300 From: Boaz Harrosh MIME-Version: 1.0 Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> <55E583E2.9000200@plexistor.com> <20150901111020.GA7820@node.dhcp.inet.fi> In-Reply-To: <20150901111020.GA7820@node.dhcp.inet.fi> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, Yigal Korman , Jan Kara , Dave Chinner List-ID: On 09/01/2015 02:10 PM, Kirill A. Shutemov wrote: > On Tue, Sep 01, 2015 at 01:54:26PM +0300, Boaz Harrosh wrote: >> On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: >>> For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of >>> vm_ops->page_mkwrite to notify abort write access. This means we want >>> vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. >>> >> >> Hi Kirill >> >> I will test with this right away and ACK on this. >> >> Hmm so are you saying we might be missing some buffer modifications right now. >> >> What would be a theoretical scenario that will cause these missed events? > > On writable mapping with vm_ops->pfn_mkwrite, but without > vm_ops->page_mkwrite: read fault followed by write access to the pfn. > Writable pte will be set up on read fault and write fault will not be > generated. > > I found it examining Dave's complain on generic/080: > > http://lkml.kernel.org/g/20150831233803.GO3902@dastard > > Although I don't think it's the reason. > >> I would like to put a test in our test rigs that should fail today and this >> patch fixes. >> >> [In our system every modified pmem block is also RDMAed to a remote >> pmem for HA, a missed modification will make the two copies unsynced] > > It shouldn't be a problem for ext2/ext4 as they provide both pfn_mkwrite > and page_mkwrite. > Ha right we have both as well, and so should xfs I think (because of the zero pages thing, in fact any dax.c user should). Thanks so this verifies why we could not see any such breakage. ACK-by: Boaz Harrosh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 1 Sep 2015 14:10:20 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Message-ID: <20150901111020.GA7820@node.dhcp.inet.fi> References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> <55E583E2.9000200@plexistor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55E583E2.9000200@plexistor.com> Sender: owner-linux-mm@kvack.org To: Boaz Harrosh Cc: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, Yigal Korman , Jan Kara , Dave Chinner List-ID: On Tue, Sep 01, 2015 at 01:54:26PM +0300, Boaz Harrosh wrote: > On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: > > For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of > > vm_ops->page_mkwrite to notify abort write access. This means we want > > vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. > > > > Hi Kirill > > I will test with this right away and ACK on this. > > Hmm so are you saying we might be missing some buffer modifications right now. > > What would be a theoretical scenario that will cause these missed events? On writable mapping with vm_ops->pfn_mkwrite, but without vm_ops->page_mkwrite: read fault followed by write access to the pfn. Writable pte will be set up on read fault and write fault will not be generated. I found it examining Dave's complain on generic/080: http://lkml.kernel.org/g/20150831233803.GO3902@dastard Although I don't think it's the reason. > I would like to put a test in our test rigs that should fail today and this > patch fixes. > > [In our system every modified pmem block is also RDMAed to a remote > pmem for HA, a missed modification will make the two copies unsynced] It shouldn't be a problem for ext2/ext4 as they provide both pfn_mkwrite and page_mkwrite. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <55E583E2.9000200@plexistor.com> Date: Tue, 01 Sep 2015 13:54:26 +0300 From: Boaz Harrosh MIME-Version: 1.0 Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> In-Reply-To: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, Yigal Korman , Jan Kara , Dave Chinner List-ID: On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: > For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of > vm_ops->page_mkwrite to notify abort write access. This means we want > vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. > Hi Kirill I will test with this right away and ACK on this. Hmm so are you saying we might be missing some buffer modifications right now. What would be a theoretical scenario that will cause these missed events? I would like to put a test in our test rigs that should fail today and this patch fixes. [In our system every modified pmem block is also RDMAed to a remote pmem for HA, a missed modification will make the two copies unsynced] Thanks for catching this Boaz > Signed-off-by: Kirill A. Shutemov > Cc: Yigal Korman > Cc: Boaz Harrosh > Cc: Matthew Wilcox > Cc: Jan Kara > Cc: Dave Chinner > --- > mm/mmap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index df6d5f07035b..3f78bceefe5a 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) > return 0; > > /* The backer wishes to know when pages are first written to? */ > - if (vma->vm_ops && vma->vm_ops->page_mkwrite) > + if (vma->vm_ops && > + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) > return 1; > > /* The open routine did something to the protections that pgprot_modify > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: "Kirill A. Shutemov" Subject: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Date: Tue, 1 Sep 2015 13:22:41 +0300 Message-Id: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, "Kirill A. Shutemov" , Yigal Korman , Boaz Harrosh , Jan Kara , Dave Chinner List-ID: For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of vm_ops->page_mkwrite to notify abort write access. This means we want vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. Signed-off-by: Kirill A. Shutemov Cc: Yigal Korman Cc: Boaz Harrosh Cc: Matthew Wilcox Cc: Jan Kara Cc: Dave Chinner --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f07035b..3f78bceefe5a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) return 0; /* The backer wishes to know when pages are first written to? */ - if (vma->vm_ops && vma->vm_ops->page_mkwrite) + if (vma->vm_ops && + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) return 1; /* The open routine did something to the protections that pgprot_modify -- 2.5.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Date: Tue, 1 Sep 2015 13:22:41 +0300 Message-ID: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, "Kirill A. Shutemov" , Yigal Korman , Boaz Harrosh , Jan Kara , Dave Chinner To: Andrew Morton , Matthew Wilcox Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of vm_ops->page_mkwrite to notify abort write access. This means we want vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. Signed-off-by: Kirill A. Shutemov Cc: Yigal Korman Cc: Boaz Harrosh Cc: Matthew Wilcox Cc: Jan Kara Cc: Dave Chinner --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f07035b..3f78bceefe5a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) return 0; /* The backer wishes to know when pages are first written to? */ - if (vma->vm_ops && vma->vm_ops->page_mkwrite) + if (vma->vm_ops && + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) return 1; /* The open routine did something to the protections that pgprot_modify -- 2.5.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Date: Tue, 01 Sep 2015 13:54:26 +0300 Message-ID: <55E583E2.9000200@plexistor.com> References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, Yigal Korman , Jan Kara , Dave Chinner To: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox Return-path: Received: from mail-wi0-f178.google.com ([209.85.212.178]:38728 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbbIAKy3 (ORCPT ); Tue, 1 Sep 2015 06:54:29 -0400 Received: by wiclp12 with SMTP id lp12so26258102wic.1 for ; Tue, 01 Sep 2015 03:54:28 -0700 (PDT) In-Reply-To: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: > For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of > vm_ops->page_mkwrite to notify abort write access. This means we want > vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. > Hi Kirill I will test with this right away and ACK on this. Hmm so are you saying we might be missing some buffer modifications right now. What would be a theoretical scenario that will cause these missed events? I would like to put a test in our test rigs that should fail today and this patch fixes. [In our system every modified pmem block is also RDMAed to a remote pmem for HA, a missed modification will make the two copies unsynced] Thanks for catching this Boaz > Signed-off-by: Kirill A. Shutemov > Cc: Yigal Korman > Cc: Boaz Harrosh > Cc: Matthew Wilcox > Cc: Jan Kara > Cc: Dave Chinner > --- > mm/mmap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index df6d5f07035b..3f78bceefe5a 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) > return 0; > > /* The backer wishes to know when pages are first written to? */ > - if (vma->vm_ops && vma->vm_ops->page_mkwrite) > + if (vma->vm_ops && > + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) > return 1; > > /* The open routine did something to the protections that pgprot_modify > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755338AbbIAKWw (ORCPT ); Tue, 1 Sep 2015 06:22:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:38745 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755272AbbIAKWu (ORCPT ); Tue, 1 Sep 2015 06:22:50 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,448,1437462000"; d="scan'208";a="795350302" From: "Kirill A. Shutemov" To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, "Kirill A. Shutemov" , Yigal Korman , Boaz Harrosh , Jan Kara , Dave Chinner Subject: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Date: Tue, 1 Sep 2015 13:22:41 +0300 Message-Id: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of vm_ops->page_mkwrite to notify abort write access. This means we want vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. Signed-off-by: Kirill A. Shutemov Cc: Yigal Korman Cc: Boaz Harrosh Cc: Matthew Wilcox Cc: Jan Kara Cc: Dave Chinner --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f07035b..3f78bceefe5a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) return 0; /* The backer wishes to know when pages are first written to? */ - if (vma->vm_ops && vma->vm_ops->page_mkwrite) + if (vma->vm_ops && + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) return 1; /* The open routine did something to the protections that pgprot_modify -- 2.5.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755658AbbIAKyb (ORCPT ); Tue, 1 Sep 2015 06:54:31 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33480 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019AbbIAKy3 (ORCPT ); Tue, 1 Sep 2015 06:54:29 -0400 Message-ID: <55E583E2.9000200@plexistor.com> Date: Tue, 01 Sep 2015 13:54:26 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox CC: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, Yigal Korman , Jan Kara , Dave Chinner Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> In-Reply-To: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: > For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of > vm_ops->page_mkwrite to notify abort write access. This means we want > vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. > Hi Kirill I will test with this right away and ACK on this. Hmm so are you saying we might be missing some buffer modifications right now. What would be a theoretical scenario that will cause these missed events? I would like to put a test in our test rigs that should fail today and this patch fixes. [In our system every modified pmem block is also RDMAed to a remote pmem for HA, a missed modification will make the two copies unsynced] Thanks for catching this Boaz > Signed-off-by: Kirill A. Shutemov > Cc: Yigal Korman > Cc: Boaz Harrosh > Cc: Matthew Wilcox > Cc: Jan Kara > Cc: Dave Chinner > --- > mm/mmap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index df6d5f07035b..3f78bceefe5a 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) > return 0; > > /* The backer wishes to know when pages are first written to? */ > - if (vma->vm_ops && vma->vm_ops->page_mkwrite) > + if (vma->vm_ops && > + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) > return 1; > > /* The open routine did something to the protections that pgprot_modify > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753593AbbIALKZ (ORCPT ); Tue, 1 Sep 2015 07:10:25 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37860 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbbIALKX (ORCPT ); Tue, 1 Sep 2015 07:10:23 -0400 Date: Tue, 1 Sep 2015 14:10:20 +0300 From: "Kirill A. Shutemov" To: Boaz Harrosh Cc: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, Yigal Korman , Jan Kara , Dave Chinner Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Message-ID: <20150901111020.GA7820@node.dhcp.inet.fi> References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> <55E583E2.9000200@plexistor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55E583E2.9000200@plexistor.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2015 at 01:54:26PM +0300, Boaz Harrosh wrote: > On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: > > For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of > > vm_ops->page_mkwrite to notify abort write access. This means we want > > vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. > > > > Hi Kirill > > I will test with this right away and ACK on this. > > Hmm so are you saying we might be missing some buffer modifications right now. > > What would be a theoretical scenario that will cause these missed events? On writable mapping with vm_ops->pfn_mkwrite, but without vm_ops->page_mkwrite: read fault followed by write access to the pfn. Writable pte will be set up on read fault and write fault will not be generated. I found it examining Dave's complain on generic/080: http://lkml.kernel.org/g/20150831233803.GO3902@dastard Although I don't think it's the reason. > I would like to put a test in our test rigs that should fail today and this > patch fixes. > > [In our system every modified pmem block is also RDMAed to a remote > pmem for HA, a missed modification will make the two copies unsynced] It shouldn't be a problem for ext2/ext4 as they provide both pfn_mkwrite and page_mkwrite. -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbIALWB (ORCPT ); Tue, 1 Sep 2015 07:22:01 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:35120 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbbIALV7 (ORCPT ); Tue, 1 Sep 2015 07:21:59 -0400 Message-ID: <55E58A54.8040805@plexistor.com> Date: Tue, 01 Sep 2015 14:21:56 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Kirill A. Shutemov" CC: "Kirill A. Shutemov" , Andrew Morton , Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, Yigal Korman , Jan Kara , Dave Chinner Subject: Re: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified References: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> <55E583E2.9000200@plexistor.com> <20150901111020.GA7820@node.dhcp.inet.fi> In-Reply-To: <20150901111020.GA7820@node.dhcp.inet.fi> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/01/2015 02:10 PM, Kirill A. Shutemov wrote: > On Tue, Sep 01, 2015 at 01:54:26PM +0300, Boaz Harrosh wrote: >> On 09/01/2015 01:22 PM, Kirill A. Shutemov wrote: >>> For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of >>> vm_ops->page_mkwrite to notify abort write access. This means we want >>> vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. >>> >> >> Hi Kirill >> >> I will test with this right away and ACK on this. >> >> Hmm so are you saying we might be missing some buffer modifications right now. >> >> What would be a theoretical scenario that will cause these missed events? > > On writable mapping with vm_ops->pfn_mkwrite, but without > vm_ops->page_mkwrite: read fault followed by write access to the pfn. > Writable pte will be set up on read fault and write fault will not be > generated. > > I found it examining Dave's complain on generic/080: > > http://lkml.kernel.org/g/20150831233803.GO3902@dastard > > Although I don't think it's the reason. > >> I would like to put a test in our test rigs that should fail today and this >> patch fixes. >> >> [In our system every modified pmem block is also RDMAed to a remote >> pmem for HA, a missed modification will make the two copies unsynced] > > It shouldn't be a problem for ext2/ext4 as they provide both pfn_mkwrite > and page_mkwrite. > Ha right we have both as well, and so should xfs I think (because of the zero pages thing, in fact any dax.c user should). Thanks so this verifies why we could not see any such breakage. ACK-by: Boaz Harrosh