Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp126218lqh; Mon, 6 May 2024 13:30:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnwFOHxlRr201nPByWupJAykw7+NtmD7g/SNRaydV4uG/rY945+0JqtXcCzE4G7yGc+FO9yG0QJlTuU6fXPtHaIdlpt7l4TGW7lqXDUQ== X-Google-Smtp-Source: AGHT+IHQL0tEL7oQMvhkXyd2Zl6fOyB69nglnNlpjSHs5bo8LoMEFbIy+Vdx6HISWOWFB5zMegx4 X-Received: by 2002:ac2:5291:0:b0:51f:697b:b56e with SMTP id q17-20020ac25291000000b0051f697bb56emr6625453lfm.5.1715027442579; Mon, 06 May 2024 13:30:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715027442; cv=pass; d=google.com; s=arc-20160816; b=jfk/cMrOZLu2+V8MYQRoIo2qdwvrW2CqVdKQYpbGxik0rRbkEHPiEzN7LgjjzV+jfb bbeHLJTxcBthIWnViQE0r1Sn76duL2tZnHHazUld68Hj0B7sCs0WJb6fHlI/2TO5pFiF 1NKd2XqRQuQj9mgiPiX0BuSoKx8E04g3ZN1Ub/nt8W433O6eyd0uI1rv9KSHmWnNXvUN IfJrTRlZiX6w8xIt28onwoAlX9kE8mir973P9YV4q8/qEv/lImTvtaeQZRGyaNfaDsjK P8Nx9ttDsLGqRy9uoJ98z/I9+r2wc5roocvHIUHmQPFIjyCX3XZXg5FvyW4FeEnhr+5m sHtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=zWTgDMw010qjBzY9SNStiBF2+BhONuUA6RIHZNLF4YI=; fh=NhvAG7YMdUQcyJITupyZk51UpqpDuthCeEuiZVaWBz8=; b=NT0ykY1h0ltw+SVnh35UzZCXkvnCJVNL9LEHNqn1qDQAq0De5RdWKThCOJUmihKi4b u64IV2/1kHVwbrQE2OwXAfogzOTWfz1OXWl7lZZ3VIyXkz6qfjSCFlwpfDpExTDszoE7 ROTtgsTsJtWcGbZxtFpnU9/cWHV0Rb/17RSTxTavkvqMFM3WEvybbeIejD/feNjeMixC Pg1FCEZhD0ktRvhSFq2/hzD/kg9oXqzllas8t6rqoODdVc06sD8kkJFuhzbtba7EHLTy 2hEw+GQfln1JQsFlK33RvLyndZ6vK9wXvNRqok3kNVbdmaWYromJbTxNrB1ASKYGkVCz ch5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="EvKNLO/J"; 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-170396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n23-20020a170906841700b00a59af83e402si2951538ejx.837.2024.05.06.13.30.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 13:30:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="EvKNLO/J"; 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-170396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170396-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4D0441F21972 for ; Mon, 6 May 2024 20:30:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49D4215B549; Mon, 6 May 2024 20:30:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EvKNLO/J" Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 31458158D64 for ; Mon, 6 May 2024 20:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715027435; cv=none; b=BFYw6NCM+0PjD4WAR/CcoNqKpFb+lBrQ9Pqzz7OQnprV4K8a46T2IwiU0Ph0RESpaymMHqZH9AYd5h67ClAhK5fYU1o50VIzBFmiWqYFc6SCTeV7MKweHkGnWl8R93bARzF+9PLaXOPL2p+eh6EjNn3ffzjJTI50N4VuteNBi+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715027435; c=relaxed/simple; bh=R8tARm9RJFf1E2kRwZTfvLXE7k9nH6dKIKq82rh/Zr8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I5A0JKew0NG87C19F3Vr4qbCgEeACJUXxB1giAWD4nMJ9Xp+3ia8kw6vHhy3eI7lNSVL5t5czTaZC79QYbbfmq093AkkDTkQ6LKFU/JmhtVt/U+YLIi68NNfgv44oP7y67nsDJk7ZwneU0eHvNj/z5XM9dXxp3xeBQlCRbL7Tag= 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=EvKNLO/J; arc=none smtp.client-ip=95.215.58.178 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 Date: Mon, 6 May 2024 13:30:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715027429; 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=zWTgDMw010qjBzY9SNStiBF2+BhONuUA6RIHZNLF4YI=; b=EvKNLO/JPjUI8g84XqS/c8Vr2c1jLOLboa5hR1FxWZnWTzoheYGGabDAkAgEWeVqHqnV7P Pr3PFGD+9YllGtNWxf0gWmfMRHjMGMb46W/O4HK2XpYp80gRGQL6WsDP1RpeyUeNM1GawN tCLtZY8O+UblZWbaC7vM8sYHrRGlJss= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Yosry Ahmed Cc: Andrew Morton , Shakeel Butt , Johannes Weiner , Michal Hocko , Muchun Song , David Hildenbrand , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com Subject: Re: [PATCH v2] mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED Message-ID: References: <20240506192924.271999-1-yosryahmed@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240506192924.271999-1-yosryahmed@google.com> X-Migadu-Flow: FLOW_OUT On Mon, May 06, 2024 at 07:29:24PM +0000, Yosry Ahmed wrote: > Previously, all NR_VM_EVENT_ITEMS stats were maintained per-memcg, > although some of those fields are not exposed anywhere. Commit > 14e0f6c957e39 ("memcg: reduce memory for the lruvec and memcg stats") > changed this such that we only maintain the stats we actually expose > per-memcg via a translation table. > > Additionally, commit 514462bbe927b ("memcg: warn for unexpected events > and stats") added a warning if a per-memcg stat update is attempted for > a stat that is not in the translation table. The warning started firing > for the NR_{FILE/SHMEM}_PMDMAPPED stat updates in the rmap code. These > stats are not maintained per-memcg, and hence are not in the translation > table. > > Do not use __lruvec_stat_mod_folio() when updating NR_FILE_PMDMAPPED and > NR_SHMEM_PMDMAPPED. Use __mod_node_page_state() instead, which updates > the global per-node stats only. > > Reported-by: syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/lkml/0000000000001b9d500617c8b23c@google.com > Fixes: 514462bbe927 ("memcg: warn for unexpected events and stats") > Acked-by: Shakeel Butt > Signed-off-by: Yosry Ahmed Reviewed-by: Roman Gushchin Thanks!