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


Groups > linux.kernel > #1227031

Re: [RFC v5 3/3] mm: make swapin readahead to improve thp collapse rate

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [RFC v5 3/3] mm: make swapin readahead to improve thp collapse rate
Date 2015-09-17 15:30 +0200
Message-ID <q9Hqb-4OV-27@gated-at.bofh.it> (permalink)
References <q8HLz-7lZ-7@gated-at.bofh.it> <q8HLA-7lZ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v5 3/3] mm: make swapin readahead to improve thp collapse rate Ebru Akagunduz <ebru.akagunduz@gmail.com> - 2015-09-14 21:40 +0200
  Re: [RFC v5 3/3] mm: make swapin readahead to improve thp collapse  rate "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-17 15:30 +0200
  Re: [RFC v5 3/3] mm: make swapin readahead to improve thp collapse  rate "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-17 17:20 +0200

csiph-web