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