Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp80006lqh; Mon, 6 May 2024 11:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbS3NtLlJh8wa6/HwuXW/sSWfLcINe0sFq9NXs82EgX35s+jnYFmKy4bfNpQfVwMia1gZJVS0MOe6rTgVDuNa619QnHFQM0nvcCsHxrg== X-Google-Smtp-Source: AGHT+IGx+ilXgJHU+gkL8ZsjuThkszgP28/lpXByGXLeThh3C+cHFqlDa9IAmy9v8LMn99MKDiIt X-Received: by 2002:a05:6a21:270f:b0:1af:7bbc:a163 with SMTP id rm15-20020a056a21270f00b001af7bbca163mr11142512pzb.18.1715021611664; Mon, 06 May 2024 11:53:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715021611; cv=pass; d=google.com; s=arc-20160816; b=ZWlq1KlcBRDhgveEXsPdYszW9ThnbWfFVcrVMOEJK5uLRMwAVwtnKYeRdHUpkAQDKX DImuguKwRDAqV9uU0UfWvXCs7n11VqeSGcM8qOWET58B0XlJYgCjQnO2QyWt8qvtz2QY jJLvh+l8CQmQLYsFzS9Jlk5ePqoFOSRk5iGDRI5HMEJ0PTCa4Dpc4jFPl941FEpzblIb VGwYGmMqV7NEvGjiHOGXcbI1pT9ikdY30+xm2Ng9ffSFeNDhxtV9s8bar5FNkb5+9Kca IQ4GeaqCMArfvXRqrnSSMJibJRFr6C8KB7Td50kno+FodHlwU29Z5zKuwGq8qGw8+nI+ xgeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=uvqnx8a52JgW44MRDiVGrtHg7doUR6XkYawNsmmAJKQ=; fh=PKBAxMO3n8MLJp7tSnKULr3yQuYg2JV26Era7lbK4wc=; b=xmKQmxAvPZ9mbbxeHzJb9Qg6Kw55fLIwse8MJ/D7RCO5RZeKpEyg3W85dS9TY+T5PO eM3WL3ZM/cA0lVwRxI7I/WS8xz6x2yOyBkyFkpvCZ//I6yffsXIqrRJFhjOa1Ek8+yE7 VmHc1Erceh3RT3pDgSO4a+dMs3x9/OfZl66F1rNDNDMn56/m6XZAwKJhpqPj6LcoUymY qfc1AZUvc0sYK6ZtBNjkKPcchOGm0yaB7FHXYJxQFe7hfmIcwzxBvcAJWvoZscyZTJ4y YT9Afl4+D89iA/ybnL2ELqMTVNEv8TIoS4XZ4vzM8E2RvgkfOovMgFI1pAYjJ4dj9eAF lcew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Sjm9G8aC; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-170310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fw2-20020a17090b128200b002a0322b7450si11367498pjb.114.2024.05.06.11.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 11:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Sjm9G8aC; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-170310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3CB91284FC4 for ; Mon, 6 May 2024 18:53:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D02F1426F; Mon, 6 May 2024 18:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Sjm9G8aC" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4168774E37 for ; Mon, 6 May 2024 18:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715021602; cv=none; b=hDX22tQG1izyr2yrTxutNSX5Ysb7G3A2+nrr4QRzX2piq7W1r6uJW9QL0V4PUngYSLIxpGXufZRDX87M1C8hCZl7IwHuwkrAcejp4/kI+rK2J6qTiQ4TJPuDk5QtE4l8pGISxETf7RGC0VeaKa3KCuIcG0sNu+6FKxmTs25R29E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715021602; c=relaxed/simple; bh=uvqnx8a52JgW44MRDiVGrtHg7doUR6XkYawNsmmAJKQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ORdCyD8fcgxpfU/HDDOctMnhocuPY3NPTp0FiQMYID4LiZYKh/4cvnLgCET/WbflOZV5x9yqayXM/H2aTdW02Zr5aAYYz/lUnW518nfZX0gyWYdHr9KCNXoe3GFv3nXSk7cFnxqXXBMu+P9rXBS+MV80KEduoclTWGRJxk/H7rc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Sjm9G8aC; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a59c448b44aso375348166b.2 for ; Mon, 06 May 2024 11:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715021599; x=1715626399; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uvqnx8a52JgW44MRDiVGrtHg7doUR6XkYawNsmmAJKQ=; b=Sjm9G8aC+JASzV38yLWDqBehSVt6ubHxeIcb1xzWDU3hy9NnnSX5usWCKIHjuSSaef G1BgYYB1jKePxxxxKHu/P/1jvN39P6ZnjAmtDdkWI5CNhPi32tvhZJUd4JzyGsN8oO/3 95TDrk6mxaeCr00DeArWjA4I9tpKDBq46Z1teRLuU51+vAqCQDFVzYq4XFMiKy/3/iuw J9X/J62fTzM9dzwua0vOMoB3b0/4Hk51M+HC517/QrswoGlCHqzjSG+BJjAc6ZQ+oxcD uTYdMuKWyIbdiWWSAqUu11j4a90EOZ+JUnNOHq+zEvu6tkfUdOLlr5x4HX8VUrB/xQFu Y9OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715021599; x=1715626399; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uvqnx8a52JgW44MRDiVGrtHg7doUR6XkYawNsmmAJKQ=; b=QIH/IlLJMueO53eCOHl19s3vFNqM/yW7nqrtODWYEexlLsJ7ZigI+uyw0OnFG4WgdA +2fXgiJ2nm4dhXXelBn/TTB7kPEB4QHnMx7dDfzBIjyqpFiuNyrv6cPZMEdHZj5UNTiu hQhGUloQY2M5CGQLPIVOf1jbMk+5c2NBtY7yXwBUB+EHqgmMedakyVx5uhlDbfjaP1X0 fX7bFJN9FNLG6PjdPqtByaZ9qYrfV6jvFTv5ZJlSaMtEZlk7wJAYpEq8LKZTxWwkNNtY jnO+adJpLe8pPVNxSpPA3tILdpzSAB6W3lf9iRILqVBCvco6ELRFYQFNdfljzfFvOu/2 mVKA== X-Forwarded-Encrypted: i=1; AJvYcCVNLd/hNT52GD7Q9RxGTwtubPMDuYSsfprIZq44jfszGZZkyZxb5h+HSszEEH8OJwOGWvSHy2x5IfQE9SEz4pIFagaSCruO+9qY1E5i X-Gm-Message-State: AOJu0YxV/JQgSj6QYanvMuTBL/pYnZhaoyxh9o9hfOs/4zubLt6AmBJg qNh8QgLNIhq6uyDMqmSjmbxbvfLgqZersANO6FUXR1NzjT643W0Jni3rjllrADm5j/MzHokmC09 0DInWIueZJl1SI8ZYnSak44ZbOmmy+/xOwWKO X-Received: by 2002:a17:907:7e8b:b0:a59:bfab:b254 with SMTP id qb11-20020a1709077e8b00b00a59bfabb254mr4113478ejc.64.1715021599491; Mon, 06 May 2024 11:53:19 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240506170024.202111-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Mon, 6 May 2024 11:52:40 -0700 Message-ID: Subject: Re: [PATCH] mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED To: David Hildenbrand Cc: Andrew Morton , Shakeel Butt , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 6, 2024 at 11:35=E2=80=AFAM David Hildenbrand wrote: > > On 06.05.24 19:00, Yosry Ahmed wrote: > > Do not use __lruvec_stat_mod_folio() when updating NR_FILE_PMDMAPPED an= d > > NR_SHMEM_PMDMAPPED as these stats are not maintained per-memcg. Use > > __mod_node_page_state() instead, which updates the global per-node stat= s > > only. > > What's the effect of this? IIUC, it's been that way forever, no? Yes, but it has been the case that all the NR_VM_EVENT_ITEMS stats were maintained per-memcg, although some of those fields are not exposed anywhere. Shakeel recently added commit14e0f6c957e39 ("memcg: reduce memory for the lruvec and memcg stats"), which changed this such that we only maintain the stats we actually expose per-memcg (via a translation table). He also added commit 514462bbe927b ("memcg: warn for unexpected events and stats"), which warns if we try to update a stat per-memcg that we do not maintain per-memcg (i.e. the warning firing here). The goal is to make sure the translation table has all the stats it needs to have. Both of these commits were just merged today into mm-stable, hence the need for the fix now. It is the warning working as intended. No Fixes or CC stable are needed, but if necessary I would think: Fixes: 514462bbe927b ("memcg: warn for unexpected events and stats") , because without the warning, the stat update will just be ignored. So if anything the warning should have been added *after* this was fixed up. > > Fixes: ? > > Do we want to CC stable? > > > -- > Cheers, > > David / dhildenb >