Re: [PATCH v5 02/14] sched/debug: Stop and start server based on if it was active

From: Tejun Heo
Date: Mon Jun 23 2025 - 16:17:00 EST


On Fri, Jun 20, 2025 at 04:32:17PM -0400, Joel Fernandes wrote:
> @@ -381,7 +382,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
> return -EINVAL;
> }
>
> - if (rq->cfs.h_nr_queued) {
> + if (dl_server_active(&rq->fair_server)) {
> + was_active = true;
> update_rq_clock(rq);
> dl_server_stop(&rq->fair_server);
> }
> @@ -392,7 +394,7 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
> printk_deferred("Fair server disabled in CPU %d, system may crash due to starvation.\n",
> cpu_of(rq));
>
> - if (rq->cfs.h_nr_queued)
> + if (was_active)

This is minor but the style looks a bit odd to me. Would it make more sense
to put was_active in the scoped_guard block and do something like:

is_active = dl_server_active(&rq->fair_server);
if (is_active) {
...
}
...
if (is_active)
dl_server_start(&rq->fair_server);

Other than that,

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

--
tejun