compaction.c (da733563be5a9da26fe81d9f007262d00b846e22) compaction.c (31b8384a555d94c78e2ea2284a323cb985441f60)
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>

--- 351 unchanged lines hidden (view full) ---

360
361 /* Successfully isolated */
362 del_page_from_lru_list(zone, page, page_lru(page));
363 list_add(&page->lru, migratelist);
364 cc->nr_migratepages++;
365 nr_isolated++;
366
367 /* Avoid isolating too much */
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>

--- 351 unchanged lines hidden (view full) ---

360
361 /* Successfully isolated */
362 del_page_from_lru_list(zone, page, page_lru(page));
363 list_add(&page->lru, migratelist);
364 cc->nr_migratepages++;
365 nr_isolated++;
366
367 /* Avoid isolating too much */
368 if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)
368 if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) {
369 ++low_pfn;
369 break;
370 break;
371 }
370 }
371
372 acct_isolated(zone, cc);
373
374 spin_unlock_irq(&zone->lru_lock);
375 cc->migrate_pfn = low_pfn;
376
377 trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);

--- 338 unchanged lines hidden (view full) ---

716 void __user *buffer, size_t *length, loff_t *ppos)
717{
718 proc_dointvec_minmax(table, write, buffer, length, ppos);
719
720 return 0;
721}
722
723#if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
372 }
373
374 acct_isolated(zone, cc);
375
376 spin_unlock_irq(&zone->lru_lock);
377 cc->migrate_pfn = low_pfn;
378
379 trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);

--- 338 unchanged lines hidden (view full) ---

718 void __user *buffer, size_t *length, loff_t *ppos)
719{
720 proc_dointvec_minmax(table, write, buffer, length, ppos);
721
722 return 0;
723}
724
725#if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
724ssize_t sysfs_compact_node(struct sys_device *dev,
725 struct sysdev_attribute *attr,
726ssize_t sysfs_compact_node(struct device *dev,
727 struct device_attribute *attr,
726 const char *buf, size_t count)
727{
728 compact_node(dev->id);
729
730 return count;
731}
728 const char *buf, size_t count)
729{
730 compact_node(dev->id);
731
732 return count;
733}
732static SYSDEV_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node);
734static DEVICE_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node);
733
734int compaction_register_node(struct node *node)
735{
735
736int compaction_register_node(struct node *node)
737{
736 return sysdev_create_file(&node->sysdev, &attr_compact);
738 return device_create_file(&node->dev, &dev_attr_compact);
737}
738
739void compaction_unregister_node(struct node *node)
740{
739}
740
741void compaction_unregister_node(struct node *node)
742{
741 return sysdev_remove_file(&node->sysdev, &attr_compact);
743 return device_remove_file(&node->dev, &dev_attr_compact);
742}
743#endif /* CONFIG_SYSFS && CONFIG_NUMA */
744}
745#endif /* CONFIG_SYSFS && CONFIG_NUMA */