From patchwork Wed Jun 12 05:10:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13694423 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 9FF3FC27C53 for ; Wed, 12 Jun 2024 05:10:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0650E6B0093; Wed, 12 Jun 2024 01:10:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F2EB46B009C; Wed, 12 Jun 2024 01:10:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCEB56B009D; Wed, 12 Jun 2024 01:10:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B7E0A6B0093 for ; Wed, 12 Jun 2024 01:10:49 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2F447C14F7 for ; Wed, 12 Jun 2024 05:10:49 +0000 (UTC) X-FDA: 82221061818.13.03FD662 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) by imf12.hostedemail.com (Postfix) with ESMTP id 8824740004 for ; Wed, 12 Jun 2024 05:10:47 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=OSY8guqC; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.160.44 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718169047; 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=gxIuQyI+KqEjqXSPbt+rLQHHedM6hADL5yUtu3q/GcU=; b=ZwkeH/Ib67rj3KkTOVNSr4K6MA+N/Wm/QalIu2WT6Lxus02ZM7Bf3xHSd6uNh3SnqOR4JS U1k80QEoS1Pz+lbWYtdkyOmwft0p7ah2riVmqcdd660gmYqiaSQtjErZcA/T2RS7bDrwj5 blxSR2mC2rNbK96GpHVaAxUacDkfLzM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=OSY8guqC; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.160.44 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718169047; a=rsa-sha256; cv=none; b=8g1QlFnMEzTJfuCG+xo7zUN7DQFLpg/Rtenj85wEfS/0Bf72iTrkUALujmX4YlMdIO6jGS +tRORiPMM8SRzfxE9YqUqdPyWjSin/E9p1OyVTSBlIjhqwKnlgrrsQRlyX8oFxlbAF4GnZ vn2NTHSvih++7+d3wzEa1DA5DvK2HPk= Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-254a370e7a4so270172fac.1 for ; Tue, 11 Jun 2024 22:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718169046; x=1718773846; darn=kvack.org; h=mime-version:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=gxIuQyI+KqEjqXSPbt+rLQHHedM6hADL5yUtu3q/GcU=; b=OSY8guqCTyDShycUHx7vvxtlVrNjK12wPBJd6WUAQ8hE79rEV37g04pcyJFnBsaV7A luYR9ol2CC/4uzMpZZyNMETvZoYivOVpvg0eHhduK0wz/0/2Zzy4yFWkoxBTpBt1XLDT cwjam74RUfTDdC3IkHtUI6HPY+12JhKKPWTasifwELamr4TFm6GK4JXnBNeVbtDhQRX/ Opm+fHWMw9pdUI1ic2dQ0lFWXogRCS0J7UhPYBFEL9wVzoAACrQ5FVxZKAd/FnnLfS1V 1PJMECEu8NIT2g1Fpn18arZ0y6ZQJ9cGJuC/tFMDiwc3BUHMepHzo7s+YYdWYderpp8l 0CWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718169046; x=1718773846; h=mime-version:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gxIuQyI+KqEjqXSPbt+rLQHHedM6hADL5yUtu3q/GcU=; b=rvrWO1PVLztp+zuf1Yi79SjUhfnWSeNYw0RIVIxxSs4MQQKW3csZ8JzDrhPhIl8KlA EX1qlTB8GNCaLpPgHLHbqUVC/bKWBoHwprTO2pPQV2hdM4FMLZl2E4TbVtdQR2r0t96F GZ/UtYIG1Y8zZGyqIA8uaApLzwxWRdS5gnHXZDNx3cAqvdeOu/KHq5J7q9liWmX+fiwg 1lBJkMhMnN42eIB4moQY8OPHX76INekKvBq+INrBpQMXXdbjwIzl9XJ/SAtFp3W5CECa T66iZvZbxNxbdbKh0NVT9aB7Bz2nYWEuHp9KRzOT/3GgDUicdjoSbHHgnKD22Jj0vF9D W2og== X-Forwarded-Encrypted: i=1; AJvYcCUPNPT3nvjNZjzb1E3cm1PyM+lTROGeHLUYq25Qry1bxdI51+pn94evO496p7nCZ9RG4TFnU3Lw+6+t27fttNs4XbE= X-Gm-Message-State: AOJu0Yz/B2nYyWZqg6zxVMWbut0ylWE7UKTejpqtpBjhE3x36ia6/4xa aVDYfRGIjOrnVTfLosRR0r39RiESbgFKE5V8eqs5Xj6J6JbCZrkRirqrDvd1og== X-Google-Smtp-Source: AGHT+IGiNmcr+Nz2B0xj5+N+rKP1+pl5UWeNkvv3gEeqh+JA35GJJ3cB5kaZJhQz2KxpNG2GrPrSKg== X-Received: by 2002:a05:6870:968f:b0:250:3c9d:fd20 with SMTP id 586e51a60fabf-255131599d8mr469507fac.0.1718169046206; Tue, 11 Jun 2024 22:10:46 -0700 (PDT) Received: from darker.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-254a8de199asm1855570fac.22.2024.06.11.22.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 22:10:45 -0700 (PDT) Date: Tue, 11 Jun 2024 22:10:43 -0700 (PDT) From: Hugh Dickins To: Andrew Morton cc: Yosry Ahmed , David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH unstable] mm: rmap: abstract updating per-node and per-memcg stats fix Message-ID: <49914517-dfc7-e784-fde0-0e08fafbecc2@google.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8824740004 X-Stat-Signature: 3tdce8876b3gp9c8bkn6nkkatsqnm8ce X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1718169047-135584 X-HE-Meta: U2FsdGVkX18KLlpvXrF8zH0Ez8+6cYqfUnK5clHWDBj4iIbK6FcqRkhT9tWYE1ha/wWGG2iQn6yVlNbU6LIT/1+aKTqdUv/S7zKfkAqAbt/LqD3Q0CwBQdrac0KMOcfU5zl+ho3kE6sOLNXFz/D6XQQjagjrxvmIOiFGgQk9xe7eC4j+Rll64tEUyWuZfQRd+hNsJP4ndGAfgt3rX6NXlY8arxHAZ5GdKC0gnyQ4dOUxQkElslwG7WQkVf65jSM1smuYH7n2bwXRDFENO1NNl/fewe1wXMl7gQi9NuaAV6yfR2fqqMuGHtKEBKfi5IHdPXZ/PwCqi0Mkc91+surfY1CTw4Z9yM/kbDepKjBUORTEURETH4Toj/QpczrpV7Hlk2cGEyyBPgHUK3SkhRLJHMGbhLMsRZGWLUofnx4jJeGQmxI0DvAspVW2sT6dT/3rXq1nZ+3sbvXhyYtKE4t7A0j5PzBUJxf8R60nLx83tZlpXkJjaipVlJ9NWLs7WBnMbWCabGLvYS+J1xrusCrCpghGv+zrIH5pi8c9dWEVKygEL1cuidPMcNz/TaTeA4hir2wK2JuvYVyRT7wPsAhpN59RxihrMYpA2BW4/RKiHk0xVHxbbpMLzl92rEtmB3Dyh/agdqnW/epMSRVxCkDlW39dvlUNUrjbXk2kuY0Hjff1Kv0RO3u5QwEN/dSk/zVHZSffL6f6iRPhmnjC/u+RZCvsu77FqXH4ZSuFJtKaZsCPPgihvAkMMPxpYr1mm+ryxqqHaDiyVo0enW+Lpa85p9a0Z8YDBQDRiQtYUdGMMHAGfTCwXpq4AqKjkAXQKhzMhpuVPDet12hp5QnfMVBiDFJ7vKVFE70fVK09sKrX3pziymerLE772VzQt6HiXmXUEPZqRJw7xW9Hm3EUyPZAFI20/6L4kmAcyTR7ZZoCRSSuEf+VyricKQYHB5sc5mBwBdZTZhekF96ul9TBMCs SG46OnXW pWO3Ewz+y8oT9f2CEukV5U5cQEG2ZkfGTvueuMNqMsFlgbZjTHKd32CP/Nm5qIt0gY77Uo1F/IOyvmMh6mc13DwtrEEJD31bw52SFuC2AHdpam0k73tikIYSIXZh1OhOExEO8fML2LwRVpzOGCYwF0V+aE/O5ICMkujulZyv0WNJPCdUmRQYbyHDbTWnCUYw0J04fQ1hqJHQbNylWKqBVgz4QeMLpt5TpvaOiKFpuvQAkD1PDltMbeRFSpx7IlWisoqDJ7fTb8API6u/9crMQJXjIUh5tbpKRjRHWXSrKsWrPK+aoWRiZP8PNhs4KXiO9U3xqgjA3h0TTa0xSIGsmm0p2UcKWdpom3hSYHiH/dV14f6244vzz6P3G0A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000012, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: /proc/meminfo is showing ridiculously large numbers on some lines: __folio_remove_rmap()'s __folio_mod_stat() should be subtracting! Signed-off-by: Hugh Dickins Reviewed-by: Yosry Ahmed Acked-by: David Hildenbrand --- A fix for folding into mm-unstable, not needed for 6.10-rc. mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1567,7 +1567,7 @@ static __always_inline void __folio_remove_rmap(struct folio *folio, list_empty(&folio->_deferred_list)) deferred_split_folio(folio); } - __folio_mod_stat(folio, nr, nr_pmdmapped); + __folio_mod_stat(folio, -nr, -nr_pmdmapped); /* * It would be tidy to reset folio_test_anon mapping when fully