Skip to content

Cache inclusivity? #37

@chriselrod

Description

@chriselrod

This is probably an issue for Hwloc itself, but I figured I'd raise it here first.

Hwloc checks the inclusivity of the caches, e.g. running

hwloc-gather-topology /tmp/myhost

on the command line with create a .xml file that includes, among other output

      <object type="L3Cache" cpuset="0x000000ff" complete_cpuset="0x000000ff" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="8" cache_size="12582912" depth="3" cache_linesize="64" cache_associativity="12" cache_type="0">
        <info name="Inclusive" value="0"/>
        <object type="L2Cache" cpuset="0x00000011" complete_cpuset="0x00000011" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="7" cache_size="1310720" depth="2" cache_linesize="64" cache_associativity="20" cache_type="0">
          <info name="Inclusive" value="0"/>
          <object type="L1Cache" cpuset="0x00000011" complete_cpuset="0x00000011" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="5" cache_size="49152" depth="1" cache_linesize="64" cache_associativity="12" cache_type="1">
            <info name="Inclusive" value="0"/>
            <object type="L1iCache" cpuset="0x00000011" complete_cpuset="0x00000011" nodeset="0x00000001" complete_nodeset="0x00000001" gp_index="6" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
              <info name="Inclusive" value="0"/>

Indicating that none of the caches are inclusive.

Hwloc uses cpuid for AMD and Intel CPUs, storing the results in a struct:

struct cacheinfo {
  hwloc_obj_cache_type_t type;
  unsigned level;
  unsigned nbthreads_sharing;
  unsigned cacheid;

  unsigned linesize;
  unsigned linepart;
  int inclusive;
  int ways;
  unsigned sets;
  unsigned long size;
};

But this seems to be an undocumented internal.
The documented hwloc_cache_attr_s that you can load with the API is missing several of these fields.

There is a documented hwloc_obj_get_info_by_name which is used to query "Inclusive", but nm -D doesn't show that symbol, and it'd take some work to figure out how to create the argument it takes (and if that object is a cacheinfo, we could just read the inclusive directly).
So perhaps it's a Hwloc issue to ask about an API for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions