Examining the CPU topology
If supported by your hardware, an interface is available that you can use to get information about the CPU topology of an LPAR.
Before you begin
About this task
Use this information, for example, to optimize the Linux scheduler, which bases its decisions on which process gets scheduled to which CPU. Depending on the workload, this optimization might increase cache hits and therefore overall performance.
topology=off
in your parmfile
or zipl.conf.
/sys/devices/system/cpu/cpu<N>/topology/thread_siblings
/sys/devices/system/cpu/cpu<N>/topology/core_siblings
/sys/devices/system/cpu/cpu<N>/topology/book_siblings
/sys/devices/system/cpu/cpu<N>/topology/drawer_siblings
where
<N> specifies a particular logical CPU number. These attributes contain masks
that specify sets of CPUs.Because the mainframe hardware is evolving over time, the terms drawer, book, core, and thread do not necessarily correspond to fixed hardware entities. What matters for the Linux scheduler is the levels of relatedness that these terms signify, not the physical embodiment of the levels. In this context, more closely related means sharing more resources, like caches.
The thread_siblings, core_siblings, book_siblings, and drawer_siblings attribute each contain a mask that specifies the CPU and its peers at a particular level of relatedness.
- The thread_siblings attribute covers the CPU and its closely related peers.
- The core_siblings attribute covers all CPUs of the thread_siblings attribute and peers related at the core level.
- The book_siblings attribute covers all CPUs of the core_siblings attribute and peers related at the book level.
- The drawer_siblings attribute covers all CPUs of the book_siblings attribute and peers related at the drawer level.
If a machine reconfiguration causes the CPU topology to change, change
uevents
are created for each online CPU.
If the kernel also supports standby CPU activation and deactivation, the masks also contains the CPUs that are in a configured, but offline state. Updating the masks after a reconfiguration might take some time.