lkml.org 
[lkml]   [2014]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 5/5] sched,numa: find the preferred nid with complex NUMA topology
On Wed, Oct 08, 2014 at 03:37:30PM -0400, riel@redhat.com wrote:
> +static int preferred_group_nid(struct task_struct *p, int nid)
> +{
> + nodemask_t nodes;
> + int hops;
> +
> + /* Direct connections between all NUMA nodes. */
> + if (sched_numa_topology_type == NUMA_DIRECT)
> + return nid;
> +
> + /*
> + * On a system with glueless mesh NUMA topology, group_weight
> + * scores nodes according to the number of NUMA hinting faults on
> + * both the node itself, and on nearby nodes.
> + */
> + if (sched_numa_topology_type == NUMA_GLUELESS_MESH) {
> + unsigned long score, max_score = 0;
> + int node, max_node = nid;
> +
> + hops = sched_domains_numa_levels;
> +
> + for_each_online_node(node) {
> + score = group_weight(p, node, hops);
> + if (score > max_score) {
> + max_score = score;
> + max_node = node;
> + }
> + }
> + return max_node;
> + }

This too is O(nr_nodes^2), right?


\
 
 \ /
  Last update: 2014-10-12 17:21    [W:0.131 / U:2.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site