Re: [PATCH 5/5] sched/fair: Add exception for hints in load balancing path

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

 



On 12 Sep 2022 11:59:50 +0530 K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> >> @@ -7977,6 +7980,21 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
> >>  		return 0;
> >>  	}
> >>  
> >> +	/*
> >> +	 * Hints are followed only if the MC Domain is still ideal
> >> +	 * for the task.
> >> +	 */
> >> +	if (!env->ignore_hint) {
> >> +		/*
> >> +		 * Only consider the hints from the wakeup path to maintain
> >> +		 * data locality.
> >> +		 */
> >> +		if (READ_ONCE(p->hint) &
> >> +		    (PR_SCHED_HINT_WAKE_AFFINE | PR_SCHED_HINT_WAKE_HOLD))
> >> +			return 0;
> >> +	}
> > 
> > The wake hints are not honored during lb without PR_SCHED_HINT_IGNORE_LB set
> > then the scheduler works as you hint.
> 
> Are you suggesting we leave it to the user, to control whether the
> load-balancer can spread the task apart, even if hints are set,
> via another userspace hint "PR_SCHED_HINT_IGNORE_LB"?

Yes, given we have room in kernel for both LB and wake hints.
> 
> I had not considered it before but it may benefit some workloads.

Like setting CPU affinity, scheduler works as user hints, but not
responsible for any results, stupid or smart, because you are making
the game simpler. And this is a good work.

Hillf




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux