Lines Matching full:node
3 * Basic Node interface support
12 #include <linux/node.h>
25 .name = "node",
26 .dev_name = "node",
34 struct node *node_dev = to_node(dev); in node_read_cpumap()
71 * @list_node: List element in the node's access list
109 static void node_remove_accesses(struct node *node) in node_remove_accesses() argument
113 list_for_each_entry_safe(c, cnext, &node->access_list, list_node) { in node_remove_accesses()
124 static struct node_access_nodes *node_init_node_access(struct node *node, in node_init_node_access() argument
130 list_for_each_entry(access_node, &node->access_list, list_node) in node_init_node_access()
140 dev->parent = &node->dev; in node_init_node_access()
150 list_add_tail(&access_node->list_node, &node->access_list); in node_init_node_access()
185 * @nid: Node identifier to be set
193 struct node *node; in node_set_perf_attrs() local
199 node = node_devices[nid]; in node_set_perf_attrs()
200 c = node_init_node_access(node, access); in node_set_perf_attrs()
208 pr_info("failed to add performance attribute to node %d\n", in node_set_perf_attrs()
216 * struct node_cache_info - Internal tracking for memory node caches
218 * @node: List element for tracking in the node
223 struct list_head node; member
263 static void node_init_cache_dev(struct node *node) in node_init_cache_dev() argument
271 dev->parent = &node->dev; in node_init_cache_dev()
280 node->cache_dev = dev; in node_init_cache_dev()
289 * node_add_cache() - add cache attribute to a memory node
290 * @nid: Node identifier that has new cache attributes
297 struct node *node; in node_add_cache() local
302 node = node_devices[nid]; in node_add_cache()
303 list_for_each_entry(info, &node->cache_attrs, node) { in node_add_cache()
305 dev_warn(&node->dev, in node_add_cache()
312 if (!node->cache_dev) in node_add_cache()
313 node_init_cache_dev(node); in node_add_cache()
314 if (!node->cache_dev) in node_add_cache()
322 dev->parent = node->cache_dev; in node_add_cache()
330 dev_warn(&node->dev, "failed to add cache level:%d\n", in node_add_cache()
335 list_add_tail(&info->node, &node->cache_attrs); in node_add_cache()
343 static void node_remove_caches(struct node *node) in node_remove_caches() argument
347 if (!node->cache_dev) in node_remove_caches()
350 list_for_each_entry_safe(info, next, &node->cache_attrs, node) { in node_remove_caches()
351 list_del(&info->node); in node_remove_caches()
354 device_unregister(node->cache_dev); in node_remove_caches()
363 static void node_remove_caches(struct node *node) { } in node_remove_caches() argument
380 "Node %d MemTotal: %8lu kB\n" in node_read_meminfo()
381 "Node %d MemFree: %8lu kB\n" in node_read_meminfo()
382 "Node %d MemUsed: %8lu kB\n" in node_read_meminfo()
383 "Node %d Active: %8lu kB\n" in node_read_meminfo()
384 "Node %d Inactive: %8lu kB\n" in node_read_meminfo()
385 "Node %d Active(anon): %8lu kB\n" in node_read_meminfo()
386 "Node %d Inactive(anon): %8lu kB\n" in node_read_meminfo()
387 "Node %d Active(file): %8lu kB\n" in node_read_meminfo()
388 "Node %d Inactive(file): %8lu kB\n" in node_read_meminfo()
389 "Node %d Unevictable: %8lu kB\n" in node_read_meminfo()
390 "Node %d Mlocked: %8lu kB\n", in node_read_meminfo()
407 "Node %d HighTotal: %8lu kB\n" in node_read_meminfo()
408 "Node %d HighFree: %8lu kB\n" in node_read_meminfo()
409 "Node %d LowTotal: %8lu kB\n" in node_read_meminfo()
410 "Node %d LowFree: %8lu kB\n", in node_read_meminfo()
417 "Node %d Dirty: %8lu kB\n" in node_read_meminfo()
418 "Node %d Writeback: %8lu kB\n" in node_read_meminfo()
419 "Node %d FilePages: %8lu kB\n" in node_read_meminfo()
420 "Node %d Mapped: %8lu kB\n" in node_read_meminfo()
421 "Node %d AnonPages: %8lu kB\n" in node_read_meminfo()
422 "Node %d Shmem: %8lu kB\n" in node_read_meminfo()
423 "Node %d KernelStack: %8lu kB\n" in node_read_meminfo()
425 "Node %d ShadowCallStack:%8lu kB\n" in node_read_meminfo()
427 "Node %d PageTables: %8lu kB\n" in node_read_meminfo()
428 "Node %d NFS_Unstable: %8lu kB\n" in node_read_meminfo()
429 "Node %d Bounce: %8lu kB\n" in node_read_meminfo()
430 "Node %d WritebackTmp: %8lu kB\n" in node_read_meminfo()
431 "Node %d KReclaimable: %8lu kB\n" in node_read_meminfo()
432 "Node %d Slab: %8lu kB\n" in node_read_meminfo()
433 "Node %d SReclaimable: %8lu kB\n" in node_read_meminfo()
434 "Node %d SUnreclaim: %8lu kB\n" in node_read_meminfo()
436 "Node %d AnonHugePages: %8lu kB\n" in node_read_meminfo()
437 "Node %d ShmemHugePages: %8lu kB\n" in node_read_meminfo()
438 "Node %d ShmemPmdMapped: %8lu kB\n" in node_read_meminfo()
439 "Node %d FileHugePages: %8lu kB\n" in node_read_meminfo()
440 "Node %d FilePmdMapped: %8lu kB\n" in node_read_meminfo()
539 * buf is currently PAGE_SIZE in length and each node needs 4 chars in node_read_distance()
567 * hugetlbfs per node attributes registration interface:
569 * it will register its per node attributes for all online nodes with
571 * register its attribute registration functions with this node driver.
572 * Once these hooks have been initialized, the node driver will call into
578 static inline bool hugetlb_register_node(struct node *node) in hugetlb_register_node() argument
581 node_state(node->dev.id, N_MEMORY)) { in hugetlb_register_node()
582 __hugetlb_register_node(node); in hugetlb_register_node()
588 static inline void hugetlb_unregister_node(struct node *node) in hugetlb_unregister_node() argument
591 __hugetlb_unregister_node(node); in hugetlb_unregister_node()
601 static inline void hugetlb_register_node(struct node *node) {} in hugetlb_register_node() argument
603 static inline void hugetlb_unregister_node(struct node *node) {} in hugetlb_unregister_node() argument
608 struct node *node = to_node(dev); in node_device_release() local
613 * onlined/offlined on this node. When we come here, in node_device_release()
614 * all the memory on this node has been offlined, in node_device_release()
617 * The work is using node->node_work, so we should in node_device_release()
620 flush_work(&node->node_work); in node_device_release()
622 kfree(node); in node_device_release()
626 * register_node - Setup a sysfs device for a node.
627 * @num - Node number to use when creating the device.
629 * Initialize and register the node device.
631 static int register_node(struct node *node, int num) in register_node() argument
635 node->dev.id = num; in register_node()
636 node->dev.bus = &node_subsys; in register_node()
637 node->dev.release = node_device_release; in register_node()
638 node->dev.groups = node_dev_groups; in register_node()
639 error = device_register(&node->dev); in register_node()
642 put_device(&node->dev); in register_node()
644 hugetlb_register_node(node); in register_node()
646 compaction_register_node(node); in register_node()
652 * unregister_node - unregister a node device
653 * @node: node going away
655 * Unregisters a node device @node. All the devices on the node must be
658 void unregister_node(struct node *node) in unregister_node() argument
660 hugetlb_unregister_node(node); /* no-op, if memoryless node */ in unregister_node()
661 node_remove_accesses(node); in unregister_node()
662 node_remove_caches(node); in unregister_node()
663 device_unregister(&node->dev); in unregister_node()
666 struct node *node_devices[MAX_NUMNODES];
669 * register cpu under node
695 * register_memory_node_under_compute_node - link memory node to its compute
696 * node for a given access class.
697 * @mem_nid: Memory node number
698 * @cpu_nid: Cpu node number
703 * This function will export node relationships linking which memory
711 struct node *init_node, *targ_node; in register_memory_node_under_compute_node()
782 * the last processed node. in do_register_memory_block_under_node()
804 /* register memory section under specified node if it spans that node */
829 * case because node's ranges can be interleaved. in register_mem_block_under_node_early()
840 /* mem section does not span the specified node */ in register_mem_block_under_node_early()
846 * node.
858 * Unregister a memory block device under the node it spans. Memory blocks
889 * Handle per node hstate attribute [un]registration on transistions
894 struct node *node = container_of(work, struct node, node_work); in node_hugetlb_work() local
897 * We only get here when a node transitions to/from memoryless state. in node_hugetlb_work()
899 * node has memory now. hugetlb_register_node() already check this in node_hugetlb_work()
901 * node has transitioned to memoryless, try to unregister the in node_hugetlb_work()
904 if (!hugetlb_register_node(node)) in node_hugetlb_work()
905 hugetlb_unregister_node(node); in node_hugetlb_work()
923 * offload per node hstate [un]registration to a work thread in node_memory_callback()
960 node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL); in __register_one_node()
966 /* link cpu under this node */ in __register_one_node()
990 * node states attributes
1063 * Note: we're not going to unregister the node class if we fail in register_node_type()
1064 * to register the node state class attribute files. in register_node_type()