On Mon, Sep 14, 2015 at 10:31:45PM +0300, Ebru Akagunduz wrote:
> @@ -2655,6 +2696,8 @@ static void collapse_huge_page(struct mm_struct *mm,
>  
>       anon_vma_lock_write(vma->anon_vma);
>  
> +     __collapse_huge_page_swapin(mm, vma, address, pmd, pte);
> +

Do I miss something, or 'pte' is not initialized at this point?
And the value is not really used in __collapse_huge_page_swapin().

>       pte = pte_offset_map(pmd, address);
>       pte_ptl = pte_lockptr(mm, pmd);


>From 76783e1dfb22cde04cf46903336810df8a632617 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Thu, 17 Sep 2015 16:23:30 +0300
Subject: [PATCH] khugepaged: __collapse_huge_page_swapin(): drop unused 'pte'
 parameter

'pte' dereference is eliminated by compiler, since nobody uses the
pteval until it's overwritten inside the loop.

Value of 'pte' itself is overwritten by pte_offset_map() before first
real use.

Signed-off-by: Kirill A. Shutemov <[email protected]>
---
 mm/huge_memory.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 4b057abd8615..5ad5c443cc94 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2628,11 +2628,10 @@ static bool hugepage_vma_check(struct vm_area_struct 
*vma)
 
 static void __collapse_huge_page_swapin(struct mm_struct *mm,
                                        struct vm_area_struct *vma,
-                                       unsigned long address, pmd_t *pmd,
-                                       pte_t *pte)
+                                       unsigned long address, pmd_t *pmd)
 {
        unsigned long _address;
-       pte_t pteval = *pte;
+       pte_t *pte, pteval;
        int swapped_in = 0, ret = 0;
 
        pte = pte_offset_map(pmd, address);
@@ -2730,7 +2729,7 @@ static void collapse_huge_page(struct mm_struct *mm,
 
        anon_vma_lock_write(vma->anon_vma);
 
-       __collapse_huge_page_swapin(mm, vma, address, pmd, pte);
+       __collapse_huge_page_swapin(mm, vma, address, pmd);
 
        pte = pte_offset_map(pmd, address);
        pte_ptl = pte_lockptr(mm, pmd);
-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to