[Bluetooth]: Workaround for inquiry results with RSSI and page scan mode
[pandora-kernel.git] / mm / page_alloc.c
index 3c9f7f8..8d08837 100644 (file)
@@ -897,12 +897,6 @@ rebalance:
        cond_resched();
 
        if (likely(did_some_progress)) {
-               /*
-                * Go through the zonelist yet one more time, keep
-                * very high watermark here, this is only to catch
-                * a parallel oom killing, we must fail if we're still
-                * under heavy pressure.
-                */
                for (i = 0; (z = zones[i]) != NULL; i++) {
                        if (!zone_watermark_ok(z, order, z->pages_min,
                                               classzone_idx, can_try_harder,
@@ -936,7 +930,7 @@ rebalance:
                                goto got_pg;
                }
 
-               out_of_memory(gfp_mask);
+               out_of_memory(gfp_mask, order);
                goto restart;
        }
 
@@ -1067,20 +1061,19 @@ unsigned int nr_free_pages_pgdat(pg_data_t *pgdat)
 
 static unsigned int nr_free_zone_pages(int offset)
 {
-       pg_data_t *pgdat;
+       /* Just pick one node, since fallback list is circular */
+       pg_data_t *pgdat = NODE_DATA(numa_node_id());
        unsigned int sum = 0;
 
-       for_each_pgdat(pgdat) {
-               struct zonelist *zonelist = pgdat->node_zonelists + offset;
-               struct zone **zonep = zonelist->zones;
-               struct zone *zone;
+       struct zonelist *zonelist = pgdat->node_zonelists + offset;
+       struct zone **zonep = zonelist->zones;
+       struct zone *zone;
 
-               for (zone = *zonep++; zone; zone = *zonep++) {
-                       unsigned long size = zone->present_pages;
-                       unsigned long high = zone->pages_high;
-                       if (size > high)
-                               sum += size - high;
-               }
+       for (zone = *zonep++; zone; zone = *zonep++) {
+               unsigned long size = zone->present_pages;
+               unsigned long high = zone->pages_high;
+               if (size > high)
+                       sum += size - high;
        }
 
        return sum;
@@ -1867,7 +1860,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
                unsigned long *zones_size, unsigned long *zholes_size)
 {
        unsigned long i, j;
-       const unsigned long zone_required_alignment = 1UL << (MAX_ORDER-1);
        int cpu, nid = pgdat->node_id;
        unsigned long zone_start_pfn = pgdat->node_start_pfn;
 
@@ -1940,9 +1932,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
                zone->zone_mem_map = pfn_to_page(zone_start_pfn);
                zone->zone_start_pfn = zone_start_pfn;
 
-               if ((zone_start_pfn) & (zone_required_alignment-1))
-                       printk(KERN_CRIT "BUG: wrong zone alignment, it will crash\n");
-
                memmap_init(size, nid, j, zone_start_pfn);
 
                zonetable_add(zone, nid, j, zone_start_pfn, size);