查看cache information
参考:https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu
$ ls /sys/devices/system/cpu/cpu0/cache/index0/
coherency_line_size id level number_of_sets physical_line_partition shared_cpu_list shared_cpu_map size type uevent ways_of_associativity
What: /sys/devices/system/cpu/cpu*/cache/index*/<set_of_attributes_mentioned_below>
Date: July 2014(documented, existed before August 2008)
Contact: Sudeep Holla <sudeep.holla@arm.com>Linux kernel mailing list <linux-kernel@vger.kernel.org>
Description: Parameters for the CPU cache attributesallocation_policy:- WriteAllocate:allocate a memory location to a cache lineon a cache miss because of a write- ReadAllocate:allocate a memory location to a cache lineon a cache miss because of a read- ReadWriteAllocate:both writeallocate and readallocatecoherency_line_size:the minimum amount of data in bytes that getstransferred from memory to cachelevel:the cache hierarchy in the multi-level cache configurationnumber_of_sets:total number of sets in the cache, a set is acollection of cache lines with the same cache indexphysical_line_partition:number of physical cache line per cache tagshared_cpu_list:the list of logical cpus sharing the cacheshared_cpu_map:logical cpu mask containing the list of cpus sharingthe cachesize:the total cache size in kBtype:- Instruction: cache that only holds instructions- Data: cache that only caches data- Unified: cache that holds both data and instructionsways_of_associativity:degree of freedom in placing a particular blockof memory in the cachewrite_policy:- WriteThrough:data is written to both the cache lineand to the block in the lower-level memory- WriteBack:data is written only to the cache line andthe modified cache line is written to mainmemory only when it is replaced