Lines Matching refs:target

94 	struct memory_target *target;  in find_mem_target()  local
96 list_for_each_entry(target, &targets, node) in find_mem_target()
97 if (target->memory_pxm == mem_pxm) in find_mem_target()
98 return target; in find_mem_target()
125 struct memory_target *target; in alloc_memory_target() local
127 target = find_mem_target(mem_pxm); in alloc_memory_target()
128 if (!target) { in alloc_memory_target()
129 target = kzalloc(sizeof(*target), GFP_KERNEL); in alloc_memory_target()
130 if (!target) in alloc_memory_target()
132 target->memory_pxm = mem_pxm; in alloc_memory_target()
133 target->processor_pxm = PXM_INVAL; in alloc_memory_target()
134 target->memregions = (struct resource) { in alloc_memory_target()
140 list_add_tail(&target->node, &targets); in alloc_memory_target()
141 INIT_LIST_HEAD(&target->caches); in alloc_memory_target()
148 if (!__request_region(&target->memregions, start, len, "memory target", in alloc_memory_target()
225 static void hmat_update_target_access(struct memory_target *target, in hmat_update_target_access() argument
230 target->hmem_attrs[access].read_latency = value; in hmat_update_target_access()
231 target->hmem_attrs[access].write_latency = value; in hmat_update_target_access()
234 target->hmem_attrs[access].read_latency = value; in hmat_update_target_access()
237 target->hmem_attrs[access].write_latency = value; in hmat_update_target_access()
240 target->hmem_attrs[access].read_bandwidth = value; in hmat_update_target_access()
241 target->hmem_attrs[access].write_bandwidth = value; in hmat_update_target_access()
244 target->hmem_attrs[access].read_bandwidth = value; in hmat_update_target_access()
247 target->hmem_attrs[access].write_bandwidth = value; in hmat_update_target_access()
297 struct memory_target *target; in hmat_parse_locality() local
339 target = find_mem_target(targs[targ]); in hmat_parse_locality()
340 if (target && target->processor_pxm == inits[init]) { in hmat_parse_locality()
341 hmat_update_target_access(target, type, value, 0); in hmat_parse_locality()
344 hmat_update_target_access(target, type, value, 1); in hmat_parse_locality()
360 struct memory_target *target; in hmat_parse_cache() local
375 target = find_mem_target(cache->memory_PD); in hmat_parse_cache()
376 if (!target) in hmat_parse_cache()
414 list_add_tail(&tcache->node, &target->caches); in hmat_parse_cache()
423 struct memory_target *target = NULL; in hmat_parse_proximity_domain() local
441 target = find_mem_target(p->memory_PD); in hmat_parse_proximity_domain()
442 if (!target) { in hmat_parse_proximity_domain()
447 if (target && p->flags & ACPI_HMAT_PROCESSOR_PD_VALID) { in hmat_parse_proximity_domain()
454 target->processor_pxm = p->processor_PD; in hmat_parse_proximity_domain()
493 static u32 hmat_initiator_perf(struct memory_target *target, in hmat_initiator_perf() argument
518 if (targs[i] == target->memory_pxm) { in hmat_initiator_perf()
585 static void hmat_register_target_initiators(struct memory_target *target) in hmat_register_target_initiators() argument
595 mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_initiators()
601 if (target->processor_pxm != PXM_INVAL) { in hmat_register_target_initiators()
602 cpu_nid = pxm_to_node(target->processor_pxm); in hmat_register_target_initiators()
638 value = hmat_initiator_perf(target, initiator, in hmat_register_target_initiators()
646 hmat_update_target_access(target, loc->hmat_loc->data_type, in hmat_register_target_initiators()
677 value = hmat_initiator_perf(target, initiator, loc->hmat_loc); in hmat_register_target_initiators()
684 hmat_update_target_access(target, loc->hmat_loc->data_type, best, 1); in hmat_register_target_initiators()
692 static void hmat_register_target_cache(struct memory_target *target) in hmat_register_target_cache() argument
694 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_cache()
697 list_for_each_entry(tcache, &target->caches, node) in hmat_register_target_cache()
701 static void hmat_register_target_perf(struct memory_target *target, int access) in hmat_register_target_perf() argument
703 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_perf()
704 node_set_perf_attrs(mem_nid, &target->hmem_attrs[access], access); in hmat_register_target_perf()
707 static void hmat_register_target_devices(struct memory_target *target) in hmat_register_target_devices() argument
718 for (res = target->memregions.child; res; res = res->sibling) { in hmat_register_target_devices()
719 int target_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_devices()
725 static void hmat_register_target(struct memory_target *target) in hmat_register_target() argument
727 int nid = pxm_to_node(target->memory_pxm); in hmat_register_target()
733 hmat_register_target_devices(target); in hmat_register_target()
746 if (!target->registered) { in hmat_register_target()
747 hmat_register_target_initiators(target); in hmat_register_target()
748 hmat_register_target_cache(target); in hmat_register_target()
749 hmat_register_target_perf(target, 0); in hmat_register_target()
750 hmat_register_target_perf(target, 1); in hmat_register_target()
751 target->registered = true; in hmat_register_target()
758 struct memory_target *target; in hmat_register_targets() local
760 list_for_each_entry(target, &targets, node) in hmat_register_targets()
761 hmat_register_target(target); in hmat_register_targets()
767 struct memory_target *target; in hmat_callback() local
775 target = find_mem_target(pxm); in hmat_callback()
776 if (!target) in hmat_callback()
779 hmat_register_target(target); in hmat_callback()
785 struct memory_target *target, *tnext; in hmat_free_structures() local
790 list_for_each_entry_safe(target, tnext, &targets, node) { in hmat_free_structures()
793 list_for_each_entry_safe(tcache, cnext, &target->caches, node) { in hmat_free_structures()
798 list_del(&target->node); in hmat_free_structures()
799 res = target->memregions.child; in hmat_free_structures()
802 __release_region(&target->memregions, res->start, in hmat_free_structures()
806 kfree(target); in hmat_free_structures()