STRUCT CACHEINFO(9)
πΈ NAME
struct cacheinfo β represent a cache leaf node. Okay bestie, this is struct cacheinfo(9) straight out of the Kernel API Manual, and it's giving very specific kernel-cache energy π
β¨
β¨ SYNOPSIS
struct cacheinfo {
unsigned int id;
enum cache_type type;
unsigned int level;
unsigned int coherency_line_size;
unsigned int number_of_sets;
unsigned int ways_of_associativity;
unsigned int physical_line_partition;
unsigned int size;
cpumask_t shared_cpu_map;
unsigned int attributes;
#define CACHE_WRITE_THROUGH BIT(0);
#define CACHE_WRITE_BACK BIT(1);
#define CACHE_WRITE_POLICY_MASK (CACHE_WRITE_THROUGH |
CACHE_WRITE_BACK);
#define CACHE_READ_ALLOCATE BIT(2);
#define CACHE_WRITE_ALLOCATE BIT(3);
#define CACHE_ALLOCATE_POLICY_MASK (CACHE_READ_ALLOCATE |
CACHE_WRITE_ALLOCATE);
#define CACHE_ID BIT(4);
void *fw_token;
bool disable_sysfs;
void *priv;
};
π Members
idβ this cache's id. It is unique among caches with the same(type, level). No duplicates in that little squad, periodt πtypeβ type of the cache:data,inst, orunified. Pick your fighter β¨levelβ represents the hierarchy in the multi-level cache. It's giving cache-floor realness π’coherency_line_sizeβ size of each cache line, usually representing the minimum amount of data that gets transferred from memory. Iconic little transfer unit πnumber_of_setsβ total number of sets; a set is a collection of cache lines sharing the same index. Set theory but make it cache π§ways_of_associativityβ number of ways in which a particular memory block can be placed in the cache. So many options, honestly π¦physical_line_partitionβ number of physical cache lines sharing the same cachetag. Shared tag moment πsizeβ total size of the cache. Big? Small? It's in there πshared_cpu_mapβ logical cpumask representing all the cpus sharing this cache node. CPU besties sharing one cache π«Άattributesβ bitfield representing various cache attributes. TheCACHE_*defines up top are living here, iykyk π₯fw_tokenβ unique value used to determine if differentcacheinfostructures represent a single hardware cache instance. One hardware cache, one token, no cap πdisable_sysfsβ indicates whether this node is visible to the user via sysfs or not. Visible or lowkey hidden πprivβ pointer to any private data structure specific to particular cache design. Private data stays private, bestie π
π¦ Description
While of_node, disable_sysfs, and priv are used for internal book keeping, the remaining members form the core properties of the cache. That's the whole vibe check π
π SEE ALSO
- Kernel file
./include/linux/cacheinfo.hβ go read it, bestie π
source/version: ./include/linux β’ date: October 2026 β’ page: struct cacheinfo(9) β mwah π bye bestie π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms