From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9DA9C33CB1 for ; Wed, 15 Jan 2020 16:10:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C47F207FF for ; Wed, 15 Jan 2020 16:10:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C47F207FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E6BCE8E0007; Wed, 15 Jan 2020 11:10:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF5608E0006; Wed, 15 Jan 2020 11:10:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0A648E0007; Wed, 15 Jan 2020 11:10:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id BB5568E0006 for ; Wed, 15 Jan 2020 11:10:47 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 6B29A180AD802 for ; Wed, 15 Jan 2020 16:10:47 +0000 (UTC) X-FDA: 76380356934.19.sofa33_5e226e68c2f3b X-HE-Tag: sofa33_5e226e68c2f3b X-Filterd-Recvd-Size: 2874 Received: from Galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 16:10:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=flow.W.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1irlFj-0003KS-RW; Wed, 15 Jan 2020 17:10:43 +0100 From: Sebastian Andrzej Siewior To: linux-mm@kvack.org Cc: Thomas Gleixner , Vlastimil Babka , Andrew Morton , Luis Chamberlain , Kees Cook , Iurii Zaikin , Sebastian Andrzej Siewior Subject: [PATCH] mm/compaction: Disable compact_unevictable_allowed on RT Date: Wed, 15 Jan 2020 17:10:35 +0100 Message-Id: <20200115161035.893221-1-bigeasy@linutronix.de> X-Mailer: git-send-email 2.25.0.rc2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 =3D 0 default and remove it from /proc on RT. Link: https://lore.kernel.org/linux-mm/20190710144138.qyn4tuttdq6h7kqx@linu= tronix.de/ Signed-off-by: Sebastian Andrzej Siewior --- kernel/sysctl.c | 3 ++- mm/compaction.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 70665934d53e2..d08bd51a0fbc3 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1488,6 +1488,7 @@ static struct ctl_table vm_table[] =3D { .extra1 =3D &min_extfrag_threshold, .extra2 =3D &max_extfrag_threshold, }, +#ifndef CONFIG_PREEMPT_RT { .procname =3D "compact_unevictable_allowed", .data =3D &sysctl_compact_unevictable_allowed, @@ -1497,7 +1498,7 @@ static struct ctl_table vm_table[] =3D { .extra1 =3D SYSCTL_ZERO, .extra2 =3D SYSCTL_ONE, }, - +#endif #endif /* CONFIG_COMPACTION */ { .procname =3D "min_free_kbytes", diff --git a/mm/compaction.c b/mm/compaction.c index 672d3c78c6abf..b2c804c35ae56 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1590,7 +1590,11 @@ typedef enum { * Allow userspace to control policy on scanning the unevictable LRU for * compactable pages. */ +#ifdef CONFIG_PREEMPT_RT +#define sysctl_compact_unevictable_allowed 0 +#else int sysctl_compact_unevictable_allowed __read_mostly =3D 1; +#endif =20 static inline void update_fast_start_pfn(struct compact_control *cc, unsigned long pfn) --=20 2.25.0.rc2