linux/Documentation/cputopology.txt
<<
>>
Prefs
   1
   2Export CPU topology info via sysfs. Items (attributes) are similar
   3to /proc/cpuinfo.
   4
   51) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
   6
   7        physical package id of cpuX. Typically corresponds to a physical
   8        socket number, but the actual value is architecture and platform
   9        dependent.
  10
  112) /sys/devices/system/cpu/cpuX/topology/core_id:
  12
  13        the CPU core ID of cpuX. Typically it is the hardware platform's
  14        identifier (rather than the kernel's).  The actual value is
  15        architecture and platform dependent.
  16
  173) /sys/devices/system/cpu/cpuX/topology/book_id:
  18
  19        the book ID of cpuX. Typically it is the hardware platform's
  20        identifier (rather than the kernel's).  The actual value is
  21        architecture and platform dependent.
  22
  234) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
  24
  25        internel kernel map of cpuX's hardware threads within the same
  26        core as cpuX
  27
  285) /sys/devices/system/cpu/cpuX/topology/core_siblings:
  29
  30        internal kernel map of cpuX's hardware threads within the same
  31        physical_package_id.
  32
  336) /sys/devices/system/cpu/cpuX/topology/book_siblings:
  34
  35        internal kernel map of cpuX's hardware threads within the same
  36        book_id.
  37
  38To implement it in an architecture-neutral way, a new source file,
  39drivers/base/topology.c, is to export the 4 or 6 attributes. The two book
  40related sysfs files will only be created if CONFIG_SCHED_BOOK is selected.
  41
  42For an architecture to support this feature, it must define some of
  43these macros in include/asm-XXX/topology.h:
  44#define topology_physical_package_id(cpu)
  45#define topology_core_id(cpu)
  46#define topology_book_id(cpu)
  47#define topology_thread_cpumask(cpu)
  48#define topology_core_cpumask(cpu)
  49#define topology_book_cpumask(cpu)
  50
  51The type of **_id is int.
  52The type of siblings is (const) struct cpumask *.
  53
  54To be consistent on all architectures, include/linux/topology.h
  55provides default definitions for any of the above macros that are
  56not defined by include/asm-XXX/topology.h:
  571) physical_package_id: -1
  582) <provides de7dp2"Documentation/cputopology.txt#L49" id5L49" class="line" name=5L49">59173y/thread_sibling j musf thgdrinhe Cd:
60234y/core_sibling j musf thgdrinhe Cd:
6 41
6 42For architecturos thadonuXtto suppory_bo isf CONFIG_SCHED_BO>3y/ecorecornoa>
6 536 34
6 55provid undelar
6 566 576 18
6 19  l kern_max:oe Thmaximumrt CPindexon aowined bn the kernbe cfigurntati *.
7 30              [NR_t CS-1]*.
7 41
7230  off="li:a>  t Cros that a a>nol oefinbecausare ey havinbeena>
7330              HOTPLUGGE ID f (seect c-hotpluggy.t) 4 oexceinen thlimita>
7430              y ot Cron aowined bn the kernbe cfigurntati (l kern_maxa>
7530              e abo). [~n/c_l oefi_pumas+ct cs t;&g= NR_t CS]*.
7  6
7  7  l oefi:a>   t Cros that a l oefine anbebli scheduline[n/c_l oefi_puma]*.
7 18
7 19  pose_sii:a> t Cros thahavinbeenon aocreatetur soursne anca  bare
8 30              broughnol oefinifre ey dwareturndene[n/c_pose_sii_puma]*.
8 41
8230  eturnde:a>  t Cros thahavinbeeno  identifdre abebli eturnde thin ta>
8330              s/systne[n/c_pturnde_puma]*.
8 34
8552Thinrmntce foe The abovoutinpud icompntasiids wict clnsial_rse(pu)
8  68 37
8 18
8943tal kernel x whichud ilimitineno 0..31ed bn thNR_t CSbe cfig 9 30nol oefinb butould bare
9 419 32
9330   l kern_max:o3 -1
9430      ass="line2,4-31]neno -1
9530       l oefi:a0-1]n-1
9 36     pose_sii:a0-3 -1
9  7       turnde:a0-3 -1
9 18
9918
   l kern_max:o127a>
      ass="line2,4-127,128-14n-1
       l oefi:a0-1]n-1
     pose_sii:a0-127a>
       turnde:a0-3a>

a>ThorigiernaLXR softrdward bn th. LXR community12lxr@e/lin.no12 lxr.e/lin.no kindonlhostined b. Redpill L/l /p AS12provir y oL/linbe coultbli e anoperanitionserdevic since 1995.
/bodyiv /htmliv