Lines Matching defs:caps
167 scx_cmask_init(&pshard->caps[i].cmask, shard->base_cid, shard->nr_cids);
224 * Seed the root's caps fully. Root owns all cids on all caps at enable time.
225 * Children acquire caps via scx_bpf_sub_grant().
235 scx_cmask_fill(&ps->caps[i].cmask);
680 * Return @rq's local DSQ if @sch holds the required caps on @rq's cid.
691 * always holds all caps.
706 * @p's owner (@sch). Check caps against the scheduling sched.
717 * The task must run on this CPU regardless of caps: the rq is draining
719 * migration is pending. Admit despite the missing caps and count it.
755 /* @p lost the caps needed to stay on @rq's local DSQ? Record reason if so. */
819 /* record a caps change, see struct scx_caps_updated */
820 static void caps_updated_record(struct scx_pshard *ps, const struct scx_cmask *cids, u64 caps,
827 cu->caps |= caps;
842 u64 caps = 0;
847 * live yet - e.g. caps grant from ops.sub_attach().
852 if (cu->caps && SCX_HAS_OP(sch, sub_caps_updated) &&
856 caps = cu->caps;
861 cu->caps = 0;
866 if (!caps)
869 /* caps != 0 only when deliverable (has_op, above) */
870 SCX_CALL_OP(sch, sub_caps_updated, NULL, cu->cmask_arena_out, caps);
876 * Deliver caps owed to @sch that couldn't be delivered earlier (e.g. a grant
892 if (cu->caps && list_empty(&cu->node_in_flight))
905 if (scx_cmask_test(cid, &ps->caps[cap_bit].cmask))
926 * sees the caps[] update made before this call.
949 * scx_process_sync_ecaps - Sync this cpu's ecaps to pshard->caps[]
953 * pshard->caps[] is the target configuration. pcpu->ecaps is the effective
1011 * Tell the sched its effective caps on this cid changed. The
1051 * against the effective caps and thus must come after the ecaps sync.
1094 * recomputes effective caps from the pshard and fires ops.sub_ecaps_updated()
1976 /* @sch is enabled; deliver any caps owed since its sub_attach() */
2260 static s32 sub_cap_preamble(u64 cgroup_id, u64 caps, const struct bpf_prog_aux *aux,
2284 if (unlikely(caps & ~__SCX_CAP_ALL)) {
2285 scx_error(parent, "invalid caps 0x%llx", caps);
2295 * scx_bpf_sub_grant - Grant @caps on a cmask's cids to a direct child
2297 * @caps: bitmask of SCX_CAP_* to grant
2298 * @cmask__arena: cid cmask to grant @caps on
2312 __bpf_kfunc s32 scx_bpf_sub_grant(u64 cgroup_id, u64 caps,
2325 ret = sub_cap_preamble(cgroup_id, caps, aux, &parent, &child);
2368 scx_for_each_cap_bit(cap_bit, caps)
2369 scx_cmask_and(granted_cids, &pps->caps[cap_bit].cmask);
2375 scx_for_each_cap_bit(cap_bit, caps) {
2376 struct scx_cmask *ccm = &cps->caps[cap_bit].cmask;
2422 * scx_bpf_sub_revoke - Revoke @caps on a cmask's cids from a direct child
2424 * @caps: bitmask of SCX_CAP_* to revoke
2425 * @cmask__arena: cid cmask to revoke @caps on
2428 * Clear @caps bits on @cmask__arena from the child named by @cgroup_id and all
2432 __bpf_kfunc void scx_bpf_sub_revoke(u64 cgroup_id, u64 caps,
2443 if (sub_cap_preamble(cgroup_id, caps, aux, &parent, &child))
2452 /* per-shard, walk child's subtree and clear @caps */
2462 * nothing means no descendant of it can hold @caps on these
2479 scx_for_each_cap_bit(cap_bit, caps) {
2480 struct scx_cmask *cm = &ps->caps[cap_bit].cmask;
2515 * @caps: one or more SCX_CAP_* bits
2516 * @out__arena: cmask to receive the union of @caps within its range
2526 __bpf_kfunc s32 scx_bpf_sub_caps(u64 cgroup_id, u64 caps, struct scx_cmask *out__arena,
2545 if (unlikely(caps & ~__SCX_CAP_ALL)) {
2546 scx_error(sch, "invalid caps 0x%llx", caps);
2565 * The target's caps storage may not be set up yet (e.g. a self-read
2572 scx_error(sch, "scx_bpf_sub_caps() called before caps storage is initialized");
2588 scx_for_each_cap_bit(cap_bit, caps)
2589 scx_cmask_or(local_out, &pshard[si]->caps[cap_bit].cmask);
2653 __bpf_kfunc s32 scx_bpf_sub_grant(u64 cgroup_id, u64 caps,
2661 __bpf_kfunc void scx_bpf_sub_revoke(u64 cgroup_id, u64 caps,
2667 __bpf_kfunc s32 scx_bpf_sub_caps(u64 cgroup_id, u64 caps, struct scx_cmask *out__arena,