public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Rik van Riel <riel@redhat.com>
Cc: linux-kernel@vger.kernel.org, mgorman@suse.de,
	chegu_vinod@hp.com, mingo@kernel.org
Subject: Re: [PATCH] sched,numa: update migrate_improves/degrades_locality
Date: Fri, 16 May 2014 15:46:37 +0200	[thread overview]
Message-ID: <20140516134637.GT11096@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140515130306.61aae7db@cuia.bos.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On Thu, May 15, 2014 at 01:03:06PM -0400, Rik van Riel wrote:
> Update the migrate_improves/degrades_locality functions with
> knowledge of pseudo-interleaving.
> 
> Do not consider moving tasks around within the set of group's active
> nodes as improving or degrading locality. Instead, leave the load
> balancer free to balance the load between a numa_group's active nodes.
> 
> Also, switch from the group/task_weight functions to the group/task_fault
> functions. The "weight" functions involve a division, but both calls use
> the same divisor, so there's no point in doing that from these functions.
> 
> On a 4 node (x10 core) system, performance of SPECjbb2005 seems
> unaffected, though the number of migrations with 2 8-warehouse wide
> instances seems to have almost halved, due to the scheduler running
> each instance on a single node.
> 
> Signed-off-by: Rik van Riel <riel@redhat.com>
> ---
>  kernel/sched/fair.c | 42 +++++++++++++++++++++++++++++-------------
>  1 file changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6504015..4f01e2f1 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4971,6 +4971,7 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
>  /* Returns true if the destination node has incurred more faults */
>  static bool migrate_improves_locality(struct task_struct *p, struct lb_env *env)
>  {
> +	struct numa_group *numa_group = ACCESS_ONCE(p->numa_group);

That wants to be rcu_dereference() to match the rcu_assign_pointer() we
use to set it.

Same in that wake_numa patch

>  	int src_nid, dst_nid;
>  
>  	if (!sched_feat(NUMA_FAVOUR_HIGHER) || !p->numa_faults_memory ||

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-05-16 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 17:03 [PATCH] sched,numa: update migrate_improves/degrades_locality Rik van Riel
2014-05-16 13:46 ` Peter Zijlstra [this message]
2014-05-19 13:11 ` [tip:sched/core] sched,numa: Update migrate_improves/ degrades_locality tip-bot for Rik van Riel
2014-05-22 12:29 ` [tip:sched/core] sched/numa: Update migrate_improves/ degrades_locality() tip-bot for Rik van Riel

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=20140516134637.GT11096@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=chegu_vinod@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=riel@redhat.com \
    /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