From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-kernel@vger.kernel.org, Rob Herring <robh@kernel.org>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH RFC/RFT v3 2/9] drivers: base: support cpu cache information interface to userspace via sysfs
Date: Fri, 28 Feb 2014 16:42:16 -0800 [thread overview]
Message-ID: <20140301004216.GA30634@kroah.com> (raw)
In-Reply-To: <1392825976-17633-3-git-send-email-sudeep.holla@arm.com>
On Wed, Feb 19, 2014 at 04:06:09PM +0000, Sudeep Holla wrote:
> From: Sudeep Holla <sudeep.holla@arm.com>
>
> 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>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: linux-doc@vger.kernel.org
> ---
> Documentation/ABI/testing/sysfs-devices-system-cpu | 40 ++
> drivers/base/Makefile | 2 +-
> drivers/base/cacheinfo.c | 484 +++++++++++++++++++++
> include/linux/cacheinfo.h | 55 +++
> 4 files changed, 580 insertions(+), 1 deletion(-)
> create mode 100644 drivers/base/cacheinfo.c
> create mode 100644 include/linux/cacheinfo.h
>
> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
> index d5a0d33..dabe03e 100644
> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> @@ -224,3 +224,43 @@ Description: Parameters for the Intel P-state driver
> frequency range.
>
> More details can be found in Documentation/cpu-freq/intel-pstate.txt
> +
> +What: /sys/devices/system/cpu/cpu*/cache/index*/<set_of_attributes_mentioned_below>
> +Date: February 2014
> +Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
No, your name goes here, you don't get to run away from this new code :)
> +Description: Parameters for the CPU cache attributes
> +
> + attributes:
> + - 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
> + - 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
> +
> + coherency_line_size: the minimum amount of data that gets transferred
> +
> + level: the cache hierarcy 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 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
With this patch, does this all work for x86, or does it need more glue
logic?
thanks,
greg k-h
next prev parent reply other threads:[~2014-03-01 0:40 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 16:06 [PATCH RFC/RFT v3 0/9] drivers: cacheinfo support Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 1/9] drivers: base: add new class "cpu" to group cpu devices Sudeep Holla
2014-03-01 0:42 ` Greg Kroah-Hartman
2014-03-03 7:28 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 2/9] drivers: base: support cpu cache information interface to userspace via sysfs Sudeep Holla
2014-03-01 0:42 ` Greg Kroah-Hartman [this message]
2014-03-03 7:39 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 3/9] ia64: move cacheinfo sysfs to generic cacheinfo infrastructure Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 4/9] s390: " Sudeep Holla
2014-02-20 8:38 ` Heiko Carstens
2014-02-20 13:33 ` Sudeep Holla
2014-02-20 13:33 ` Sudeep Holla
2014-02-20 14:07 ` Heiko Carstens
2014-02-20 14:37 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 5/9] x86: " Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 6/9] powerpc: " Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-03-07 4:06 ` Anshuman Khandual
2014-03-07 4:06 ` Anshuman Khandual
2014-03-07 6:14 ` Anshuman Khandual
2014-03-07 6:14 ` Anshuman Khandual
2014-03-10 11:12 ` Sudeep Holla
2014-03-10 11:12 ` Sudeep Holla
2014-03-21 3:44 ` Anshuman Khandual
2014-03-21 3:44 ` Anshuman Khandual
2014-03-21 12:04 ` Sudeep Holla
2014-03-21 12:04 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 7/9] ARM64: kernel: add support for cpu cache information Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 8/9] ARM: " Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
2014-02-19 16:06 ` [PATCH RFC/RFT v3 9/9] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla
2014-02-19 16:06 ` Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140301004216.GA30634@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.