Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-08-23 19:27:20 +0200
committerMichal Suchanek <msuchanek@suse.de>2018-08-23 19:27:37 +0200
commit93ea62d43fa01bd0040776b6387e1d85f26c96b8 (patch)
treea46ab51ccf48b0687139a56a2ae7a9f0b901d974
parentd6d4d9cd7312876391089bd51233abdc53f477bb (diff)
powerpc/perf: Fix memory allocation for core-imc based on
num_possible_cpus() (bsc#1054914). suse-commit: 20c6b1f09460970bd9ca610635cade95ea4f0aaf
-rw-r--r--arch/powerpc/perf/imc-pmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index be4e7f84f70a..dfb58648b315 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1132,7 +1132,7 @@ static int init_nest_pmu_ref(void)
static void cleanup_all_core_imc_memory(void)
{
- int i, nr_cores = DIV_ROUND_UP(num_present_cpus(), threads_per_core);
+ int i, nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
struct imc_mem_info *ptr = core_imc_pmu->mem_info;
int size = core_imc_pmu->counter_mem_size;
@@ -1248,7 +1248,7 @@ static int imc_mem_init(struct imc_pmu *pmu_ptr, struct device_node *parent,
if (!pmu_ptr->pmu.name)
return -ENOMEM;
- nr_cores = DIV_ROUND_UP(num_present_cpus(), threads_per_core);
+ nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
pmu_ptr->mem_info = kcalloc(nr_cores, sizeof(struct imc_mem_info),
GFP_KERNEL);