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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4700C2BA4C for ; Wed, 26 Jan 2022 14:40:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7ABD96B0075; Wed, 26 Jan 2022 09:40:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 734026B0078; Wed, 26 Jan 2022 09:40:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 623296B007B; Wed, 26 Jan 2022 09:40:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 4F2516B0075 for ; Wed, 26 Jan 2022 09:40:57 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 12AA791E43 for ; Wed, 26 Jan 2022 14:40:57 +0000 (UTC) X-FDA: 79072700154.25.3CCA5DD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf19.hostedemail.com (Postfix) with ESMTP id 8169A1A0008 for ; Wed, 26 Jan 2022 14:40:56 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D8CE51F3B2; Wed, 26 Jan 2022 14:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643208054; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ikVGucglYY6adaWYk1tsxONRaOQuLmugr5KPZRiegJs=; b=FB53ozzCG75iUCc1fuk8x9gf645bOEnHQTfs7mxB6POtWIUBPVvLD7lzOkV9/hm1dz9NuJ imh9GgjUMVjAE1u8VmWiOr8F2DwE7YRaPnWZjh8TDG4aWCtmKd773P0dTj2UruRixxYbEH aMM8usYypLjnN4bg8nLwKrE+k3/0g50= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A9074A3B83; Wed, 26 Jan 2022 14:40:54 +0000 (UTC) Date: Wed, 26 Jan 2022 15:40:54 +0100 From: Michal Hocko To: Sebastian Andrzej Siewior Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long Subject: Re: [PATCH 1/4] mm/memcg: Disable threshold event handlers on PREEMPT_RT Message-ID: References: <20220125164337.2071854-1-bigeasy@linutronix.de> <20220125164337.2071854-2-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20220125164337.2071854-2-bigeasy@linutronix.de> X-Rspamd-Queue-Id: 8169A1A0008 X-Rspam-User: nil Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=FB53ozzC; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf19.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Stat-Signature: tbopi4w8afw31fu5k8urpfpdycbj9jt1 X-Rspamd-Server: rspam08 X-HE-Tag: 1643208056-626162 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: On Tue 25-01-22 17:43:34, Sebastian Andrzej Siewior wrote: > During the integration of PREEMPT_RT support, the code flow around > memcg_check_events() resulted in `twisted code'. Moving the code around > and avoiding then would then lead to an additional local-irq-save > section within memcg_check_events(). While looking better, it adds a > local-irq-save section to code flow which is usually within an > local-irq-off block on non-PREEMPT_RT configurations. >=20 > The threshold event handler is a deprecated memcg v1 feature. Instead o= f > trying to get it to work under PREEMPT_RT just disable it. There should > be no users on PREEMPT_RT. From that perspective it makes even less > sense to get it to work under PREEMPT_RT while having zero users. >=20 > Make memory.soft_limit_in_bytes and cgroup.event_control return > -EOPNOTSUPP on PREEMPT_RT. Make an empty memcg_check_events() and > memcg_write_event_control() which return only -EOPNOTSUPP on PREEMPT_RT= . > Document that the two knobs are disabled on PREEMPT_RT. Shuffle the cod= e around > so that all unused function are in on #ifdef block. >=20 > Suggested-by: Michal Hocko > Suggested-by: Michal Koutn=FD > Signed-off-by: Sebastian Andrzej Siewior I still support this approach but the patch is much larger than necessary. The code moving shouldn't be really necessary and a simple "do not allow" to set any thresholds or soft limit should be good enough.=20 While in general it is better to disable the unreachable code I do not think this is worth the code churn here. > --- > .../admin-guide/cgroup-v1/memory.rst | 2 + > mm/memcontrol.c | 788 +++++++++--------- > 2 files changed, 404 insertions(+), 386 deletions(-) --=20 Michal Hocko SUSE Labs