driver inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/10043 ---------------------------------------------------------------------- struct reclaim_notify_data is currently defined inside the does not depend on any CONFIG_RECLAIM_NOTIFY-gated type — every field (int, bool, unsigned long, the always-defined MAX_NUMNODES array, and enum reclaim_reason, which already lives outside the ifdef) is unconditionally available. However, the struct is referenced by code that is compiled regardless of CONFIG_RECLAIM_NOTIFY: obmm_lowmem.c (built under CONFIG_OBMM) and sentry_reporter.c (built under CONFIG_UB_SENTRY) both dereference it without their own ifdef guards. On the bigdipperv5r9_prod_64k build the page_64k fragment disables ARM64_4K_PAGES, which unmet's NUMA_REMOTE's "depends on ARM64_4K_PAGES". NUMA_REMOTE is forced off, and because RECLAIM_NOTIFY depends on NUMA_REMOTE, RECLAIM_NOTIFY is also forced off — even though both the base defconfig and the bigdipper_v5r9 fragment request it. With the symbol off, struct reclaim_notify_data is no longer defined, yet obmm_lowmem.o and sentry_reporter.o are still compiled, breaking the 64K build. Hoist the struct definition out of the #ifdef so the type is always available to its unconditional users. The notifier chain API (register/unregister/do_reclaim_notifier) remains gated, so when CONFIG_RECLAIM_NOTIFY=n those entry points still collapse to no-ops as before; only the passive payload type becomes unconditionally visible. Signed-off-by: Yushan Wang <wangyushan12@huawei.com> Signed-off-by: Hongye Lin <linhongye@h-partners.com> --- include/linux/mm.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index dfe362127354..62da3b473511 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4415,8 +4415,6 @@ enum reclaim_reason { RR_TYPES }; -#ifdef CONFIG_RECLAIM_NOTIFY - struct reclaim_notify_data { int nr_nid; /* Number of nodes in nid[] */ int nid[MAX_NUMNODES]; /* Nodes who getting trouble in reclaiming */ @@ -4442,6 +4440,7 @@ struct reclaim_notify_data { unsigned long nr_freed; }; +#ifdef CONFIG_RECLAIM_NOTIFY int register_reclaim_notifier(struct notifier_block *nb); int unregister_reclaim_notifier(struct notifier_block *nb); unsigned long do_reclaim_notify(enum reclaim_reason reason, -- 2.33.0