aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2013-09-11 17:20:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:24 -0400
commit9966c4bbb110003ee218c5c4df583041b57027c4 (patch)
treecd6d35df60f8a995f925f32acb06490fcf777b0a /mm
parent72457c0a05ed06f978d3a8a7c9d5ad527db88b4c (diff)
mm, hugetlb: move up the code which check availability of free huge page
In this time we are holding a hugetlb_lock, so hstate values can't be changed. If we don't have any usable free huge page in this time, we don't need to proceed with the processing. So move this code up. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Hillf Danton <dhillf@gmail.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Hugh Dickins <hughd@google.com> Cc: Davidlohr Bueso <davidlohr.bueso@hp.com> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 6e514831bda5..a87903578810 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -539,10 +539,6 @@ static struct page *dequeue_huge_page_vma(struct hstate *h,
539 struct zoneref *z; 539 struct zoneref *z;
540 unsigned int cpuset_mems_cookie; 540 unsigned int cpuset_mems_cookie;
541 541
542retry_cpuset:
543 cpuset_mems_cookie = get_mems_allowed();
544 zonelist = huge_zonelist(vma, address,
545 htlb_alloc_mask, &mpol, &nodemask);
546 /* 542 /*
547 * A child process with MAP_PRIVATE mappings created by their parent 543 * A child process with MAP_PRIVATE mappings created by their parent
548 * have no page reserves. This check ensures that reservations are 544 * have no page reserves. This check ensures that reservations are
@@ -556,6 +552,11 @@ retry_cpuset:
556 if (avoid_reserve && h->free_huge_pages - h->resv_huge_pages == 0) 552 if (avoid_reserve && h->free_huge_pages - h->resv_huge_pages == 0)
557 goto err; 553 goto err;
558 554
555retry_cpuset:
556 cpuset_mems_cookie = get_mems_allowed();
557 zonelist = huge_zonelist(vma, address,
558 htlb_alloc_mask, &mpol, &nodemask);
559
559 for_each_zone_zonelist_nodemask(zone, z, zonelist, 560 for_each_zone_zonelist_nodemask(zone, z, zonelist,
560 MAX_NR_ZONES - 1, nodemask) { 561 MAX_NR_ZONES - 1, nodemask) {
561 if (cpuset_zone_allowed_softwall(zone, htlb_alloc_mask)) { 562 if (cpuset_zone_allowed_softwall(zone, htlb_alloc_mask)) {
@@ -574,7 +575,6 @@ retry_cpuset:
574 return page; 575 return page;
575 576
576err: 577err:
577 mpol_cond_put(mpol);
578 return NULL; 578 return NULL;
579} 579}
580 580