Merge branch 'x86/numa' into x86/devel
Conflicts: arch/x86/Kconfig arch/x86/kernel/e820.c arch/x86/kernel/efi_64.c arch/x86/kernel/mpparse.c arch/x86/kernel/setup.c arch/x86/kernel/setup_32.c arch/x86/mm/init_64.c include/asm-x86/proto.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
此提交包含在:
@@ -40,6 +40,7 @@ static ssize_t show_##name(struct sys_device *dev, char *buf) \
|
||||
return sprintf(buf, "%d\n", topology_##name(cpu)); \
|
||||
}
|
||||
|
||||
#if defined(topology_thread_siblings) || defined(topology_core_siblings)
|
||||
static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
|
||||
{
|
||||
ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf;
|
||||
@@ -54,21 +55,41 @@ static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
|
||||
}
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef arch_provides_topology_pointers
|
||||
#define define_siblings_show_map(name) \
|
||||
static inline ssize_t show_##name(struct sys_device *dev, char *buf) \
|
||||
static ssize_t show_##name(struct sys_device *dev, char *buf) \
|
||||
{ \
|
||||
unsigned int cpu = dev->id; \
|
||||
return show_cpumap(0, &(topology_##name(cpu)), buf); \
|
||||
}
|
||||
|
||||
#define define_siblings_show_list(name) \
|
||||
static inline ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
|
||||
static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
|
||||
{ \
|
||||
unsigned int cpu = dev->id; \
|
||||
return show_cpumap(1, &(topology_##name(cpu)), buf); \
|
||||
}
|
||||
|
||||
#else
|
||||
#define define_siblings_show_map(name) \
|
||||
static ssize_t show_##name(struct sys_device *dev, char *buf) \
|
||||
{ \
|
||||
unsigned int cpu = dev->id; \
|
||||
cpumask_t mask = topology_##name(cpu); \
|
||||
return show_cpumap(0, &mask, buf); \
|
||||
}
|
||||
|
||||
#define define_siblings_show_list(name) \
|
||||
static ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
|
||||
{ \
|
||||
unsigned int cpu = dev->id; \
|
||||
cpumask_t mask = topology_##name(cpu); \
|
||||
return show_cpumap(1, &mask, buf); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define define_siblings_show_func(name) \
|
||||
define_siblings_show_map(name); define_siblings_show_list(name)
|
||||
|
||||
|
新增問題並參考
封鎖使用者