Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2727606lqt; Mon, 22 Apr 2024 22:23:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU39d5+ZjY8YsyeM3fp8K1EgmBjOmsb6eEfCUbpLhdodX6sX8Kxj/Z26e5NVi1f9nrwoV470tV+BgaRjDyVnVDcL9EKoqr2XJ8Gc5Tvrg== X-Google-Smtp-Source: AGHT+IH6axOlfVf9U2td+rMkLd9+s+2zc6kXt6hgpJa7xGNiMCwFkOFFTrp2TnnoSyWKCpSt2BHz X-Received: by 2002:ae9:f112:0:b0:78e:ddf9:5f5d with SMTP id k18-20020ae9f112000000b0078eddf95f5dmr12731442qkg.18.1713849837347; Mon, 22 Apr 2024 22:23:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713849837; cv=pass; d=google.com; s=arc-20160816; b=kndYQQ0SkK7n+lGMSIigPHTPi01XQ9f8dJu42m8dXVW2HQDk1drWt5LNppjDIjvqna UWzCSeRyjez4Yll7sRa/Dll0OfJTodgvebWSF5OIiL4xKvyTegP7HZHV98anUqmGVFJ7 0W4FUmWjaJoyIK9nTGOZF3BuUAzmbV1jBhYPsilDMJaR65/buMlnPEWmDS5oQYntP6c7 egKlwRKHHngatdyJlAkm8SXlxF+4lHfyMJ7XgQtqXRxQrGTN45Ggd0PoM+7vlpNp/zgJ 2im1N0C41flfYWNNyJ0Q/sZ0wgmFxG/uO/E8KJI2ukgWGbPsmMkto2SvXIQodMshvVqu vrDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7wZMRsMyHQHXjFKrcDnWCD1NMGczgsTlPNC9ZrGXAJ8=; fh=RT6qUd/cFk7mA1daRZyPKZ73SkJUv705B/3NiEK9oSU=; b=In8OTvmWX4Fk9Ei/+u5OA/vOdGIkUehhHuD3h6WZoR+ou6tSyf+Q0Rvj0IHkR8LNBi ShwpM3KjNoKWA3mj/YuL9OfEDc8xs9Ix47j+mzRYb5kHKyZkNWLyoex5TCrsq7K2nU2A Jir9x6p9do4Bu6W0DSk7GJ3S4+43As7qdNy1NvSHBae8R8zsiMGxTGkZ2AFVMtSSoOl8 JOqzMSw8CaRIEA6VgduV5lYiVLaXmjy5Y4xukc9/RwSDln24OJDVPldf6LAbvYv4k1vm XZSRbtLVZbP7nET+OqEFDWItvio0I5jUwx7ItCIcVtSTCkhmp9bzbXA91NLLH1oWwZq0 Ej5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OvsiSo2V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-154527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ow26-20020a05620a821a00b0078f0a037defsi11672891qkn.617.2024.04.22.22.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 22:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OvsiSo2V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-154527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 163AE1C20AD1 for ; Tue, 23 Apr 2024 05:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D15EE208CB; Tue, 23 Apr 2024 05:23:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OvsiSo2V" Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DEFA1C2AD for ; Tue, 23 Apr 2024 05:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713849831; cv=none; b=dKm8osVSCojrfnetg1j4zbZX8gSIifP0YX2LGsgPlKrSXkReHiXmUfr6Yg04NBEVXYq8BWxwSYJf5029KB/9Ivx75BcqJebVA2P7p5yxEzb3WuVFg0q7tp0RsPXwQMo2fMy0oa+x/25UKEeEXsykNAwwAYXKo2Trw2QKH1cH3bQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713849831; c=relaxed/simple; bh=99EfjvqpzFog+KcyejWyS1acNRGTXkB7Y1R/IpDMIK8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ecUBIyRPZawdOFD8l3jNdqX0kzi6e+KMNb4B4gfEHtkwRbPdrjemV7yjRY6JZTvIj27GCL/g4lmTH3alE0TGZKJAFcnc3k02zxyRsTFtldXjSb77h4PKrVQj135j7o2J2TetAjB8LIrrra+7uFeFdsy6k8qxxXvjGQCV+3nzCz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OvsiSo2V; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713849827; 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: in-reply-to:in-reply-to:references:references; bh=7wZMRsMyHQHXjFKrcDnWCD1NMGczgsTlPNC9ZrGXAJ8=; b=OvsiSo2VciEz80V+ECLlsVWhu9VrKAZMMiT5JyhaIJpiJCaRlCFNPBSSnIM/oQ0A13NJ6j Q0M6ktSc75eUe/FEsbEGO8Xw0LzcxsIBnDqZmgTIXd3X28/O0v+b8GHm92PPzMRnAkJ0U6 /BuPKk6hpDPgJz/MbeeRSvhhJ5MUOLI= From: Shakeel Butt To: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] memcg: restrict __mod_memcg_lruvec_state to memcg stats Date: Mon, 22 Apr 2024 22:23:43 -0700 Message-ID: <20240423052343.811563-1-shakeel.butt@linux.dev> In-Reply-To: <20240423051826.791934-1-shakeel.butt@linux.dev> References: <20240423051826.791934-1-shakeel.butt@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Currently __mod_memcg_lruvec_state takes enum node_stat_item as a parameter and enum node_stat_item contains both memcg and non-memcg stats but __mod_memcg_lruvec_state can only handle the memcg stats, so simply only call __mod_memcg_lruvec_state for memcg stats. Signed-off-by: Shakeel Butt --- mm/memcontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4e991e913393..531b6ff711c7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -860,8 +860,6 @@ static void __mod_memcg_lruvec_state(struct lruvec *lruvec, case NR_ANON_MAPPED: case NR_FILE_MAPPED: case NR_ANON_THPS: - case NR_SHMEM_PMDMAPPED: - case NR_FILE_PMDMAPPED: if (WARN_ON_ONCE(!in_task())) pr_warn("stat item index: %d\n", idx); break; @@ -899,7 +897,7 @@ void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, __mod_node_page_state(lruvec_pgdat(lruvec), idx, val); /* Update memcg and lruvec */ - if (!mem_cgroup_disabled()) + if (!mem_cgroup_disabled() && idx < NR_VM_NODE_MEMCG_STAT_ITEMS) __mod_memcg_lruvec_state(lruvec, idx, val); } -- 2.43.0