Lines Matching refs:idx
41 swap(cp->elements[cpu_a].idx, cp->elements[cpu_b].idx); in cpudl_exchange()
44 static void cpudl_heapify(struct cpudl *cp, int idx) in cpudl_heapify() argument
50 l = left_child(idx); in cpudl_heapify()
51 r = right_child(idx); in cpudl_heapify()
52 largest = idx; in cpudl_heapify()
54 if ((l < cp->size) && dl_time_before(cp->elements[idx].dl, in cpudl_heapify()
60 if (largest == idx) in cpudl_heapify()
64 cpudl_exchange(cp, largest, idx); in cpudl_heapify()
65 idx = largest; in cpudl_heapify()
69 static void cpudl_change_key(struct cpudl *cp, int idx, u64 new_dl) in cpudl_change_key() argument
71 WARN_ON(idx == IDX_INVALID || !cpu_present(idx)); in cpudl_change_key()
73 if (dl_time_before(new_dl, cp->elements[idx].dl)) { in cpudl_change_key()
74 cp->elements[idx].dl = new_dl; in cpudl_change_key()
75 cpudl_heapify(cp, idx); in cpudl_change_key()
77 cp->elements[idx].dl = new_dl; in cpudl_change_key()
78 while (idx > 0 && dl_time_before(cp->elements[parent(idx)].dl, in cpudl_change_key()
79 cp->elements[idx].dl)) { in cpudl_change_key()
80 cpudl_exchange(cp, idx, parent(idx)); in cpudl_change_key()
81 idx = parent(idx); in cpudl_change_key()
140 old_idx = cp->elements[cpu].idx; in cpudl_set()
155 cp->elements[new_cpu].idx = old_idx; in cpudl_set()
156 cp->elements[cpu].idx = IDX_INVALID; in cpudl_set()
173 cp->elements[cpu].idx = cp->size - 1; in cpudl_set()
228 cp->elements[i].idx = IDX_INVALID; in cpudl_init()