Skip to content

Commit 271aeff

Browse files
lrq-maxmartinkpetersen
authored andcommitted
scsi: qla2xxx: Use nr_cpu_ids instead of NR_CPUS for qp_cpu_map allocation
Change the memory allocation for qp_cpu_map to use the actual number of CPUs ('nr_cpu_ids') instead of the maximum possible CPUs ('NR_CPUS'). This saves memory on systems where the maximum CPU limit is much higher than the active CPU count. Signed-off-by: Li RongQing <lirongqing@baidu.com> Link: https://patch.msgid.link/20260331053245.1839-1-lirongqing@baidu.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent e423f1c commit 271aeff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/qla2xxx/qla_inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ static inline int qla_mapq_alloc_qp_cpu_map(struct qla_hw_data *ha)
621621
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
622622

623623
if (!ha->qp_cpu_map) {
624-
ha->qp_cpu_map = kzalloc_objs(struct qla_qpair *, NR_CPUS);
624+
ha->qp_cpu_map = kzalloc_objs(struct qla_qpair *, nr_cpu_ids);
625625
if (!ha->qp_cpu_map) {
626626
ql_log(ql_log_fatal, vha, 0x0180,
627627
"Unable to allocate memory for qp_cpu_map ptrs.\n");

0 commit comments

Comments
 (0)