mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
acc455cffa
commit 5f4826a362405748bbf73957027b77993e61e1af Author: chris hyser <chris.hyser@oracle.com> Date: Tue Apr 21 10:31:38 2015 -0400 sparc64: Setup sysfs to mark LDOM sockets, cores and threads correctly The current sparc kernel has no representation for sockets though tools like lscpu can pull this from sysfs. This patch walks the machine description cache and socket hierarchy and marks sockets as well as cores and threads such that a representative sysfs is created by drivers/base/topology.c. Before this patch: $ lscpu Architecture: sparc64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Big Endian CPU(s): 1024 On-line CPU(s) list: 0-1023 Thread(s) per core: 8 Core(s) per socket: 1 <--- wrong Socket(s): 128 <--- wrong NUMA node(s): 4 NUMA node0 CPU(s): 0-255 NUMA node1 CPU(s): 256-511 NUMA node2 CPU(s): 512-767 NUMA node3 CPU(s): 768-1023 After this patch: $ lscpu Architecture: sparc64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Big Endian CPU(s): 1024 On-line CPU(s) list: 0-1023 Thread(s) per core: 8 Core(s) per socket: 32 Socket(s): 4 NUMA node(s): 4 NUMA node0 CPU(s): 0-255 NUMA node1 CPU(s): 256-511 NUMA node2 CPU(s): 512-767 NUMA node3 CPU(s): 768-1023 Most of this patch was done by Chris with updates by David. Signed-off-by: Chris Hyser <chris.hyser@oracle.com> Signed-off-by: David Ahern <david.ahern@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
41 lines
980 B
C
41 lines
980 B
C
/* cpudata.h: Per-cpu parameters.
|
|
*
|
|
* Copyright (C) 2003, 2005, 2006 David S. Miller (davem@davemloft.net)
|
|
*/
|
|
|
|
#ifndef _SPARC64_CPUDATA_H
|
|
#define _SPARC64_CPUDATA_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
typedef struct {
|
|
/* Dcache line 1 */
|
|
unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
|
|
unsigned int __nmi_count;
|
|
unsigned long clock_tick; /* %tick's per second */
|
|
unsigned long __pad;
|
|
unsigned int irq0_irqs;
|
|
unsigned int __pad2;
|
|
|
|
/* Dcache line 2, rarely used */
|
|
unsigned int dcache_size;
|
|
unsigned int dcache_line_size;
|
|
unsigned int icache_size;
|
|
unsigned int icache_line_size;
|
|
unsigned int ecache_size;
|
|
unsigned int ecache_line_size;
|
|
unsigned short sock_id;
|
|
unsigned short core_id;
|
|
int proc_id;
|
|
} cpuinfo_sparc;
|
|
|
|
DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
|
|
#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
|
|
#define local_cpu_data() (*this_cpu_ptr(&__cpu_data))
|
|
|
|
#endif /* !(__ASSEMBLY__) */
|
|
|
|
#include <asm/trap_block.h>
|
|
|
|
#endif /* _SPARC64_CPUDATA_H */
|