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=-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 5C45CC3F2D1 for ; Mon, 2 Mar 2020 21:25:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1F3572465E for ; Mon, 2 Mar 2020 21:25:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="veaCjF2S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F3572465E 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 C838D6B0006; Mon, 2 Mar 2020 16:25:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C33476B0007; Mon, 2 Mar 2020 16:25:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B23916B0008; Mon, 2 Mar 2020 16:25:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 94E246B0006 for ; Mon, 2 Mar 2020 16:25:33 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 784868248068 for ; Mon, 2 Mar 2020 21:25:33 +0000 (UTC) X-FDA: 76551703746.16.roll20_307a4e8947b3b X-HE-Tag: roll20_307a4e8947b3b X-Filterd-Recvd-Size: 3906 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Mon, 2 Mar 2020 21:25:32 +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 C2BD0208C3; Mon, 2 Mar 2020 21:25:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583184332; bh=irH+qIz7RQAX8VNOn4osnuiinNKfwvRGDRqgNDX/JKk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=veaCjF2SKyTQH/NZgidyCbSQloTu1GBH7jEg4PH2gAtPsw1kfiuemamqB9QJuq7eb IwbcA7ag3CnHZhzVlTlbYOVMOSPV+rPms4rRA/1mL53MzpksBbXBQUnNmsaikzpvud t3AobnNzWI8oXZ1IRmv+g3CAJu4r+adKsjSsEFjc= Date: Mon, 2 Mar 2020 13:25:31 -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 v2] mm/compaction: Disable compact_unevictable_allowed on RT Message-Id: <20200302132531.59a2c9dffe2515d78abaf909@linux-foundation.org> In-Reply-To: <20200302173516.iysuejilava37psk@linutronix.de> References: <20200115161035.893221-1-bigeasy@linutronix.de> <4cf4507b-0632-34e6-5985-df933559af9f@suse.cz> <20200302173516.iysuejilava37psk@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 Mon, 2 Mar 2020 18:35:16 +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 RO on RT. hm, that's a bit sad but I guess it's tolerable. > ... > > index 64aeee1009cab..bbfa59d25eec3 100644 > --- a/Documentation/admin-guide/sysctl/vm.rst > +++ b/Documentation/admin-guide/sysctl/vm.rst > @@ -128,6 +128,7 @@ allowed to examine the unevictable lru (mlocked pages) for pages to compact. > This should be used on systems where stalls for minor page faults are an > acceptable trade for large contiguous free memory. Set to 0 to prevent > compaction from moving pages that are unevictable. Default value is 1. > +On CONFIG_PREEMPT_RT the default value is 0. This doesn't mention that the file is unwritable on -rt, and it doesn't explain *why* -rt has different behaviour. > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1483,7 +1483,11 @@ static struct ctl_table vm_table[] = { > .procname = "compact_unevictable_allowed", > .data = &sysctl_compact_unevictable_allowed, > .maxlen = sizeof(int), > +#ifdef CONFIG_PREEMPT_RT > + .mode = 0444, > +#else > .mode = 0644, > +#endif This is non-backward-compatible and introduces a possibility that tested-on-non-rt userspace will fail on -rt kernels. It might be better to accept the writes, but to ignore them. Probably with a pr_warn_once() to let people know what we did. But do we really need to take the option away from -rt users? Perhaps someone wants this feature and can accept the latency hit. How about switching the default and otherwise leaving the kernel behaviour as-is and simply emitting a warning letting -rt users know that they might not want to enable this?