Hello,

On 10/03/26 11:56, Gabriele Monaco wrote:

...

> +/* Used by other monitors */
> +struct sched_class *rv_ext_sched_class;
> +
> +static int __init register_deadline(void)
> +{
> +     if (IS_ENABLED(CONFIG_SCHED_CLASS_EXT))
> +             rv_ext_sched_class = (void 
> *)kallsyms_lookup_name("ext_sched_class");

Looks like the above look up can fail. I don't actually see how/why if
would fail if things build correctly and EXT tasks are around. But,
theoretically, we could end up with rv_ext_sched_class = NULL ?

...

> +static inline bool task_is_scx_enabled(struct task_struct *tsk)
> +{
> +     return IS_ENABLED(CONFIG_SCHED_CLASS_EXT) &&
> +            tsk->sched_class == rv_ext_sched_class;
> +}
> +
> +/* Expand id and target as arguments for da functions */
> +#define EXPAND_ID(dl_se, cpu, type) get_entity_id(dl_se, cpu, type), dl_se
> +#define EXPAND_ID_TASK(tsk) get_entity_id(&tsk->dl, task_cpu(tsk), DL_TASK), 
> &tsk->dl
> +
> +static inline uint8_t get_server_type(struct task_struct *tsk)
> +{
> +     if (tsk->policy == SCHED_NORMAL || tsk->policy == SCHED_EXT ||
> +         tsk->policy == SCHED_BATCH || tsk->policy == SCHED_IDLE)
> +             return task_is_scx_enabled(tsk) ? DL_SERVER_EXT : 
> DL_SERVER_FAIR;
> +     return DL_OTHER;
> +}

Considering that, if that happens, get_server_type() will return
DL_SERVER_FAIR for scx tasks as well (possibly confusing monitors?),
shall we add a warn or something just in case. A 'no we don't need that
because it can't happen' works for me, just thought I should still
mention this. :)

Thanks,
Juri


Reply via email to