diff options
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 9583e193dc47..94cce51b0b35 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -433,6 +433,8 @@ static unsigned long compact_zone_order(struct zone *zone, | |||
433 | return compact_zone(zone, &cc); | 433 | return compact_zone(zone, &cc); |
434 | } | 434 | } |
435 | 435 | ||
436 | int sysctl_extfrag_threshold = 500; | ||
437 | |||
436 | /** | 438 | /** |
437 | * try_to_compact_pages - Direct compact to satisfy a high-order allocation | 439 | * try_to_compact_pages - Direct compact to satisfy a high-order allocation |
438 | * @zonelist: The zonelist used for the current allocation | 440 | * @zonelist: The zonelist used for the current allocation |
@@ -491,7 +493,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
491 | * Only compact if a failure would be due to fragmentation. | 493 | * Only compact if a failure would be due to fragmentation. |
492 | */ | 494 | */ |
493 | fragindex = fragmentation_index(zone, order); | 495 | fragindex = fragmentation_index(zone, order); |
494 | if (fragindex >= 0 && fragindex <= 500) | 496 | if (fragindex >= 0 && fragindex <= sysctl_extfrag_threshold) |
495 | continue; | 497 | continue; |
496 | 498 | ||
497 | if (fragindex == -1 && zone_watermark_ok(zone, order, watermark, 0, 0)) { | 499 | if (fragindex == -1 && zone_watermark_ok(zone, order, watermark, 0, 0)) { |
@@ -572,6 +574,14 @@ int sysctl_compaction_handler(struct ctl_table *table, int write, | |||
572 | return 0; | 574 | return 0; |
573 | } | 575 | } |
574 | 576 | ||
577 | int sysctl_extfrag_handler(struct ctl_table *table, int write, | ||
578 | void __user *buffer, size_t *length, loff_t *ppos) | ||
579 | { | ||
580 | proc_dointvec_minmax(table, write, buffer, length, ppos); | ||
581 | |||
582 | return 0; | ||
583 | } | ||
584 | |||
575 | #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) | 585 | #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) |
576 | ssize_t sysfs_compact_node(struct sys_device *dev, | 586 | ssize_t sysfs_compact_node(struct sys_device *dev, |
577 | struct sysdev_attribute *attr, | 587 | struct sysdev_attribute *attr, |