Lines Matching refs:ref
317 struct imc_pmu_ref *ref; in ppc_nest_imc_cpu_offline() local
361 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
362 if (!ref) in ppc_nest_imc_cpu_offline()
365 ref->refc = 0; in ppc_nest_imc_cpu_offline()
411 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
424 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
425 if (!ref) in nest_imc_counters_release()
429 mutex_lock(&ref->lock); in nest_imc_counters_release()
430 if (ref->refc == 0) { in nest_imc_counters_release()
441 mutex_unlock(&ref->lock); in nest_imc_counters_release()
444 ref->refc--; in nest_imc_counters_release()
445 if (ref->refc == 0) { in nest_imc_counters_release()
449 mutex_unlock(&ref->lock); in nest_imc_counters_release()
453 } else if (ref->refc < 0) { in nest_imc_counters_release()
455 ref->refc = 0; in nest_imc_counters_release()
457 mutex_unlock(&ref->lock); in nest_imc_counters_release()
466 struct imc_pmu_ref *ref; in nest_imc_event_init() local
523 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
524 if (!ref) in nest_imc_event_init()
527 mutex_lock(&ref->lock); in nest_imc_event_init()
528 if (ref->refc == 0) { in nest_imc_event_init()
532 mutex_unlock(&ref->lock); in nest_imc_event_init()
538 ++ref->refc; in nest_imc_event_init()
539 mutex_unlock(&ref->lock); in nest_imc_event_init()
630 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
668 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
669 if (!ref) in ppc_core_imc_cpu_offline()
672 ref->refc = 0; in ppc_core_imc_cpu_offline()
688 struct imc_pmu_ref *ref; in core_imc_counters_release() local
701 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
702 if (!ref) in core_imc_counters_release()
705 mutex_lock(&ref->lock); in core_imc_counters_release()
706 if (ref->refc == 0) { in core_imc_counters_release()
717 mutex_unlock(&ref->lock); in core_imc_counters_release()
720 ref->refc--; in core_imc_counters_release()
721 if (ref->refc == 0) { in core_imc_counters_release()
725 mutex_unlock(&ref->lock); in core_imc_counters_release()
729 } else if (ref->refc < 0) { in core_imc_counters_release()
731 ref->refc = 0; in core_imc_counters_release()
733 mutex_unlock(&ref->lock); in core_imc_counters_release()
742 struct imc_pmu_ref *ref; in core_imc_event_init() local
779 ref = &core_imc_refc[core_id]; in core_imc_event_init()
780 if (!ref) in core_imc_event_init()
789 mutex_lock(&ref->lock); in core_imc_event_init()
790 if (ref->refc == 0) { in core_imc_event_init()
794 mutex_unlock(&ref->lock); in core_imc_event_init()
800 ++ref->refc; in core_imc_event_init()
801 mutex_unlock(&ref->lock); in core_imc_event_init()
997 struct imc_pmu_ref *ref; in thread_imc_event_add() local
1012 ref = &core_imc_refc[core_id]; in thread_imc_event_add()
1013 if (!ref) in thread_imc_event_add()
1016 mutex_lock(&ref->lock); in thread_imc_event_add()
1017 if (ref->refc == 0) { in thread_imc_event_add()
1020 mutex_unlock(&ref->lock); in thread_imc_event_add()
1026 ++ref->refc; in thread_imc_event_add()
1027 mutex_unlock(&ref->lock); in thread_imc_event_add()
1035 struct imc_pmu_ref *ref; in thread_imc_event_del() local
1044 ref = &core_imc_refc[core_id]; in thread_imc_event_del()
1046 mutex_lock(&ref->lock); in thread_imc_event_del()
1047 ref->refc--; in thread_imc_event_del()
1048 if (ref->refc == 0) { in thread_imc_event_del()
1051 mutex_unlock(&ref->lock); in thread_imc_event_del()
1056 } else if (ref->refc < 0) { in thread_imc_event_del()
1057 ref->refc = 0; in thread_imc_event_del()
1059 mutex_unlock(&ref->lock); in thread_imc_event_del()