~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/node.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/node.h (Version linux-6.12-rc7) and /include/linux/node.h (Version linux-6.10.14)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*                                                  2 /*
  3  * include/linux/node.h - generic node definit      3  * include/linux/node.h - generic node definition
  4  *                                                  4  *
  5  * This is mainly for topological representati      5  * This is mainly for topological representation. We define the
  6  * basic 'struct node' here, which can be embe      6  * basic 'struct node' here, which can be embedded in per-arch
  7  * definitions of processors.                       7  * definitions of processors.
  8  *                                                  8  *
  9  * Basic handling of the devices is done in dr      9  * Basic handling of the devices is done in drivers/base/node.c
 10  * and system devices are handled in drivers/b     10  * and system devices are handled in drivers/base/sys.c.
 11  *                                                 11  *
 12  * Nodes are exported via driverfs in the clas     12  * Nodes are exported via driverfs in the class/node/devices/
 13  * directory.                                      13  * directory.
 14  */                                                14  */
 15 #ifndef _LINUX_NODE_H_                             15 #ifndef _LINUX_NODE_H_
 16 #define _LINUX_NODE_H_                             16 #define _LINUX_NODE_H_
 17                                                    17 
 18 #include <linux/device.h>                          18 #include <linux/device.h>
                                                   >>  19 #include <linux/cpumask.h>
 19 #include <linux/list.h>                            20 #include <linux/list.h>
 20                                                    21 
 21 /**                                                22 /**
 22  * struct access_coordinate - generic performa     23  * struct access_coordinate - generic performance coordinates container
 23  *                                                 24  *
 24  * @read_bandwidth:     Read bandwidth in MB/s     25  * @read_bandwidth:     Read bandwidth in MB/s
 25  * @write_bandwidth:    Write bandwidth in MB/     26  * @write_bandwidth:    Write bandwidth in MB/s
 26  * @read_latency:       Read latency in nanose     27  * @read_latency:       Read latency in nanoseconds
 27  * @write_latency:      Write latency in nanos     28  * @write_latency:      Write latency in nanoseconds
 28  */                                                29  */
 29 struct access_coordinate {                         30 struct access_coordinate {
 30         unsigned int read_bandwidth;               31         unsigned int read_bandwidth;
 31         unsigned int write_bandwidth;              32         unsigned int write_bandwidth;
 32         unsigned int read_latency;                 33         unsigned int read_latency;
 33         unsigned int write_latency;                34         unsigned int write_latency;
 34 };                                                 35 };
 35                                                    36 
 36 /*                                                 37 /*
 37  * ACCESS_COORDINATE_LOCAL correlates to ACCES     38  * ACCESS_COORDINATE_LOCAL correlates to ACCESS CLASS 0
 38  *      - access_coordinate between target nod     39  *      - access_coordinate between target node and nearest initiator node
 39  * ACCESS_COORDINATE_CPU correlates to ACCESS      40  * ACCESS_COORDINATE_CPU correlates to ACCESS CLASS 1
 40  *      - access_coordinate between target nod     41  *      - access_coordinate between target node and nearest CPU node
 41  */                                                42  */
 42 enum access_coordinate_class {                     43 enum access_coordinate_class {
 43         ACCESS_COORDINATE_LOCAL,                   44         ACCESS_COORDINATE_LOCAL,
 44         ACCESS_COORDINATE_CPU,                     45         ACCESS_COORDINATE_CPU,
 45         ACCESS_COORDINATE_MAX                      46         ACCESS_COORDINATE_MAX
 46 };                                                 47 };
 47                                                    48 
 48 enum cache_indexing {                              49 enum cache_indexing {
 49         NODE_CACHE_DIRECT_MAP,                     50         NODE_CACHE_DIRECT_MAP,
 50         NODE_CACHE_INDEXED,                        51         NODE_CACHE_INDEXED,
 51         NODE_CACHE_OTHER,                          52         NODE_CACHE_OTHER,
 52 };                                                 53 };
 53                                                    54 
 54 enum cache_write_policy {                          55 enum cache_write_policy {
 55         NODE_CACHE_WRITE_BACK,                     56         NODE_CACHE_WRITE_BACK,
 56         NODE_CACHE_WRITE_THROUGH,                  57         NODE_CACHE_WRITE_THROUGH,
 57         NODE_CACHE_WRITE_OTHER,                    58         NODE_CACHE_WRITE_OTHER,
 58 };                                                 59 };
 59                                                    60 
 60 /**                                                61 /**
 61  * struct node_cache_attrs - system memory cac     62  * struct node_cache_attrs - system memory caching attributes
 62  *                                                 63  *
 63  * @indexing:           The ways memory blocks     64  * @indexing:           The ways memory blocks may be placed in cache
 64  * @write_policy:       Write back or write th     65  * @write_policy:       Write back or write through policy
 65  * @size:               Total size of cache in     66  * @size:               Total size of cache in bytes
 66  * @line_size:          Number of bytes fetche     67  * @line_size:          Number of bytes fetched on a cache miss
 67  * @level:              The cache hierarchy le     68  * @level:              The cache hierarchy level
 68  */                                                69  */
 69 struct node_cache_attrs {                          70 struct node_cache_attrs {
 70         enum cache_indexing indexing;              71         enum cache_indexing indexing;
 71         enum cache_write_policy write_policy;      72         enum cache_write_policy write_policy;
 72         u64 size;                                  73         u64 size;
 73         u16 line_size;                             74         u16 line_size;
 74         u8 level;                                  75         u8 level;
 75 };                                                 76 };
 76                                                    77 
 77 #ifdef CONFIG_HMEM_REPORTING                       78 #ifdef CONFIG_HMEM_REPORTING
 78 void node_add_cache(unsigned int nid, struct n     79 void node_add_cache(unsigned int nid, struct node_cache_attrs *cache_attrs);
 79 void node_set_perf_attrs(unsigned int nid, str     80 void node_set_perf_attrs(unsigned int nid, struct access_coordinate *coord,
 80                          enum access_coordinat     81                          enum access_coordinate_class access);
 81 #else                                              82 #else
 82 static inline void node_add_cache(unsigned int     83 static inline void node_add_cache(unsigned int nid,
 83                                   struct node_     84                                   struct node_cache_attrs *cache_attrs)
 84 {                                                  85 {
 85 }                                                  86 }
 86                                                    87 
 87 static inline void node_set_perf_attrs(unsigne     88 static inline void node_set_perf_attrs(unsigned int nid,
 88                                        struct      89                                        struct access_coordinate *coord,
 89                                        enum ac     90                                        enum access_coordinate_class access)
 90 {                                                  91 {
 91 }                                                  92 }
 92 #endif                                             93 #endif
 93                                                    94 
 94 struct node {                                      95 struct node {
 95         struct device   dev;                       96         struct device   dev;
 96         struct list_head access_list;              97         struct list_head access_list;
 97 #ifdef CONFIG_HMEM_REPORTING                       98 #ifdef CONFIG_HMEM_REPORTING
 98         struct list_head cache_attrs;              99         struct list_head cache_attrs;
 99         struct device *cache_dev;                 100         struct device *cache_dev;
100 #endif                                            101 #endif
101 };                                                102 };
102                                                   103 
103 struct memory_block;                              104 struct memory_block;
104 extern struct node *node_devices[];               105 extern struct node *node_devices[];
105                                                   106 
106 #if defined(CONFIG_MEMORY_HOTPLUG) && defined(    107 #if defined(CONFIG_MEMORY_HOTPLUG) && defined(CONFIG_NUMA)
107 void register_memory_blocks_under_node(int nid    108 void register_memory_blocks_under_node(int nid, unsigned long start_pfn,
108                                        unsigne    109                                        unsigned long end_pfn,
109                                        enum me    110                                        enum meminit_context context);
110 #else                                             111 #else
111 static inline void register_memory_blocks_unde    112 static inline void register_memory_blocks_under_node(int nid, unsigned long start_pfn,
112                                                   113                                                      unsigned long end_pfn,
113                                                   114                                                      enum meminit_context context)
114 {                                                 115 {
115 }                                                 116 }
116 #endif                                            117 #endif
117                                                   118 
118 extern void unregister_node(struct node *node)    119 extern void unregister_node(struct node *node);
119 #ifdef CONFIG_NUMA                                120 #ifdef CONFIG_NUMA
120 extern void node_dev_init(void);                  121 extern void node_dev_init(void);
121 /* Core of the node registration - only memory    122 /* Core of the node registration - only memory hotplug should use this */
122 extern int __register_one_node(int nid);          123 extern int __register_one_node(int nid);
123                                                   124 
124 /* Registers an online node */                    125 /* Registers an online node */
125 static inline int register_one_node(int nid)      126 static inline int register_one_node(int nid)
126 {                                                 127 {
127         int error = 0;                            128         int error = 0;
128                                                   129 
129         if (node_online(nid)) {                   130         if (node_online(nid)) {
130                 struct pglist_data *pgdat = NO    131                 struct pglist_data *pgdat = NODE_DATA(nid);
131                 unsigned long start_pfn = pgda    132                 unsigned long start_pfn = pgdat->node_start_pfn;
132                 unsigned long end_pfn = start_    133                 unsigned long end_pfn = start_pfn + pgdat->node_spanned_pages;
133                                                   134 
134                 error = __register_one_node(ni    135                 error = __register_one_node(nid);
135                 if (error)                        136                 if (error)
136                         return error;             137                         return error;
137                 register_memory_blocks_under_n    138                 register_memory_blocks_under_node(nid, start_pfn, end_pfn,
138                                                   139                                                   MEMINIT_EARLY);
139         }                                         140         }
140                                                   141 
141         return error;                             142         return error;
142 }                                                 143 }
143                                                   144 
144 extern void unregister_one_node(int nid);         145 extern void unregister_one_node(int nid);
145 extern int register_cpu_under_node(unsigned in    146 extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
146 extern int unregister_cpu_under_node(unsigned     147 extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid);
147 extern void unregister_memory_block_under_node    148 extern void unregister_memory_block_under_nodes(struct memory_block *mem_blk);
148                                                   149 
149 extern int register_memory_node_under_compute_    150 extern int register_memory_node_under_compute_node(unsigned int mem_nid,
150                                                   151                                                    unsigned int cpu_nid,
151                                                   152                                                    enum access_coordinate_class access);
152 #else                                             153 #else
153 static inline void node_dev_init(void)            154 static inline void node_dev_init(void)
154 {                                                 155 {
155 }                                                 156 }
156 static inline int __register_one_node(int nid)    157 static inline int __register_one_node(int nid)
157 {                                                 158 {
158         return 0;                                 159         return 0;
159 }                                                 160 }
160 static inline int register_one_node(int nid)      161 static inline int register_one_node(int nid)
161 {                                                 162 {
162         return 0;                                 163         return 0;
163 }                                                 164 }
164 static inline int unregister_one_node(int nid)    165 static inline int unregister_one_node(int nid)
165 {                                                 166 {
166         return 0;                                 167         return 0;
167 }                                                 168 }
168 static inline int register_cpu_under_node(unsi    169 static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid)
169 {                                                 170 {
170         return 0;                                 171         return 0;
171 }                                                 172 }
172 static inline int unregister_cpu_under_node(un    173 static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
173 {                                                 174 {
174         return 0;                                 175         return 0;
175 }                                                 176 }
176 static inline void unregister_memory_block_und    177 static inline void unregister_memory_block_under_nodes(struct memory_block *mem_blk)
177 {                                                 178 {
178 }                                                 179 }
179 #endif                                            180 #endif
180                                                   181 
181 #define to_node(device) container_of(device, s    182 #define to_node(device) container_of(device, struct node, dev)
182                                                   183 
183 #endif /* _LINUX_NODE_H_ */                       184 #endif /* _LINUX_NODE_H_ */
184                                                   185 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php