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 2E4BAC433F5 for ; Thu, 13 Jan 2022 14:48:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADE066B0072; Thu, 13 Jan 2022 09:48:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A65C66B0073; Thu, 13 Jan 2022 09:48:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DF5D6B0074; Thu, 13 Jan 2022 09:48:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 7BBD46B0072 for ; Thu, 13 Jan 2022 09:48:06 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2C6E8181F3205 for ; Thu, 13 Jan 2022 14:48:06 +0000 (UTC) X-FDA: 79025543772.12.B084255 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id C1AF180008 for ; Thu, 13 Jan 2022 14:48:05 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7ADFC1F387; Thu, 13 Jan 2022 14:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1642085284; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3/KiLmbu2FzwjS6g8oZPwe01R3SCJm9aWDvcjh1V1oQ=; b=UzapisG0u9pfLMsgBm15bvLIVl8KzGhzBfs+l22qSgE6/NiXDdINQLc9ShJjoGYF6NyL9D N0xgRz4dE6ou/b3G6Wy9yCq0nhAhI9RuklR4BmHJ3fpvuILBLV8j0uSQ+Fxm90ImIleIm8 CxA7xma/OBgwkBbt+v3yd6LtJRSqOe8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5A35B13DD1; Thu, 13 Jan 2022 14:48:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vVhwFaQ74GGRBgAAMHmgww (envelope-from ); Thu, 13 Jan 2022 14:48:04 +0000 Date: Thu, 13 Jan 2022 15:48:03 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Sebastian Andrzej Siewior Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Thomas Gleixner , Waiman Long , Peter Zijlstra Subject: Re: [RFC PATCH 1/3] mm/memcg: Protect per-CPU counter by disabling preemption on PREEMPT_RT Message-ID: <20220113144803.GB28468@blackbody.suse.cz> References: <20211222114111.2206248-1-bigeasy@linutronix.de> <20211222114111.2206248-2-bigeasy@linutronix.de> <20220105141653.GA6464@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C1AF180008 X-Stat-Signature: myhbo6z7zz9438h8nwra3w4yn3wkg3yi Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=UzapisG0; spf=pass (imf02.hostedemail.com: domain of mkoutny@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1642085285-289767 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 Thu, Jan 13, 2022 at 02:08:10PM +0100, Sebastian Andrzej Siewior wrote: > I added a preempt-disable() section restricted to RT to > mem_cgroup_event_ratelimit(). Oh, I missed that one. (Than the decoupling of such mem_cgroup_event_ratelimit() also makes some more sense.) > That would mean that mem_cgroup_event_ratelimit() needs a > local_irq_save(). If that is okay then sure I can move it that way. Whatever avoids the twisted code :-) --- > I remember Michal (Hocko) suggested excluding/ rejecting soft limit but > I didn't know where exactly and its implications. In this block here I > just followed the replacement of irq-off with preempt-off for RT. Both soft limit and (these) event notifications are v1 features. Soft limit itself is rather considered even misfeature. I guess the implications would not be many since PREEMPT_RT+memcg users would be new(?) so should rather start with v2 anyway. One way to disable it would be to reject writes into memory.soft_limit_in_bytes or cgroup.event_control + documentation of that. Michal From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal =?iso-8859-1?Q?Koutn=FD?= Subject: Re: [RFC PATCH 1/3] mm/memcg: Protect per-CPU counter by disabling preemption on PREEMPT_RT Date: Thu, 13 Jan 2022 15:48:03 +0100 Message-ID: <20220113144803.GB28468@blackbody.suse.cz> References: <20211222114111.2206248-1-bigeasy@linutronix.de> <20211222114111.2206248-2-bigeasy@linutronix.de> <20220105141653.GA6464@blackbody.suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1642085284; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3/KiLmbu2FzwjS6g8oZPwe01R3SCJm9aWDvcjh1V1oQ=; b=UzapisG0u9pfLMsgBm15bvLIVl8KzGhzBfs+l22qSgE6/NiXDdINQLc9ShJjoGYF6NyL9D N0xgRz4dE6ou/b3G6Wy9yCq0nhAhI9RuklR4BmHJ3fpvuILBLV8j0uSQ+Fxm90ImIleIm8 CxA7xma/OBgwkBbt+v3yd6LtJRSqOe8= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sebastian Andrzej Siewior Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Thomas Gleixner , Waiman Long , Peter Zijlstra On Thu, Jan 13, 2022 at 02:08:10PM +0100, Sebastian Andrzej Siewior wrote: > I added a preempt-disable() section restricted to RT to > mem_cgroup_event_ratelimit(). Oh, I missed that one. (Than the decoupling of such mem_cgroup_event_ratelimit() also makes some more sense.) > That would mean that mem_cgroup_event_ratelimit() needs a > local_irq_save(). If that is okay then sure I can move it that way. Whatever avoids the twisted code :-) --- > I remember Michal (Hocko) suggested excluding/ rejecting soft limit but > I didn't know where exactly and its implications. In this block here I > just followed the replacement of irq-off with preempt-off for RT. Both soft limit and (these) event notifications are v1 features. Soft limit itself is rather considered even misfeature. I guess the implications would not be many since PREEMPT_RT+memcg users would be new(?) so should rather start with v2 anyway. One way to disable it would be to reject writes into memory.soft_limit_in_bytes or cgroup.event_control + documentation of that. Michal