Hi Mina, Thank you for the patch! Yet something to improve: [auto build test ERROR on hnaz-mm/master] url: https://github.com/0day-ci/linux/commits/Mina-Almasry/mm-shmem-support-deterministic-charging-of-tmpfs/20211111-062122 base: https://github.com/hnaz/linux-mm master config: ia64-defconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/aaf0e3e0832977b6eb257e1ed27747cf97c479d4 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Mina-Almasry/mm-shmem-support-deterministic-charging-of-tmpfs/20211111-062122 git checkout aaf0e3e0832977b6eb257e1ed27747cf97c479d4 # save the attached .config to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): mm/shmem.c:118:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef] 118 | #if CONFIG_MEMCG | ^~~~~~~~~~~~ mm/shmem.c: In function 'shmem_add_to_page_cache': >> mm/shmem.c:721:46: error: invalid use of undefined type 'struct mem_cgroup' 721 | css_put(&remote_memcg->css); | ^~ mm/shmem.c: In function 'shmem_getpage_gfp': mm/shmem.c:1863:38: error: invalid use of undefined type 'struct mem_cgroup' 1863 | css_put(&remote_memcg->css); | ^~ mm/shmem.c: In function 'shmem_parse_one': mm/shmem.c:3410:28: warning: unused variable 'memcg' [-Wunused-variable] 3410 | struct mem_cgroup *memcg; | ^~~~~ mm/shmem.c: In function 'shmem_reconfigure': mm/shmem.c:3616:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef] 3616 | #if CONFIG_MEMCG | ^~~~~~~~~~~~ mm/shmem.c: In function 'shmem_fill_super': mm/shmem.c:3772:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef] 3772 | #if CONFIG_MEMCG | ^~~~~~~~~~~~ vim +721 mm/shmem.c 691 692 /* 693 * Like add_to_page_cache_locked, but error if expected item has gone. 694 */ 695 static int shmem_add_to_page_cache(struct page *page, 696 struct address_space *mapping, 697 pgoff_t index, void *expected, gfp_t gfp, 698 struct mm_struct *charge_mm) 699 { 700 XA_STATE_ORDER(xas, &mapping->i_pages, index, compound_order(page)); 701 unsigned long i = 0; 702 unsigned long nr = compound_nr(page); 703 int error; 704 struct mem_cgroup *remote_memcg; 705 706 VM_BUG_ON_PAGE(PageTail(page), page); 707 VM_BUG_ON_PAGE(index != round_down(index, nr), page); 708 VM_BUG_ON_PAGE(!PageLocked(page), page); 709 VM_BUG_ON_PAGE(!PageSwapBacked(page), page); 710 VM_BUG_ON(expected && PageTransHuge(page)); 711 712 page_ref_add(page, nr); 713 page->mapping = mapping; 714 page->index = index; 715 716 if (!PageSwapCache(page)) { 717 remote_memcg = mem_cgroup_mapping_get_charge_target(mapping); 718 if (remote_memcg) { 719 error = mem_cgroup_charge_memcg(page_folio(page), 720 remote_memcg, gfp); > 721 css_put(&remote_memcg->css); 722 } else 723 error = mem_cgroup_charge(page_folio(page), charge_mm, 724 gfp); 725 if (error) { 726 if (PageTransHuge(page)) { 727 count_vm_event(THP_FILE_FALLBACK); 728 count_vm_event(THP_FILE_FALLBACK_CHARGE); 729 } 730 goto error; 731 } 732 } 733 cgroup_throttle_swaprate(page, gfp); 734 735 do { 736 void *entry; 737 xas_lock_irq(&xas); 738 entry = xas_find_conflict(&xas); 739 if (entry != expected) 740 xas_set_err(&xas, -EEXIST); 741 xas_create_range(&xas); 742 if (xas_error(&xas)) 743 goto unlock; 744 next: 745 xas_store(&xas, page); 746 if (++i < nr) { 747 xas_next(&xas); 748 goto next; 749 } 750 if (PageTransHuge(page)) { 751 count_vm_event(THP_FILE_ALLOC); 752 __mod_lruvec_page_state(page, NR_SHMEM_THPS, nr); 753 } 754 mapping->nrpages += nr; 755 __mod_lruvec_page_state(page, NR_FILE_PAGES, nr); 756 __mod_lruvec_page_state(page, NR_SHMEM, nr); 757 unlock: 758 xas_unlock_irq(&xas); 759 } while (xas_nomem(&xas, gfp)); 760 761 if (xas_error(&xas)) { 762 error = xas_error(&xas); 763 goto error; 764 } 765 766 return 0; 767 error: 768 page->mapping = NULL; 769 page_ref_sub(page, nr); 770 return error; 771 } 772 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org