The patch titled Subject: memcg: expose swapcache stat for memcg v1 has been added to the -mm mm-unstable branch. Its filename is memcg-expose-swapcache-stat-for-memcg-v1.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/memcg-expose-swapcache-stat-for-memcg-v1.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Liu Shixin <liushixin2@xxxxxxxxxx> Subject: memcg: expose swapcache stat for memcg v1 Date: Fri, 15 Sep 2023 18:58:44 +0800 Patch series "Expose swapcache stat for memcg v1", v2. Since commit b6038942480e ("mm: memcg: add swapcache stat for memcg v2") adds swapcache stat for the cgroup v2, it seems there is no reason to hide it in memcg v1. Conversely, with swapcached it is more accurate to evaluate the available memory for memcg. Link: https://lkml.kernel.org/r/20230915105845.3199656-1-liushixin2@xxxxxxxxxx Link: https://lkml.kernel.org/r/20230915105845.3199656-2-liushixin2@xxxxxxxxxx Signed-off-by: Liu Shixin <liushixin2@xxxxxxxxxx> Suggested-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Acked-by: Tejun Heo <tj@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Jonathan Corbet <corbet@xxxxxxx> Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Michal Koutný <mkoutny@xxxxxxxx> Cc: Zefan Li <lizefan.x@xxxxxxxxxxxxx> Cc: Roman Gushchin <roman.gushchin@xxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/admin-guide/cgroup-v1/memory.rst | 1 + mm/memcontrol.c | 6 ++++++ 2 files changed, 7 insertions(+) --- a/Documentation/admin-guide/cgroup-v1/memory.rst~memcg-expose-swapcache-stat-for-memcg-v1 +++ a/Documentation/admin-guide/cgroup-v1/memory.rst @@ -544,6 +544,7 @@ memory.stat file includes following stat event happens each time a page is unaccounted from the cgroup. swap # of bytes of swap usage + swapcached # of bytes of swap cached in memory dirty # of bytes that are waiting to get written back to the disk. writeback # of bytes of file/anon cache that are queued for syncing to disk. --- a/mm/memcontrol.c~memcg-expose-swapcache-stat-for-memcg-v1 +++ a/mm/memcontrol.c @@ -4061,7 +4061,10 @@ static const unsigned int memcg1_stats[] NR_WRITEBACK, WORKINGSET_REFAULT_ANON, WORKINGSET_REFAULT_FILE, +#ifdef CONFIG_SWAP MEMCG_SWAP, + NR_SWAPCACHE, +#endif }; static const char *const memcg1_stat_names[] = { @@ -4076,7 +4079,10 @@ static const char *const memcg1_stat_nam "writeback", "workingset_refault_anon", "workingset_refault_file", +#ifdef CONFIG_SWAP "swap", + "swapcached", +#endif }; /* Universal VM events cgroup1 shows, original sort order */ _ Patches currently in -mm which might be from liushixin2@xxxxxxxxxx are mm-vmscan-try-to-reclaim-swapcache-pages-if-no-swap-space.patch mm-vmscan-try-to-reclaim-swapcache-pages-if-no-swap-space-v6.patch memcg-expose-swapcache-stat-for-memcg-v1.patch memcg-remove-unused-do_memsw_account-in-memcg1_stat_format.patch