[PATCH 2/3] mm: dirty accountable change only apply to non prot numa case

2014-02-11 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

So move it within the if loop

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
 mm/mprotect.c | 21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 7332c1785744..33eab902f10e 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -58,6 +58,13 @@ static unsigned long change_pte_range(struct vm_area_struct 
*vma, pmd_t *pmd,
if (pte_numa(ptent))
ptent = pte_mknonnuma(ptent);
ptent = pte_modify(ptent, newprot);
+   /*
+* Avoid taking write faults for pages we
+* know to be dirty.
+*/
+   if (dirty_accountable  pte_dirty(ptent))
+   ptent = pte_mkwrite(ptent);
+   ptep_modify_prot_commit(mm, addr, pte, ptent);
updated = true;
} else {
struct page *page;
@@ -72,22 +79,8 @@ static unsigned long change_pte_range(struct vm_area_struct 
*vma, pmd_t *pmd,
}
}
}
-
-   /*
-* Avoid taking write faults for pages we know to be
-* dirty.
-*/
-   if (dirty_accountable  pte_dirty(ptent)) {
-   ptent = pte_mkwrite(ptent);
-   updated = true;
-   }
-
if (updated)
pages++;
-
-   /* Only !prot_numa always clears the pte */
-   if (!prot_numa)
-   ptep_modify_prot_commit(mm, addr, pte, ptent);
} else if (IS_ENABLED(CONFIG_MIGRATION)  !pte_file(oldpte)) {
swp_entry_t entry = pte_to_swp_entry(oldpte);
 
-- 
1.8.3.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 2/3] mm: dirty accountable change only apply to non prot numa case

2014-02-11 Thread Rik van Riel
On 02/11/2014 05:34 AM, Aneesh Kumar K.V wrote:
 From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
 
 So move it within the if loop
 
 Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

Reviewed-by: Rik van Riel r...@redhat.com

-- 
All rights reversed
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 2/3] mm: dirty accountable change only apply to non prot numa case

2014-02-11 Thread Mel Gorman
On Tue, Feb 11, 2014 at 04:04:54PM +0530, Aneesh Kumar K.V wrote:
 From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
 
 So move it within the if loop
 
 Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

Acked-by: Mel Gorman mgor...@suse.de

-- 
Mel Gorman
SUSE Labs
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev