perf/x86: Vectorize cpuc->kfree_on_online
Make the cpuc->kfree_on_online a vector to accommodate more than one entry and add the second entry to be used by a later patch. Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com> Cc: bp@alien8.de Cc: jolsa@redhat.com Cc: kan.liang@intel.com Link: http://lkml.kernel.org/r/1416251225-17721-3-git-send-email-eranian@google.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
9a5e3fb52a
commit
9041346431
@@ -1373,11 +1373,12 @@ x86_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
|
||||
{
|
||||
unsigned int cpu = (long)hcpu;
|
||||
struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
|
||||
int ret = NOTIFY_OK;
|
||||
int i, ret = NOTIFY_OK;
|
||||
|
||||
switch (action & ~CPU_TASKS_FROZEN) {
|
||||
case CPU_UP_PREPARE:
|
||||
cpuc->kfree_on_online = NULL;
|
||||
for (i = 0 ; i < X86_PERF_KFREE_MAX; i++)
|
||||
cpuc->kfree_on_online[i] = NULL;
|
||||
if (x86_pmu.cpu_prepare)
|
||||
ret = x86_pmu.cpu_prepare(cpu);
|
||||
break;
|
||||
@@ -1388,7 +1389,10 @@ x86_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
|
||||
break;
|
||||
|
||||
case CPU_ONLINE:
|
||||
kfree(cpuc->kfree_on_online);
|
||||
for (i = 0 ; i < X86_PERF_KFREE_MAX; i++) {
|
||||
kfree(cpuc->kfree_on_online[i]);
|
||||
cpuc->kfree_on_online[i] = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_DYING:
|
||||
|
Reference in New Issue
Block a user