Since patch 316346243be6 has already updated the minimum gcc version to 5.1.
The previous problem mentioned in patch f02c69680088 is not existed. So we
can now revert to use hotplug_memory_notifier() directly rather than
register_hotmemory_notifier().
Signed-off-by: Liu Shixin <[email protected]>
---
mm/mm_init.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 0d7b2bd2454a..ec6989fcf762 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -178,16 +178,10 @@ static int __meminit mm_compute_batch_notifier(struct notifier_block *self,
return NOTIFY_OK;
}
-static struct notifier_block compute_batch_nb __meminitdata = {
- .notifier_call = mm_compute_batch_notifier,
- .priority = IPC_CALLBACK_PRI, /* use lowest priority */
-};
-
static int __init mm_compute_batch_init(void)
{
mm_compute_batch(sysctl_overcommit_memory);
- register_hotmemory_notifier(&compute_batch_nb);
-
+ hotplug_memory_notifier(&mm_compute_batch_notifier, IPC_CALLBACK_PRI);
return 0;
}
--
2.25.1
Hi Liu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Liu-Shixin/mm-Use-hotplug_memory_notifier-instead-of-register_hotmemory_notifier/20220919-160043
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
config: arm64-randconfig-r036-20220919 (https://download.01.org/0day-ci/archive/20220920/[email protected]/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/33c4e50ed97460db120701f262ae1814509ba982
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Liu-Shixin/mm-Use-hotplug_memory_notifier-instead-of-register_hotmemory_notifier/20220919-160043
git checkout 33c4e50ed97460db120701f262ae1814509ba982
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
All errors (new ones prefixed by >>):
>> mm/mm_init.c:184:26: error: expected identifier or '('
hotplug_memory_notifier(&mm_compute_batch_notifier, IPC_CALLBACK_PRI);
^
>> mm/mm_init.c:184:2: error: use of undeclared identifier 'mm_compute_batch_notifier_mem_nb'
hotplug_memory_notifier(&mm_compute_batch_notifier, IPC_CALLBACK_PRI);
^
include/linux/memory.h:167:28: note: expanded from macro 'hotplug_memory_notifier'
register_memory_notifier(&fn##_mem_nb); \
^
<scratch space>:31:1: note: expanded from here
mm_compute_batch_notifier_mem_nb
^
2 errors generated.
vim +184 mm/mm_init.c
180
181 static int __init mm_compute_batch_init(void)
182 {
183 mm_compute_batch(sysctl_overcommit_memory);
> 184 hotplug_memory_notifier(&mm_compute_batch_notifier, IPC_CALLBACK_PRI);
185 return 0;
186 }
187
--
0-DAY CI Kernel Test Service
https://01.org/lkp