随笔-处理器微架构-查看cache information

查看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 attributes

		allocation_policy:
			- WriteAllocate:
					allocate a memory location to a cache line
					on a cache miss because of a write
			- ReadAllocate:
					allocate a memory location to a cache line
					on a cache miss because of a read
			- ReadWriteAllocate:
					both writeallocate and readallocate

		coherency_line_size:
				     the minimum amount of data in bytes that gets
				     transferred from memory to cache

		level:
			the cache hierarchy in the multi-level cache configuration

		number_of_sets:
				total number of sets in the cache, a set is a
				collection of cache lines with the same cache index

		physical_line_partition:
				number of physical cache line per cache tag

		shared_cpu_list:
				the list of logical cpus sharing the cache

		shared_cpu_map:
				logical cpu mask containing the list of cpus sharing
				the cache

		size:
			the total cache size in kB

		type:
			- Instruction: cache that only holds instructions
			- Data: cache that only caches data
			- Unified: cache that holds both data and instructions

		ways_of_associativity:
			degree of freedom in placing a particular block
			of memory in the cache

		write_policy:
			- WriteThrough:
					data is written to both the cache line
					and to the block in the lower-level memory
			- WriteBack:
				     data is written only to the cache line and
				     the modified cache line is written to main
				     memory only when it is replaced

查看cache topo

lstopo-no-graphics -.svg --no-io --no-bridges  --no-legend > 1.svg  

posted @   LiYanbin  阅读(12)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
点击右上角即可分享
微信分享提示