On Tue, 3 Mar 2020 21:22:25 +0100 Sebastian Andrzej Siewior [off-list ref] wrote:
Since commit
5bbe3547aa3ba ("mm: allow compaction of unevictable pages")
it is allowed to examine mlocked pages and compact them by default.
On -RT even minor pagefaults are problematic because it may take a few
100us to resolve them and until then the task is blocked.
Make compact_unevictable_allowed = 0 default and issue a warning on RT
if it is changed.
Fair enough, I guess.
quoted hunk ↗ jump to hunk
@@ -2572,6 +2577,26 @@ int proc_dointvec(struct ctl_table *table, int write,
return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
}
+#ifdef CONFIG_COMPACTION
+static int proc_dointvec_warn_RT_change(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos)
+{
+ int ret, old;
+
+ if (!IS_ENABLED(CONFIG_PREEMPT_RT) || !write)
+ return proc_dointvec(table, write, buffer, lenp, ppos);
+
+ old = *(int *)table->data;
+ ret = proc_dointvec(table, write, buffer, lenp, ppos);
+ if (ret)
+ return ret;
+ WARN_ONCE(old != *(int *)table->data, "sysctl attribute %s changed.",
+ table->procname);
The WARN will include a stack trace which just isn't interesting. A
pr_warn() would be better?
+ return ret;
+}
+#endif