lkml.org 
[lkml]   [2022]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] sched/fair: Choose the CPU where short task is running during wake up
On 2022-09-29 at 14:59:46 +0800, Honglei Wang wrote:
> > > > @@ -6050,7 +6063,8 @@ wake_affine_idle(int this_cpu, int prev_cpu, int sync)
> > > > if (available_idle_cpu(this_cpu) && cpus_share_cache(this_cpu, prev_cpu))
> > > > return available_idle_cpu(prev_cpu) ? prev_cpu : this_cpu;
> > > > - if (sync && cpu_rq(this_cpu)->nr_running == 1)
> > > > + if ((sync && cpu_rq(this_cpu)->nr_running == 1) ||
> > > > + is_short_task(cpu_curr(this_cpu)))
>
> Seems it a bit breaks idle (or will be idle) purpose of wake_affine_idle()
> here.
Exactly, we should prefer previous idle CPU to 'potential idle' this_cpu to keep
it consistent.
> Maybe we can do it something like this?
>
> if ((sync || is_short_task(cpu_curr(this_cpu))) &&
> cpu_rq(this_cpu)->nr_running == 1)
>
Yes, Prateek's experimental results has proven your suggestion.

thanks,
Chenyu
> Thanks,
> Honglei

\
 
 \ /
  Last update: 2022-09-30 18:08    [W:0.074 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site