[PATCH] khugepaged: __collapse_huge_page_swapin(): drop unused 'pte' parameter

From: Kirill A. Shutemov
Date: Thu Sep 17 2015 - 09:23:30 EST


'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 <kirill.shutemov@xxxxxxxxxxxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/