* [PATCH] lpfc: use hdwq assigned cpu for allocation
@ 2019-11-16 0:38 James Smart
2019-11-19 4:39 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: James Smart @ 2019-11-16 0:38 UTC (permalink / raw)
To: linux-scsi; +Cc: James Smart, Dick Kennedy
Looking at the recent conversion from smp_processor_id() to
raw_smp_processor_id(), realized that the allocation should be
based on the cpu the hdwq is bound to, not the executing cpu.
Revise to pull cpu number from the hdwq
Fixes: 765ab6cdac3b ("scsi: lpfc: Fix a kernel warning triggered by lpfc_get_sgl_per_hdwq()")
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
drivers/scsi/lpfc/lpfc_sli.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 5286c78645ac..7c8527bd1677 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -20668,7 +20668,7 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
/* allocate more */
spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
- cpu_to_node(raw_smp_processor_id()));
+ cpu_to_node(hdwq->io_wq->chann));
if (!tmp) {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"8353 error kmalloc memory for HDWQ "
@@ -20811,7 +20811,7 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
/* allocate more */
spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
- cpu_to_node(raw_smp_processor_id()));
+ cpu_to_node(hdwq->io_wq->chann));
if (!tmp) {
lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"8355 error kmalloc memory for HDWQ "
--
2.13.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lpfc: use hdwq assigned cpu for allocation
2019-11-16 0:38 [PATCH] lpfc: use hdwq assigned cpu for allocation James Smart
@ 2019-11-19 4:39 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-11-19 4:39 UTC (permalink / raw)
To: James Smart; +Cc: linux-scsi, Dick Kennedy
James,
> Looking at the recent conversion from smp_processor_id() to
> raw_smp_processor_id(), realized that the allocation should be based
> on the cpu the hdwq is bound to, not the executing cpu.
Applied to 5.5/scsi-queue, thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-19 4:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16 0:38 [PATCH] lpfc: use hdwq assigned cpu for allocation James Smart
2019-11-19 4:39 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).