Lines Matching refs:memtype
34 struct memory_dev_type *memtype; member
151 struct memory_dev_type *memtype; in get_memtier_nodemask() local
153 list_for_each_entry(memtype, &memtier->memory_types, tier_sibling) in get_memtier_nodemask()
154 nodes_or(nodes, nodes, memtype->nodes); in get_memtier_nodemask()
197 static struct memory_tier *find_create_memory_tier(struct memory_dev_type *memtype) in find_create_memory_tier() argument
202 int adistance = memtype->adistance; in find_create_memory_tier()
212 if (!list_empty(&memtype->tier_sibling)) { in find_create_memory_tier()
256 list_add(&memtype->tier_sibling, &memtier->memory_types); in find_create_memory_tier()
524 static inline void __init_node_memory_type(int node, struct memory_dev_type *memtype) in __init_node_memory_type() argument
526 if (!node_memory_types[node].memtype) in __init_node_memory_type()
527 node_memory_types[node].memtype = memtype; in __init_node_memory_type()
536 if (node_memory_types[node].memtype == memtype) { in __init_node_memory_type()
538 kref_get(&memtype->kref); in __init_node_memory_type()
545 struct memory_dev_type *memtype = default_dram_type; in set_node_memory_tier() local
556 if (!node_memory_types[node].memtype) { in set_node_memory_tier()
557 memtype = mt_find_alloc_memory_type(adist, &default_memory_types); in set_node_memory_tier()
558 if (IS_ERR(memtype)) { in set_node_memory_tier()
559 memtype = default_dram_type; in set_node_memory_tier()
564 __init_node_memory_type(node, memtype); in set_node_memory_tier()
566 memtype = node_memory_types[node].memtype; in set_node_memory_tier()
567 node_set(node, memtype->nodes); in set_node_memory_tier()
568 memtier = find_create_memory_tier(memtype); in set_node_memory_tier()
600 struct memory_dev_type *memtype; in clear_node_memory_tier() local
604 memtype = node_memory_types[node].memtype; in clear_node_memory_tier()
605 node_clear(node, memtype->nodes); in clear_node_memory_tier()
606 if (nodes_empty(memtype->nodes)) { in clear_node_memory_tier()
607 list_del_init(&memtype->tier_sibling); in clear_node_memory_tier()
618 struct memory_dev_type *memtype; in release_memtype() local
620 memtype = container_of(kref, struct memory_dev_type, kref); in release_memtype()
621 kfree(memtype); in release_memtype()
626 struct memory_dev_type *memtype; in alloc_memory_type() local
628 memtype = kmalloc_obj(*memtype); in alloc_memory_type()
629 if (!memtype) in alloc_memory_type()
632 memtype->adistance = adistance; in alloc_memory_type()
633 INIT_LIST_HEAD(&memtype->tier_sibling); in alloc_memory_type()
634 memtype->nodes = NODE_MASK_NONE; in alloc_memory_type()
635 kref_init(&memtype->kref); in alloc_memory_type()
636 return memtype; in alloc_memory_type()
640 void put_memory_type(struct memory_dev_type *memtype) in put_memory_type() argument
642 kref_put(&memtype->kref, release_memtype); in put_memory_type()
646 void init_node_memory_type(int node, struct memory_dev_type *memtype) in init_node_memory_type() argument
650 __init_node_memory_type(node, memtype); in init_node_memory_type()
655 void clear_node_memory_type(int node, struct memory_dev_type *memtype) in clear_node_memory_type() argument
658 if (node_memory_types[node].memtype == memtype || !memtype) in clear_node_memory_type()
665 memtype = node_memory_types[node].memtype; in clear_node_memory_type()
666 node_memory_types[node].memtype = NULL; in clear_node_memory_type()
667 put_memory_type(memtype); in clear_node_memory_type()
723 if (node_memory_types[nid].memtype) in memory_tier_late_init()