2 * linux/mm/compaction.c
4 * Memory compaction for the reduction of external fragmentation. Note that
5 * this heavily depends upon page migration to do all the real heavy
8 * Copyright IBM Corp. 2007-2010 Mel Gorman <mel@csn.ul.ie>
10 #include <linux/swap.h>
11 #include <linux/migrate.h>
12 #include <linux/compaction.h>
13 #include <linux/mm_inline.h>
14 #include <linux/backing-dev.h>
15 #include <linux/sysctl.h>
16 #include <linux/sysfs.h>
19 #define CREATE_TRACE_POINTS
20 #include <trace/events/compaction.h>
23 * compact_control is used to track pages being migrated and the free pages
24 * they are being migrated to during memory compaction. The free_pfn starts
25 * at the end of a zone and migrate_pfn begins at the start. Movable pages
26 * are moved to the end of a zone during a compaction run and the run
27 * completes when free_pfn <= migrate_pfn
29 struct compact_control {
30 struct list_head freepages; /* List of free pages to migrate to */
31 struct list_head migratepages; /* List of pages being migrated */
32 unsigned long nr_freepages; /* Number of isolated free pages */
33 unsigned long nr_migratepages; /* Number of pages to migrate */
34 unsigned long free_pfn; /* isolate_freepages search base */
35 unsigned long migrate_pfn; /* isolate_migratepages search base */
36 bool sync; /* Synchronous migration */
38 int order; /* order a direct compactor needs */
39 int migratetype; /* MOVABLE, RECLAIMABLE etc */
43 static unsigned long release_freepages(struct list_head *freelist)
45 struct page *page, *next;
46 unsigned long count = 0;
48 list_for_each_entry_safe(page, next, freelist, lru) {
58 * Isolate free pages onto a private freelist. Caller must hold zone->lock.
59 * If @strict is true, will abort returning 0 on any invalid PFNs or non-free
60 * pages inside of the pageblock (even though it may still end up isolating
63 static unsigned long isolate_freepages_block(unsigned long blockpfn,
64 unsigned long end_pfn,
65 struct list_head *freelist,
68 int nr_scanned = 0, total_isolated = 0;
71 cursor = pfn_to_page(blockpfn);
73 /* Isolate free pages. This assumes the block is valid */
74 for (; blockpfn < end_pfn; blockpfn++, cursor++) {
76 struct page *page = cursor;
78 if (!pfn_valid_within(blockpfn)) {
85 if (!PageBuddy(page)) {
91 /* Found a free page, break it into order-0 pages */
92 isolated = split_free_page(page);
93 if (!isolated && strict)
95 total_isolated += isolated;
96 for (i = 0; i < isolated; i++) {
97 list_add(&page->lru, freelist);
101 /* If a page was split, advance to the end of it */
103 blockpfn += isolated - 1;
104 cursor += isolated - 1;
108 trace_mm_compaction_isolate_freepages(nr_scanned, total_isolated);
109 return total_isolated;
113 * isolate_freepages_range() - isolate free pages.
114 * @start_pfn: The first PFN to start isolating.
115 * @end_pfn: The one-past-last PFN.
117 * Non-free pages, invalid PFNs, or zone boundaries within the
118 * [start_pfn, end_pfn) range are considered errors, cause function to
119 * undo its actions and return zero.
121 * Otherwise, function returns one-past-the-last PFN of isolated page
122 * (which may be greater then end_pfn if end fell in a middle of
126 isolate_freepages_range(unsigned long start_pfn, unsigned long end_pfn)
128 unsigned long isolated, pfn, block_end_pfn, flags;
129 struct zone *zone = NULL;
132 if (pfn_valid(start_pfn))
133 zone = page_zone(pfn_to_page(start_pfn));
135 for (pfn = start_pfn; pfn < end_pfn; pfn += isolated) {
136 if (!pfn_valid(pfn) || zone != page_zone(pfn_to_page(pfn)))
140 * On subsequent iterations ALIGN() is actually not needed,
141 * but we keep it that we not to complicate the code.
143 block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages);
144 block_end_pfn = min(block_end_pfn, end_pfn);
146 spin_lock_irqsave(&zone->lock, flags);
147 isolated = isolate_freepages_block(pfn, block_end_pfn,
149 spin_unlock_irqrestore(&zone->lock, flags);
152 * In strict mode, isolate_freepages_block() returns 0 if
153 * there are any holes in the block (ie. invalid PFNs or
160 * If we managed to isolate pages, it is always (1 << n) *
161 * pageblock_nr_pages for some non-negative n. (Max order
162 * page may span two pageblocks).
166 /* split_free_page does not map the pages */
167 map_pages(&freelist);
170 /* Loop terminated early, cleanup. */
171 release_freepages(&freelist);
175 /* We don't use freelists for anything. */
179 /* Returns true if the page is within a block suitable for migration to */
180 static bool suitable_migration_target(struct page *page)
183 int migratetype = get_pageblock_migratetype(page);
185 /* Don't interfere with memory hot-remove or the min_free_kbytes blocks */
186 if (migratetype == MIGRATE_ISOLATE || migratetype == MIGRATE_RESERVE)
189 /* If the page is a large free page, then allow migration */
190 if (PageBuddy(page) && page_order(page) >= pageblock_order)
193 /* If the block is MIGRATE_MOVABLE, allow migration */
194 if (migratetype == MIGRATE_MOVABLE)
197 /* Otherwise skip the block */
201 static void map_pages(struct list_head *list)
205 list_for_each_entry(page, list, lru) {
206 arch_alloc_page(page, 0);
207 kernel_map_pages(page, 1, 1);
212 * Based on information in the current compact_control, find blocks
213 * suitable for isolating free pages from and then isolate them.
215 static void isolate_freepages(struct zone *zone,
216 struct compact_control *cc)
219 unsigned long high_pfn, low_pfn, pfn, zone_end_pfn, end_pfn;
221 int nr_freepages = cc->nr_freepages;
222 struct list_head *freelist = &cc->freepages;
225 * Initialise the free scanner. The starting point is where we last
226 * scanned from (or the end of the zone if starting). The low point
227 * is the end of the pageblock the migration scanner is using.
230 low_pfn = cc->migrate_pfn + pageblock_nr_pages;
233 * Take care that if the migration scanner is at the end of the zone
234 * that the free scanner does not accidentally move to the next zone
235 * in the next isolation cycle.
237 high_pfn = min(low_pfn, pfn);
239 zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
242 * Isolate free pages until enough are available to migrate the
243 * pages on cc->migratepages. We stop searching if the migrate
244 * and free page scanners meet or enough free pages are isolated.
246 for (; pfn > low_pfn && cc->nr_migratepages > nr_freepages;
247 pfn -= pageblock_nr_pages) {
248 unsigned long isolated;
254 * Check for overlapping nodes/zones. It's possible on some
255 * configurations to have a setup like
257 * i.e. it's possible that all pages within a zones range of
258 * pages do not belong to a single zone.
260 page = pfn_to_page(pfn);
261 if (page_zone(page) != zone)
264 /* Check the block is suitable for migration */
265 if (!suitable_migration_target(page))
269 * Found a block suitable for isolating free pages from. Now
270 * we disabled interrupts, double check things are ok and
271 * isolate the pages. This is to minimise the time IRQs
275 spin_lock_irqsave(&zone->lock, flags);
276 if (suitable_migration_target(page)) {
277 end_pfn = min(pfn + pageblock_nr_pages, zone_end_pfn);
278 isolated = isolate_freepages_block(pfn, end_pfn,
280 nr_freepages += isolated;
282 spin_unlock_irqrestore(&zone->lock, flags);
285 * Record the highest PFN we isolated pages from. When next
286 * looking for free pages, the search will restart here as
287 * page migration may have returned some pages to the allocator
290 high_pfn = max(high_pfn, pfn);
293 /* split_free_page does not map the pages */
296 cc->free_pfn = high_pfn;
297 cc->nr_freepages = nr_freepages;
300 /* Update the number of anon and file isolated pages in the zone */
301 static void acct_isolated(struct zone *zone, struct compact_control *cc)
304 unsigned int count[2] = { 0, };
306 list_for_each_entry(page, &cc->migratepages, lru)
307 count[!!page_is_file_cache(page)]++;
309 __mod_zone_page_state(zone, NR_ISOLATED_ANON, count[0]);
310 __mod_zone_page_state(zone, NR_ISOLATED_FILE, count[1]);
313 /* Similar to reclaim, but different enough that they don't share logic */
314 static bool too_many_isolated(struct zone *zone)
316 unsigned long active, inactive, isolated;
318 inactive = zone_page_state(zone, NR_INACTIVE_FILE) +
319 zone_page_state(zone, NR_INACTIVE_ANON);
320 active = zone_page_state(zone, NR_ACTIVE_FILE) +
321 zone_page_state(zone, NR_ACTIVE_ANON);
322 isolated = zone_page_state(zone, NR_ISOLATED_FILE) +
323 zone_page_state(zone, NR_ISOLATED_ANON);
325 return isolated > (inactive + active) / 2;
328 /* possible outcome of isolate_migratepages */
330 ISOLATE_ABORT, /* Abort compaction now */
331 ISOLATE_NONE, /* No pages isolated, continue scanning */
332 ISOLATE_SUCCESS, /* Pages isolated, migrate */
336 * isolate_migratepages_range() - isolate all migrate-able pages in range.
337 * @zone: Zone pages are in.
338 * @cc: Compaction control structure.
339 * @low_pfn: The first PFN of the range.
340 * @end_pfn: The one-past-the-last PFN of the range.
342 * Isolate all pages that can be migrated from the range specified by
343 * [low_pfn, end_pfn). Returns zero if there is a fatal signal
344 * pending), otherwise PFN of the first page that was not scanned
345 * (which may be both less, equal to or more then end_pfn).
347 * Assumes that cc->migratepages is empty and cc->nr_migratepages is
350 * Apart from cc->migratepages and cc->nr_migratetypes this function
351 * does not modify any cc's fields, in particular it does not modify
352 * (or read for that matter) cc->migrate_pfn.
355 isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
356 unsigned long low_pfn, unsigned long end_pfn)
358 unsigned long last_pageblock_nr = 0, pageblock_nr;
359 unsigned long nr_scanned = 0, nr_isolated = 0;
360 struct list_head *migratelist = &cc->migratepages;
361 isolate_mode_t mode = ISOLATE_ACTIVE|ISOLATE_INACTIVE;
364 * Ensure that there are not too many pages isolated from the LRU
365 * list by either parallel reclaimers or compaction. If there are,
366 * delay for some time until fewer pages are isolated
368 while (unlikely(too_many_isolated(zone))) {
369 /* async migration should just abort */
373 congestion_wait(BLK_RW_ASYNC, HZ/10);
375 if (fatal_signal_pending(current))
379 /* Time to isolate some pages for migration */
381 spin_lock_irq(&zone->lru_lock);
382 for (; low_pfn < end_pfn; low_pfn++) {
386 /* give a chance to irqs before checking need_resched() */
387 if (!((low_pfn+1) % SWAP_CLUSTER_MAX)) {
388 spin_unlock_irq(&zone->lru_lock);
391 if (need_resched() || spin_is_contended(&zone->lru_lock)) {
393 spin_unlock_irq(&zone->lru_lock);
395 spin_lock_irq(&zone->lru_lock);
396 if (fatal_signal_pending(current))
399 spin_lock_irq(&zone->lru_lock);
402 * migrate_pfn does not necessarily start aligned to a
403 * pageblock. Ensure that pfn_valid is called when moving
404 * into a new MAX_ORDER_NR_PAGES range in case of large
405 * memory holes within the zone
407 if ((low_pfn & (MAX_ORDER_NR_PAGES - 1)) == 0) {
408 if (!pfn_valid(low_pfn)) {
409 low_pfn += MAX_ORDER_NR_PAGES - 1;
414 if (!pfn_valid_within(low_pfn))
419 * Get the page and ensure the page is within the same zone.
420 * See the comment in isolate_freepages about overlapping
421 * nodes. It is deliberate that the new zone lock is not taken
422 * as memory compaction should not move pages between nodes.
424 page = pfn_to_page(low_pfn);
425 if (page_zone(page) != zone)
433 * For async migration, also only scan in MOVABLE blocks. Async
434 * migration is optimistic to see if the minimum amount of work
435 * satisfies the allocation
437 pageblock_nr = low_pfn >> pageblock_order;
438 if (!cc->sync && last_pageblock_nr != pageblock_nr &&
439 get_pageblock_migratetype(page) != MIGRATE_MOVABLE) {
440 low_pfn += pageblock_nr_pages;
441 low_pfn = ALIGN(low_pfn, pageblock_nr_pages) - 1;
442 last_pageblock_nr = pageblock_nr;
450 * PageLRU is set, and lru_lock excludes isolation,
451 * splitting and collapsing (collapsing has already
452 * happened if PageLRU is set).
454 if (PageTransHuge(page)) {
455 low_pfn += (1 << compound_order(page)) - 1;
460 mode |= ISOLATE_ASYNC_MIGRATE;
462 /* Try isolate the page */
463 if (__isolate_lru_page(page, mode, 0) != 0)
466 VM_BUG_ON(PageTransCompound(page));
468 /* Successfully isolated */
469 del_page_from_lru_list(zone, page, page_lru(page));
470 list_add(&page->lru, migratelist);
471 cc->nr_migratepages++;
474 /* Avoid isolating too much */
475 if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) {
481 acct_isolated(zone, cc);
483 spin_unlock_irq(&zone->lru_lock);
485 trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);
491 * Isolate all pages that can be migrated from the block pointed to by
492 * the migrate scanner within compact_control.
494 static isolate_migrate_t isolate_migratepages(struct zone *zone,
495 struct compact_control *cc)
497 unsigned long low_pfn, end_pfn;
499 /* Do not scan outside zone boundaries */
500 low_pfn = max(cc->migrate_pfn, zone->zone_start_pfn);
502 /* Only scan within a pageblock boundary */
503 end_pfn = ALIGN(low_pfn + pageblock_nr_pages, pageblock_nr_pages);
505 /* Do not cross the free scanner or scan within a memory hole */
506 if (end_pfn > cc->free_pfn || !pfn_valid(low_pfn)) {
507 cc->migrate_pfn = end_pfn;
511 /* Perform the isolation */
512 low_pfn = isolate_migratepages_range(zone, cc, low_pfn, end_pfn);
514 return ISOLATE_ABORT;
516 cc->migrate_pfn = low_pfn;
518 return ISOLATE_SUCCESS;
522 * This is a migrate-callback that "allocates" freepages by taking pages
523 * from the isolated freelists in the block we are migrating to.
525 static struct page *compaction_alloc(struct page *migratepage,
529 struct compact_control *cc = (struct compact_control *)data;
530 struct page *freepage;
532 /* Isolate free pages if necessary */
533 if (list_empty(&cc->freepages)) {
534 isolate_freepages(cc->zone, cc);
536 if (list_empty(&cc->freepages))
540 freepage = list_entry(cc->freepages.next, struct page, lru);
541 list_del(&freepage->lru);
548 * We cannot control nr_migratepages and nr_freepages fully when migration is
549 * running as migrate_pages() has no knowledge of compact_control. When
550 * migration is complete, we count the number of pages on the lists by hand.
552 static void update_nr_listpages(struct compact_control *cc)
554 int nr_migratepages = 0;
555 int nr_freepages = 0;
558 list_for_each_entry(page, &cc->migratepages, lru)
560 list_for_each_entry(page, &cc->freepages, lru)
563 cc->nr_migratepages = nr_migratepages;
564 cc->nr_freepages = nr_freepages;
567 static int compact_finished(struct zone *zone,
568 struct compact_control *cc)
571 unsigned long watermark;
573 if (fatal_signal_pending(current))
574 return COMPACT_PARTIAL;
576 /* Compaction run completes if the migrate and free scanner meet */
577 if (cc->free_pfn <= cc->migrate_pfn)
578 return COMPACT_COMPLETE;
581 * order == -1 is expected when compacting via
582 * /proc/sys/vm/compact_memory
585 return COMPACT_CONTINUE;
587 /* Compaction run is not finished if the watermark is not met */
588 watermark = low_wmark_pages(zone);
589 watermark += (1 << cc->order);
591 if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0))
592 return COMPACT_CONTINUE;
594 /* Direct compactor: Is a suitable page free? */
595 for (order = cc->order; order < MAX_ORDER; order++) {
596 /* Job done if page is free of the right migratetype */
597 if (!list_empty(&zone->free_area[order].free_list[cc->migratetype]))
598 return COMPACT_PARTIAL;
600 /* Job done if allocation would set block type */
601 if (order >= pageblock_order && zone->free_area[order].nr_free)
602 return COMPACT_PARTIAL;
605 return COMPACT_CONTINUE;
609 * compaction_suitable: Is this suitable to run compaction on this zone now?
611 * COMPACT_SKIPPED - If there are too few free pages for compaction
612 * COMPACT_PARTIAL - If the allocation would succeed without compaction
613 * COMPACT_CONTINUE - If compaction should run now
615 unsigned long compaction_suitable(struct zone *zone, int order)
618 unsigned long watermark;
621 * order == -1 is expected when compacting via
622 * /proc/sys/vm/compact_memory
625 return COMPACT_CONTINUE;
628 * Watermarks for order-0 must be met for compaction. Note the 2UL.
629 * This is because during migration, copies of pages need to be
630 * allocated and for a short time, the footprint is higher
632 watermark = low_wmark_pages(zone) + (2UL << order);
633 if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
634 return COMPACT_SKIPPED;
637 * fragmentation index determines if allocation failures are due to
638 * low memory or external fragmentation
640 * index of -1000 implies allocations might succeed depending on
642 * index towards 0 implies failure is due to lack of memory
643 * index towards 1000 implies failure is due to fragmentation
645 * Only compact if a failure would be due to fragmentation.
647 fragindex = fragmentation_index(zone, order);
648 if (fragindex >= 0 && fragindex <= sysctl_extfrag_threshold)
649 return COMPACT_SKIPPED;
651 if (fragindex == -1000 && zone_watermark_ok(zone, order, watermark,
653 return COMPACT_PARTIAL;
655 return COMPACT_CONTINUE;
658 static int compact_zone(struct zone *zone, struct compact_control *cc)
662 ret = compaction_suitable(zone, cc->order);
664 case COMPACT_PARTIAL:
665 case COMPACT_SKIPPED:
666 /* Compaction is likely to fail */
668 case COMPACT_CONTINUE:
669 /* Fall through to compaction */
673 /* Setup to move all movable pages to the end of the zone */
674 cc->migrate_pfn = zone->zone_start_pfn;
675 cc->free_pfn = cc->migrate_pfn + zone->spanned_pages;
676 cc->free_pfn &= ~(pageblock_nr_pages-1);
678 migrate_prep_local();
680 while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) {
681 unsigned long nr_migrate, nr_remaining;
684 switch (isolate_migratepages(zone, cc)) {
686 ret = COMPACT_PARTIAL;
690 case ISOLATE_SUCCESS:
694 nr_migrate = cc->nr_migratepages;
695 err = migrate_pages(&cc->migratepages, compaction_alloc,
696 (unsigned long)cc, false,
697 cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC);
698 update_nr_listpages(cc);
699 nr_remaining = cc->nr_migratepages;
701 count_vm_event(COMPACTBLOCKS);
702 count_vm_events(COMPACTPAGES, nr_migrate - nr_remaining);
704 count_vm_events(COMPACTPAGEFAILED, nr_remaining);
705 trace_mm_compaction_migratepages(nr_migrate - nr_remaining,
708 /* Release LRU pages not migrated */
710 putback_lru_pages(&cc->migratepages);
711 cc->nr_migratepages = 0;
717 /* Release free pages and check accounting */
718 cc->nr_freepages -= release_freepages(&cc->freepages);
719 VM_BUG_ON(cc->nr_freepages != 0);
724 static unsigned long compact_zone_order(struct zone *zone,
725 int order, gfp_t gfp_mask,
728 struct compact_control cc = {
730 .nr_migratepages = 0,
732 .migratetype = allocflags_to_migratetype(gfp_mask),
736 INIT_LIST_HEAD(&cc.freepages);
737 INIT_LIST_HEAD(&cc.migratepages);
739 return compact_zone(zone, &cc);
742 int sysctl_extfrag_threshold = 500;
745 * try_to_compact_pages - Direct compact to satisfy a high-order allocation
746 * @zonelist: The zonelist used for the current allocation
747 * @order: The order of the current allocation
748 * @gfp_mask: The GFP mask of the current allocation
749 * @nodemask: The allowed nodes to allocate from
750 * @sync: Whether migration is synchronous or not
752 * This is the main entry point for direct page compaction.
754 unsigned long try_to_compact_pages(struct zonelist *zonelist,
755 int order, gfp_t gfp_mask, nodemask_t *nodemask,
758 enum zone_type high_zoneidx = gfp_zone(gfp_mask);
759 int may_enter_fs = gfp_mask & __GFP_FS;
760 int may_perform_io = gfp_mask & __GFP_IO;
763 int rc = COMPACT_SKIPPED;
766 * Check whether it is worth even starting compaction. The order check is
767 * made because an assumption is made that the page allocator can satisfy
768 * the "cheaper" orders without taking special steps
770 if (!order || !may_enter_fs || !may_perform_io)
773 count_vm_event(COMPACTSTALL);
775 /* Compact each zone in the list */
776 for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx,
780 status = compact_zone_order(zone, order, gfp_mask, sync);
781 rc = max(status, rc);
783 /* If a normal allocation would succeed, stop compacting */
784 if (zone_watermark_ok(zone, order, low_wmark_pages(zone), 0, 0))
792 /* Compact all zones within a node */
793 static int __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
798 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
800 zone = &pgdat->node_zones[zoneid];
801 if (!populated_zone(zone))
804 cc->nr_freepages = 0;
805 cc->nr_migratepages = 0;
807 INIT_LIST_HEAD(&cc->freepages);
808 INIT_LIST_HEAD(&cc->migratepages);
810 if (cc->order == -1 || !compaction_deferred(zone, cc->order))
811 compact_zone(zone, cc);
814 int ok = zone_watermark_ok(zone, cc->order,
815 low_wmark_pages(zone), 0, 0);
816 if (ok && cc->order > zone->compact_order_failed)
817 zone->compact_order_failed = cc->order + 1;
818 /* Currently async compaction is never deferred. */
819 else if (!ok && cc->sync)
820 defer_compaction(zone, cc->order);
823 VM_BUG_ON(!list_empty(&cc->freepages));
824 VM_BUG_ON(!list_empty(&cc->migratepages));
830 int compact_pgdat(pg_data_t *pgdat, int order)
832 struct compact_control cc = {
837 return __compact_pgdat(pgdat, &cc);
840 static int compact_node(int nid)
842 struct compact_control cc = {
847 return __compact_pgdat(NODE_DATA(nid), &cc);
850 /* Compact all nodes in the system */
851 static int compact_nodes(void)
855 /* Flush pending updates to the LRU lists */
858 for_each_online_node(nid)
861 return COMPACT_COMPLETE;
864 /* The written value is actually unused, all memory is compacted */
865 int sysctl_compact_memory;
867 /* This is the entry point for compacting all nodes via /proc/sys/vm */
868 int sysctl_compaction_handler(struct ctl_table *table, int write,
869 void __user *buffer, size_t *length, loff_t *ppos)
872 return compact_nodes();
877 int sysctl_extfrag_handler(struct ctl_table *table, int write,
878 void __user *buffer, size_t *length, loff_t *ppos)
880 proc_dointvec_minmax(table, write, buffer, length, ppos);
885 #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
886 ssize_t sysfs_compact_node(struct device *dev,
887 struct device_attribute *attr,
888 const char *buf, size_t count)
892 if (nid >= 0 && nid < nr_node_ids && node_online(nid)) {
893 /* Flush pending updates to the LRU lists */
901 static DEVICE_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node);
903 int compaction_register_node(struct node *node)
905 return device_create_file(&node->dev, &dev_attr_compact);
908 void compaction_unregister_node(struct node *node)
910 return device_remove_file(&node->dev, &dev_attr_compact);
912 #endif /* CONFIG_SYSFS && CONFIG_NUMA */