linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: linux-kernel@vger.kernel.org, mgorman@techsingularity.net,
	peterz@infradead.org, linux-mm@kvack.org,
	vincent.guittot@linaro.org
Subject: Re: [PATCH 5/5] sched/fair: Add exception for hints in load balancing path
Date: Mon, 12 Sep 2022 16:55:20 +0800	[thread overview]
Message-ID: <20220912085520.2775-1-hdanton@sina.com> (raw)
In-Reply-To: <bc788935-f1f7-35ed-6c3f-ac22dd3d2214@amd.com>

On 12 Sep 2022 11:59:50 +0530 K Prateek Nayak <kprateek.nayak@amd.com> 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


      reply	other threads:[~2022-09-12  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220910105326.1797-1-kprateek.nayak@amd.com>
     [not found] ` <20220910105326.1797-6-kprateek.nayak@amd.com>
2022-09-11  8:05   ` Hillf Danton
2022-09-12  6:29     ` K Prateek Nayak
2022-09-12  8:55       ` Hillf Danton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220912085520.2775-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox