Commit 212a0a6f28dda0a1e732d20d57abb465750d473c
Committed by
Linus Torvalds
1 parent
6f6313d487
Exists in
master
and in
20 other branches
mm, mempolicy: remove duplicate code
Remove some duplicate code and simplify alloc_pages_vma(). No functional change. Signed-off-by: David Rientjes <rientjes@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 4 additions and 17 deletions Side-by-side Diff
mm/mempolicy.c
... | ... | @@ -1907,7 +1907,6 @@ |
1907 | 1907 | unsigned long addr, int node) |
1908 | 1908 | { |
1909 | 1909 | struct mempolicy *pol; |
1910 | - struct zonelist *zl; | |
1911 | 1910 | struct page *page; |
1912 | 1911 | unsigned int cpuset_mems_cookie; |
1913 | 1912 | |
1914 | 1913 | |
... | ... | @@ -1926,23 +1925,11 @@ |
1926 | 1925 | |
1927 | 1926 | return page; |
1928 | 1927 | } |
1929 | - zl = policy_zonelist(gfp, pol, node); | |
1930 | - if (unlikely(mpol_needs_cond_ref(pol))) { | |
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, | |
1928 | + page = __alloc_pages_nodemask(gfp, order, | |
1929 | + policy_zonelist(gfp, pol, node), | |
1945 | 1930 | policy_nodemask(gfp, pol)); |
1931 | + if (unlikely(mpol_needs_cond_ref(pol))) | |
1932 | + __mpol_put(pol); | |
1946 | 1933 | if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) |
1947 | 1934 | goto retry_cpuset; |
1948 | 1935 | return page; |