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

Joel Fernandes
2025-06-30T14:11:23Z

On Mon, Jun 23, 2025 at 10:16:53 -1000, Tejun Heo wrote:
> 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);

I agree, I will make this change.

> Other than that,
>
> Acked-by: Tejun Heo <tj@kernel.org>

thanks!

- Joel