Lines Matching refs:idx
46 swap(cp->elements[cpu_a].idx, cp->elements[cpu_b].idx); in cpudl_exchange()
49 static void cpudl_heapify(struct cpudl *cp, int idx) in cpudl_heapify() argument
55 l = left_child(idx); in cpudl_heapify()
56 r = right_child(idx); in cpudl_heapify()
57 largest = idx; in cpudl_heapify()
59 if ((l < cp->size) && dl_time_before(cp->elements[idx].dl, in cpudl_heapify()
65 if (largest == idx) in cpudl_heapify()
69 cpudl_exchange(cp, largest, idx); in cpudl_heapify()
70 idx = largest; in cpudl_heapify()
74 static void cpudl_change_key(struct cpudl *cp, int idx, u64 new_dl) in cpudl_change_key() argument
76 WARN_ON(idx == IDX_INVALID || !cpu_present(idx)); in cpudl_change_key()
78 if (dl_time_before(new_dl, cp->elements[idx].dl)) { in cpudl_change_key()
79 cp->elements[idx].dl = new_dl; in cpudl_change_key()
80 cpudl_heapify(cp, idx); in cpudl_change_key()
82 cp->elements[idx].dl = new_dl; in cpudl_change_key()
83 while (idx > 0 && dl_time_before(cp->elements[parent(idx)].dl, in cpudl_change_key()
84 cp->elements[idx].dl)) { in cpudl_change_key()
85 cpudl_exchange(cp, idx, parent(idx)); in cpudl_change_key()
86 idx = parent(idx); in cpudl_change_key()
145 old_idx = cp->elements[cpu].idx; in cpudl_set()
160 cp->elements[new_cpu].idx = old_idx; in cpudl_set()
161 cp->elements[cpu].idx = IDX_INVALID; in cpudl_set()
178 cp->elements[cpu].idx = cp->size - 1; in cpudl_set()
233 cp->elements[i].idx = IDX_INVALID; in cpudl_init()