bab9bb6b69
Create new directories: ceph config config-files filesystem kernel kernel/kernel-modules ldap logging strorage-drivers tools utilities virt Retire directories: connectivity core devtools support extended Delete two packages: tgt irqbalance Relocated packages: base/ dhcp initscripts libevent lighttpd linuxptp memcached net-snmp novnc ntp openssh pam procps sanlock shadow sudo systemd util-linux vim watchdog ceph/ python-cephclient config/ facter puppet-4.8.2 puppet-modules filesystem/ e2fsprogs nfs-utils nfscheck kernel/ kernel-std kernel-rt kernel/kernel-modules/ mlnx-ofa_kernel ldap/ nss-pam-ldapd openldap logging/ syslog-ng logrotate networking/ lldpd iproute mellanox python-ryu mlx4-config python/ python-2.7.5 python-django python-gunicorn python-setuptools python-smartpm python-voluptuous security/ shim-signed shim-unsigned tboot strorage-drivers/ python-3parclient python-lefthandclient virt/ cloud-init libvirt libvirt-python qemu tools/ storage-topology vm-topology utilities/ tis-extensions namespace-utils nova-utils update-motd Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
115 lines
3.3 KiB
Diff
115 lines
3.3 KiB
Diff
From 8eea2ba32882bcbcaf10588c99f7fec0104e9854 Mon Sep 17 00:00:00 2001
|
|
Message-Id: <8eea2ba32882bcbcaf10588c99f7fec0104e9854.1528226387.git.Jim.Somerville@windriver.com>
|
|
In-Reply-To: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
|
|
References: <c8270e79f6b7008fde44b8d5aa6314d8cf89d3ed.1528226387.git.Jim.Somerville@windriver.com>
|
|
From: Alex Kozyrev <alex.kozyrev@windriver.com>
|
|
Date: Wed, 19 Jul 2017 02:25:15 -0500
|
|
Subject: [PATCH 20/32] Fix cacheinfo compilation issues for 3.10
|
|
|
|
Had to revert commit 7cc277b489b4fe91f42eb596b282879c2d13152e:
|
|
"Install the callbacks via the state machine and let the core invoke
|
|
the callbacks on the already online CPUs. No functional change."
|
|
There is no hotplug state machine in 3.10 kernel.
|
|
Also implemented cpumap_print_to_pagebuf() function in place.
|
|
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
---
|
|
drivers/base/cacheinfo.c | 65 ++++++++++++++++++++++++++++++++++++------------
|
|
1 file changed, 49 insertions(+), 16 deletions(-)
|
|
|
|
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
|
|
index eb3af27..c924f7e 100644
|
|
--- a/drivers/base/cacheinfo.c
|
|
+++ b/drivers/base/cacheinfo.c
|
|
@@ -383,7 +383,12 @@ static ssize_t shared_cpumap_show_func(struct device *dev, bool list, char *buf)
|
|
struct cacheinfo *this_leaf = dev_get_drvdata(dev);
|
|
const struct cpumask *mask = &this_leaf->shared_cpu_map;
|
|
|
|
- return cpumap_print_to_pagebuf(list, buf, mask);
|
|
+ int len = list?
|
|
+ cpulist_scnprintf(buf, PAGE_SIZE-2, mask) :
|
|
+ cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
|
|
+ buf[len++] = '\n';
|
|
+ buf[len] = '\0';
|
|
+ return len;
|
|
}
|
|
|
|
static ssize_t shared_cpu_map_show(struct device *dev,
|
|
@@ -633,30 +638,58 @@ err:
|
|
return rc;
|
|
}
|
|
|
|
-static int cacheinfo_cpu_online(unsigned int cpu)
|
|
+static void cache_remove_dev(unsigned int cpu)
|
|
{
|
|
- int rc = detect_cache_attributes(cpu);
|
|
+ if (!cpumask_test_cpu(cpu, &cache_dev_map))
|
|
+ return;
|
|
+ cpumask_clear_cpu(cpu, &cache_dev_map);
|
|
|
|
- if (rc)
|
|
- return rc;
|
|
- rc = cache_add_dev(cpu);
|
|
- if (rc)
|
|
- free_cache_attributes(cpu);
|
|
- return rc;
|
|
+ cpu_cache_sysfs_exit(cpu);
|
|
}
|
|
|
|
-static int cacheinfo_cpu_pre_down(unsigned int cpu)
|
|
+static int cacheinfo_cpu_callback(struct notifier_block *nfb,
|
|
+ unsigned long action, void *hcpu)
|
|
{
|
|
- if (cpumask_test_and_clear_cpu(cpu, &cache_dev_map))
|
|
- cpu_cache_sysfs_exit(cpu);
|
|
+ unsigned int cpu = (unsigned long)hcpu;
|
|
+ int rc = 0;
|
|
|
|
- free_cache_attributes(cpu);
|
|
- return 0;
|
|
+ switch (action & ~CPU_TASKS_FROZEN) {
|
|
+ case CPU_ONLINE:
|
|
+ rc = detect_cache_attributes(cpu);
|
|
+ if (!rc)
|
|
+ rc = cache_add_dev(cpu);
|
|
+ break;
|
|
+ case CPU_DEAD:
|
|
+ cache_remove_dev(cpu);
|
|
+ if (per_cpu_cacheinfo(cpu))
|
|
+ free_cache_attributes(cpu);
|
|
+ break;
|
|
+ }
|
|
+ return notifier_from_errno(rc);
|
|
}
|
|
|
|
static int __init cacheinfo_sysfs_init(void)
|
|
{
|
|
- return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online",
|
|
- cacheinfo_cpu_online, cacheinfo_cpu_pre_down);
|
|
+ int cpu, rc = 0;
|
|
+
|
|
+ cpu_notifier_register_begin();
|
|
+
|
|
+ for_each_online_cpu(cpu) {
|
|
+ rc = detect_cache_attributes(cpu);
|
|
+ if (rc)
|
|
+ goto out;
|
|
+ rc = cache_add_dev(cpu);
|
|
+ if (rc) {
|
|
+ free_cache_attributes(cpu);
|
|
+ pr_err("error populating cacheinfo..cpu%d\n", cpu);
|
|
+ goto out;
|
|
+ }
|
|
+ }
|
|
+ __hotcpu_notifier(cacheinfo_cpu_callback, 0);
|
|
+
|
|
+out:
|
|
+ cpu_notifier_register_done();
|
|
+ return rc;
|
|
}
|
|
+
|
|
device_initcall(cacheinfo_sysfs_init);
|
|
--
|
|
1.8.3.1
|
|
|