diff mbox series

[v2,8/9] memory: replace IPC_CALLBACK_PRI with MM_BATCH_CALLBACK_PRI

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

Commit Message

Liu Shixin Sept. 20, 2022, 2:51 a.m. UTC
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(-)

Comments

David Hildenbrand Sept. 20, 2022, 12:07 p.m. UTC | #1
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.
Liu Shixin Sept. 22, 2022, 1:12 p.m. UTC | #2
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 mbox series

Patch

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;
 }