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]
Message-ID: <Zy0PWPaYHWsgh7Rp@slm.duckdns.org>
Date: Thu, 7 Nov 2024 09:04:56 -1000
From: Tejun Heo <tj@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: David Vernet <void@...ifault.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 sched_ext/for-6.13] sched_ext: Do not enable LLC/NUMA
 optimizations when domains overlap

Hello, Andrea.

Some nits below:

On Thu, Nov 07, 2024 at 09:48:03AM +0100, Andrea Righi wrote:
> +static bool llc_and_numa_mismatch(void)
> +{
...
> +	for_each_online_cpu(cpu) {
> +		sd = cpu_rq(cpu)->sd;
> +
> +		while (sd) {

This can be for_each_domain(cpu, sd).

> +			bool is_llc = sd->flags & SD_SHARE_LLC;
> +			bool is_numa = sd->flags & SD_NUMA;
> +
> +			if (is_llc != is_numa)
> +				return true;
> +
> +			sd = sd->parent;
> +		}
> +	}
> +
> +	return false;
> +}
> +
>  /*
>   * Initialize topology-aware scheduling.
>   *
>   * Detect if the system has multiple LLC or multiple NUMA domains and enable
>   * cache-aware / NUMA-aware scheduling optimizations in the default CPU idle
>   * selection policy.
> + *
> + * Assumption: under normal circumstances we can assume that each CPU belongs
> + * to a single NUMA domain and a single LLC domain.
> + *
> + * However, in complex or highly specialized systems (e.g., multi-socket,
> + * chiplet-based, or virtualized systems), the relationship between NUMA and
> + * LLC domains can become more intricate, though each CPU is still considered
> + * to belong to a single NUMA and LLC domain in the kernel's internal
> + * representation.
> + *
> + * Another assumption is that each LLC domain is always fully contained within
> + * a single NUMA domain. In reality, in chiplet-based or virtualized systems,
> + * LLC domains may logically span multiple NUMA nodes. However, the kernel’s

Are there any actual systems that have a single LLC spanning multiple NUMA
nodes? I think it'd be sufficient to state that the kernel assumes that a
CPU belongs to a single LLC and a single LLC belongs to a single socket.

Otherwise, looks great to me.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ