[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1434653369-5162-1-git-send-email-kanaka.d.juvva@linux.intel.com>
Date: Thu, 18 Jun 2015 11:49:29 -0700
From: Kanaka Juvva <kanaka.d.juvva@...ux.intel.com>
To: kanaka.d.juvva@...el.com, glenn.p.williamson@...el.com,
matt.fleming@...el.com, will.auld@...el.com, andi@...stfloor.org,
ananth.s.narayan@...el.com, linux-kernel@...r.kernel.org,
andrew.j.herdrich@...el.com, tony.luck@...el.com,
peterz@...radead.org, tglx@...utronix.de, x86@...nel.org,
mingo@...hat.com, hpa@...or.com, luto@...capital.net,
dvlasenk@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
peter.p.waskiewicz.jr@...el.com, imammedo@...hat.com, bp@...e.de,
ross.zwisler@...ux.intel.com, jacob.w.shin@...il.com,
dirk.j.brandewie@...el.com, vikas.shivappa@...el.com,
edwin.verplanke@...el.com, tomasz.kantecki@...el.com
Subject: [PATCH v1 2/2] x86, perf,cqm: handle CPU hotplug
Added lock in event reader function. The cqm_pick_event_reader() function
accesses cqm_cpumask and it is critical section between this and
cqm_stable().
This situation is true when a CPU is hotplugged. Mutex is used to protect
the critical section.
Signed-off-by: Kanaka Juvva <kanaka.d.juvva@...ux.intel.com>
---
arch/x86/kernel/cpu/perf_event_intel_cqm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_cqm.c b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
index 1880761..e17e37f 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_cqm.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
@@ -1239,12 +1239,15 @@ static inline void cqm_pick_event_reader(int cpu)
int phys_id = topology_physical_package_id(cpu);
int i;
+ mutex_lock(&cache_mutex);
for_each_cpu(i, &cqm_cpumask) {
if (phys_id == topology_physical_package_id(i))
- return; /* already got reader for this socket */
+ goto out; /* already got reader for this socket */
}
cpumask_set_cpu(cpu, &cqm_cpumask);
+out:
+ mutex_unlock(&cache_mutex);
}
static void intel_cqm_cpu_prepare(unsigned int cpu)
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists