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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 EC809C3F2C6 for ; Tue, 3 Mar 2020 23:56:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD09420870 for ; Tue, 3 Mar 2020 23:56:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="mKX2B+3Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD09420870 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 590386B0072; Tue, 3 Mar 2020 18:56:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 540B66B0073; Tue, 3 Mar 2020 18:56:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42EDF6B0074; Tue, 3 Mar 2020 18:56:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 2943E6B0072 for ; Tue, 3 Mar 2020 18:56:38 -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 C8969D21A for ; Tue, 3 Mar 2020 23:56:37 +0000 (UTC) X-FDA: 76555713234.01.idea54_740d2bf1a7d40 X-HE-Tag: idea54_740d2bf1a7d40 X-Filterd-Recvd-Size: 3429 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Mar 2020 23:56:37 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F0CE20866; Tue, 3 Mar 2020 23:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583279796; bh=zVphD0+lmSoeVpHjFG+9E8QBcLMbSzrDZweDit/0a3o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mKX2B+3Z4/Y3P1GhdlDAWkLGvdkB4LlgxiGgntPi5hOBIqR2WrXc9JXX6poU7TrMV cEundsxK66IXugFeyld+uQrp9pohnxnbQX59yQL2EuOZk1/yhU7spdZ4FOUvxmx5lM r9RKtAxbCENPTEEc3nwAF40vIVuo105k3JRu8dAs= Date: Tue, 3 Mar 2020 15:56:35 -0800 From: Andrew Morton To: Sebastian Andrzej Siewior Cc: Vlastimil Babka , linux-mm@kvack.org, Thomas Gleixner , Luis Chamberlain , Kees Cook , Iurii Zaikin , Mel Gorman , Linux API Subject: Re: [PATCH 2/2 v3] mm/compaction: Disable compact_unevictable_allowed on RT Message-Id: <20200303155635.1955cb90451abd3ef8bfba63@linux-foundation.org> In-Reply-To: <20200303202225.nhqc3v5gwlb7x6et@linutronix.de> References: <20200115161035.893221-1-bigeasy@linutronix.de> <4cf4507b-0632-34e6-5985-df933559af9f@suse.cz> <20200302173516.iysuejilava37psk@linutronix.de> <20200302132531.59a2c9dffe2515d78abaf909@linux-foundation.org> <20200303175910.ichnkjkgmz5y2ipb@linutronix.de> <20200303202054.gsosv7fsx2ma3cic@linutronix.de> <20200303202225.nhqc3v5gwlb7x6et@linutronix.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Tue, 3 Mar 2020 21:22:25 +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. Fair enough, I guess. > @@ -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