lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zw08JUlsm7b8xZk8@gpd3>
Date: Mon, 14 Oct 2024 17:43:33 +0200
From: Andrea Righi <andrea.righi@...ux.dev>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Tejun Heo <tj@...nel.org>, David Vernet <void@...ifault.com>,
	Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Valentin Schneider <vschneid@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched_ext: Always call put_prev_task() with scx enabled

On Mon, Oct 14, 2024 at 10:36:08AM +0200, Peter Zijlstra wrote:
...
> > @@ -2523,6 +2508,21 @@ DECLARE_STATIC_KEY_FALSE(__scx_switched_all);	/* all fair class tasks on SCX */
> >  #define scx_switched_all()	false
> >  #endif /* !CONFIG_SCHED_CLASS_EXT */
> >  
> > +static inline void put_prev_set_next_task(struct rq *rq,
> > +					  struct task_struct *prev,
> > +					  struct task_struct *next)
> > +{
> > +	WARN_ON_ONCE(rq->curr != prev);
> > +
> > +	__put_prev_set_next_dl_server(rq, prev, next);
> > +
> > +	if (next == prev && !scx_enabled())
> > +		return;
> 
> Does that not also want to include a 'next->sched_class ==
> &ext_sched_class' clause ? And a comment?
> 
> > +
> > +	prev->sched_class->put_prev_task(rq, prev, next);
> > +	next->sched_class->set_next_task(rq, next, true);
> > +}
> 
> And is there really no way scx can infer this happened? We just did pick
> after all, that can see this coming a mile of.

Ah, I believe I understand better what's happening now.

When prev == next with the idle class we're not calling
->put_prev_task/set_next_task anymore, so we may skip calling
ops.update_idle() in scx.

I think that's the only special case that we need to handle, and we may
be able to solve the regression by calling scx_update_idle() from
pick_task_idle().

Will do some testing with this.

-Andrea

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ