Lines Matching refs:nb
356 struct amd_nb *nb = cpuc->amd_nb; in amd_has_nb() local
358 return nb && nb->nb_id != -1; in amd_has_nb()
385 struct amd_nb *nb = cpuc->amd_nb; in __amd_put_nb_event_constraints() local
397 if (cmpxchg(nb->owners + i, event, NULL) == event) in __amd_put_nb_event_constraints()
443 struct amd_nb *nb = cpuc->amd_nb; in __amd_get_nb_event_constraints() local
466 old = cmpxchg(nb->owners + idx, NULL, event); in __amd_get_nb_event_constraints()
467 else if (nb->owners[idx] == event) in __amd_get_nb_event_constraints()
478 cmpxchg(nb->owners + new, event, NULL); in __amd_get_nb_event_constraints()
489 return &nb->event_constraints[new]; in __amd_get_nb_event_constraints()
494 struct amd_nb *nb; in amd_alloc_nb() local
497 nb = kzalloc_node(sizeof(struct amd_nb), GFP_KERNEL, cpu_to_node(cpu)); in amd_alloc_nb()
498 if (!nb) in amd_alloc_nb()
501 nb->nb_id = -1; in amd_alloc_nb()
507 __set_bit(i, nb->event_constraints[i].idxmsk); in amd_alloc_nb()
508 nb->event_constraints[i].weight = 1; in amd_alloc_nb()
510 return nb; in amd_alloc_nb()
533 struct amd_nb *nb; in amd_pmu_cpu_starting() local
545 nb = per_cpu(cpu_hw_events, i).amd_nb; in amd_pmu_cpu_starting()
546 if (WARN_ON_ONCE(!nb)) in amd_pmu_cpu_starting()
549 if (nb->nb_id == nb_id) { in amd_pmu_cpu_starting()
551 cpuc->amd_nb = nb; in amd_pmu_cpu_starting()
570 struct amd_nb *nb = cpuhw->amd_nb; in amd_pmu_cpu_dead() local
572 if (nb->nb_id == -1 || --nb->refcnt == 0) in amd_pmu_cpu_dead()
573 kfree(nb); in amd_pmu_cpu_dead()