All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libfc: do not flood console with messages 'libfc: queue full ...'
@ 2017-04-27 14:25 Hannes Reinecke
  2017-04-27 16:07 ` Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hannes Reinecke @ 2017-04-27 14:25 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Hannes Reinecke,
	Hannes Reinecke

When the FCoE sending side becomes congested libfc tries to
reduce the queue depth on the host; however due to the built-in
lag before attempting to ramp down the queue depth _again_ the
message log is flooded with messages

libfc: queue full, reducing can_queue to 512

With this patch the message is printed only once (ie when it's
actually changed).

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/libfc/fc_fcp.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index a808e8e..234352da 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -407,11 +407,12 @@ static void fc_fcp_can_queue_ramp_up(struct fc_lport *lport)
  * can_queue. Eventually we will hit the point where we run
  * on all reserved structs.
  */
-static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
+static bool fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
 {
 	struct fc_fcp_internal *si = fc_get_scsi_internal(lport);
 	unsigned long flags;
 	int can_queue;
+	bool changed = false;
 
 	spin_lock_irqsave(lport->host->host_lock, flags);
 
@@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
 	if (!can_queue)
 		can_queue = 1;
 	lport->host->can_queue = can_queue;
+	changed = true;
 
 unlock:
 	spin_unlock_irqrestore(lport->host->host_lock, flags);
+	return changed;
 }
 
 /*
@@ -1896,11 +1899,11 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
 
 	if (!fc_fcp_lport_queue_ready(lport)) {
 		if (lport->qfull) {
-			fc_fcp_can_queue_ramp_down(lport);
-			shost_printk(KERN_ERR, lport->host,
-				     "libfc: queue full, "
-				     "reducing can_queue to %d.\n",
-				     lport->host->can_queue);
+			if (fc_fcp_can_queue_ramp_down(lport))
+				shost_printk(KERN_ERR, lport->host,
+					     "libfc: queue full, "
+					     "reducing can_queue to %d.\n",
+					     lport->host->can_queue);
 		}
 		rc = SCSI_MLQUEUE_HOST_BUSY;
 		goto out;
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] libfc: do not flood console with messages 'libfc: queue full ...'
  2017-04-27 14:25 [PATCH] libfc: do not flood console with messages 'libfc: queue full ...' Hannes Reinecke
@ 2017-04-27 16:07 ` Bart Van Assche
  2017-05-08  8:48 ` Johannes Thumshirn
  2017-05-09  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2017-04-27 16:07 UTC (permalink / raw)
  To: hare, martin.petersen; +Cc: hch, james.bottomley, linux-scsi, hare

On Thu, 2017-04-27 at 16:25 +0200, Hannes Reinecke wrote:
> @@ -1896,11 +1899,11 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
>  
>  	if (!fc_fcp_lport_queue_ready(lport)) {
>  		if (lport->qfull) {
> -			fc_fcp_can_queue_ramp_down(lport);
> -			shost_printk(KERN_ERR, lport->host,
> -				     "libfc: queue full, "
> -				     "reducing can_queue to %d.\n",
> -				     lport->host->can_queue);
> +			if (fc_fcp_can_queue_ramp_down(lport))
> +				shost_printk(KERN_ERR, lport->host,
> +					     "libfc: queue full, "
> +					     "reducing can_queue to %d.\n",
> +					     lport->host->can_queue);
>  		}
>  		rc = SCSI_MLQUEUE_HOST_BUSY;
>  		goto out;

Hello Hannes,

Although this would have been a good opportunity to join the log message
that has been split over two lines:

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libfc: do not flood console with messages 'libfc: queue full ...'
  2017-04-27 14:25 [PATCH] libfc: do not flood console with messages 'libfc: queue full ...' Hannes Reinecke
  2017-04-27 16:07 ` Bart Van Assche
@ 2017-05-08  8:48 ` Johannes Thumshirn
  2017-05-09  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2017-05-08  8:48 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Hannes Reinecke

On Thu, Apr 27, 2017 at 04:25:03PM +0200, Hannes Reinecke wrote:
> When the FCoE sending side becomes congested libfc tries to
> reduce the queue depth on the host; however due to the built-in
> lag before attempting to ramp down the queue depth _again_ the
> message log is flooded with messages
> 
> libfc: queue full, reducing can_queue to 512
> 
> With this patch the message is printed only once (ie when it's
> actually changed).
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---

Acked-by: Johannes Thumshirn <jth@kernel.org>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libfc: do not flood console with messages 'libfc: queue full ...'
  2017-04-27 14:25 [PATCH] libfc: do not flood console with messages 'libfc: queue full ...' Hannes Reinecke
  2017-04-27 16:07 ` Bart Van Assche
  2017-05-08  8:48 ` Johannes Thumshirn
@ 2017-05-09  1:21 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2017-05-09  1:21 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Hannes Reinecke


Hannes,

> When the FCoE sending side becomes congested libfc tries to reduce the
> queue depth on the host; however due to the built-in lag before
> attempting to ramp down the queue depth _again_ the message log is
> flooded with messages
>
> libfc: queue full, reducing can_queue to 512
>
> With this patch the message is printed only once (ie when it's
> actually changed).

Applied to 4.12/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-09  1:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 14:25 [PATCH] libfc: do not flood console with messages 'libfc: queue full ...' Hannes Reinecke
2017-04-27 16:07 ` Bart Van Assche
2017-05-08  8:48 ` Johannes Thumshirn
2017-05-09  1:21 ` Martin K. Petersen

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.