30 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * A scheduler that validates the behavior of direct dispatching with a default4 * select_cpu implementation.5 *6 * Copyright (c) 2023 Meta Platforms, Inc. and affiliates.7 * Copyright (c) 2023 David Vernet <dvernet@meta.com>8 * Copyright (c) 2023 Tejun Heo <tj@kernel.org>9 */10 11#include <scx/common.bpf.h>12 13char _license[] SEC("license") = "GPL";14 15u32 exit_kind;16 17void BPF_STRUCT_OPS_SLEEPABLE(enq_last_no_enq_fails_exit, struct scx_exit_info *info)18{19 exit_kind = info->kind;20}21 22SEC(".struct_ops.link")23struct sched_ext_ops enq_last_no_enq_fails_ops = {24 .name = "enq_last_no_enq_fails",25 /* Need to define ops.enqueue() with SCX_OPS_ENQ_LAST */26 .flags = SCX_OPS_ENQ_LAST,27 .exit = (void *) enq_last_no_enq_fails_exit,28 .timeout_ms = 1000U,29};30