This is a note to let you know that I've just added the patch titled scsi: qla2xxx: Format log strings only if needed to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-qla2xxx-format-log-strings-only-if-needed.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 69002c8ce914ef0ae22a6ea14b43bb30b9a9a6a8 Mon Sep 17 00:00:00 2001 From: Roman Bolshakov <r.bolshakov@xxxxxxxxx> Date: Fri, 12 Nov 2021 17:54:46 +0300 Subject: scsi: qla2xxx: Format log strings only if needed From: Roman Bolshakov <r.bolshakov@xxxxxxxxx> commit 69002c8ce914ef0ae22a6ea14b43bb30b9a9a6a8 upstream. Commit 598a90f2002c ("scsi: qla2xxx: add ring buffer for tracing debug logs") introduced unconditional log string formatting to ql_dbg() even if ql_dbg_log event is disabled. It harms performance because some strings are formatted in fastpath and/or interrupt context. Link: https://lore.kernel.org/r/20211112145446.51210-1-r.bolshakov@xxxxxxxxx Fixes: 598a90f2002c ("scsi: qla2xxx: add ring buffer for tracing debug logs") Cc: Rajan Shanmugavelu <rajan.shanmugavelu@xxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/qla2xxx/qla_dbg.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -2477,6 +2477,9 @@ ql_dbg(uint level, scsi_qla_host_t *vha, struct va_format vaf; char pbuf[64]; + if (!ql_mask_match(level) && !trace_ql_dbg_log_enabled()) + return; + va_start(va, fmt); vaf.fmt = fmt; Patches currently in stable-queue which might be from r.bolshakov@xxxxxxxxx are queue-5.10/scsi-qla2xxx-format-log-strings-only-if-needed.patch