compaction.c (602605a42ea4c299aeed4d806c49fb9dd18cd204) | compaction.c (b2eef8c0d09101bbbff2531c097543aedde0b525) |
---|---|
1/* 2 * linux/mm/compaction.c 3 * 4 * Memory compaction for the reduction of external fragmentation. Note that 5 * this heavily depends upon page migration to do all the real heavy 6 * lifting 7 * 8 * Copyright IBM Corp. 2007-2010 Mel Gorman <mel@csn.ul.ie> --- 263 unchanged lines hidden (view full) --- 272 while (unlikely(too_many_isolated(zone))) { 273 congestion_wait(BLK_RW_ASYNC, HZ/10); 274 275 if (fatal_signal_pending(current)) 276 return 0; 277 } 278 279 /* Time to isolate some pages for migration */ | 1/* 2 * linux/mm/compaction.c 3 * 4 * Memory compaction for the reduction of external fragmentation. Note that 5 * this heavily depends upon page migration to do all the real heavy 6 * lifting 7 * 8 * Copyright IBM Corp. 2007-2010 Mel Gorman <mel@csn.ul.ie> --- 263 unchanged lines hidden (view full) --- 272 while (unlikely(too_many_isolated(zone))) { 273 congestion_wait(BLK_RW_ASYNC, HZ/10); 274 275 if (fatal_signal_pending(current)) 276 return 0; 277 } 278 279 /* Time to isolate some pages for migration */ |
280 cond_resched(); |
|
280 spin_lock_irq(&zone->lru_lock); 281 for (; low_pfn < end_pfn; low_pfn++) { 282 struct page *page; | 281 spin_lock_irq(&zone->lru_lock); 282 for (; low_pfn < end_pfn; low_pfn++) { 283 struct page *page; |
284 bool locked = true; 285 286 /* give a chance to irqs before checking need_resched() */ 287 if (!((low_pfn+1) % SWAP_CLUSTER_MAX)) { 288 spin_unlock_irq(&zone->lru_lock); 289 locked = false; 290 } 291 if (need_resched() || spin_is_contended(&zone->lru_lock)) { 292 if (locked) 293 spin_unlock_irq(&zone->lru_lock); 294 cond_resched(); 295 spin_lock_irq(&zone->lru_lock); 296 if (fatal_signal_pending(current)) 297 break; 298 } else if (!locked) 299 spin_lock_irq(&zone->lru_lock); 300 |
|
283 if (!pfn_valid_within(low_pfn)) 284 continue; 285 nr_scanned++; 286 287 /* Get the page and skip if free */ 288 page = pfn_to_page(low_pfn); 289 if (PageBuddy(page)) 290 continue; --- 407 unchanged lines hidden --- | 301 if (!pfn_valid_within(low_pfn)) 302 continue; 303 nr_scanned++; 304 305 /* Get the page and skip if free */ 306 page = pfn_to_page(low_pfn); 307 if (PageBuddy(page)) 308 continue; --- 407 unchanged lines hidden --- |