Commit 6a2c5a9c authored by Barry Song's avatar Barry Song Committed by Kalesh Singh
Browse files

FROMGIT: mm: huge_mm: fix undefined reference to `mthp_stats' for CONFIG_SYSFS=n

if CONFIG_SYSFS is not enabled in config, we get the below error,

All errors (new ones prefixed by >>):

   s390-linux-ld: mm/memory.o: in function `count_mthp_stat':
>> include/linux/huge_mm.h:285:(.text+0x191c): undefined reference to `mthp_stats'
   s390-linux-ld: mm/huge_memory.o:(.rodata+0x10): undefined reference to `mthp_stats'

vim +285 include/linux/huge_mm.h

   279
   280  static inline void count_mthp_stat(int order, enum mthp_stat_item item)
   281  {
   282          if (order <= 0 || order > PMD_ORDER)
   283                  return;
   284
 > 285          this_cpu_inc(mthp_stats.stats[order][item]);
   286  }
   287

Link: https://lkml.kernel.org/r/20240523210045.40444-1-21cnbao@gmail.com


Fixes: ec33687c ("mm: add per-order mTHP anon_fault_alloc and anon_fault_fallback counters")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405231728.tCAogiSI-lkp@intel.com/


Change-Id: I3f157a84ae1bf2301a2e785728899df005d40d5b
Signed-off-by: default avatarBarry Song <v-songbaohua@oppo.com>
Tested-by: default avatarYujie Liu <yujie.liu@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Bug: 313807618
(cherry picked from commit 94d46bf1 https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git

 mm-unstable)
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent 20c5972c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment