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


Groups > linux.kernel > #1293136 > unrolled thread

[PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()

Started byOleg Nesterov <oleg@redhat.com>
First post2015-12-16 18:30 +0100
Last post2015-12-22 23:10 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in  clear_soft_dirty_pmd() Oleg Nesterov <oleg@redhat.com> - 2015-12-16 18:30 +0100
    Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY  in clear_soft_dirty_pmd() "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-12-16 18:50 +0100
    Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY  in clear_soft_dirty_pmd() Cyrill Gorcunov <gorcunov@gmail.com> - 2015-12-16 19:00 +0100
    Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY  in clear_soft_dirty_pmd() David Rientjes <rientjes@google.com> - 2015-12-22 23:10 +0100

#1293136 — [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()

FromOleg Nesterov <oleg@redhat.com>
Date2015-12-16 18:30 +0100
Subject[PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
Message-ID<qGo3L-4HH-7@gated-at.bofh.it>
clear_soft_dirty_pmd() is called by clear_refs_write(CLEAR_REFS_SOFT_DIRTY),
VM_SOFTDIRTY was already cleared before walk_page_range().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 fs/proc/task_mmu.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 187b3b5..1a02b15 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -817,9 +817,6 @@ static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma,
 	pmd = pmd_wrprotect(pmd);
 	pmd = pmd_clear_soft_dirty(pmd);
 
-	if (vma->vm_flags & VM_SOFTDIRTY)
-		vma->vm_flags &= ~VM_SOFTDIRTY;
-
 	set_pmd_at(vma->vm_mm, addr, pmdp, pmd);
 }
 #else
-- 
1.5.5.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293154 — Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-12-16 18:50 +0100
SubjectRe: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
Message-ID<qGon8-4Os-23@gated-at.bofh.it>
In reply to#1293136
On Wed, Dec 16, 2015 at 06:26:32PM +0100, Oleg Nesterov wrote:
> clear_soft_dirty_pmd() is called by clear_refs_write(CLEAR_REFS_SOFT_DIRTY),
> VM_SOFTDIRTY was already cleared before walk_page_range().

Not only that, We shouldn't [generally] change vm_flags without exclusive
mmap_sem and we have only down_read() here.

> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

> ---
>  fs/proc/task_mmu.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 187b3b5..1a02b15 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -817,9 +817,6 @@ static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma,
>  	pmd = pmd_wrprotect(pmd);
>  	pmd = pmd_clear_soft_dirty(pmd);
>  
> -	if (vma->vm_flags & VM_SOFTDIRTY)
> -		vma->vm_flags &= ~VM_SOFTDIRTY;
> -
>  	set_pmd_at(vma->vm_mm, addr, pmdp, pmd);
>  }
>  #else
> -- 
> 1.5.5.1
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1293191 — Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()

FromCyrill Gorcunov <gorcunov@gmail.com>
Date2015-12-16 19:00 +0100
SubjectRe: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
Message-ID<qGowP-4RZ-19@gated-at.bofh.it>
In reply to#1293136
On Wed, Dec 16, 2015 at 06:26:32PM +0100, Oleg Nesterov wrote:
> clear_soft_dirty_pmd() is called by clear_refs_write(CLEAR_REFS_SOFT_DIRTY),
> VM_SOFTDIRTY was already cleared before walk_page_range().
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Thank you!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1297089 — Re: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()

FromDavid Rientjes <rientjes@google.com>
Date2015-12-22 23:10 +0100
SubjectRe: [PATCH] mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
Message-ID<qIDi2-1cT-27@gated-at.bofh.it>
In reply to#1293136
On Wed, 16 Dec 2015, Oleg Nesterov wrote:

> clear_soft_dirty_pmd() is called by clear_refs_write(CLEAR_REFS_SOFT_DIRTY),
> VM_SOFTDIRTY was already cleared before walk_page_range().
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: David Rientjes <rientjes@google.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web