All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH 18/21] uas: Use scsi_print_command
Date: Wed, 10 Sep 2014 16:08:49 +0000	[thread overview]
Message-ID: <94D0CD8314A33A4D9D801C0FE68B402958C710E7@G9W0745.americas.hpqcorp.net> (raw)
In-Reply-To: <1410349611-17573-19-git-send-email-hdegoede@redhat.com>



> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Hans de Goede
> Sent: Wednesday, 10 September, 2014 6:47 AM
> To: Greg Kroah-Hartman
> Cc: linux-usb@vger.kernel.org; linux-scsi@vger.kernel.org;
> stable@vger.kernel.org; Hans de Goede
> Subject: [PATCH 18/21] uas: Use scsi_print_command
> 
> Use scsi_print_command to print commands during errors, rather then
> printing
> the rather meaningless pointer to the command.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/usb/storage/uas.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
> index 46b8788..220f4c7 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -229,8 +229,8 @@ static void uas_log_cmd_state(struct scsi_cmnd
> *cmnd, const char *caller)
>  	struct uas_cmd_info *ci = (void *)&cmnd->SCp;
> 
>  	scmd_printk(KERN_INFO, cmnd,
> -		    "%s %p tag %d,
> inflight:%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
> -		    caller, cmnd, uas_get_tag(cmnd),
> +		    "%s tag %d inflight:%s%s%s%s%s%s%s%s%s%s%s%s%s ",
> +		    caller, uas_get_tag(cmnd),
>  		    (ci->state & SUBMIT_STATUS_URB)     ? " s-st"  : "",
>  		    (ci->state & ALLOC_DATA_IN_URB)     ? " a-in"  : "",
>  		    (ci->state & SUBMIT_DATA_IN_URB)    ? " s-in"  : "",
> @@ -244,6 +244,7 @@ static void uas_log_cmd_state(struct scsi_cmnd
> *cmnd, const char *caller)
>  		    (ci->state & COMMAND_COMPLETED)     ? " done"  : "",
>  		    (ci->state & COMMAND_ABORTED)       ? " abort" : "",
>  		    (ci->state & IS_IN_WORK_LIST)       ? " work"  : "");
> +	scsi_print_command(cmnd);
>  }

The SCSI midlayer already does a scsi_print_command, under
the MLCOMPLETE logging level.  Printing the command in
the LLD is redundant; Printing the scmd pointer was not,
as it matched the prints in the SCSI midlayer, letting
you find all the messages for a command.

In Hannes' logging patch series, Christoph Hellwig suggested
printing the block layer tag instead of the scmd pointer.
If UAS uses that tag directly, then the uas_get_tag() print
already does that.  If they're not identical (looks like 
they differ by 2), then you might want to print both.

More general comment: 
scsi-mq stress testing has shown that calling printk
on each command with an error is problematic.  If the
system runs into hundreds or thousands of errors, the
printks take so long they induce more timeouts and errors.  

As discussed in the threads by Yoshihiro YUNOMAE and Hannes
Reinecke, you might want to:
* tuck the scmd_printk inside SCSI_LOG_LLCOMPLETE so
the user can control the verbosity
* use a _ratelimited version of each print
* plan to add and eventually switch to tracepoints, so
logging doesn't have performance impacts

---
Rob Elliott    HP Server Storage

  reply	other threads:[~2014-09-10 16:08 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 11:46 [PATCH 00/21] uas: rewrite error handling for robustness + misc cleanups Hans de Goede
2014-09-10 11:46 ` [PATCH 04/21] uas: Add uas_get_tag() helper function Hans de Goede
2014-09-10 11:46 ` [PATCH 05/21] uas: Do not use scsi_host_find_tag Hans de Goede
2014-09-10 11:46 ` [PATCH 06/21] uas: Check against unexpected completions Hans de Goede
     [not found] ` <1410349611-17573-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 11:46   ` [PATCH 01/21] uas: replace WARN_ON_ONCE() with lockdep_assert_held() Hans de Goede
2014-09-10 11:48     ` Hans de Goede
     [not found]       ` <54103AA3.7000801-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 11:56         ` Oliver Neukum
     [not found]           ` <1410350184.12706.18.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2014-09-10 11:58             ` Sharma, Sanjeev
2014-09-10 12:00             ` Hans de Goede
     [not found]               ` <54103D73.5050104-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-10 12:54                 ` Oliver Neukum
     [not found]                   ` <1410353663.12706.20.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2014-09-10 13:15                     ` Hans de Goede
2014-09-10 13:51                       ` Greg Kroah-Hartman
2014-09-11  3:40                         ` Sharma, Sanjeev
2014-09-10 14:38     ` Peter Hurley
     [not found]       ` <54106271.5090909-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2014-09-10 15:02         ` Hans de Goede
2014-09-11  3:42           ` Sharma, Sanjeev
2014-09-10 11:46   ` [PATCH 02/21] uas: Remove task-management / abort error handling code Hans de Goede
2014-09-10 13:31     ` Oliver Neukum
2014-09-10 11:46   ` [PATCH 03/21] uas: Fix resetting flag handling Hans de Goede
2014-09-10 13:40     ` Oliver Neukum
2014-09-10 13:50       ` Hans de Goede
2014-09-10 11:46   ` [PATCH 07/21] uas: Simplify unlink of data urbs on error Hans de Goede
2014-09-10 11:46   ` [PATCH 08/21] uas: Free data urbs on completion Hans de Goede
2014-09-10 11:46   ` [PATCH 10/21] uas: zap_pending: data urbs should have completed at this time Hans de Goede
2014-09-10 14:10     ` Oliver Neukum
2014-09-10 14:17       ` Hans de Goede
2014-09-10 11:46   ` [PATCH 14/21] uas: Fix memleak of non-submitted urbs Hans de Goede
2014-09-10 11:46   ` [PATCH 20/21] uas: Remove support for old sense ui as used in pre-production hardware Hans de Goede
2014-09-10 14:06     ` Oliver Neukum
2014-09-10 14:16       ` Hans de Goede
2014-09-10 11:46 ` [PATCH 09/21] uas: Simplify reset / disconnect handling Hans de Goede
2014-09-10 11:46 ` [PATCH 11/21] uas: Drop inflight list Hans de Goede
2014-09-10 11:46 ` [PATCH 12/21] uas: Remove cmnd reference from the cmd urb Hans de Goede
2014-09-10 11:46 ` [PATCH 13/21] uas: Drop all references to a scsi_cmnd once it has been aborted Hans de Goede
2014-09-10 11:46 ` [PATCH 15/21] uas: pre_reset and suspend: Fix a few races Hans de Goede
2014-09-10 11:46 ` [PATCH 16/21] uas: Use streams on upcoming 10Gbps / 3.1 USB Hans de Goede
2014-09-10 11:46 ` [PATCH 17/21] uas: Do not log urb status error on cancellation Hans de Goede
2014-09-10 14:00   ` Oliver Neukum
2014-09-10 14:05     ` Hans de Goede
2014-09-10 11:46 ` [PATCH 18/21] uas: Use scsi_print_command Hans de Goede
2014-09-10 16:08   ` Elliott, Robert (Server Storage) [this message]
2014-09-10 17:58     ` Hans de Goede
2014-09-10 11:46 ` [PATCH 19/21] uas: Drop COMMAND_COMPLETED flag Hans de Goede
2014-09-10 11:46 ` [PATCH 21/21] uas: Remove protype hardware usb interface info Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94D0CD8314A33A4D9D801C0FE68B402958C710E7@G9W0745.americas.hpqcorp.net \
    --to=elliott@hp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.