[PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-03-26 Thread Rik van Riel
On Mon, 22 Mar 2021 11:03:06 + Mel Gorman wrote: > Second, select_idle_smt() does not use the cpus mask so consider moving > the cpus initialisation after select_idle_smt() has been called. > Specifically this initialisation > > cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); >

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-08 Thread Rik van Riel
On Wed, 2021-04-07 at 12:19 +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 11:54:37AM +0200, Peter Zijlstra wrote: > > > Let me have another poke at it. > > Pretty much what you did, except I also did s/smt/has_idle_core/ and > fixed that @sd thing. > > Like so then? Looks good to me. T

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Vincent Guittot
On Fri, 26 Mar 2021 at 20:19, Rik van Riel wrote: > > On Mon, 22 Mar 2021 11:03:06 + > Mel Gorman wrote: > > > > Second, select_idle_smt() does not use the cpus mask so consider moving > > the cpus initialisation after select_idle_smt() has been called. > > Specifically this initialisation >

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Rik van Riel
On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > On Fri, 26 Mar 2021 at 20:19, Rik van Riel wrote: > > > -static int select_idle_cpu(struct task_struct *p, struct > > sched_domain *sd, int target) > > +static int select_idle_cpu(struct task_struct *p, struct > > sched_domain *sd, int p

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Vincent Guittot
On Tue, 6 Apr 2021 at 17:26, Rik van Riel wrote: > > On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > > On Fri, 26 Mar 2021 at 20:19, Rik van Riel wrote: > > > > > -static int select_idle_cpu(struct task_struct *p, struct > > > sched_domain *sd, int target) > > > +static int select_idl

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Vincent Guittot
On Tue, 6 Apr 2021 at 17:31, Vincent Guittot wrote: > > On Tue, 6 Apr 2021 at 17:26, Rik van Riel wrote: > > > > On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > > > On Fri, 26 Mar 2021 at 20:19, Rik van Riel wrote: > > > > > > > -static int select_idle_cpu(struct task_struct *p, stru

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Rik van Riel
On Tue, 2021-04-06 at 17:31 +0200, Vincent Guittot wrote: > On Tue, 6 Apr 2021 at 17:26, Rik van Riel wrote: > > On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > > > On Fri, 26 Mar 2021 at 20:19, Rik van Riel > > > wrote: > > > > > > > -static int select_idle_cpu(struct task_struct *p

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-06 Thread Vincent Guittot
On Tue, 6 Apr 2021 at 17:55, Rik van Riel wrote: > > On Tue, 2021-04-06 at 17:31 +0200, Vincent Guittot wrote: > > On Tue, 6 Apr 2021 at 17:26, Rik van Riel wrote: > > > On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > > > > On Fri, 26 Mar 2021 at 20:19, Rik van Riel > > > > wrote: >

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Peter Zijlstra
On Tue, Apr 06, 2021 at 11:26:37AM -0400, Rik van Riel wrote: > I would be happy to pull the static branch out of select_idle_smt() > and place it into this if condition, though. You are right that > would save some overhead on non-smt systems. > > Peter, would you prefer a follow-up patch for tha

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Mel Gorman
On Wed, Apr 07, 2021 at 09:17:18AM +0200, Peter Zijlstra wrote: > Subject: sched/fair: Bring back select_idle_smt(), but differently > From: Rik van Riel > Date: Fri, 26 Mar 2021 15:19:32 -0400 > > From: Rik van Riel > > Mel Gorman did some nice work in 9fe1f127b913 ("sched/fair: Merge > select

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Vincent Guittot
Le mercredi 07 avril 2021 à 09:17:18 (+0200), Peter Zijlstra a écrit : > On Tue, Apr 06, 2021 at 11:26:37AM -0400, Rik van Riel wrote: > > I would be happy to pull the static branch out of select_idle_smt() > > and place it into this if condition, though. You are right that > > would save some over

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 11:42:17AM +0200, Vincent Guittot wrote: > I would really prefer to keep that out of select_idle_cpu which aims to merge > in one > single loop the walk through sd_llc. In the case of select_idle_smt, this is > done outside > the loop: Fair enough. > @@ -6317,11 +6339,21

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Vincent Guittot
On Wed, 7 Apr 2021 at 11:55, Peter Zijlstra wrote: > > On Wed, Apr 07, 2021 at 11:42:17AM +0200, Vincent Guittot wrote: > > I would really prefer to keep that out of select_idle_cpu which aims to > > merge in one > > single loop the walk through sd_llc. In the case of select_idle_smt, this > > i

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 10:41:06AM +0100, Mel Gorman wrote: > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -6112,6 +6112,27 @@ static int select_idle_core(struct task_ > > return -1; > > } > > > > +/* > > + * Scan the local SMT mask for idle CPUs. > > + */ > > +static in

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 11:54:37AM +0200, Peter Zijlstra wrote: > Let me have another poke at it. Pretty much what you did, except I also did s/smt/has_idle_core/ and fixed that @sd thing. Like so then? --- --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6038,11 +6038,9 @@ static inline

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Vincent Guittot
On Wed, 7 Apr 2021 at 12:19, Peter Zijlstra wrote: > > On Wed, Apr 07, 2021 at 11:54:37AM +0200, Peter Zijlstra wrote: > > > Let me have another poke at it. > > Pretty much what you did, except I also did s/smt/has_idle_core/ and > fixed that @sd thing. > > Like so then? Yes. Looks good to me >

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Mel Gorman
On Wed, Apr 07, 2021 at 12:15:13PM +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 10:41:06AM +0100, Mel Gorman wrote: > > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -6112,6 +6112,27 @@ static int select_idle_core(struct task_ > > > return -1; > > > } > > >

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-04-07 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 11:47:17AM +0100, Mel Gorman wrote: > Ok, cpusets do split domains. I can't imagine the logic of splitting SMT > siblings across cpusets but if it's possible, it has to be checked and > protecting that with cpusets_enabled() would be a little overkill and > possibly miss so

Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently

2021-03-28 Thread Mel Gorman
On Fri, Mar 26, 2021 at 03:19:32PM -0400, Rik van Riel wrote: > ---8<--- > sched,fair: bring back select_idle_smt, but differently > > Mel Gorman did some nice work in 9fe1f127b913 > ("sched/fair: Merge select_idle_core/cpu()"), resulting in the kernel > being more efficient at finding an idle CPU