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=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 62D41C32771 for ; Wed, 15 Jan 2020 22:04:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2BEF22465A for ; Wed, 15 Jan 2020 22:04:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BEF22465A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BD95E8E000D; Wed, 15 Jan 2020 17:04:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B8A2E8E0003; Wed, 15 Jan 2020 17:04:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA15B8E000D; Wed, 15 Jan 2020 17:04:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id 9543F8E0003 for ; Wed, 15 Jan 2020 17:04:22 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5AE1940D6 for ; Wed, 15 Jan 2020 22:04:22 +0000 (UTC) X-FDA: 76381247964.01.tray78_7d7023b3da315 X-HE-Tag: tray78_7d7023b3da315 X-Filterd-Recvd-Size: 4048 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 22:04:21 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D273AB016; Wed, 15 Jan 2020 22:04:19 +0000 (UTC) Subject: Re: [PATCH] mm/compaction: Disable compact_unevictable_allowed on RT To: Sebastian Andrzej Siewior , linux-mm@kvack.org Cc: Thomas Gleixner , Andrew Morton , Luis Chamberlain , Kees Cook , Iurii Zaikin , Mel Gorman , Linux API References: <20200115161035.893221-1-bigeasy@linutronix.de> From: Vlastimil Babka Message-ID: <4cf4507b-0632-34e6-5985-df933559af9f@suse.cz> Date: Wed, 15 Jan 2020 23:04:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200115161035.893221-1-bigeasy@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: On 1/15/2020 5:10 PM, 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. Fine, this makes sense on RT I guess. There might be some trade-off for high-order allocation latencies though. We could perhaps migrate such mlocked pages to pages allocated without __GFP_MOVABLE during the mlock() to at least somewhat prevent them being scattered all over the zones. For MCL_FUTURE, allocate them as unmovable from the beginning. But that can wait until issues are reported. I assume you have similar solution for NUMA balancing and whatever else can cause minor faults? > Make compact_unevictable_allowed = 0 default and remove it from /proc on > RT. Removing it is maybe going too far in terms of RT kernel differences confusing users? Change the default sure, perhaps making it read-only, but removing? > Link: https://lore.kernel.org/linux-mm/20190710144138.qyn4tuttdq6h7kqx@linutronix.de/ In any case the sysctl Documentation/ should be updated? And perhaps also the mlock manpage as you noted in the older thread above? Thanks, Vlastimil > 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) >