diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-09-26 02:31:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:50 -0400 |
commit | 1192d526412b1b8ccb1493064cea06efc12c772b (patch) | |
tree | 8caa9e73ae1ead8d057ca6d273ed091c324e9ef9 | |
parent | bd1b1677b5d4f39deda068bf5cc43ce3aaec839f (diff) |
[PATCH] Cleanup: Add zone pointer to get_page_from_freelist
There are frequent references to *z in get_page_from_freelist.
Add an explicit zone variable that can be used in all these places.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-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 | } |