From patchwork Tue Dec 7 15:52:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12662169 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 83E0DC433F5 for ; Tue, 7 Dec 2021 15:52:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2D476B0098; Tue, 7 Dec 2021 10:52:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DDC746B0099; Tue, 7 Dec 2021 10:52:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7D196B00A0; Tue, 7 Dec 2021 10:52:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id B6A136B0098 for ; Tue, 7 Dec 2021 10:52:22 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7164D181C49B3 for ; Tue, 7 Dec 2021 15:52:12 +0000 (UTC) X-FDA: 78891439704.31.4499542 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf11.hostedemail.com (Postfix) with ESMTP id E275BF0000AC for ; Tue, 7 Dec 2021 15:52:11 +0000 (UTC) Date: Tue, 7 Dec 2021 16:52:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1638892329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=VS6roNBiwUEM5X9fxDy5HZGLySBmQhwrowKmxwnMeKo=; b=BcczSFN8CKvWRlXBGO8eJz8aSgoUZFPDl3yXZwMqcRiniKvyEO5H1I4FD8smWeB72tPE7W 4FhHfvENUhH9Oo6smxiNulqEiCddctZcH8HzErDwFV5cQVwltMyZTjvCpZA16+BMABd+nu URprFReGV/dMjZsMN9iyCoeY+dLhb/Sv22rM9pdB88rvFY2yO2deqrjbrcgru9sePRnXs+ Zu5n9d5/Jpy2MuFGa1z+CABNUK9eZbcyQVF+WyhjJaF2c8dQU9/Z8fRwNc7F6XZRQAzXpr LgdIAHZGeTPJuYa+DoJdCJ6Vn8/T5VSKZagkg/tQUH0Rcb5lLWAMFha7knUaPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1638892329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=VS6roNBiwUEM5X9fxDy5HZGLySBmQhwrowKmxwnMeKo=; b=w1JyOzTzNREXfaHDN1SVgPUu3ulwLcDKPcxYzaU9oZ+cen1LSNAG8b7kwCvPe4RsoqnOQS pEpFizCPgDi0ANAg== From: Sebastian Andrzej Siewior To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Thomas Gleixner , Vladimir Davydov , Waiman Long Subject: [PATCH] mm/memcontrol: Disable on PREEMPT_RT Message-ID: <20211207155208.eyre5svucpg7krxe@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E275BF0000AC X-Stat-Signature: k8f4yn86brnwdr3bkfup8sdayi9nap1t Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=BcczSFN8; dkim=pass header.d=linutronix.de header.s=2020e header.b=w1JyOzTz; spf=pass (imf11.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-HE-Tag: 1638892331-44854 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: From: Thomas Gleixner MEMCG has a few constructs which are not compatible with PREEMPT_RT's requirements. This includes: - relying on disabled interrupts from spin_lock_irqsave() locking for something not related to lock itself (like the per-CPU counter). - explicitly disabling interrupts and acquiring a spinlock_t based lock like in memcg_check_events() -> eventfd_signal(). - explicitly disabling interrupts and freeing memory like in drain_obj_stock() -> obj_cgroup_put() -> obj_cgroup_release() -> percpu_ref_exit(). Commit 559271146efc ("mm/memcg: optimize user context object stock access") continued to optimize for the CPU local access which complicates the PREEMPT_RT locking requirements further. Disable MEMCG on PREEMPT_RT until the whole situation can be evaluated again. [ bigeasy: commit description. ] Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- init/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/init/Kconfig +++ b/init/Kconfig @@ -943,6 +943,7 @@ config PAGE_COUNTER config MEMCG bool "Memory controller" + depends on !PREEMPT_RT select PAGE_COUNTER select EVENTFD help