From patchwork Wed Jan 15 16:10:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 11335251 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4E2613BD 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 BC375214AF for ; Wed, 15 Jan 2020 16:10:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC375214AF 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DF5608E0006; Wed, 15 Jan 2020 11:10:47 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 2,0,0,77ff6df517d0139a,d41d8cd98f00b204,bigeasy@linutronix.de,::tglx@linutronix.de:vbabka@suse.cz:akpm@linux-foundation.org:mcgrof@kernel.org:keescook@chromium.org:yzaikin@google.com:bigeasy@linutronix.de,RULES_HIT:41:355:379:541:800:960:966:967:968:973:988:989:1260:1261:1311:1314:1345:1437:1513:1515:1521:1534:1541:1711:1730:1747:1777:1792:2196:2199:2393:2525:2553:2559:2563:2682:2685:2859:2902:2910:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4385:5007:6261:7903:9025:9592:10004:11026:11473:11658:11914:12043:12114:12160:12296:12297:12438:12555:12679:12895:12986:13069:13311:13357:14093:14181:14384:14394:14721:21080:21451:21627:21749:21811:21939:21983:30054:30090,0,RBL:193.142.43.55:@linutronix.de:.lbl8.mailshell.net-62.14.6.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral, Custom_r 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 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 = 0 default and remove it from /proc on RT. Link: https://lore.kernel.org/linux-mm/20190710144138.qyn4tuttdq6h7kqx@linutronix.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[] = { .extra1 = &min_extfrag_threshold, .extra2 = &max_extfrag_threshold, }, +#ifndef CONFIG_PREEMPT_RT { .procname = "compact_unevictable_allowed", .data = &sysctl_compact_unevictable_allowed, @@ -1497,7 +1498,7 @@ static struct ctl_table vm_table[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, - +#endif #endif /* CONFIG_COMPACTION */ { .procname = "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 = 1; +#endif static inline void update_fast_start_pfn(struct compact_control *cc, unsigned long pfn)