Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332369
b: refs/heads/master
c: 420256e
h: refs/heads/master
i:
  332367: 50222e5
v: v3
  • Loading branch information
Xiao Guangrong authored and Linus Torvalds committed Oct 9, 2012
1 parent 6f40228 commit 3932df6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d516904bd239fe2c9f1bd46cf146bb4b8831321c
refs/heads/master: 420256ef02660af0acf28c12fe4b7d514ca88a4d
19 changes: 7 additions & 12 deletions trunk/mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,15 +1873,12 @@ static void collapse_huge_page(struct mm_struct *mm,
*hpage = ERR_PTR(-ENOMEM);
return;
}
*hpage = new_page;
count_vm_event(THP_COLLAPSE_ALLOC);
#endif

if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
#ifdef CONFIG_NUMA
put_page(new_page);
#endif
if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL)))
return;
}

/*
* Prevent all access to pagetables with the exception of
Expand Down Expand Up @@ -1982,19 +1979,15 @@ static void collapse_huge_page(struct mm_struct *mm,
prepare_pmd_huge_pte(pgtable, mm);
spin_unlock(&mm->page_table_lock);

#ifndef CONFIG_NUMA
*hpage = NULL;
#endif

khugepaged_pages_collapsed++;
out_up_write:
up_write(&mm->mmap_sem);
return;

out:
mem_cgroup_uncharge_page(new_page);
#ifdef CONFIG_NUMA
put_page(new_page);
#endif
goto out_up_write;
}

Expand Down Expand Up @@ -2260,8 +2253,6 @@ static void khugepaged_do_scan(void)
barrier(); /* write khugepaged_pages_to_scan to local stack */

while (progress < pages) {
cond_resched();

#ifndef CONFIG_NUMA
if (!hpage)
hpage = khugepaged_alloc_hugepage(&wait);
Expand All @@ -2274,8 +2265,12 @@ static void khugepaged_do_scan(void)
break;
wait = false;
khugepaged_alloc_sleep();
} else if (hpage) {
put_page(hpage);
hpage = NULL;
}
#endif
cond_resched();

if (unlikely(kthread_should_stop() || freezing(current)))
break;
Expand Down

0 comments on commit 3932df6

Please sign in to comment.