aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mempolicy.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4ea600da8940..05b28361a39b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1907,7 +1907,6 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
1907 unsigned long addr, int node) 1907 unsigned long addr, int node)
1908{ 1908{
1909 struct mempolicy *pol; 1909 struct mempolicy *pol;
1910 struct zonelist *zl;
1911 struct page *page; 1910 struct page *page;
1912 unsigned int cpuset_mems_cookie; 1911 unsigned int cpuset_mems_cookie;
1913 1912
@@ -1926,23 +1925,11 @@ retry_cpuset:
1926 1925
1927 return page; 1926 return page;
1928 } 1927 }
1929 zl = policy_zonelist(gfp, pol, node); 1928 page = __alloc_pages_nodemask(gfp, order,
1930 if (unlikely(mpol_needs_cond_ref(pol))) { 1929 policy_zonelist(gfp, pol, node),
1931 /*
1932 * slow path: ref counted shared policy
1933 */
1934 struct page *page = __alloc_pages_nodemask(gfp, order,
1935 zl, policy_nodemask(gfp, pol));
1936 __mpol_put(pol);
1937 if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page))
1938 goto retry_cpuset;
1939 return page;
1940 }
1941 /*
1942 * fast path: default or task policy
1943 */
1944 page = __alloc_pages_nodemask(gfp, order, zl,
1945 policy_nodemask(gfp, pol)); 1930 policy_nodemask(gfp, pol));
1931 if (unlikely(mpol_needs_cond_ref(pol)))
1932 __mpol_put(pol);
1946 if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) 1933 if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page))
1947 goto retry_cpuset; 1934 goto retry_cpuset;
1948 return page; 1935 return page;