diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ea498788af53..e8a71657ac4a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -887,35 +887,37 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, | |||
887 | struct zone **z = zonelist->zones; | 887 | struct zone **z = zonelist->zones; |
888 | struct page *page = NULL; | 888 | struct page *page = NULL; |
889 | int classzone_idx = zone_idx(*z); | 889 | int classzone_idx = zone_idx(*z); |
890 | struct zone *zone; | ||
890 | 891 | ||
891 | /* | 892 | /* |
892 | * Go through the zonelist once, looking for a zone with enough free. | 893 | * Go through the zonelist once, looking for a zone with enough free. |
893 | * See also cpuset_zone_allowed() comment in kernel/cpuset.c. | 894 | * See also cpuset_zone_allowed() comment in kernel/cpuset.c. |
894 | */ | 895 | */ |
895 | do { | 896 | do { |
897 | zone = *z; | ||
896 | if (unlikely((gfp_mask & __GFP_THISNODE) && | 898 | if (unlikely((gfp_mask & __GFP_THISNODE) && |
897 | (*z)->zone_pgdat != zonelist->zones[0]->zone_pgdat)) | 899 | zone->zone_pgdat != zonelist->zones[0]->zone_pgdat)) |
898 | break; | 900 | break; |
899 | if ((alloc_flags & ALLOC_CPUSET) && | 901 | if ((alloc_flags & ALLOC_CPUSET) && |
900 | !cpuset_zone_allowed(*z, gfp_mask)) | 902 | !cpuset_zone_allowed(zone, gfp_mask)) |
901 | continue; | 903 | continue; |
902 | 904 | ||
903 | if (!(alloc_flags & ALLOC_NO_WATERMARKS)) { | 905 | if (!(alloc_flags & ALLOC_NO_WATERMARKS)) { |
904 | unsigned long mark; | 906 | unsigned long mark; |
905 | if (alloc_flags & ALLOC_WMARK_MIN) | 907 | if (alloc_flags & ALLOC_WMARK_MIN) |
906 | mark = (*z)->pages_min; | 908 | mark = zone->pages_min; |
907 | else if (alloc_flags & ALLOC_WMARK_LOW) | 909 | else if (alloc_flags & ALLOC_WMARK_LOW) |
908 | mark = (*z)->pages_low; | 910 | mark = zone->pages_low; |
909 | else | 911 | else |
910 | mark = (*z)->pages_high; | 912 | mark = zone->pages_high; |
911 | if (!zone_watermark_ok(*z, order, mark, | 913 | if (!zone_watermark_ok(zone , order, mark, |
912 | classzone_idx, alloc_flags)) | 914 | classzone_idx, alloc_flags)) |
913 | if (!zone_reclaim_mode || | 915 | if (!zone_reclaim_mode || |
914 | !zone_reclaim(*z, gfp_mask, order)) | 916 | !zone_reclaim(zone, gfp_mask, order)) |
915 | continue; | 917 | continue; |
916 | } | 918 | } |
917 | 919 | ||
918 | page = buffered_rmqueue(zonelist, *z, order, gfp_mask); | 920 | page = buffered_rmqueue(zonelist, zone, order, gfp_mask); |
919 | if (page) { | 921 | if (page) { |
920 | break; | 922 | break; |
921 | } | 923 | } |