Re: [RFC PATCH v4 0/2] sched/fair: Choose the CPU where short task is running during wake up

From: K Prateek Nayak
Date: Sun Jan 22 2023 - 23:48:22 EST


Hello Chenyu,

Thank you for looking into this.

On 1/22/2023 9:07 PM, Chen Yu wrote:
> On 2023-01-20 at 17:09:28 +0800, Yicong Yang wrote:
> [..snip..]
>
> This sounds reasonable to me. I think we can further enhance it.
> And before you sending out the proposal, could you help test the following
> experimental change, to see if it makes tbench netperf and MySQL better?
>
> Hi Prateek, could you also help check if below change would make the Spec regression
> go away?

Sure. I'll add this on top of v4 and queue some runs.
Will share the results soon.

>
> thanks,
> Chenyu
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index fc8a636eca5e..6e1ab5e2686c 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4974,7 +4974,7 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
> static inline int is_short_task(struct task_struct *p)
> {
> return sched_feat(SIS_SHORT) && p->se.dur_avg &&
> - ((p->se.dur_avg * 8) <= sysctl_sched_min_granularity);
> + ((p->se.dur_avg * 1024) <= (__this_cpu_read(sd_llc_size) * sysctl_sched_min_granularity));
> }
>
> /*


--
Thanks and Regards,
Prateek