From c53444978602e6255e532f381dd92a870e0dc137 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Thu, 29 Nov 2012 14:17:27 +1100 Subject: [PATCH] mm, mempolicy: remove duplicate code Remove some duplicate code and simplify alloc_pages_vma(). No functional change. Signed-off-by: David Rientjes Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton --- mm/mempolicy.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 02890f20aa9e..5ad2bd949510 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1925,7 +1925,6 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, unsigned long addr, int node) { struct mempolicy *pol; - struct zonelist *zl; struct page *page; unsigned int cpuset_mems_cookie; @@ -1944,23 +1943,11 @@ retry_cpuset: return page; } - zl = policy_zonelist(gfp, pol, node); - if (unlikely(mpol_needs_cond_ref(pol))) { - /* - * slow path: ref counted shared policy - */ - struct page *page = __alloc_pages_nodemask(gfp, order, - zl, policy_nodemask(gfp, pol)); - __mpol_put(pol); - if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) - goto retry_cpuset; - return page; - } - /* - * fast path: default or task policy - */ - page = __alloc_pages_nodemask(gfp, order, zl, + page = __alloc_pages_nodemask(gfp, order, + policy_zonelist(gfp, pol, node), policy_nodemask(gfp, pol)); + if (unlikely(mpol_needs_cond_ref(pol))) + __mpol_put(pol); if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) goto retry_cpuset; return page; -- 2.39.5