mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 10:26:55 +07:00
148f9bb877
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0
("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
84 lines
2.2 KiB
C
84 lines
2.2 KiB
C
#ifndef _ASM_X86_NUMA_H
|
|
#define _ASM_X86_NUMA_H
|
|
|
|
#include <linux/nodemask.h>
|
|
|
|
#include <asm/topology.h>
|
|
#include <asm/apicdef.h>
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
|
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
|
|
|
|
/*
|
|
* Too small node sizes may confuse the VM badly. Usually they
|
|
* result from BIOS bugs. So dont recognize nodes as standalone
|
|
* NUMA entities that have less than this amount of RAM listed:
|
|
*/
|
|
#define NODE_MIN_SIZE (4*1024*1024)
|
|
|
|
extern int numa_off;
|
|
|
|
/*
|
|
* __apicid_to_node[] stores the raw mapping between physical apicid and
|
|
* node and is used to initialize cpu_to_node mapping.
|
|
*
|
|
* The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
|
|
* should be accessed by the accessors - set_apicid_to_node() and
|
|
* numa_cpu_node().
|
|
*/
|
|
extern s16 __apicid_to_node[MAX_LOCAL_APIC];
|
|
extern nodemask_t numa_nodes_parsed __initdata;
|
|
|
|
extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
|
|
extern void __init numa_set_distance(int from, int to, int distance);
|
|
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
{
|
|
__apicid_to_node[apicid] = node;
|
|
}
|
|
|
|
extern int numa_cpu_node(int cpu);
|
|
|
|
#else /* CONFIG_NUMA */
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
{
|
|
}
|
|
|
|
static inline int numa_cpu_node(int cpu)
|
|
{
|
|
return NUMA_NO_NODE;
|
|
}
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#ifdef CONFIG_X86_32
|
|
# include <asm/numa_32.h>
|
|
#endif
|
|
|
|
#ifdef CONFIG_NUMA
|
|
extern void numa_set_node(int cpu, int node);
|
|
extern void numa_clear_node(int cpu);
|
|
extern void __init init_cpu_to_node(void);
|
|
extern void numa_add_cpu(int cpu);
|
|
extern void numa_remove_cpu(int cpu);
|
|
#else /* CONFIG_NUMA */
|
|
static inline void numa_set_node(int cpu, int node) { }
|
|
static inline void numa_clear_node(int cpu) { }
|
|
static inline void init_cpu_to_node(void) { }
|
|
static inline void numa_add_cpu(int cpu) { }
|
|
static inline void numa_remove_cpu(int cpu) { }
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
|
|
void debug_cpumask_set_cpu(int cpu, int node, bool enable);
|
|
#endif
|
|
|
|
#ifdef CONFIG_NUMA_EMU
|
|
#define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
|
|
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
|
|
void numa_emu_cmdline(char *);
|
|
#endif /* CONFIG_NUMA_EMU */
|
|
|
|
#endif /* _ASM_X86_NUMA_H */
|