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


Groups > linux.kernel > #1262263 > unrolled thread

[RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page

Started byAaron Tomlin <atomlin@redhat.com>
First post2015-11-04 13:50 +0100
Last post2015-11-04 16:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page Aaron Tomlin <atomlin@redhat.com> - 2015-11-04 13:50 +0100
    Re: [RESEND PATCH v2] thp: Remove unused vma parameter from  khugepaged_alloc_page Vlastimil Babka <vbabka@suse.cz> - 2015-11-04 16:30 +0100

#1262263 — [RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page

FromAaron Tomlin <atomlin@redhat.com>
Date2015-11-04 13:50 +0100
Subject[RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page
Message-ID<qr5FM-tl-7@gated-at.bofh.it>
Resending due to incomplete subject.

Changes since v2:

 - Fixed incorrect commit message

The "vma" parameter to khugepaged_alloc_page() is unused.
It has to remain unused or the drop read lock 'map_sem' optimisation
introduce by commit 8b1645685acf ("mm, THP: don't hold mmap_sem in
khugepaged when allocating THP") wouldn't be safe. So let's remove it.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
 mm/huge_memory.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index bbac913..490fa81 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2413,8 +2413,7 @@ static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
 
 static struct page *
 khugepaged_alloc_page(struct page **hpage, gfp_t gfp, struct mm_struct *mm,
-		       struct vm_area_struct *vma, unsigned long address,
-		       int node)
+		       unsigned long address, int node)
 {
 	VM_BUG_ON_PAGE(*hpage, *hpage);
 
@@ -2481,8 +2480,7 @@ static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
 
 static struct page *
 khugepaged_alloc_page(struct page **hpage, gfp_t gfp, struct mm_struct *mm,
-		       struct vm_area_struct *vma, unsigned long address,
-		       int node)
+		       unsigned long address, int node)
 {
 	up_read(&mm->mmap_sem);
 	VM_BUG_ON(!*hpage);
@@ -2530,7 +2528,7 @@ static void collapse_huge_page(struct mm_struct *mm,
 		__GFP_THISNODE;
 
 	/* release the mmap_sem read lock. */
-	new_page = khugepaged_alloc_page(hpage, gfp, mm, vma, address, node);
+	new_page = khugepaged_alloc_page(hpage, gfp, mm, address, node);
 	if (!new_page)
 		return;
 
-- 
2.4.3

--
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/

[toc] | [next] | [standalone]


#1262352 — Re: [RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page

FromVlastimil Babka <vbabka@suse.cz>
Date2015-11-04 16:30 +0100
SubjectRe: [RESEND PATCH v2] thp: Remove unused vma parameter from khugepaged_alloc_page
Message-ID<qr8aC-2cC-31@gated-at.bofh.it>
In reply to#1262263
On 11/04/2015 01:48 PM, Aaron Tomlin wrote:
> Resending due to incomplete subject.
>
> Changes since v2:
>
>   - Fixed incorrect commit message
>
> The "vma" parameter to khugepaged_alloc_page() is unused.
> It has to remain unused or the drop read lock 'map_sem' optimisation
> introduce by commit 8b1645685acf ("mm, THP: don't hold mmap_sem in
> khugepaged when allocating THP") wouldn't be safe. So let's remove it.
>
> Signed-off-by: Aaron Tomlin <atomlin@redhat.com>

Pretty sure the compiler inlines it away anyway, but sure, why not.
Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>   mm/huge_memory.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index bbac913..490fa81 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2413,8 +2413,7 @@ static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
>
>   static struct page *
>   khugepaged_alloc_page(struct page **hpage, gfp_t gfp, struct mm_struct *mm,
> -		       struct vm_area_struct *vma, unsigned long address,
> -		       int node)
> +		       unsigned long address, int node)
>   {
>   	VM_BUG_ON_PAGE(*hpage, *hpage);
>
> @@ -2481,8 +2480,7 @@ static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
>
>   static struct page *
>   khugepaged_alloc_page(struct page **hpage, gfp_t gfp, struct mm_struct *mm,
> -		       struct vm_area_struct *vma, unsigned long address,
> -		       int node)
> +		       unsigned long address, int node)
>   {
>   	up_read(&mm->mmap_sem);
>   	VM_BUG_ON(!*hpage);
> @@ -2530,7 +2528,7 @@ static void collapse_huge_page(struct mm_struct *mm,
>   		__GFP_THISNODE;
>
>   	/* release the mmap_sem read lock. */
> -	new_page = khugepaged_alloc_page(hpage, gfp, mm, vma, address, node);
> +	new_page = khugepaged_alloc_page(hpage, gfp, mm, address, node);
>   	if (!new_page)
>   		return;
>
>

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web