- admin_reserve_kbytes
- compact_memory
- compaction_proactiveness
+- compaction_proactiveness_leeway
- compact_unevictable_allowed
- dirty_background_bytes
- dirty_background_ratio
Be careful when setting it to extreme values like 100, as that may
cause excessive background compaction activity.
+compaction_proactiveness_leeway
+===============================
+
+This tunable controls the difference between high and low watermarks for
+proactive compaction. This tunable takes a value in the range [0, 100] with
+a default value of 10. Higher values will result in proactive compaction
+triggering less often but doing more work when it does trigger.
+
+Proactive compaction triggers when fragmentation score (lower is better) gets
+larger than high watermark. Compaction stops when the score gets smaller or
+equal to low watermark (or when no progress is being made).
+The watermarks are calculated as follows:
+
+low_wmark = 100 - compaction_proactiveness;
+high_wmark = low_wmark + compaction_proactiveness_leeway;
+
compact_unevictable_allowed
===========================
* background. It takes values in the range [0, 100].
*/
static unsigned int __read_mostly sysctl_compaction_proactiveness = 20;
+static unsigned int __read_mostly sysctl_compaction_proactiveness_leeway = 10;
static int sysctl_extfrag_threshold = 500;
static int __read_mostly sysctl_compact_memory;
* close to 100 (maximum).
*/
wmark_low = 100U - sysctl_compaction_proactiveness;
- return low ? wmark_low : min(wmark_low + 10, 100U);
+ return low ? wmark_low : min(wmark_low + sysctl_compaction_proactiveness_leeway, 100U);
}
static bool should_proactive_compact_node(pg_data_t *pgdat)
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE_HUNDRED,
},
+ {
+ .procname = "compaction_proactiveness_leeway",
+ .data = &sysctl_compaction_proactiveness_leeway,
+ .maxlen = sizeof(sysctl_compaction_proactiveness_leeway),
+ .mode = 0644,
+ .proc_handler = compaction_proactiveness_sysctl_handler,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE_HUNDRED,
+ },
{
.procname = "extfrag_threshold",
.data = &sysctl_extfrag_threshold,