From patchwork Thu Feb 17 09:47:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12749685 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 E1C31C433EF for ; Thu, 17 Feb 2022 09:48:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 712376B0074; Thu, 17 Feb 2022 04:48:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C25F6B0075; Thu, 17 Feb 2022 04:48:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58B736B0078; Thu, 17 Feb 2022 04:48:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 4BC386B0074 for ; Thu, 17 Feb 2022 04:48:09 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0FDC095B1D for ; Thu, 17 Feb 2022 09:48:09 +0000 (UTC) X-FDA: 79151795898.14.938B744 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf18.hostedemail.com (Postfix) with ESMTP id 9B8071C0006 for ; Thu, 17 Feb 2022 09:48:08 +0000 (UTC) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1645091287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A4ypfDSqGMLg9km1dl2WOJwJsS8OW8SkL6eTIxLtYuc=; b=elTaWLiRGCv72mzSp9Bn5+xIhnnOLk02quK11HhQEiDGoAHa0bQtAn3sNjtHsc3Co7fCPn UYkVRXcupS33LVJlDqLQ60Sv3edMm9HWVcPL5mCvS4oolAAtMTphXJ5UE9Hf6xItugrE6e Kb2ksXizy4WoqynEpl8MPiW7Ds1eOaFGmGJ6MOmTp06Js+K2oY08/5xpQBpQ6o4/+MFrh7 HwKhJ6KqvkPckqPdz5XPKx/ns8vxfhDzACx8/2ueyIoVvXHKlf7z4XOiXqeso10Tt7Z0z9 dz1sL3Q7fjs/wGPrNdzMQJPMGp+AkFwYXgd6jMSjhu5MxvbUfCKXv6Rv4gDV1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1645091287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A4ypfDSqGMLg9km1dl2WOJwJsS8OW8SkL6eTIxLtYuc=; b=W7kqkBljW4f1rmnUnTl4a9BsY3Hz7ECJSUiEAiFfHNnHHa8U9x2NdU53pOkTCFTvy/Yvmq xwFn+kjKzH8kSZBA== To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Johannes Weiner , Michal Hocko , =?utf-8?q?Michal_Koutn=C3=BD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long Subject: [PATCH v3 0/5] mm/memcg: Address PREEMPT_RT problems instead of disabling it. Date: Thu, 17 Feb 2022 10:47:57 +0100 Message-Id: <20220217094802.3644569-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9B8071C0006 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=elTaWLiR; dkim=pass header.d=linutronix.de header.s=2020e header.b=W7kqkBlj; spf=pass (imf18.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-Stat-Signature: 1nh9rtkndpyy371dfw85w1zn7st9ptkj X-HE-Tag: 1645091288-466351 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: Hi, this series aims to address the memcg related problem on PREEMPT_RT. I tested them on CONFIG_PREEMPT and CONFIG_PREEMPT_RT with the tools/testing/selftests/cgroup/* tests and I haven't observed any regressions (other than the lockdep report that is already there). Changes since v2: - rebased on top of v5.17-rc4-mmots-2022-02-15-20-39. - Added memcg_stats_lock() in 3/5 so it a little more obvious and hopefully easiert to maintain. - Opencoded obj_cgroup_uncharge_pages() in drain_obj_stock(). The __locked suffix was confusing. v2: https://lore.kernel.org/all/20220211223537.2175879-1-bigeasy@linutronix.de/ Changes since v1: - Made a full patch from Michal Hocko's diff to disable the from-IRQ vs from-task optimisation - Disabling threshold event handlers is using now IS_ENABLED(PREEMPT_RT) instead of #ifdef. The outcome is the same but there is no need to shuffle the code around. v1: https://lore.kernel.org/all/20220125164337.2071854-1-bigeasy@linutronix.de/ Changes since the RFC: - cgroup.event_control / memory.soft_limit_in_bytes is disabled on PREEMPT_RT. It is a deprecated v1 feature. Fixing the signal path is not worth it. - The updates to per-CPU counters are usually synchronised by disabling interrupts. There are a few spots where assumption about disabled interrupts are not true on PREEMPT_RT and therefore preemption is disabled. This is okay since the counter are never written from in_irq() context. RFC: https://lore.kernel.org/all/20211222114111.2206248-1-bigeasy@linutronix.de/ Sebastian