Re: [PATCH 1/5] topology: introduce cpu_node information for multi-node processors

From: Bert Wesarg
Date: Wed Jun 03 2009 - 10:56:13 EST


On Wed, Jun 3, 2009 at 16:29, Andreas Herrmann
<andreas.herrmann3@xxxxxxx> wrote:
>
> New topology attributes are
> - cpu_node_id (id of the internal node)
> - cpu_node_siblings and cpu_node_siblings_list
> Â(siblings on the same internal node)
Looks good. Thank you.

Acked-by: Bert.Wesarg@xxxxxxxxxxxxxx

>
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@xxxxxxx>
> ---
> Âdrivers/base/topology.c Â| Â 10 ++++++++++
> Âinclude/linux/topology.h | Â Â9 +++++++++
> Â2 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/topology.c b/drivers/base/topology.c
> index bf6b132..1e35a43 100644
> --- a/drivers/base/topology.c
> +++ b/drivers/base/topology.c
> @@ -103,6 +103,9 @@ static ssize_t show_##name##_list(struct sys_device *dev, Â Â Â Â Â \
> Âdefine_id_show_func(physical_package_id);
> Âdefine_one_ro(physical_package_id);
>
> +define_id_show_func(cpu_node_id);
> +define_one_ro(cpu_node_id);
> +
> Âdefine_id_show_func(core_id);
> Âdefine_one_ro(core_id);
>
> @@ -110,6 +113,10 @@ define_siblings_show_func(thread_cpumask);
> Âdefine_one_ro_named(thread_siblings, show_thread_cpumask);
> Âdefine_one_ro_named(thread_siblings_list, show_thread_cpumask_list);
>
> +define_siblings_show_func(cpu_node_cpumask);
> +define_one_ro_named(cpu_node_siblings, show_cpu_node_cpumask);
> +define_one_ro_named(cpu_node_siblings_list, show_cpu_node_cpumask_list);
> +
> Âdefine_siblings_show_func(core_cpumask);
> Âdefine_one_ro_named(core_siblings, show_core_cpumask);
> Âdefine_one_ro_named(core_siblings_list, show_core_cpumask_list);
> @@ -119,6 +126,9 @@ static struct attribute *default_attrs[] = {
> Â Â Â Â&attr_core_id.attr,
> Â Â Â Â&attr_thread_siblings.attr,
> Â Â Â Â&attr_thread_siblings_list.attr,
> + Â Â Â &attr_cpu_node_id.attr,
> + Â Â Â &attr_cpu_node_siblings.attr,
> + Â Â Â &attr_cpu_node_siblings_list.attr,
> Â Â Â Â&attr_core_siblings.attr,
> Â Â Â Â&attr_core_siblings_list.attr,
> Â Â Â ÂNULL
> diff --git a/include/linux/topology.h b/include/linux/topology.h
> index 7402c1a..976a130 100644
> --- a/include/linux/topology.h
> +++ b/include/linux/topology.h
> @@ -180,6 +180,9 @@ int arch_update_cpu_topology(void);
> Â#ifndef topology_physical_package_id
> Â#define topology_physical_package_id(cpu) Â Â Â((void)(cpu), -1)
> Â#endif
> +#ifndef topology_cpu_node_id
> +#define topology_cpu_node_id(cpu) Â Â Â Â Â Â Â((void)(cpu), 0)
> +#endif
> Â#ifndef topology_core_id
> Â#define topology_core_id(cpu) Â Â Â Â Â Â Â Â Â((void)(cpu), 0)
> Â#endif
> @@ -189,12 +192,18 @@ int arch_update_cpu_topology(void);
> Â#ifndef topology_core_siblings
> Â#define topology_core_siblings(cpu) Â Â Â Â Â Âcpumask_of_cpu(cpu)
> Â#endif
> +#ifndef topology_cpu_node_siblings
> +#define topology_cpu_node_siblings(cpu) Â Â Â Â Â Â Â Âtopology_core_siblings(cpu)
> +#endif
> Â#ifndef topology_thread_cpumask
> Â#define topology_thread_cpumask(cpu) Â Â Â Â Â cpumask_of(cpu)
> Â#endif
> Â#ifndef topology_core_cpumask
> Â#define topology_core_cpumask(cpu) Â Â Â Â Â Â cpumask_of(cpu)
> Â#endif
> +#ifndef topology_cpu_node_cpumask
> +#define topology_cpu_node_cpumask(cpu) Â Â Â Â topology_core_cpumask(cpu)
> +#endif
>
> Â/* Returns the number of the current Node. */
> Â#ifndef numa_node_id
> --
> 1.6.3.1
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/