Lines Matching refs:cgv_node
101 struct cgv_node { struct
108 private(CGV_TREE) struct bpf_rb_root cgv_tree __contains(cgv_node, rb_node); argument
111 struct cgv_node __kptr *node;
147 struct cgv_node *cgc_a, *cgc_b; in cgv_node_less()
149 cgc_a = container_of(a, struct cgv_node, rb_node); in cgv_node_less()
150 cgc_b = container_of(b, struct cgv_node, rb_node); in cgv_node_less()
255 static void cgrp_cap_budget(struct cgv_node *cgv_node, struct fcg_cgrp_ctx *cgc) in cgrp_cap_budget() argument
265 cvtime = cgv_node->cvtime + delta; in cgrp_cap_budget()
277 cgv_node->cvtime = cvtime; in cgrp_cap_budget()
283 struct cgv_node *cgv_node; in cgrp_enqueued() local
299 cgv_node = bpf_kptr_xchg(&stash->node, NULL); in cgrp_enqueued()
300 if (!cgv_node) { in cgrp_enqueued()
306 cgrp_cap_budget(cgv_node, cgc); in cgrp_enqueued()
307 bpf_rbtree_add(&cgv_tree, &cgv_node->rb_node, cgv_node_less); in cgrp_enqueued()
616 struct cgv_node *cgv_node; in try_pick_next_cgroup() local
645 cgv_node = container_of(rb_node, struct cgv_node, rb_node); in try_pick_next_cgroup()
646 cgid = cgv_node->cgid; in try_pick_next_cgroup()
648 if (vtime_before(cvtime_now, cgv_node->cvtime)) in try_pick_next_cgroup()
649 cvtime_now = cgv_node->cvtime; in try_pick_next_cgroup()
689 cgv_node->cvtime += cgrp_slice_ns * FCG_HWEIGHT_ONE / (cgc->hweight ?: 1); in try_pick_next_cgroup()
690 cgrp_cap_budget(cgv_node, cgc); in try_pick_next_cgroup()
691 bpf_rbtree_add(&cgv_tree, &cgv_node->rb_node, cgv_node_less); in try_pick_next_cgroup()
714 bpf_rbtree_add(&cgv_tree, &cgv_node->rb_node, cgv_node_less); in try_pick_next_cgroup()
718 cgv_node = bpf_kptr_xchg(&stash->node, cgv_node); in try_pick_next_cgroup()
719 if (cgv_node) { in try_pick_next_cgroup()
728 bpf_obj_drop(cgv_node); in try_pick_next_cgroup()
839 struct cgv_node *cgv_node; in BPF_STRUCT_OPS_SLEEPABLE() local
879 cgv_node = bpf_obj_new(struct cgv_node); in BPF_STRUCT_OPS_SLEEPABLE()
880 if (!cgv_node) { in BPF_STRUCT_OPS_SLEEPABLE()
885 cgv_node->cgid = cgid; in BPF_STRUCT_OPS_SLEEPABLE()
886 cgv_node->cvtime = cvtime_now; in BPF_STRUCT_OPS_SLEEPABLE()
888 cgv_node = bpf_kptr_xchg(&stash->node, cgv_node); in BPF_STRUCT_OPS_SLEEPABLE()
889 if (cgv_node) { in BPF_STRUCT_OPS_SLEEPABLE()
898 bpf_obj_drop(cgv_node); in BPF_STRUCT_OPS_SLEEPABLE()