From patchwork Fri Jan 10 12:21:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 13934384 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 BC042E7719C for ; Fri, 10 Jan 2025 12:20:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CE086B00C5; Fri, 10 Jan 2025 07:20:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10AB76B00C7; Fri, 10 Jan 2025 07:20:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC1656B00C5; Fri, 10 Jan 2025 07:20:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B0E956B00AE for ; Fri, 10 Jan 2025 07:20:50 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6E35F1A09F0 for ; Fri, 10 Jan 2025 12:20:50 +0000 (UTC) X-FDA: 82991451060.20.E046D98 Received: from esa12.hc1455-7.c3s2.iphmx.com (esa12.hc1455-7.c3s2.iphmx.com [139.138.37.100]) by imf13.hostedemail.com (Postfix) with ESMTP id 22EE220003 for ; Fri, 10 Jan 2025 12:20:47 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=fj2 header.b=fVe76nNl; spf=pass (imf13.hostedemail.com: domain of lizhijian@fujitsu.com designates 139.138.37.100 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com; dmarc=pass (policy=reject) header.from=fujitsu.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736511648; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=FuZFfiENKRgkY7jivRvtdfoZ7u5bptdDnuVAG8Vu8Kg=; b=747TqfMGw3UxUlEFU8MFv06X9wwPBEv5EHez0t2b4lXrfy6KB2pt3g53qQaD5LgklGv51c hmwbsaUTd4KppNFM2/NXLOPIYKbQz8gKgkWr0z5nIevC8rwums/BmU7QbHNOj5OPEh0GIL o40yrHsC8J/5BcGG48UMiFu/3HeetaU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=fj2 header.b=fVe76nNl; spf=pass (imf13.hostedemail.com: domain of lizhijian@fujitsu.com designates 139.138.37.100 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com; dmarc=pass (policy=reject) header.from=fujitsu.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736511648; a=rsa-sha256; cv=none; b=fXAeqNXI75ffR7b8/NSHW5+OLES+mO5WsfuZQBwyDhA/Vzb7lcduOHOJjWYiQGlfYIw52W uDAg6Ik3El5GJua52v7GGOvnngQMVgg46zJ6ZVHaEEVfU3gYe8w/H0hFum8rlrfWRI0KiQ brroKPH24iPQ3EFTaDOn4ebMMjpYiF0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736511648; x=1768047648; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=65r/qZPJes78kiIIXaRQZysNM1Xe6cntqmOLkf1614c=; b=fVe76nNlx2eQqEM5NVMoGHD7Mwig7WtGfLC53cVntd2KXCG6wTpAeZzI W4pNq4/4wh1drj+L9PAOqpt69rcXWyLOZKDzj2/L7nsplG6/qreoJ4duk MAGy3e/mgeWM+r9M4Ug3tseHhgojE5hnNFjOR1ksYoZw+eIMaGEmkFz8H XLqep5+S0Cc86uRSuE4HP0Hu7vDYnYll1a/u6JB6L8/v1VVU//RtiJT9w uklpBJed4pq/ie5YMoDONXrKODjICtx6TC40dw6WNGVk4HQzJl8NZjh2b PAXoNWhSfu2ANei1G03lWsFjujUDNqQkVVUR+v0wWycAtUBiDu1+K82qt A==; X-CSE-ConnectionGUID: 2rLa2X5pSymKHo05Zx3BlQ== X-CSE-MsgGUID: lkGmYMBUTzCnoKghX+Gv1A== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="165128461" X-IronPort-AV: E=Sophos;i="6.12,303,1728918000"; d="scan'208";a="165128461" Received: from unknown (HELO yto-r4.gw.nic.fujitsu.com) ([218.44.52.220]) by esa12.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2025 21:20:46 +0900 Received: from yto-m1.gw.nic.fujitsu.com (yto-nat-yto-m1.gw.nic.fujitsu.com [192.168.83.64]) by yto-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id B5F1AE0765 for ; Fri, 10 Jan 2025 21:20:43 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by yto-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 8CF70D1980 for ; Fri, 10 Jan 2025 21:20:43 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 1C5062022762A for ; Fri, 10 Jan 2025 21:20:42 +0900 (JST) Received: from iaas-rdma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 2670E1A000B; Fri, 10 Jan 2025 20:20:42 +0800 (CST) From: Li Zhijian To: linux-mm@kvack.org Cc: Kaiyang Zhao , Andrew Morton , linux-kernel@vger.kernel.org, Li Zhijian Subject: [PATCH 1/2] mm/vmscan: Accumulate nr_demoted for accurate demotion statistics Date: Fri, 10 Jan 2025 20:21:32 +0800 Message-ID: <20250110122133.423481-1-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28914.007 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28914.007 X-TMASE-Result: 10-7.328400-10.000000 X-TMASE-MatchedRID: UpZ+EYxJ0vkM5CG8CYBPxaPbYx8mFyCIqf/efKFN1nCr1gUu9f1F/xzu L4P52bGMIvrftAIhWmLy9zcRSkKatXN94JK30y2IngIgpj8eDcBpkajQR5gb3mn0m688Eo38Kra uXd3MZDVwWSVyBlCcxxJo5B2/HUubMnVEloGvKtNuqigeLFHGpT2VMu9pSwVzr98/cAo+GMyY2/ fVgU35PnS6FqTvuDH1Jyi7ol44knmUTGVAhB5EbQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Rspamd-Queue-Id: 22EE220003 X-Rspamd-Server: rspam12 X-Stat-Signature: xjsznxhqy56xery6849pie7yydqk86by X-Rspam-User: X-HE-Tag: 1736511647-151409 X-HE-Meta: U2FsdGVkX1/g4fnHGntkVOi5tuYZNf07BU35tcIfay/yI/NFYS7x8BTP4Tjvaqt2h6A2PgBxMefDlpJHvWCxMC9UnZ+mbzSKk3m6zUKs40pCgprJ+6/Q6FQ7sJQf4Qf9GvGxwVLXmh5gUDRwd1m6vUgOdWmF8kAriqseWzTtwharsPGBmVXnOD6pHt3C1ju3RqbGHWS8NWgy1T8KxONA2asfbU3Tgjzy3KSUP8S/HLWAFXHC/BrS2hPByPzgY4eIK8p+K4+O5o6aByO4fT8HIEiQcACix0v72Xdh70Nl/xryMaJl9M72Ws2kb/c+FVeIWQrt8aTZXox8jMuAcBQFBpSUHmyck601KIJGs/EDretYfrOLE1Gl1OJVU7qvwCYBtp00YC84knSkP8i0UcsuMd9xgEmJJy5djm7P0z6esQi8LQp4kkMfyLbJEqp/gWRGzKPYV4B9T2FXRTzWvFYrhHiXlX8+bFuLY15oviMIir8LmG07BJw/QniLahP26DmqxA/7Soi2S70uBCqzBj9a2hAQC6ewGvxV2FgfSdtwHiuO02wNyfj+QCbDcyKlfu7zo7eZSrrKknF2BLT3JKYn3gxIR5o21AUYmSLSBGO29QziXdqzrwjrTk0k1KYbL2yFSTXgfdmbPyXYyuQttvu884+Amz0UXW0dMLlXx0OCabsIFXg3HzluDf8qCZBVyi3F4l19qGomUJljHYNLA78vjLnGGZMvIVFR4Ky+Lin0WGbXxpfx0p1kNEv4nXphjc5IJq4UWMtP73smcyxN2V7ErBxFt1FVZvfmSjXWH83EzUWqj+7AAjHd+zw4gFMkjy/em5kDvMGek/PlEqErZ0dwljSgk4+TL58jQdd1Aj7+6WMxOD4A2zUVI0h5HB3oP4CYSbAzsykVStFuFQvgE/a9KuQm0jsGaMHGxby/2R0CYm7ACw9WfACCs4ixNjyqt5qabJfe1tKlRsdIt228utr asPFfiGA uaEBsDtgyfInnhXqYlt+nMZVb/wlqVuuIULoxl8d29CU5XYO7O2yGe8MQW8BiWQJPPphLbaa9GVGJh7oHfsqt5xCmVGqbLDJHfFuigIswepSTLhZAkRREEylGQQSvbEKPmYXm4yZIFhZyt4SLPrDwPYUaTGrNndc0NeYTui5BuqZTrNwBz7kthONHZrhTkwEeZ2pJD9yl09LSYZvGCliOVFbIAeSNP6VeNdNW4wFYM3U43F82mKB0aPYVVJybdsCFGMkKBgPm/ME0S7f7MSOh3/lFy6WrweGIqTe+UF5AcoDXeFpKAFRLeMhlqQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000064, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In the shrink_folio_list() function, demote_folio_list() can be called multiple times, which can lead to inaccurate demotion statistics if the number of demoted pages is not accumulated correctly. Accumulate the nr_demoted count across multiple calls to demote_folio_list(), ensuring accurate reporting of demotion statistics. Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations") Signed-off-by: Li Zhijian Acked-by: Kaiyang Zhao --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 9a859b7d18d7..430d580e37dd 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1522,7 +1522,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, /* 'folio_list' is always empty here */ /* Migrate folios selected for demotion */ - stat->nr_demoted = demote_folio_list(&demote_folios, pgdat); + stat->nr_demoted += demote_folio_list(&demote_folios, pgdat); nr_reclaimed += stat->nr_demoted; /* Folios that could not be demoted are still in @demote_folios */ if (!list_empty(&demote_folios)) { From patchwork Fri Jan 10 12:21:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 13934383 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 78231E77188 for ; Fri, 10 Jan 2025 12:20:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4CD86B00AC; Fri, 10 Jan 2025 07:20:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF97B6B00AE; Fri, 10 Jan 2025 07:20:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C741F6B00C6; Fri, 10 Jan 2025 07:20:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A84116B00AC for ; Fri, 10 Jan 2025 07:20:50 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3752A1A0A8B for ; Fri, 10 Jan 2025 12:20:50 +0000 (UTC) X-FDA: 82991451060.14.41FA89A Received: from esa3.hc1455-7.c3s2.iphmx.com (esa3.hc1455-7.c3s2.iphmx.com [207.54.90.49]) by imf20.hostedemail.com (Postfix) with ESMTP id B32151C000D for ; Fri, 10 Jan 2025 12:20:47 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=fj2 header.b=gkndcfV4; dmarc=pass (policy=reject) header.from=fujitsu.com; spf=pass (imf20.hostedemail.com: domain of lizhijian@fujitsu.com designates 207.54.90.49 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736511648; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RPUMw5V65PDuiZlZcwoqDcb1GLy3GPrsP7lNG7RKfSk=; b=2wlXdrHPkn0NOOnNzlSRLgBLgCI+fhSL6u+lyKbjd7MYIkfH/3rvV0XYPzOPTV+Ox6rtqT DRstg7GF/rC3iCBNYyoVT6+LarOkPYiBVK2zukPwT99q/OZbeDyhpod0AF4eoUFJbf3/27 hPHan/yeFkRIo/wtbilkVOtuudV4ntI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736511648; a=rsa-sha256; cv=none; b=yI/1QucXU8pfGdTCU07VLZw9ISW/BNDd5r0rD2zhLlgou8HQj8pOsA2/8dCPz5CI5mVrjV VyVLAt4LIa6bvkcT3SPFxAEISUFoVc1gZYqWxu7ccPKjpLqSC9xZOaG5QXrDB2+AqjKFaX cH3gpe6FKpugLiRSnkj9KGxKHmBLHMg= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=fj2 header.b=gkndcfV4; dmarc=pass (policy=reject) header.from=fujitsu.com; spf=pass (imf20.hostedemail.com: domain of lizhijian@fujitsu.com designates 207.54.90.49 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736511648; x=1768047648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=42VWKJ8YW8tK01MzcnsOlNA2rXxVY4ofFPTfpQxtj6k=; b=gkndcfV4INylIH6eOgu0snxmZbtXhWwwMInGtkjEBXBaRFYMu1cvv4Lk Z4QfP7+8ZpuX8uX5qLzC1Rti/gJ4CuNoZxA/UFPlVyUQhukDZuVkr50G+ 7Fy8yBsViWyYa9GYuNAGli2yzUPmcz/XvOLLTmePUqn4xv87gGh6XU5TQ kyiGzI7zGxRrgjnLmSMK4AaQmPr6ksy3liTME1IZzUZVMBOybTD2+WIHA wTaOZtjtsNALgrPghm1nIigFKfK/2fplFyhWjqstrdtECjwZXZnz4cVck BiAghFVgw26qPPpmSiWhCg7PvsqCTIF1SZzk9XA3QQ2+Lvb7EphDyyi9m A==; X-CSE-ConnectionGUID: d9GJRVkJTZG/oXA9eY3DvQ== X-CSE-MsgGUID: R+RDezYGR/SbwZrR0n9SVg== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="186159827" X-IronPort-AV: E=Sophos;i="6.12,303,1728918000"; d="scan'208";a="186159827" Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2025 21:20:46 +0900 Received: from oym-m1.gw.nic.fujitsu.com (oym-nat-oym-m1.gw.nic.fujitsu.com [192.168.87.58]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id E720BDBBCD for ; Fri, 10 Jan 2025 21:20:43 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id BB324D8C1A for ; Fri, 10 Jan 2025 21:20:43 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 5113C202ED365 for ; Fri, 10 Jan 2025 21:20:43 +0900 (JST) Received: from iaas-rdma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id BF7211A0071; Fri, 10 Jan 2025 20:20:42 +0800 (CST) From: Li Zhijian To: linux-mm@kvack.org Cc: Kaiyang Zhao , Andrew Morton , linux-kernel@vger.kernel.org, Li Zhijian Subject: [PATCH 2/2] mm/vmscan: Fix pgdemote_* accounting with lru_gen_enabled Date: Fri, 10 Jan 2025 20:21:33 +0800 Message-ID: <20250110122133.423481-2-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20250110122133.423481-1-lizhijian@fujitsu.com> References: <20250110122133.423481-1-lizhijian@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28914.007 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28914.007 X-TMASE-Result: 10--7.632800-10.000000 X-TMASE-MatchedRID: llTo18AJfvH6C0RbcP9ApuMobH1h01ziY0r1N89tnQ7+Aw16GgqpOwSj wbzZYG9H1z8hM2rU8FCNtBPawAHW6IadzrWEfJJMVfLHMdWDkKgbbhhV65kaY8C5DTEMxpeQfiq 1gj2xET8qqtDuUtwyfLk3IyGZuuaD7xCWOo2+4bpwUSK4/EeOxVj54yQX4WAWt7nV+Ecc5FGjxY yRBa/qJXcsDK2xBHh7jaPj0W1qn0Q7AFczfjr/7JtAPn6huqqAqAMzFABxg/wqBYgQWxz9MOQui Ul2wtkbXZbe9jv1Xao= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Stat-Signature: dkpaxjmt7qnbqo7fcf9j877fp5gz145z X-Rspamd-Queue-Id: B32151C000D X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736511647-648335 X-HE-Meta: U2FsdGVkX1+VEwo+phfM2HpLi45HWllB/70O0lnhHtCCJd43YxfcAIFkk/sjqaGg+d2hSZlfH2CdNZM88W0Zdjh+ucMuvr6tnJneXW6mQOUnoC+3Mr/95LVSBtr9DnR8kUwgJd7BjoDmDmftfYtIScEdsssiRl33Ja0JtHoE6Tt6klv1tRT3NYnpd3wA5xhDLQwE7unLrEiiWoluwwEpnwpmvG9NEzZSVYMdRA/nEzz07Qmr37Y9xww5A+wFHuvoPKWBoT8nTRvPepWTg0dOme2COAwb6XEdduPxbLRJmpI2pBtLSyy7Lf59EZOTkJObpHqNRErkZm/DUKn+Y9PfrIPivAX1kDo9xZhFOn6Cda9QcOk4853R8WfT4s8kSEEDN4IaHCaDThJwDgIAIiiSfb/r7cQeCS9iOdfTXlLzIPsLXpG93wgHX6KNZ4FU81JJ+ILDJkNQ6JCLZ0IqKsaZAqIp4ijrmjAdeFj1Qn3XpVwl6qX5e5oJ1/eW9TFa08j+2a0mXA41UaCho1v8uB8OIBAw6AvEcA3L2Hi/bDc0hwxh6LMxC9/aHows2ykr+/iylAc2FPQMcVqwHDA0VV5y0O+pDYeD2yLf6/2ZpQf9QMba44SBIWJYDb8I10qPkqNabmJhLwLLeN9Xm7sA51f3ahAM55Hl4lSW0YksLyoXToW21akNaS9urcepcRP0YCYOl7PV78HxCySsG7pUvuSSG0fzsMlPc555mNY1uV0xB962HEEMs4LR7d9HkP8aKKLiDpGNSRXFv/zLsvwGpmZhKXDYOtdH3xbggTzTmV+1yBNrqntfW+GlL3tIxGO/YfawntSdk8qDO9lTra33ZYA/5QrPZEpqPalfSEtKQHXVUcPnRHCzPvNodt5Uue5esqbuznkgfGzzpaPPF43ODxyGcbY55ZonKQ2E4+v9WwBIST9U28HJnk11KoAzfH8Uy7i9a6r8JjdMm0XOZion39s pEUqL82X j3T5fq7kv2zCAkq1HuJOyVKX6z5yNds2Z84mZgIOTAFO2bQJ0BsSbnswY2dypoqkX9tmQQQ6UGzgBMTMKGlI/VgRA2nWZWuFNkSgYekys34XN3DybXKbNP5eK8KNxI5mWQJnF4zktVPJI86zRUE+A+8wd1tXvsieeC7WHZff6FmHQ83TU262Bvd3+04aJtyb0TxRyf/Cb9CJVQ3wljJUVhJi8Wvex/YvRIVA38TIYxM8M3o257vX24aMRkY4mRTb7hG0FoMsf6OmotCWNZBtdgancHfAH8p0CUKK14JSkP2WqIgA7Byl55k3qVA== 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: List-Subscribe: List-Unsubscribe: Commit f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations") moved the accounting of PGDEMOTE_* statistics to shrink_inactive_list(). However, shrink_inactive_list() is not called when lrugen_enabled is true, leading to incorrect demotion statistics despite actual demotion events occurring. Add the PGDEMOTE_* accounting in evict_folios(), ensuring that demotion statistics are correctly updated regardless of the lru_gen_enabled state. This fix is crucial for systems that rely on accurate NUMA balancing metrics for performance tuning and resource management. Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations") Signed-off-by: Li Zhijian --- mm/vmscan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 430d580e37dd..f2d279de06c4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4642,6 +4642,8 @@ static int evict_folios(struct lruvec *lruvec, struct scan_control *sc, int swap reset_batch_size(walk); } + __mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(), + stat.nr_demoted); item = PGSTEAL_KSWAPD + reclaimer_offset(); if (!cgroup_reclaim(sc)) __count_vm_events(item, reclaimed);