mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
We replace the old way to configure the scheduler topology with a new method which enables a platform to declare additionnal level (if needed). We still have a default topology table definition that can be used by platform that don't want more level than the SMT, MC, CPU and NUMA ones. This table can be overwritten by an arch which either wants to add new level where a load balance make sense like BOOK or powergating level or wants to change the flags configuration of some levels. For each level, we need a function pointer that returns cpumask for each cpu, a function pointer that returns the flags for the level and a name. Only flags that describe topology, can be set by an architecture. The current topology flags are: SD_SHARE_CPUPOWER SD_SHARE_PKG_RESOURCES SD_NUMA SD_ASYM_PACKING Then, each level must be a subset on the next one. The build sequence of the sched_domain will take care of removing useless levels like those with 1 CPU and those with the same CPU span and no more relevant information for load balancing than its children. Signed-off-by: Vincent Guittot <[email protected]> Tested-by: Dietmar Eggemann <[email protected]> Reviewed-by: Preeti U Murthy <[email protected]> Reviewed-by: Dietmar Eggemann <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David S. Miller <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Hanjun Guo <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Jason Low <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
62 lines
1.8 KiB
C
62 lines
1.8 KiB
C
/*
|
|
* Copyright 2010 Tilera Corporation. All Rights Reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation, version 2.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
|
* NON INFRINGEMENT. See the GNU General Public License for
|
|
* more details.
|
|
*/
|
|
|
|
#ifndef _ASM_TILE_TOPOLOGY_H
|
|
#define _ASM_TILE_TOPOLOGY_H
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
/* Mappings between logical cpu number and node number. */
|
|
extern struct cpumask node_2_cpu_mask[];
|
|
extern char cpu_2_node[];
|
|
|
|
/* Returns the number of the node containing CPU 'cpu'. */
|
|
static inline int cpu_to_node(int cpu)
|
|
{
|
|
return cpu_2_node[cpu];
|
|
}
|
|
|
|
/*
|
|
* Returns the number of the node containing Node 'node'.
|
|
* This architecture is flat, so it is a pretty simple function!
|
|
*/
|
|
#define parent_node(node) (node)
|
|
|
|
/* Returns a bitmask of CPUs on Node 'node'. */
|
|
static inline const struct cpumask *cpumask_of_node(int node)
|
|
{
|
|
return &node_2_cpu_mask[node];
|
|
}
|
|
|
|
/* For now, use numa node -1 for global allocation. */
|
|
#define pcibus_to_node(bus) ((void)(bus), -1)
|
|
|
|
/* By definition, we create nodes based on online memory. */
|
|
#define node_has_online_mem(nid) 1
|
|
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#include <asm-generic/topology.h>
|
|
|
|
#ifdef CONFIG_SMP
|
|
#define topology_physical_package_id(cpu) ((void)(cpu), 0)
|
|
#define topology_core_id(cpu) (cpu)
|
|
#define topology_core_cpumask(cpu) ((void)(cpu), cpu_online_mask)
|
|
#define topology_thread_cpumask(cpu) cpumask_of(cpu)
|
|
#endif
|
|
|
|
#endif /* _ASM_TILE_TOPOLOGY_H */
|