aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cacheinfo.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-22 12:25:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-22 12:25:45 -0500
commiteb254f323bd50ab7e3cc385f2fc641a595cc8b37 (patch)
treeada2b6251000dc6ccdfcfac0f38c4eaf7aec905a /drivers/base/cacheinfo.c
parentf79f7b1b4f910e03fa20092759c79fc2e53f2eff (diff)
parent76ae054c69a745ded388fc4ae70422d74c5bc77d (diff)
Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cache allocation interface from Thomas Gleixner: "This provides support for Intel's Cache Allocation Technology, a cache partitioning mechanism. The interface is odd, but the hardware interface of that CAT stuff is odd as well. We tried hard to come up with an abstraction, but that only allows rather simple partitioning, but no way of sharing and dealing with the per package nature of this mechanism. In the end we decided to expose the allocation bitmaps directly so all combinations of the hardware can be utilized. There are two ways of associating a cache partition: - Task A task can be added to a resource group. It uses the cache partition associated to the group. - CPU All tasks which are not member of a resource group use the group to which the CPU they are running on is associated with. That allows for simple CPU based partitioning schemes. The main expected user sare: - Virtualization so a VM can only trash only the associated part of the cash w/o disturbing others - Real-Time systems to seperate RT and general workloads. - Latency sensitive enterprise workloads - In theory this also can be used to protect against cache side channel attacks" [ Intel RDT is "Resource Director Technology". The interface really is rather odd and very specific, which delayed this pull request while I was thinking about it. The pull request itself came in early during the merge window, I just delayed it until things had calmed down and I had more time. But people tell me they'll use this, and the good news is that it is _so_ specific that it's rather independent of anything else, and no user is going to depend on the interface since it's pretty rare. So if push comes to shove, we can just remove the interface and nothing will break ] * 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits) x86/intel_rdt: Implement show_options() for resctrlfs x86/intel_rdt: Call intel_rdt_sched_in() with preemption disabled x86/intel_rdt: Update task closid immediately on CPU in rmdir and unmount x86/intel_rdt: Fix setting of closid when adding CPUs to a group x86/intel_rdt: Update percpu closid immeditately on CPUs affected by changee x86/intel_rdt: Reset per cpu closids on unmount x86/intel_rdt: Select KERNFS when enabling INTEL_RDT_A x86/intel_rdt: Prevent deadlock against hotplug lock x86/intel_rdt: Protect info directory from removal x86/intel_rdt: Add info files to Documentation x86/intel_rdt: Export the minimum number of set mask bits in sysfs x86/intel_rdt: Propagate error in rdt_mount() properly x86/intel_rdt: Add a missing #include MAINTAINERS: Add maintainer for Intel RDT resource allocation x86/intel_rdt: Add scheduler hook x86/intel_rdt: Add schemata file x86/intel_rdt: Add tasks files x86/intel_rdt: Add cpus file x86/intel_rdt: Add mkdir to resctrl file system x86/intel_rdt: Add "info" files to resctrl file system ...
Diffstat (limited to 'drivers/base/cacheinfo.c')
-rw-r--r--drivers/base/cacheinfo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 1e3903d0d994..eb3af2739537 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -363,6 +363,7 @@ static ssize_t file_name##_show(struct device *dev, \
363 return sprintf(buf, "%u\n", this_leaf->object); \ 363 return sprintf(buf, "%u\n", this_leaf->object); \
364} 364}
365 365
366show_one(id, id);
366show_one(level, level); 367show_one(level, level);
367show_one(coherency_line_size, coherency_line_size); 368show_one(coherency_line_size, coherency_line_size);
368show_one(number_of_sets, number_of_sets); 369show_one(number_of_sets, number_of_sets);
@@ -444,6 +445,7 @@ static ssize_t write_policy_show(struct device *dev,
444 return n; 445 return n;
445} 446}
446 447
448static DEVICE_ATTR_RO(id);
447static DEVICE_ATTR_RO(level); 449static DEVICE_ATTR_RO(level);
448static DEVICE_ATTR_RO(type); 450static DEVICE_ATTR_RO(type);
449static DEVICE_ATTR_RO(coherency_line_size); 451static DEVICE_ATTR_RO(coherency_line_size);
@@ -457,6 +459,7 @@ static DEVICE_ATTR_RO(shared_cpu_list);
457static DEVICE_ATTR_RO(physical_line_partition); 459static DEVICE_ATTR_RO(physical_line_partition);
458 460
459static struct attribute *cache_default_attrs[] = { 461static struct attribute *cache_default_attrs[] = {
462 &dev_attr_id.attr,
460 &dev_attr_type.attr, 463 &dev_attr_type.attr,
461 &dev_attr_level.attr, 464 &dev_attr_level.attr,
462 &dev_attr_shared_cpu_map.attr, 465 &dev_attr_shared_cpu_map.attr,
@@ -480,6 +483,8 @@ cache_default_attrs_is_visible(struct kobject *kobj,
480 const struct cpumask *mask = &this_leaf->shared_cpu_map; 483 const struct cpumask *mask = &this_leaf->shared_cpu_map;
481 umode_t mode = attr->mode; 484 umode_t mode = attr->mode;
482 485
486 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID))
487 return mode;
483 if ((attr == &dev_attr_type.attr) && this_leaf->type) 488 if ((attr == &dev_attr_type.attr) && this_leaf->type)
484 return mode; 489 return mode;
485 if ((attr == &dev_attr_level.attr) && this_leaf->level) 490 if ((attr == &dev_attr_level.attr) && this_leaf->level)