diff options
author | Gerald Schaefer <gerald.schaefer@de.ibm.com> | 2014-02-28 11:35:52 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-03-07 09:25:55 -0500 |
commit | 6967037baf08860407d275fdd6475d2ee41bd9b7 (patch) | |
tree | ab24cabaa559374fc43afcdbb1ddf97166aff655 | |
parent | d72d2bb5a6bc85af77a9f969687c74ea00cdcc99 (diff) |
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: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/appldata/appldata_os.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c index de8e2b3b0180..69b23b25ac34 100644 --- a/arch/s390/appldata/appldata_os.c +++ b/arch/s390/appldata/appldata_os.c | |||
@@ -171,7 +171,7 @@ static int __init appldata_os_init(void) | |||
171 | int rc, max_size; | 171 | int rc, max_size; |
172 | 172 | ||
173 | max_size = sizeof(struct appldata_os_data) + | 173 | max_size = sizeof(struct appldata_os_data) + |
174 | (NR_CPUS * sizeof(struct appldata_os_per_cpu)); | 174 | (num_possible_cpus() * sizeof(struct appldata_os_per_cpu)); |
175 | if (max_size > APPLDATA_MAX_REC_SIZE) { | 175 | if (max_size > APPLDATA_MAX_REC_SIZE) { |
176 | pr_err("Maximum OS record size %i exceeds the maximum " | 176 | pr_err("Maximum OS record size %i exceeds the maximum " |
177 | "record size %i\n", max_size, APPLDATA_MAX_REC_SIZE); | 177 | "record size %i\n", max_size, APPLDATA_MAX_REC_SIZE); |