hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/memory.h
....@@ -25,15 +25,10 @@
2525
2626 struct memory_block {
2727 unsigned long start_section_nr;
28
- unsigned long end_section_nr;
2928 unsigned long state; /* serialized by the dev->lock */
30
- int section_count; /* serialized by mem_sysfs_mutex */
3129 int online_type; /* for passing data to online routine */
32
- int phys_device; /* to which fru does this belong? */
33
- void *hw; /* optional pointer to fw/hw data */
34
- int (*phys_callback)(struct memory_block *);
35
- struct device dev;
3630 int nid; /* NID for this memory block */
31
+ struct device dev;
3732 };
3833
3934 int arch_get_memory_phys_device(unsigned long start_pfn);
....@@ -56,19 +51,6 @@
5651 int status_change_nid;
5752 };
5853
59
-/*
60
- * During pageblock isolation, count the number of pages within the
61
- * range [start_pfn, start_pfn + nr_pages) which are owned by code
62
- * in the notifier chain.
63
- */
64
-#define MEM_ISOLATE_COUNT (1<<0)
65
-
66
-struct memory_isolate_notify {
67
- unsigned long start_pfn; /* Start of range to check */
68
- unsigned int nr_pages; /* # pages in range to check */
69
- unsigned int pages_found; /* # pages owned found by callbacks */
70
-};
71
-
7254 struct notifier_block;
7355 struct mem_section;
7456
....@@ -80,9 +62,9 @@
8062 #define IPC_CALLBACK_PRI 10
8163
8264 #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
83
-static inline int memory_dev_init(void)
65
+static inline void memory_dev_init(void)
8466 {
85
- return 0;
67
+ return;
8668 }
8769 static inline int register_memory_notifier(struct notifier_block *nb)
8870 {
....@@ -95,31 +77,17 @@
9577 {
9678 return 0;
9779 }
98
-static inline int register_memory_isolate_notifier(struct notifier_block *nb)
99
-{
100
- return 0;
101
-}
102
-static inline void unregister_memory_isolate_notifier(struct notifier_block *nb)
103
-{
104
-}
105
-static inline int memory_isolate_notify(unsigned long val, void *v)
106
-{
107
- return 0;
108
-}
10980 #else
11081 extern int register_memory_notifier(struct notifier_block *nb);
11182 extern void unregister_memory_notifier(struct notifier_block *nb);
112
-extern int register_memory_isolate_notifier(struct notifier_block *nb);
113
-extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
11483 int create_memory_block_devices(unsigned long start, unsigned long size);
11584 void remove_memory_block_devices(unsigned long start, unsigned long size);
116
-extern int memory_dev_init(void);
85
+extern void memory_dev_init(void);
11786 extern int memory_notify(unsigned long val, void *v);
118
-extern int memory_isolate_notify(unsigned long val, void *v);
119
-extern struct memory_block *find_memory_block_hinted(struct mem_section *,
120
- struct memory_block *);
12187 extern struct memory_block *find_memory_block(struct mem_section *);
12288 typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
89
+extern int walk_memory_blocks(unsigned long start, unsigned long size,
90
+ void *arg, walk_memory_blocks_func_t func);
12391 extern int for_each_memory_block(void *arg, walk_memory_blocks_func_t func);
12492 #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
12593 #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */