diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-05-21 05:10:13 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-06-13 09:58:27 -0400 |
commit | a62247e1f5c13b926f535bb64ecbd7f9fdef7b21 (patch) | |
tree | 4ef1e9a1ec7b54531246af5007781f48e0e1a779 /drivers/base | |
parent | 0599eead5833d9dd0970b59fed3844441b44fe0c (diff) |
topology/sysfs: provide drawer id and siblings attributes
The s390 cpu topology gained another hierarchy level. The top level is
now called drawer and contains several books. A book used to be the
top level.
In order to expose the cpu topology to user space allow to create new
sysfs attributes dependent on CONFIG_SCHED_DRAWER which an
architecture may define and select.
These additional attributes will be available:
/sys/devices/system/cpu/cpuX/topology/drawer_id
/sys/devices/system/cpu/cpuX/topology/drawer_siblings
/sys/devices/system/cpu/cpuX/topology/drawer_siblings_list
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/topology.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 8b7d7f8e5851..df3c97cb4c99 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c | |||
@@ -77,6 +77,14 @@ static DEVICE_ATTR_RO(book_siblings); | |||
77 | static DEVICE_ATTR_RO(book_siblings_list); | 77 | static DEVICE_ATTR_RO(book_siblings_list); |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | #ifdef CONFIG_SCHED_DRAWER | ||
81 | define_id_show_func(drawer_id); | ||
82 | static DEVICE_ATTR_RO(drawer_id); | ||
83 | define_siblings_show_func(drawer_siblings, drawer_cpumask); | ||
84 | static DEVICE_ATTR_RO(drawer_siblings); | ||
85 | static DEVICE_ATTR_RO(drawer_siblings_list); | ||
86 | #endif | ||
87 | |||
80 | static struct attribute *default_attrs[] = { | 88 | static struct attribute *default_attrs[] = { |
81 | &dev_attr_physical_package_id.attr, | 89 | &dev_attr_physical_package_id.attr, |
82 | &dev_attr_core_id.attr, | 90 | &dev_attr_core_id.attr, |
@@ -89,6 +97,11 @@ static struct attribute *default_attrs[] = { | |||
89 | &dev_attr_book_siblings.attr, | 97 | &dev_attr_book_siblings.attr, |
90 | &dev_attr_book_siblings_list.attr, | 98 | &dev_attr_book_siblings_list.attr, |
91 | #endif | 99 | #endif |
100 | #ifdef CONFIG_SCHED_DRAWER | ||
101 | &dev_attr_drawer_id.attr, | ||
102 | &dev_attr_drawer_siblings.attr, | ||
103 | &dev_attr_drawer_siblings_list.attr, | ||
104 | #endif | ||
92 | NULL | 105 | NULL |
93 | }; | 106 | }; |
94 | 107 | ||