Re: [PATCH v2 08/12] mm: move some code around

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 09 October 2015 03:19 PM, Kirill A. Shutemov wrote:
> On Tue, Sep 22, 2015 at 04:04:52PM +0530, Vineet Gupta wrote:
>> This reduces/simplifies the diff for the next patch which moves THP
>> specific code.
>>
>> Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxxxx>
> Okay, so you group pte-related helpers together, right?
> It would be nice to mention it in commit message.
>
> Acked-by: Kirill A. Shutemov kirill.shutemov@xxxxxxxxxxxxxxx

------------->
>From 3817cec40baf8d9bf783203bf42e15dc404d9cdd Mon Sep 17 00:00:00 2001
From: Vineet Gupta <vgupta@xxxxxxxxxxxx>
Date: Thu, 9 Jul 2015 17:19:30 +0530
Subject: [PATCH v3] mm: group pte related helpers together

This reduces/simplifies the diff for the next patch which moves THP
specific code.

No semantical changes !

Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxxxx>
---
 mm/pgtable-generic.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 6b674e00153c..48851894e699 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -57,6 +57,31 @@ int ptep_set_access_flags(struct vm_area_struct *vma,
 }
 #endif
 
+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+int ptep_clear_flush_young(struct vm_area_struct *vma,
+               unsigned long address, pte_t *ptep)
+{
+    int young;
+    young = ptep_test_and_clear_young(vma, address, ptep);
+    if (young)
+        flush_tlb_page(vma, address);
+    return young;
+}
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
+pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
+               pte_t *ptep)
+{
+    struct mm_struct *mm = (vma)->vm_mm;
+    pte_t pte;
+    pte = ptep_get_and_clear(mm, address, ptep);
+    if (pte_accessible(mm, pte))
+        flush_tlb_page(vma, address);
+    return pte;
+}
+#endif
+
 #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
 int pmdp_set_access_flags(struct vm_area_struct *vma,
               unsigned long address, pmd_t *pmdp,
@@ -77,18 +102,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma,
 }
 #endif
 
-#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
-int ptep_clear_flush_young(struct vm_area_struct *vma,
-               unsigned long address, pte_t *ptep)
-{
-    int young;
-    young = ptep_test_and_clear_young(vma, address, ptep);
-    if (young)
-        flush_tlb_page(vma, address);
-    return young;
-}
-#endif
-
 #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
 int pmdp_clear_flush_young(struct vm_area_struct *vma,
                unsigned long address, pmd_t *pmdp)
@@ -106,19 +119,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
 }
 #endif
 
-#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
-pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
-               pte_t *ptep)
-{
-    struct mm_struct *mm = (vma)->vm_mm;
-    pte_t pte;
-    pte = ptep_get_and_clear(mm, address, ptep);
-    if (pte_accessible(mm, pte))
-        flush_tlb_page(vma, address);
-    return pte;
-}
-#endif
-
 #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address,
-- 
1.9.1


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]