From patchwork Tue May 28 12:19:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13676590 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 3FE32C27C44 for ; Tue, 28 May 2024 12:19:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C49006B009B; Tue, 28 May 2024 08:19:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF9226B009C; Tue, 28 May 2024 08:19:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC03A6B009D; Tue, 28 May 2024 08:19:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 916FD6B009B for ; Tue, 28 May 2024 08:19:34 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 41519C055C for ; Tue, 28 May 2024 12:19:34 +0000 (UTC) X-FDA: 82167710268.25.3766A39 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf12.hostedemail.com (Postfix) with ESMTP id 8CA3C4000B for ; Tue, 28 May 2024 12:19:32 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=zJyONNdx; dkim=pass header.d=linutronix.de header.s=2020e header.b=VFE9cBeZ; spf=pass (imf12.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716898772; a=rsa-sha256; cv=none; b=6nNtNbc0/G6ei60f598TTK9uu7vg3lECTndgOmqI6nY4obUT9GZU7/DUqYDZ54dJzTTxH7 xqM2G2x98fVKnPB26U8fXzmMmMawEDZPklAB/9u9OWtA201P/7WhFcX2G4bx8j4ETzuNx2 +b6WPF4xksbHEvvJh5CCBYJ+UfWOTcA= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=zJyONNdx; dkim=pass header.d=linutronix.de header.s=2020e header.b=VFE9cBeZ; spf=pass (imf12.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716898772; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=BVI6TfGQyXa2HdEH+/r5e1ZnTptMlsWk95fc1VQDtGI=; b=Yz0jDa2OqNdDJ6mtT4PSO8IAFw/BgCL8vSc2pwb2qPU+ibXSWa2soF1+ZkRkKqbx36z3LQ nVEttr1vuu1leHqEW0hWwqKwlsMo6KE5uWZObTc82y5V0s3RfL/2vtpDNoklfkZgYuCrkn U+F3qSXkLG29U3pn3r4EvalbormylNM= Date: Tue, 28 May 2024 14:19:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716898769; 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=BVI6TfGQyXa2HdEH+/r5e1ZnTptMlsWk95fc1VQDtGI=; b=zJyONNdx8saZ2VFjVc8rTd0pApCI3WDAcZke8JmBdGrwkoI5WG6TlAkrqz87b1Dej4Iraq VyYQZibATPir4vMtdIrvRjZdERYh2tcKPfz2HCyhQMyMXrIue+l1I1g20GjpTZtcdjkyhG UUl77euxq2PmZaTu7VMqVk4dYrqZLD+mNEwoXD4xiDXJE4/OqUGoJ5ReT17JA2cUeRfpSj FEowPg/pFCTCStMChvYOGBQr3jL0W1XXi5jhiW5JFCOSwZ/VQrQx0iOj31jwZ7qrJNEZ5l RX4HfGtWUJ/cwZfTEsIKRyZ6o/lTkhmcf+EOjIbZ2BE/sDfKLyzJLApiDljJlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716898769; 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=BVI6TfGQyXa2HdEH+/r5e1ZnTptMlsWk95fc1VQDtGI=; b=VFE9cBeZh5CSymXXWfeQVGjrBbQEPBfw1e5kuPWLhN4sfCVp68x+hZkwFF2mdx91iMaeXw MWzfG2V/8htD5MDw== From: Sebastian Andrzej Siewior To: "Vlastimil Babka (SUSE)" Cc: Shakeel Butt , Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: [PATCH] memcg: Remove the lockdep assert from __mod_objcg_mlstate(). Message-ID: <20240528121928.i-Gu7Jvg@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8CA3C4000B X-Stat-Signature: 98ipygftyqgnryu4b78rua33wiuam9bz X-HE-Tag: 1716898772-122577 X-HE-Meta: U2FsdGVkX1+ybLLfMJYeHyDnuei7dBkf4xKHQPYuBJMrYuMFWS9nwFu4neWWzw1M19FdAPzp7T+w6Vua+GWydPjjCOuwsZb94tYnqkO9O9HCLyOw9vhIF7kJ2U0LM5en5TOgR2dqLd0lR5VwMvPhTXk6lCnrSy/hPxstGZLsmbhocKNeXL9DJ9bIx7cMkTksNOV8sxcbM8qzwPBzUmY5xzqN8ltVxk0XRQHMjfgL53dzbMu+xKwfheWtvORkzNDe0Zv8WRGzU8TN0Hoxs2/pK86VgnvI3DqftBkmnmM0oUhmJ7sELZre9HAkN4TFksAyTPpBR6ZA6PmAOMz0LNgW93hp3ln4L2/WFwvFuWEtYpaVKKnOzexZwjLGCzsb2EFBMRK1cn/7cKw9QDlJyThBrmRWwsh3DDIySvBQgcPMSBxUFWbMe611kXPPoPiviS8F+lP1UYiOZOWK54RS0DAgm5lFZJ9onLTtIagFwfPj9LF5narH39l7H4C2VLXB/s+g2MpWojtIIkp/Q45TidPwCXzGGRQwsJGF80bLOyicrq0/zYVFy+DMbFnjJ76cs5liKuZ01ELK24CsCUKa/5QwdAuBcOXZtTnzNAtpvDRwgeUIn1oBVEFXOlcdkEtQvCtm3TCRoX6xXVF9t9N/pWd4VSN3yusFsQh3bM79IXupqxsT6IH28K/QVP2bCP95D6ITyRvGmKP1HvwGr6ItIwG+fvvHrfcV95zEPUsc57htkJsP2V1HX0UhlcE1UOVI6QhgVS+Bd3i3Psnjt58vGVM4Cql+HxXn9bKzSXk6ftxBSIkikXO+jZ84LFjTTHXpuf5aVLX+/HQeptZEutxj+vUf057/QFV316KHhfUbaP+RNlYWg9hQLWNPwrkex0Jbcc3zCeATg3XkP5n8fuWLQaBbFt7baA2Zb/Jvo9m4nDYwB0AOvjuAGPE5zLHjDAsGHhZhvL0OHQ8HNnlg+0BkgZY FortxfVV 1Uf5zBumKP5QyGnRLo+DEm3OEpglJpPIjcAKUsLLzawCW70zP0vxPL3EN3LaaMHeUsDroKGRGNCtZmgiLBN4BiecK6m+afaXVY97uar20C2vkpngGlg3iKFWGl6/EK50bXFvK2+GvCBaVI7Q= 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: List-Subscribe: List-Unsubscribe: The assert was introduced in the commit cited below as an insurance that the semantic is the same after the local_irq_save() has been removed and the function has been made static. The original requirement to disable interrupt was due the modification of per-CPU counters which require interrupts to be disabled because the counter update operation is not atomic and some of the counters are updated from interrupt context. All callers of __mod_objcg_mlstate() acquire a lock (memcg_stock.stock_lock) which disables interrupts on !PREEMPT_RT and the lockdep assert is satisfied. On PREEMPT_RT the interrupts are not disabled and the assert triggers. The safety of the counter update is already ensured by VM_WARN_ON_IRQS_ENABLED() which is part of memcg_stats_lock() and does not require yet another check. Remove the lockdep assert from __mod_objcg_mlstate(). Fixes: 91882c1617c15 ("memcg: simple cleanup of stats update functions") Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka --- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-) --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3147,8 +3147,6 @@ static inline void __mod_objcg_mlstate(s struct mem_cgroup *memcg; struct lruvec *lruvec; - lockdep_assert_irqs_disabled(); - rcu_read_lock(); memcg = obj_cgroup_memcg(objcg); lruvec = mem_cgroup_lruvec(memcg, pgdat);