Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357892

Re: [PATCH 20/22] atari_scsi: Set a reasonable default for cmd_per_lun

From Finn Thain <fthain@telegraphics.com.au>
Newsgroups linux.kernel
Subject Re: [PATCH 20/22] atari_scsi: Set a reasonable default for cmd_per_lun
Date 2016-03-15 09:30 +0100
Message-ID <rcSwx-7WK-3@gated-at.bofh.it> (permalink)
References <rcsC5-7iI-3@gated-at.bofh.it> <rcsC7-7iI-43@gated-at.bofh.it> <rcvqh-KB-3@gated-at.bofh.it> <rcNQe-4LQ-7@gated-at.bofh.it> <rcR7s-6VA-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 15 Mar 2016, Hannes Reinecke wrote:

> On 03/15/2016 04:27 AM, Finn Thain wrote:
> > 
> > On Mon, 14 Mar 2016, Hannes Reinecke wrote:
> > 
> >> On 03/14/2016 05:27 AM, Finn Thain wrote:
> >>> This setting does not need to be conditional on Atari ST or TT.
> >>>
> >>> Without TCQ support, cmd_per_lun == 2 is probably reasonable...
> >>>
> >>> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> >>>
> >>> ---
> >>>  drivers/scsi/atari_scsi.c |    3 +--
> >>>  1 file changed, 1 insertion(+), 2 deletions(-)
> >>>
> >>> Index: linux/drivers/scsi/atari_scsi.c
> >>> ===================================================================
> >>> --- linux.orig/drivers/scsi/atari_scsi.c	2016-03-14 15:26:45.000000000 +1100
> >>> +++ linux/drivers/scsi/atari_scsi.c	2016-03-14 15:26:55.000000000 +1100
> >>> @@ -750,6 +750,7 @@ static struct scsi_host_template atari_s
> >>>  	.eh_abort_handler	= atari_scsi_abort,
> >>>  	.eh_bus_reset_handler	= atari_scsi_bus_reset,
> >>>  	.this_id		= 7,
> >>> +	.cmd_per_lun		= 2,
> >>>  	.use_clustering		= DISABLE_CLUSTERING,
> >>>  	.cmd_size		= NCR5380_CMD_SIZE,
> >>>  };
> >> _2_ ? Are you being overly cheeky here?
> >> I sincerely doubt the driver is capable of submitting two 
> >> simultaneous commands ...
> > 
> > Right. The LLD has LU busy flags to prevent a LU from being issued 
> > more than one command.
> > 
> >> Care to explain?
> > 
> > It seemed harmless and it is consistent with the all of the other 5380 
> > drivers.
> > 
> > I don't know why it was done that way. Perhaps it was done to create a 
> > pipeline. That is, to keep a small number of commands in the LLD issue 
> > queue so that the NCR5380_main() work item does not have to terminate 
> > and then get requeued needlessly.
> > 
> Like I suspected.
> While I'm aware of the reasoning, I sincerely doubt whether it makes any 
> difference in real life.
> After all, a 'BUSY' return value still relies on someone kicking the 
> queue so that the next command can be submitted.

Well, it is not queuecommand returning SCSI_MLQUEUE_HOST_BUSY. I assume it 
is scsi_request_fn() bailing out when !scsi_dev_queue_ready().

> So it's not much different from using a queuedepth of '1' and use the 
> 'official' way.
> 
> Have you done any benchmarking here?

I have now.

> Would be very interesting to check if it makes a difference in real
> life ...

It seems that the work item startup and shutdown overhead does make a 
difference on machines where cycles are scarce.

Using mac_scsi on a 25 MHz 68030 I made some test runs of
# dd if=/dev/sda of=/dev/null count=4096
and the difference is measurable (effect size is 9+ standard deviations).

cmd_per_lun = 2 is about 3.0% faster than cmd_per_lun = 1.
cmd_per_lun = 4 is about 3.7% faster than cmd_per_lun = 1.

Increasing cmd_per_lun to 16 (which equals can_queue) doesn't improve the 
timing.

I think the 'official' way (the default cmd_per_lun) would not hurt if the 
CPU was a bit faster.

Now that you've got me to test it I think 4 is probably the best for 
mac_scsi and atari_scsi. When I send v2 I will change patch 20 and 22 
accordingly.

-- 

> 
> Cheers,
> 
> Hannes
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/22] ncr5380: Eliminate macros, reduce code duplication, fix bugs etc Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 09/22] ncr5380: Adopt uniform DMA setup convention Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 09/22] ncr5380: Adopt uniform DMA setup convention Hannes Reinecke <hare@suse.de> - 2016-03-14 08:40 +0100
      Re: [PATCH 09/22] ncr5380: Adopt uniform DMA setup convention Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 04:30 +0100
        Re: [PATCH 09/22] ncr5380: Adopt uniform DMA setup convention Hannes Reinecke <hare@suse.de> - 2016-03-15 08:00 +0100
  [PATCH 05/22] ncr5380: Disable the DMA errata workaround flag by default Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 12/22] sun3_scsi: Adopt NCR5380.c core driver Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 06/22] ncr5380: Remove PSEUDO_DMA macro Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 17/22] ncr5380: Remove remaining register storage qualifiers Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 11/22] atari_scsi: Adopt NCR5380.c core driver Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 11/22] atari_scsi: Adopt NCR5380.c core driver Hannes Reinecke <hare@suse.de> - 2016-03-14 08:40 +0100
  [PATCH 15/22] dmx3191d: Drop max_sectors limit Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 14/22] ncr5380: Add MAX_LUN limit Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 14/22] ncr5380: Add MAX_LUN limit Hannes Reinecke <hare@suse.de> - 2016-03-14 08:50 +0100
    Re: [PATCH 14/22] ncr5380: Add MAX_LUN limit Christoph Hellwig <hch@infradead.org> - 2016-03-14 09:00 +0100
      Re: [PATCH 14/22] ncr5380: Add MAX_LUN limit Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 04:30 +0100
        Re: [PATCH 14/22] ncr5380: Add MAX_LUN limit Christoph Hellwig <hch@infradead.org> - 2016-03-15 09:30 +0100
  [PATCH 07/22] ncr5380: Remove BOARD_REQUIRES_NO_DELAY macro Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 20/22] atari_scsi: Set a reasonable default for cmd_per_lun Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 20/22] atari_scsi: Set a reasonable default for  cmd_per_lun Hannes Reinecke <hare@suse.de> - 2016-03-14 08:50 +0100
      Re: [PATCH 20/22] atari_scsi: Set a reasonable default for  cmd_per_lun Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 04:30 +0100
        Re: [PATCH 20/22] atari_scsi: Set a reasonable default for  cmd_per_lun Hannes Reinecke <hare@suse.de> - 2016-03-15 08:00 +0100
          Re: [PATCH 20/22] atari_scsi: Set a reasonable default for  cmd_per_lun Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 09:30 +0100
        Re: [PATCH 20/22] atari_scsi: Set a reasonable default for  cmd_per_lun James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-03-15 15:40 +0100
  [PATCH 08/22] ncr5380: Use DMA hooks for PDMA Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 18/22] ncr5380: Remove DONT_USE_INTR and AUTOPROBE_IRQ macros Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 22/22] mac_scsi: Fix pseudo DMA implementation Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 02/22] ncr5380: Remove FLAG_NO_PSEUDO_DMA where possible Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 16/22] ncr5380: Fix register decoding for debugging Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 16/22] ncr5380: Fix register decoding for debugging Hannes Reinecke <hare@suse.de> - 2016-03-14 08:50 +0100
      Re: [PATCH 16/22] ncr5380: Fix register decoding for debugging Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 04:30 +0100
  [PATCH 19/22] ncr5380: Update usage documentation Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 21/22] atari_scsi: Allow can_queue to be increased for Falcon Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
    Re: [PATCH 21/22] atari_scsi: Allow can_queue to be increased for  Falcon Hannes Reinecke <hare@suse.de> - 2016-03-14 09:00 +0100
  [PATCH 10/22] ncr5380: Merge DMA implementation from atari_NCR5380 core driver Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 05:50 +0100
  [PATCH 01/22] g_ncr5380: Remove CONFIG_SCSI_GENERIC_NCR53C400 Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 06:00 +0100
    Re: [PATCH 01/22] g_ncr5380: Remove CONFIG_SCSI_GENERIC_NCR53C400 Hannes Reinecke <hare@suse.de> - 2016-03-14 08:30 +0100
  [PATCH 03/22] ncr5380: Remove REAL_DMA and REAL_DMA_POLL macros Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 06:00 +0100
    Re: [PATCH 03/22] ncr5380: Remove REAL_DMA and REAL_DMA_POLL macros Hannes Reinecke <hare@suse.de> - 2016-03-14 08:30 +0100
  [PATCH 04/22] atari_NCR5380: Remove DMA_MIN_SIZE macro Finn Thain <fthain@telegraphics.com.au> - 2016-03-14 06:00 +0100
    Re: [PATCH 04/22] atari_NCR5380: Remove DMA_MIN_SIZE macro Hannes Reinecke <hare@suse.de> - 2016-03-14 08:30 +0100
      Re: [PATCH 04/22] atari_NCR5380: Remove DMA_MIN_SIZE macro Finn Thain <fthain@telegraphics.com.au> - 2016-03-15 04:20 +0100

csiph-web