提交 6967037b 编写于 作者: G Gerald Schaefer 提交者: Martin Schwidefsky

s390/appldata_os: fix cpu array size calculation

The cpu array size calculation uses the NR_CPUS config option, which
was recently increased from 64 to 256. With a value of 256, the cpu
array will no longer fit into one APPLDATA record and loading the
appldata_os module fails with the following error:
could not insert 'appldata_os': Cannot allocate memory

Use num_possible_cpus() instead of NR_CPUS. For z/VM, this will still
result in a value of 64. This is not true for LPAR, but the appldata
feature is not available for LPAR.
Signed-off-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 d72d2bb5
......@@ -171,7 +171,7 @@ static int __init appldata_os_init(void)
int rc, max_size;
max_size = sizeof(struct appldata_os_data) +
(NR_CPUS * sizeof(struct appldata_os_per_cpu));
(num_possible_cpus() * sizeof(struct appldata_os_per_cpu));
if (max_size > APPLDATA_MAX_REC_SIZE) {
pr_err("Maximum OS record size %i exceeds the maximum "
"record size %i\n", max_size, APPLDATA_MAX_REC_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册