All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-scsi@vger.kernel.org, linux-m68k@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Michael Schmitz <schmitzmic@gmail.com>
Subject: Re: [PATCH v2 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers
Date: Wed, 31 Aug 2016 10:07:38 -0400 (EDT)	[thread overview]
Message-ID: <1064826087.3700254.1472652458320.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160831044453.413698369@telegraphics.com.au>



----- Original Message -----
> From: "Finn Thain" <fthain@telegraphics.com.au>
> To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, "Geert
> Uytterhoeven" <geert@linux-m68k.org>, linux-scsi@vger.kernel.org, linux-m68k@vger.kernel.org,
> linux-kernel@vger.kernel.org, "Michael Schmitz" <schmitzmic@gmail.com>
> Sent: Wednesday, August 31, 2016 12:44:56 AM
> Subject: [PATCH v2 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers
> 
> Large PIO transfers are broken up into chunks to try to avoid disabling
> local IRQs for long periods. But IRQs are still disabled for too long
> and this causes SCC FIFO overruns during serial port transfers.
> 
> This patch reduces the PIO chunk size to reduce interrupt latency to
> something on the order of milliseconds, at the expense of additional CPU
> overhead from extra iterations of the NCR5380_main() loop.
> 
> That CPU overhead is a problem for slow machines (e.g. mac_scsi on 25 MHz
> 68030) but these machines generally use PDMA not PIO. This patch doesn't
> make the overhead any worse on my Mac LC III (because it only gets about
> 510 accesses per ms).
> 
> This patch decreases disk performance by a fraction of one percent for
> dmx3191d on my 333 MHz PowerPC 750. Other affected hardware (such as
> g_NCR5380 on x86) was not tested but 5380 ISA cards generally use PDMA
> and not PIO.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> 
> ---
> Changed since v1:
> - PIO transfer chunk size is now hard-coded for simplicity.
> 
> ---
>  drivers/scsi/NCR5380.c |    8 ++++----
>  drivers/scsi/NCR5380.h |    2 ++
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> Index: linux/drivers/scsi/NCR5380.c
> ===================================================================
> --- linux.orig/drivers/scsi/NCR5380.c	2016-08-31 14:44:51.000000000 +1000
> +++ linux/drivers/scsi/NCR5380.c	2016-08-31 14:44:52.000000000 +1000
> @@ -1849,11 +1849,11 @@ static void NCR5380_information_transfer
>  						/* XXX - need to source or sink data here, as appropriate */
>  					}
>  				} else {
> -					/* Break up transfer into 3 ms chunks,
> -					 * presuming 6 accesses per handshake.
> +					/* Transfer a small chunk so that the
> +					 * irq mode lock is not held too long.
>  					 */
> -					transfersize = min((unsigned long)cmd->SCp.this_residual,
> -					                   hostdata->accesses_per_ms / 2);
> +					transfersize = min(cmd->SCp.this_residual,
> +					                   NCR5380_PIO_CHUNK_SIZE);
>  					len = transfersize;
>  					NCR5380_transfer_pio(instance, &phase, &len,
>  					                     (unsigned char **)&cmd->SCp.ptr);
> Index: linux/drivers/scsi/NCR5380.h
> ===================================================================
> --- linux.orig/drivers/scsi/NCR5380.h	2016-08-31 14:44:51.000000000 +1000
> +++ linux/drivers/scsi/NCR5380.h	2016-08-31 14:44:52.000000000 +1000
> @@ -250,6 +250,8 @@ struct NCR5380_cmd {
>  
>  #define NCR5380_CMD_SIZE		(sizeof(struct NCR5380_cmd))
>  
> +#define NCR5380_PIO_CHUNK_SIZE		256
> +
>  static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd
>  *ncmd_ptr)
>  {
>  	return ((struct scsi_cmnd *)ncmd_ptr) - 1;
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Patch makes sense, look good to me.

Reviwed-by: Laurence Oberman <loberman@redhat.com>

  reply	other threads:[~2016-08-31 14:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27  2:29 [PATCH 0/3] Small fixes and cleanup Finn Thain
2016-08-27  2:29 ` Finn Thain
2016-08-27  2:29 ` [PATCH 1/3] documentation/scsi: Remove nodisconnect parameter Finn Thain
2016-08-27  2:29   ` Finn Thain
2016-08-28  8:07   ` Geert Uytterhoeven
2016-09-06 12:41   ` Jonathan Corbet
2016-09-06 12:41     ` Jonathan Corbet
2016-08-27  2:30 ` [PATCH 2/3] scsi/ncr5380: Avoid a compiler warning Finn Thain
2016-08-27  2:30   ` Finn Thain
2016-08-28  8:08   ` Geert Uytterhoeven
2016-08-27  2:30 ` [PATCH 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers Finn Thain
2016-08-27  2:30   ` Finn Thain
2016-08-28  8:08   ` Geert Uytterhoeven
2016-08-29  4:06     ` Finn Thain
2016-08-31  4:44   ` [PATCH v2 " Finn Thain
2016-08-31  4:44     ` Finn Thain
2016-08-31 14:07     ` Laurence Oberman [this message]
2016-09-09 11:28     ` Martin K. Petersen
2016-09-09 11:28       ` Martin K. Petersen
2016-09-09 12:00       ` Geert Uytterhoeven
2016-09-14 18:12     ` Martin K. Petersen
2016-09-14 18:12       ` Martin K. Petersen
2016-08-31  4:26 ` [PATCH 0/3] Small fixes and cleanup Martin K. Petersen
2016-08-31  4:26   ` Martin K. Petersen

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=1064826087.3700254.1472652458320.JavaMail.zimbra@redhat.com \
    --to=loberman@redhat.com \
    --cc=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=schmitzmic@gmail.com \
    /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.