Skip to content

Commit

Permalink
thp: remove unused vma parameter from khugepaged_alloc_page
Browse files Browse the repository at this point in the history
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 8b16456 ("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>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Aaron Tomlin authored and Linus Torvalds committed Nov 7, 2015
1 parent c62d255 commit d6669d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit d6669d6

Please sign in to comment.