aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2014-09-30 09:48:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 14:45:00 -0500
commit246246cbde5e840012f853e27630ebb59f409486 (patch)
treec88cd0c8b3bd87ead3e110b37afdb1fa0c8fad28 /Documentation
parent3d52943b3a51497a777e6d7d840a38596a92cee9 (diff)
drivers: base: support cpu cache information interface to userspace via sysfs
This patch adds initial support for providing processor cache information to userspace through sysfs interface. This is based on already existing implementations(x86, ia64, s390 and powerpc) and hence the interface is intended to be fully compatible. The main purpose of this generic support is to avoid further code duplication to support new architectures and also to unify all the existing different implementations. This implementation maintains the hierarchy of cache objects which reflects the system's cache topology. Cache devices are instantiated as needed as CPUs come online. The cache information is replicated per-cpu even if they are shared. A per-cpu array of cache information maintained is used mainly for sysfs-related book keeping. It also implements the shared_cpu_map attribute, which is essential for enabling both kernel and user-space to discover the system's overall cache topology. This patch also add the missing ABI documentation for the cacheinfo sysfs interface already, which is well defined and widely used. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Tested-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-api@vger.kernel.org Cc: linux390@de.ibm.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu47
1 files changed, 47 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index acb9bfc89b48..99983e67c13c 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -224,3 +224,50 @@ Description: Parameters for the Intel P-state driver
224 frequency range. 224 frequency range.
225 225
226 More details can be found in Documentation/cpu-freq/intel-pstate.txt 226 More details can be found in Documentation/cpu-freq/intel-pstate.txt
227
228What: /sys/devices/system/cpu/cpu*/cache/index*/<set_of_attributes_mentioned_below>
229Date: July 2014(documented, existed before August 2008)
230Contact: Sudeep Holla <sudeep.holla@arm.com>
231 Linux kernel mailing list <linux-kernel@vger.kernel.org>
232Description: Parameters for the CPU cache attributes
233
234 allocation_policy:
235 - WriteAllocate: allocate a memory location to a cache line
236 on a cache miss because of a write
237 - ReadAllocate: allocate a memory location to a cache line
238 on a cache miss because of a read
239 - ReadWriteAllocate: both writeallocate and readallocate
240
241 attributes: LEGACY used only on IA64 and is same as write_policy
242
243 coherency_line_size: the minimum amount of data in bytes that gets
244 transferred from memory to cache
245
246 level: the cache hierarcy in the multi-level cache configuration
247
248 number_of_sets: total number of sets in the cache, a set is a
249 collection of cache lines with the same cache index
250
251 physical_line_partition: number of physical cache line per cache tag
252
253 shared_cpu_list: the list of logical cpus sharing the cache
254
255 shared_cpu_map: logical cpu mask containing the list of cpus sharing
256 the cache
257
258 size: the total cache size in kB
259
260 type:
261 - Instruction: cache that only holds instructions
262 - Data: cache that only caches data
263 - Unified: cache that holds both data and instructions
264
265 ways_of_associativity: degree of freedom in placing a particular block
266 of memory in the cache
267
268 write_policy:
269 - WriteThrough: data is written to both the cache line
270 and to the block in the lower-level memory
271 - WriteBack: data is written only to the cache line and
272 the modified cache line is written to main
273 memory only when it is replaced