Message ID | 20220920025123.2868953-9-liushixin2@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: Use hotplug_memory_notifier() instead of register_hotmemory_notifier() | expand |
On 20.09.22 04:51, Liu Shixin wrote: > Since there is nothing to do with ipc, it is strange to use IPC_CALLBACK_PRI > here. Replace IPC_CALLBACK_PRI with MM_BATCH_CALLBACK_PRI for easy reading. Should this better be called MM_COMPUTE_BATCH_CALLBACK_PRI Not so sure if "CALLBACK" is really the right term to use here in general ... we're talking about the memory notifier priority.
On 2022/9/20 20:07, David Hildenbrand wrote: > On 20.09.22 04:51, Liu Shixin wrote: >> Since there is nothing to do with ipc, it is strange to use IPC_CALLBACK_PRI >> here. Replace IPC_CALLBACK_PRI with MM_BATCH_CALLBACK_PRI for easy reading. > > Should this better be called MM_COMPUTE_BATCH_CALLBACK_PRI > > Not so sure if "CALLBACK" is really the right term to use here in general ... we're talking about the memory notifier priority. > "CALLBACK" is not mandatory. Just for the sake of being consistent with other macros. MM_COMPUTE_BATCH_CALLBACK_PRI is too long, maybe reduce to MM_COMPUTE_BATCH_PRI is better. Thanks,
diff --git a/include/linux/memory.h b/include/linux/memory.h index 98d2a2ebcc10..e5f71d3d9af8 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -112,8 +112,8 @@ struct mem_section; * Priorities for the hotplug memory callback routines (stored in decreasing * order in the callback chain) */ -#define SLAB_CALLBACK_PRI 1 -#define IPC_CALLBACK_PRI 10 +#define SLAB_CALLBACK_PRI 1 +#define MM_BATCH_CALLBACK_PRI 10 #ifndef CONFIG_MEMORY_HOTPLUG static inline void memory_dev_init(void) diff --git a/mm/mm_init.c b/mm/mm_init.c index 44aadc162d1f..1dd9257e2204 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -181,7 +181,7 @@ static int __meminit mm_compute_batch_notifier(struct notifier_block *self, static int __init mm_compute_batch_init(void) { mm_compute_batch(sysctl_overcommit_memory); - hotplug_memory_notifier(mm_compute_batch_notifier, IPC_CALLBACK_PRI); + hotplug_memory_notifier(mm_compute_batch_notifier, MM_BATCH_CALLBACK_PRI); return 0; }
Since there is nothing to do with ipc, it is strange to use IPC_CALLBACK_PRI here. Replace IPC_CALLBACK_PRI with MM_BATCH_CALLBACK_PRI for easy reading. Signed-off-by: Liu Shixin <liushixin2@huawei.com> --- include/linux/memory.h | 4 ++-- mm/mm_init.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)