All of
 help / color / mirror / Atom feed
From: Mel Gorman <>
To: Sebastian Andrzej Siewior <>
Cc: Andrew Morton <>,
	Vlastimil Babka <>,, Thomas Gleixner <>,
	Luis Chamberlain <>,
	Kees Cook <>,
	Iurii Zaikin <>,
	Linux API <>
Subject: Re: [PATCH 2/2 v3] mm/compaction: Disable compact_unevictable_allowed on RT
Date: Wed, 4 Mar 2020 09:11:59 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Mar 03, 2020 at 09:22:25PM +0100, Sebastian Andrzej Siewior 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.
> Link:
> Signed-off-by: Sebastian Andrzej Siewior <>

Acked-by: Mel Gorman <>

(caveat: I do not spend very much some on RT-specific topics)

While I ack'd this, an RT application using THP is playing with fire,
I know the RT extension for SLE explicitly disables it from being enabled
at kernel config time. At minimum the critical regions should be mlocked
followed by prctl to disable future THP faults that are non-deterministic,
both from an allocation point of view, and a TLB access point of view. It's
still reasonable to expect a smaller TLB reach for huge pages than
base pages.

It's a similar hazard with NUMA balancing, an RT application should either
disable balancing globally or set a memory policy that forces it to be
ignored. They should be doing this anyway to avoid non-deterministic
memory access costs due to NUMA artifacts but it wouldn't surprise me
if some applications got it wrong.  In that case, the SLE RT extension
disables balancing by default and it probably should warn if it's enabled
like this patch does.

It wouldn't surprise me to see patches like this in the future (completely
untested, illustrative only).

diff --git a/init/Kconfig b/init/Kconfig
index 452bc1835cd4..7a406e2b5580 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -797,7 +797,7 @@ config NUMA_BALANCING
 	bool "Automatically enable NUMA aware memory/task placement"
 	default y
-	depends on NUMA_BALANCING
 	  If set, automatic NUMA balancing will be enabled if running on a NUMA
diff --git a/mm/Kconfig b/mm/Kconfig
index ab80933be65f..313a5d794491 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -385,7 +385,7 @@ config TRANSPARENT_HUGEPAGE
 	prompt "Transparent Hugepage Support sysfs defaults"
 	  Selects the sysfs defaults for Transparent Hugepage Support.

I would hope that a user of an RT kernel with an RT-aware application
would be aware of this anyway but ..... uhhhh.

Point for Andrew is that I would not be too surprised if there were more
RT-specific checks in the future that sanity checked some configuration
options in response to RT-specific bugs that were down to insane
configurations (be they kernel configs or sysctls)

Mel Gorman

  parent reply	other threads:[~2020-03-04  9:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 16:10 [PATCH] mm/compaction: Disable compact_unevictable_allowed on RT Sebastian Andrzej Siewior
     [not found] ` <>
2020-01-15 22:04   ` Vlastimil Babka
2020-01-15 22:04     ` Vlastimil Babka
2020-01-16 10:22     ` Sebastian Andrzej Siewior
2020-03-02 17:35     ` [PATCH v2] " Sebastian Andrzej Siewior
2020-03-02 21:25       ` Andrew Morton
2020-03-03 17:59         ` Sebastian Andrzej Siewior
2020-03-03 20:20           ` [PATCH 1/2] =?UTF-8?q?mm/compaction:=20Really=20limit=20compact?= =?UTF-8?q?=5Funevictable=5Fallowed=20to=200=E2=80=A61?= Sebastian Andrzej Siewior
2020-03-03 20:22             ` [PATCH 2/2 v3] mm/compaction: Disable compact_unevictable_allowed on RT Sebastian Andrzej Siewior
2020-03-03 23:56               ` Andrew Morton
2020-03-04  8:19                 ` Vlastimil Babka
2020-03-04  9:27                   ` Sebastian Andrzej Siewior
2020-03-19 16:39                 ` [PATCH 2/2 v4] " Sebastian Andrzej Siewior
2020-03-19 16:49                   ` Vlastimil Babka
2020-03-19 16:55                     ` [PATCH 2/2 v5] " Sebastian Andrzej Siewior
2020-03-04  8:18               ` [PATCH 2/2 v3] " Vlastimil Babka
2020-03-04  9:25                 ` Sebastian Andrzej Siewior
2020-03-04  9:11               ` Mel Gorman [this message]
2020-03-04  8:12             ` [PATCH 1/2] mm/compaction: Really limit compact_unevictable_allowed to 0…1 Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.