tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: ceb2fe0d438644e1de06b9a6468a1fb8e2199c70 commit: 3e66d585be0b60d7cbf5cdb391dfeb5452040b5a [8322/9113] mm: memcg: restore subtree stats flushing config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20231218/202312182206.dlCV0jBv-lkp@xxxxxxxxx/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231218/202312182206.dlCV0jBv-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202312182206.dlCV0jBv-lkp@xxxxxxxxx/ Note: the linux-next/master HEAD ceb2fe0d438644e1de06b9a6468a1fb8e2199c70 builds fine. It may have been fixed somewhere. All errors (new ones prefixed by >>): mm/zswap.c: In function 'zswap_shrinker_count': >> mm/zswap.c:644:9: error: too few arguments to function 'mem_cgroup_flush_stats' 644 | mem_cgroup_flush_stats(); | ^~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/swap.h:9, from mm/zswap.c:24: include/linux/memcontrol.h:1054:6: note: declared here 1054 | void mem_cgroup_flush_stats(struct mem_cgroup *memcg); | ^~~~~~~~~~~~~~~~~~~~~~ vim +/mem_cgroup_flush_stats +644 mm/zswap.c b5ba474f3f5187 Nhat Pham 2023-11-30 631 b5ba474f3f5187 Nhat Pham 2023-11-30 632 static unsigned long zswap_shrinker_count(struct shrinker *shrinker, b5ba474f3f5187 Nhat Pham 2023-11-30 633 struct shrink_control *sc) b5ba474f3f5187 Nhat Pham 2023-11-30 634 { b5ba474f3f5187 Nhat Pham 2023-11-30 635 struct zswap_pool *pool = shrinker->private_data; b5ba474f3f5187 Nhat Pham 2023-11-30 636 struct mem_cgroup *memcg = sc->memcg; b5ba474f3f5187 Nhat Pham 2023-11-30 637 struct lruvec *lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(sc->nid)); b5ba474f3f5187 Nhat Pham 2023-11-30 638 unsigned long nr_backing, nr_stored, nr_freeable, nr_protected; b5ba474f3f5187 Nhat Pham 2023-11-30 639 b5ba474f3f5187 Nhat Pham 2023-11-30 640 if (!zswap_shrinker_enabled) b5ba474f3f5187 Nhat Pham 2023-11-30 641 return 0; b5ba474f3f5187 Nhat Pham 2023-11-30 642 b5ba474f3f5187 Nhat Pham 2023-11-30 643 #ifdef CONFIG_MEMCG_KMEM b5ba474f3f5187 Nhat Pham 2023-11-30 @644 mem_cgroup_flush_stats(); b5ba474f3f5187 Nhat Pham 2023-11-30 645 nr_backing = memcg_page_state(memcg, MEMCG_ZSWAP_B) >> PAGE_SHIFT; b5ba474f3f5187 Nhat Pham 2023-11-30 646 nr_stored = memcg_page_state(memcg, MEMCG_ZSWAPPED); b5ba474f3f5187 Nhat Pham 2023-11-30 647 #else b5ba474f3f5187 Nhat Pham 2023-11-30 648 /* use pool stats instead of memcg stats */ b5ba474f3f5187 Nhat Pham 2023-11-30 649 nr_backing = get_zswap_pool_size(pool) >> PAGE_SHIFT; b5ba474f3f5187 Nhat Pham 2023-11-30 650 nr_stored = atomic_read(&pool->nr_stored); b5ba474f3f5187 Nhat Pham 2023-11-30 651 #endif b5ba474f3f5187 Nhat Pham 2023-11-30 652 b5ba474f3f5187 Nhat Pham 2023-11-30 653 if (!nr_stored) b5ba474f3f5187 Nhat Pham 2023-11-30 654 return 0; b5ba474f3f5187 Nhat Pham 2023-11-30 655 b5ba474f3f5187 Nhat Pham 2023-11-30 656 nr_protected = b5ba474f3f5187 Nhat Pham 2023-11-30 657 atomic_long_read(&lruvec->zswap_lruvec_state.nr_zswap_protected); b5ba474f3f5187 Nhat Pham 2023-11-30 658 nr_freeable = list_lru_shrink_count(&pool->list_lru, sc); b5ba474f3f5187 Nhat Pham 2023-11-30 659 /* b5ba474f3f5187 Nhat Pham 2023-11-30 660 * Subtract the lru size by an estimate of the number of pages b5ba474f3f5187 Nhat Pham 2023-11-30 661 * that should be protected. b5ba474f3f5187 Nhat Pham 2023-11-30 662 */ b5ba474f3f5187 Nhat Pham 2023-11-30 663 nr_freeable = nr_freeable > nr_protected ? nr_freeable - nr_protected : 0; b5ba474f3f5187 Nhat Pham 2023-11-30 664 b5ba474f3f5187 Nhat Pham 2023-11-30 665 /* b5ba474f3f5187 Nhat Pham 2023-11-30 666 * Scale the number of freeable pages by the memory saving factor. b5ba474f3f5187 Nhat Pham 2023-11-30 667 * This ensures that the better zswap compresses memory, the fewer b5ba474f3f5187 Nhat Pham 2023-11-30 668 * pages we will evict to swap (as it will otherwise incur IO for b5ba474f3f5187 Nhat Pham 2023-11-30 669 * relatively small memory saving). b5ba474f3f5187 Nhat Pham 2023-11-30 670 */ b5ba474f3f5187 Nhat Pham 2023-11-30 671 return mult_frac(nr_freeable, nr_backing, nr_stored); b5ba474f3f5187 Nhat Pham 2023-11-30 672 } b5ba474f3f5187 Nhat Pham 2023-11-30 673 :::::: The code at line 644 was first introduced by commit :::::: b5ba474f3f518701249598b35c581b92a3c95b48 zswap: shrink zswap pool based on memory pressure :::::: TO: Nhat Pham <nphamcs@xxxxxxxxx> :::::: CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki