Re: [PATCH 09/10] x86/intel_rdt: Hot cpu support for Cache Allocation

From: Vikas Shivappa
Date: Wed Jun 24 2015 - 17:18:36 EST




On Wed, 24 Jun 2015, Thomas Gleixner wrote:

On Tue, 23 Jun 2015, Vikas Shivappa wrote:
+/*
+ * cbm_update_msrs() - Updates all the existing IA32_L3_MASK_n MSRs
+ * which are one per CLOSid except IA32_L3_MASK_0 on the current package.
+ */
+static inline void cbm_update_msrs(void)
+{
+ int maxid = boot_cpu_data.x86_cache_max_closid;
+ unsigned int i;
+
+ /*
+ * At cpureset, all bits of IA32_L3_MASK_n are set.
+ * The index starts from one as there is no need
+ * to update IA32_L3_MASK_0 as it belongs to root cgroup
+ * whose cache mask is all 1s always.
+ */
+ for (i = 1; i < maxid; i++) {
+ if (ccmap[i].clos_refcnt)
+ cbm_cpu_update((void *)i);

So this is called via

intel_rdt_cpu_notifier(CPU_ONLINE)
intel_rdt_cpu_start()
cbm_update_msrs()
cbm_cpu_update()
wrmsr()

And runs on the CPU which initiated the hotplug and not on the newly
online cpu. Pretty useless, right?

Will fix.


+ }
+}
+
+static inline void intel_rdt_cpu_start(int cpu)
+{
+ struct intel_pqr_state *state = &per_cpu(pqr_state, cpu);
+
+ state->closid = 0;
+ mutex_lock(&rdt_group_mutex);
+ if (rdt_cpumask_update(cpu))
+ cbm_update_msrs();
+ mutex_unlock(&rdt_group_mutex);
+}
+
+static void intel_rdt_cpu_exit(unsigned int cpu)
+{
+ int i;
+
+ mutex_lock(&rdt_group_mutex);
+ if (!cpumask_test_and_clear_cpu(cpu, &rdt_cpumask)) {
+ mutex_unlock(&rdt_group_mutex);
+ return;
+ }
+
+ i = cpumask_any_online_but(topology_core_cpumask(cpu), cpu);
+ if (i < nr_cpu_ids)
+ cpumask_set_cpu(i, &rdt_cpumask);
+ mutex_unlock(&rdt_group_mutex);

Same issue as in the cqm patch.

will fix.
yes this may risk the package to not have some updates.

Thanks,
Vikas


Thanks,

tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/