Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Li RongQing and committed by
Martin K. Petersen
271aeff2 e423f1c7

+1 -1
+1 -1
drivers/scsi/qla2xxx/qla_inline.h
··· 621 621 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); 622 622 623 623 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); 625 625 if (!ha->qp_cpu_map) { 626 626 ql_log(ql_log_fatal, vha, 0x0180, 627 627 "Unable to allocate memory for qp_cpu_map ptrs.\n");