From patchwork Fri Feb 25 15:17:39 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: 12760450 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 3AAEBC433F5 for ; Fri, 25 Feb 2022 15:17:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83D638D0002; Fri, 25 Feb 2022 10:17:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C55D8D0001; Fri, 25 Feb 2022 10:17:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6660E8D0002; Fri, 25 Feb 2022 10:17:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 5290F8D0001 for ; Fri, 25 Feb 2022 10:17:43 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 170A21A17 for ; Fri, 25 Feb 2022 15:17:43 +0000 (UTC) X-FDA: 79181656806.06.8A84E15 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf30.hostedemail.com (Postfix) with ESMTP id 6D4C68000C for ; Fri, 25 Feb 2022 15:17:42 +0000 (UTC) Date: Fri, 25 Feb 2022 16:17:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1645802261; 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: in-reply-to:in-reply-to:references:references; bh=GRb+2qkiHEDDH9G/1JIbbgHYgu3fgWeEbLACig+UXdw=; b=3e7V0WReYycn9LxQofAy75Lu5aJjUV05vI3xjU35qX617bvbJFPUySzgha8//QWe+WlP7P TA/BMh1L+E4KS7erjIHkV309iIaqc44dAxwd4ZDExGolClsVazc1llmE9ZoaXg4LxZoK+4 K49cZ4I40yT6pJZuZchklnlVIySURo9+CIDlqiimZjDW3GjuE1t2wU7EvF6N9bjWqGZZYN hBnmSQh6k6wYK7/ALRCH/HMphkeuHwlqmoUmdI3Dec6rct4YVA9QKzcUuz50AouBLtI1Dk r0w+ca/70Xq5A7/hcgz7uK838cEOtqzxb5HzUvCl45esaVIVJJne1ydI8RRWEQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1645802261; 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: in-reply-to:in-reply-to:references:references; bh=GRb+2qkiHEDDH9G/1JIbbgHYgu3fgWeEbLACig+UXdw=; b=tJIMaiB2JC3x804scY7JWnnQ0clm3NPSoZFdAxtMbTytHV83aV66p9NXIHhXgcH8dmq1gS BaWejrTh4lCo14BA== From: Sebastian Andrzej Siewior To: Shakeel Butt Cc: Cgroups , Linux MM , Andrew Morton , Johannes Weiner , Michal Hocko , Michal =?utf-8?q?Koutn=C3=BD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long , Roman Gushchin Subject: [PATCH] mm/memcg: Add missing counter index which are not update in interrupt. Message-ID: References: <20220221182540.380526-1-bigeasy@linutronix.de> <20220221182540.380526-4-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=3e7V0WRe; dkim=pass header.d=linutronix.de header.s=2020e header.b=tJIMaiB2; spf=pass (imf30.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-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6D4C68000C X-Stat-Signature: tfbmdfzsxsupfisxky4re69gtmig95uu X-HE-Tag: 1645802262-109221 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: Shakeel Butt reported that I missed a few counters which are not updated in-interrupt context and therefore disabling preemption is fine. Please fold into: "Protect per-CPU counter by disabling preemption on PREEMPT_RT" Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Shakeel Butt --- mm/memcontrol.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9c29b1a0e6bec..7883e2f2af3e8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -743,10 +743,17 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, */ __memcg_stats_lock(); if (IS_ENABLED(CONFIG_DEBUG_VM)) { - if (idx == NR_ANON_MAPPED || idx == NR_FILE_MAPPED) + switch (idx) { + case NR_ANON_MAPPED: + case NR_FILE_MAPPED: + case NR_ANON_THPS: + case NR_SHMEM_PMDMAPPED: + case NR_FILE_PMDMAPPED: WARN_ON_ONCE(!in_task()); - else + break; + default: WARN_ON_ONCE(!irqs_disabled()); + } } /* Update memcg */