Lines Matching refs:ref
303 struct imc_pmu_ref *ref; in ppc_nest_imc_cpu_offline() local
347 ref = get_nest_pmu_ref(cpu); in ppc_nest_imc_cpu_offline()
348 if (!ref) in ppc_nest_imc_cpu_offline()
351 ref->refc = 0; in ppc_nest_imc_cpu_offline()
397 struct imc_pmu_ref *ref; in nest_imc_counters_release() local
410 ref = get_nest_pmu_ref(event->cpu); in nest_imc_counters_release()
411 if (!ref) in nest_imc_counters_release()
415 mutex_lock(&ref->lock); in nest_imc_counters_release()
416 if (ref->refc == 0) { in nest_imc_counters_release()
427 mutex_unlock(&ref->lock); in nest_imc_counters_release()
430 ref->refc--; in nest_imc_counters_release()
431 if (ref->refc == 0) { in nest_imc_counters_release()
435 mutex_unlock(&ref->lock); in nest_imc_counters_release()
439 } else if (ref->refc < 0) { in nest_imc_counters_release()
441 ref->refc = 0; in nest_imc_counters_release()
443 mutex_unlock(&ref->lock); in nest_imc_counters_release()
452 struct imc_pmu_ref *ref; in nest_imc_event_init() local
514 ref = get_nest_pmu_ref(event->cpu); in nest_imc_event_init()
515 if (!ref) in nest_imc_event_init()
518 mutex_lock(&ref->lock); in nest_imc_event_init()
519 if (ref->refc == 0) { in nest_imc_event_init()
523 mutex_unlock(&ref->lock); in nest_imc_event_init()
529 ++ref->refc; in nest_imc_event_init()
530 mutex_unlock(&ref->lock); in nest_imc_event_init()
620 struct imc_pmu_ref *ref; in ppc_core_imc_cpu_offline() local
658 ref = &core_imc_refc[core_id]; in ppc_core_imc_cpu_offline()
659 if (!ref) in ppc_core_imc_cpu_offline()
662 ref->refc = 0; in ppc_core_imc_cpu_offline()
678 struct imc_pmu_ref *ref; in core_imc_counters_release() local
691 ref = &core_imc_refc[core_id]; in core_imc_counters_release()
692 if (!ref) in core_imc_counters_release()
695 mutex_lock(&ref->lock); in core_imc_counters_release()
696 if (ref->refc == 0) { in core_imc_counters_release()
707 mutex_unlock(&ref->lock); in core_imc_counters_release()
710 ref->refc--; in core_imc_counters_release()
711 if (ref->refc == 0) { in core_imc_counters_release()
715 mutex_unlock(&ref->lock); in core_imc_counters_release()
719 } else if (ref->refc < 0) { in core_imc_counters_release()
721 ref->refc = 0; in core_imc_counters_release()
723 mutex_unlock(&ref->lock); in core_imc_counters_release()
732 struct imc_pmu_ref *ref; in core_imc_event_init() local
769 ref = &core_imc_refc[core_id]; in core_imc_event_init()
770 if (!ref) in core_imc_event_init()
779 mutex_lock(&ref->lock); in core_imc_event_init()
780 if (ref->refc == 0) { in core_imc_event_init()
784 mutex_unlock(&ref->lock); in core_imc_event_init()
790 ++ref->refc; in core_imc_event_init()
791 mutex_unlock(&ref->lock); in core_imc_event_init()
864 struct imc_pmu_ref *ref; in thread_imc_pmu_sched_task() local
876 ref = &core_imc_refc[core_id]; in thread_imc_pmu_sched_task()
877 if (!ref) in thread_imc_pmu_sched_task()
881 mutex_lock(&ref->lock); in thread_imc_pmu_sched_task()
882 if (ref->refc == 0) { in thread_imc_pmu_sched_task()
885 mutex_unlock(&ref->lock); in thread_imc_pmu_sched_task()
891 ++ref->refc; in thread_imc_pmu_sched_task()
892 mutex_unlock(&ref->lock); in thread_imc_pmu_sched_task()
894 mutex_lock(&ref->lock); in thread_imc_pmu_sched_task()
895 ref->refc--; in thread_imc_pmu_sched_task()
896 if (ref->refc == 0) { in thread_imc_pmu_sched_task()
899 mutex_unlock(&ref->lock); in thread_imc_pmu_sched_task()
904 } else if (ref->refc < 0) { in thread_imc_pmu_sched_task()
905 ref->refc = 0; in thread_imc_pmu_sched_task()
907 mutex_unlock(&ref->lock); in thread_imc_pmu_sched_task()