Re: [PATCH 03/16] sched/debug: Stop and start server based on if it was active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 03, 2025 at 04:43:19PM +0200, Juri Lelli wrote:
> Hi,
> 
> On 03/09/25 11:33, Andrea Righi wrote:
> > From: Joel Fernandes <joelagnelf@xxxxxxxxxx>
> > 
> > Currently the DL server interface for applying parameters checks
> > CFS-internals to identify if the server is active. This is error-prone
> > and makes it difficult when adding new servers in the future.
> > 
> > Fix it, by using dl_server_active() which is also used by the DL server
> > code to determine if the DL server was started.
> > 
> > Acked-by: Tejun Heo <tj@xxxxxxxxxx>
> > Reviewed-by: Andrea Righi <arighi@xxxxxxxxxx>
> > Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
> > ---
> >  kernel/sched/debug.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> > index dbe2aee8628ce..e71f6618c1a6a 100644
> > --- a/kernel/sched/debug.c
> > +++ b/kernel/sched/debug.c
> > @@ -354,6 +354,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
> >  		return err;
> >  
> >  	scoped_guard (rq_lock_irqsave, rq) {
> > +		bool is_active;
> > +
> >  		runtime  = rq->fair_server.dl_runtime;
> >  		period = rq->fair_server.dl_period;
> >  
> > @@ -376,7 +378,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
> >  			return  -EINVAL;
> >  		}
> >  
> > -		if (rq->cfs.h_nr_queued) {
> > +		is_active = dl_server_active(&rq->fair_server);
> > +		if (is_active) {
> >  			update_rq_clock(rq);
> >  			dl_server_stop(&rq->fair_server);
> >  		}
> 
> I believe this chunk will unfortunately conflict with bb4700adc3ab
> ("sched/deadline: Always stop dl-server before changing parameters"),
> but it should be an easy fix. :)

Right, I also tested that in a separate branch, this patchset is rebased on
top of Tejun's branch that doesn't have bb4700adc3ab yet. But from a
sched_ext perspective everything seems to work fine either way.

Thanks,
-Andrea




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux