lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 13 Oct 2014 03:12:31 -0400
From:	Rik van Riel <riel@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	linux-kernel@...r.kernel.org, mgorman@...e.de, chegu_vinod@...com,
	mingo@...nel.org, efault@....de, vincent.guittot@...aro.org
Subject: Re: [PATCH RFC 2/5] sched,numa: classify the NUMA topology of a system

On 10/12/2014 10:30 AM, Peter Zijlstra wrote:
> On Wed, Oct 08, 2014 at 03:37:27PM -0400, riel@...hat.com wrote:
>> +static void init_numa_topology_type(void)
>> +{
>> +	int a, b, c, n;
>> +
>> +	n = sched_domains_numa_levels;
>> +
>> +	if (n <= 1)
>> +		sched_numa_topology_type = NUMA_DIRECT;
>> +
>> +	for_each_online_node(a) {
>> +		for_each_online_node(b) {
>> +			/* Find two nodes furthest removed from each other. */
>> +			if (node_hops(a, b) < n)
>> +				continue;
>> +
>> +			/* Is there an intermediary node between a and b? */
>> +			for_each_online_node(c) {
>> +				if (node_hops(a, c) < n &&
>> +				    node_hops(b, c) < n) {
>> +					sched_numa_topology_type =
>> +							NUMA_GLUELESS_MESH;
>> +					return;
>> +				}
>> +			}
>> +
>> +			sched_numa_topology_type = NUMA_BACKPLANE;
>> +			return;
>> +		}
>> +	}
>> +}
>
> We can find max_distance nodes in sched_init_numa(), right? Could we not
> avoid this second iteration?
>
It's not about finding the max distance, but about finding
two nodes that are at the maximum distance from each other,
in order to see whether there are intermediate nodes
between the two.

I suppose we could just directly access the node_hops
tables to get two nodes that are the furthest away from
each other, but I suspect that searching that table
directly will not make a significant difference compared
with using the macros above.

Especially since this code is only ever run once at system
bootup.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ