Lines Matching full:mi

127 				     struct numa_meminfo *mi)  in numa_add_memblk_to()  argument
140 if (mi->nr_blks >= NR_NODE_MEMBLKS) { in numa_add_memblk_to()
145 mi->blk[mi->nr_blks].start = start; in numa_add_memblk_to()
146 mi->blk[mi->nr_blks].end = end; in numa_add_memblk_to()
147 mi->blk[mi->nr_blks].nid = nid; in numa_add_memblk_to()
148 mi->nr_blks++; in numa_add_memblk_to()
155 * @mi: numa_meminfo to remove memblk from
157 * Remove @idx'th numa_memblk from @mi by shifting @mi->blk[] and
158 * decrementing @mi->nr_blks.
160 void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi) in numa_remove_memblk_from() argument
162 mi->nr_blks--; in numa_remove_memblk_from()
163 memmove(&mi->blk[idx], &mi->blk[idx + 1], in numa_remove_memblk_from()
164 (mi->nr_blks - idx) * sizeof(mi->blk[0])); in numa_remove_memblk_from()
231 * @mi: numa_meminfo to clean up
233 * Sanitize @mi by merging and removing unnecessary memblks. Also check for
239 int __init numa_cleanup_meminfo(struct numa_meminfo *mi) in numa_cleanup_meminfo() argument
246 for (i = 0; i < mi->nr_blks; i++) { in numa_cleanup_meminfo()
247 struct numa_memblk *bi = &mi->blk[i]; in numa_cleanup_meminfo()
252 numa_move_tail_memblk(&numa_reserved_meminfo, i--, mi); in numa_cleanup_meminfo()
268 numa_remove_memblk_from(i--, mi); in numa_cleanup_meminfo()
272 for (i = 0; i < mi->nr_blks; i++) { in numa_cleanup_meminfo()
273 struct numa_memblk *bi = &mi->blk[i]; in numa_cleanup_meminfo()
275 for (j = i + 1; j < mi->nr_blks; j++) { in numa_cleanup_meminfo()
276 struct numa_memblk *bj = &mi->blk[j]; in numa_cleanup_meminfo()
305 for (k = 0; k < mi->nr_blks; k++) { in numa_cleanup_meminfo()
306 struct numa_memblk *bk = &mi->blk[k]; in numa_cleanup_meminfo()
313 if (k < mi->nr_blks) in numa_cleanup_meminfo()
320 numa_remove_memblk_from(j--, mi); in numa_cleanup_meminfo()
325 for (i = mi->nr_blks; i < ARRAY_SIZE(mi->blk); i++) { in numa_cleanup_meminfo()
326 mi->blk[i].start = mi->blk[i].end = 0; in numa_cleanup_meminfo()
327 mi->blk[i].nid = NUMA_NO_NODE; in numa_cleanup_meminfo()
334 * Set nodes, which have memory in @mi, in *@nodemask.
337 const struct numa_meminfo *mi) in numa_nodemask_from_meminfo() argument
341 for (i = 0; i < ARRAY_SIZE(mi->blk); i++) in numa_nodemask_from_meminfo()
342 if (mi->blk[i].start != mi->blk[i].end && in numa_nodemask_from_meminfo()
343 mi->blk[i].nid != NUMA_NO_NODE) in numa_nodemask_from_meminfo()
344 node_set(mi->blk[i].nid, *nodemask); in numa_nodemask_from_meminfo()
517 static int __init numa_register_memblks(struct numa_meminfo *mi) in numa_register_memblks() argument
523 numa_nodemask_from_meminfo(&node_possible_map, mi); in numa_register_memblks()
527 for (i = 0; i < mi->nr_blks; i++) { in numa_register_memblks()
528 struct numa_memblk *mb = &mi->blk[i]; in numa_register_memblks()
565 for (i = 0; i < mi->nr_blks; i++) { in numa_register_memblks()
566 if (nid != mi->blk[i].nid) in numa_register_memblks()
568 start = min(mi->blk[i].start, start); in numa_register_memblks()
569 end = max(mi->blk[i].end, end); in numa_register_memblks()
894 static int meminfo_to_nid(struct numa_meminfo *mi, u64 start) in meminfo_to_nid() argument
898 for (i = 0; i < mi->nr_blks; i++) in meminfo_to_nid()
899 if (mi->blk[i].start <= start && mi->blk[i].end > start) in meminfo_to_nid()
900 return mi->blk[i].nid; in meminfo_to_nid()
957 struct numa_meminfo *mi = &numa_meminfo; in numa_fill_memblks() local
966 for (int i = 0; i < mi->nr_blks; i++) { in numa_fill_memblks()
967 struct numa_memblk *bi = &mi->blk[i]; in numa_fill_memblks()
971 blk[count] = &mi->blk[i]; in numa_fill_memblks()