Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1514058imm; Fri, 12 Oct 2018 21:09:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV60eNiQsYKoRhaWt2flaphRUlvm5Xs29vOKJELcjqjpchPpfq4P18tKO6wbe6ZWzAQbLDPNO X-Received: by 2002:a63:ed55:: with SMTP id m21-v6mr8055108pgk.147.1539403791314; Fri, 12 Oct 2018 21:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539403791; cv=none; d=google.com; s=arc-20160816; b=ntW998+Jl98a3rtKaRMnQhBWxv8fCdLJy+GCEZfFr5T9h7kZhIGIzjp/aMf0Nuucly 4N1sUxb7LIIQj9aXYyEGcV7bnnyQ1q8C80+cfNLwSa0SqZ0/s/Rmm7sNHs9NZNG/FN5T LuTAWd61hnK/OZvwSZFhen4A2DMWKHh9gPtdd83gv7fXjjEkCsVm5Zzi7BRJgOKVT/9F +f/VG2wN4DV/cAIMIR5W2l6HLy5H8J7IclRatLi02Z0KtTjQOWAsi6TR9UAIla07kc9M vT4Wav/aLqS/zW6WV8TD/rw6T9QyKvSKlPQ+3Wu86Zt6AVvGJQwt0TYwVABhB81wS8qR CCjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=yW4/ITNSqOFpeG8RWXjWZ8L2CErp5w1LIOcbsrwXork=; b=B4kvzWI6Npz8Q2LIMs1KogmFmkmNaJOJdne9NFPmmi7+3Q3juyog/8r/aUtCaUOZEr WGlAf3WICzxK9+YIiZxx2bjmlQotcLrDvkypOaKOOWBp6WgEpoy7vc04cKTu0QCbj2l+ bU9nzVUH6n/ZXX07CoOKkbFZqGMeSNtW5JRJwscDv79fpKHosjn3qA6dSMF6QBAmDG5+ g17l08xkGoaIP69unty+0V8X7xHQ4Ga6zJEaIplZuTrsJMGjJqE1WnQlaHYeU32vfjV4 T1LubVgrBI+JdDK7oj/CZxsQ8b17MRJDtlM1yV6mZ+ZKpbaA8UPFMyhnxuGSojdajhMv mDoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14-v6si3427178pgk.497.2018.10.12.21.09.36; Fri, 12 Oct 2018 21:09:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbeJMLot (ORCPT + 99 others); Sat, 13 Oct 2018 07:44:49 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:48054 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbeJMLot (ORCPT ); Sat, 13 Oct 2018 07:44:49 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 41FD929F7F; Sat, 13 Oct 2018 00:09:11 -0400 (EDT) Date: Sat, 13 Oct 2018 15:09:12 +1100 (AEDT) From: Finn Thain To: Michael Schmitz cc: "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , linux-scsi@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] esp_scsi: Optimize PIO loops In-Reply-To: <3ba0d49c-57ce-40df-b406-98afc183275e@gmail.com> Message-ID: References: <3a2534bff570653de6897afa081017e2a359747e.1539391876.git.fthain@telegraphics.com.au> <3ba0d49c-57ce-40df-b406-98afc183275e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 13 Oct 2018, Michael Schmitz wrote: > Hi Finn, > > Am 13.10.2018 um 13:51 schrieb Finn Thain: > > Avoid function calls in the inner PIO loops. On a Centris 660av this > > improves throughput for sequential read transfers by about 40% and > > sequential write by about 10%. > > > > Unfortunately it is not possible to have method calls like esp_write8() > > placed inline so this is always going to be slow (even with LTO). > > > > Tested-by: Stan Johnson > > Signed-off-by: Finn Thain > > --- > > drivers/scsi/esp_scsi.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c > > index 646701fc22a4..9f0e68cd0e99 100644 > > --- a/drivers/scsi/esp_scsi.c > > +++ b/drivers/scsi/esp_scsi.c > > @@ -2788,7 +2788,7 @@ static inline unsigned int esp_wait_for_fifo(struct > > esp *esp) > > if (fbytes) > > return fbytes; > > > > - udelay(2); > > + udelay(1); > > } while (--i); > > > > pr_err("FIFO is empty (sreg %02x)\n", esp_read8(ESP_STATUS)); > > @@ -2804,7 +2804,7 @@ static inline int esp_wait_for_intr(struct esp *esp) > > if (esp->sreg & ESP_STAT_INTR) > > return 0; > > > > - udelay(2); > > + udelay(1); > > } while (--i); > > > > pr_err("IRQ timeout (sreg %02x)\n", esp->sreg); > > @@ -2831,7 +2831,7 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 > > esp_count, > > if (!esp_wait_for_fifo(esp)) > > break; > > > > - *dst++ = esp_read8(ESP_FDATA); > > + *dst++ = readb(esp->fifo_reg); > > --esp_count; > > > > if (!esp_count) > > @@ -2852,15 +2852,15 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 > > esp_count, > > } > > > > if (phase == ESP_MIP) > > - scsi_esp_cmd(esp, ESP_CMD_MOK); > > + esp_write8(ESP_CMD_MOK, ESP_CMD); > > You're no longer logging this command with this patch. (That'll be the reason > for the speedup you saw ...) > > > > > - scsi_esp_cmd(esp, ESP_CMD_TI); > > + esp_write8(ESP_CMD_TI, ESP_CMD); > > Same here.. > > > } > > } else { > > unsigned int n = ESP_FIFO_SIZE; > > u8 *src = (u8 *)addr; > > > > - scsi_esp_cmd(esp, ESP_CMD_FLUSH); > > + esp_write8(ESP_CMD_FLUSH, ESP_CMD); > > here.. > > > > > if (n > esp_count) > > n = esp_count; > > @@ -2894,7 +2894,7 @@ void esp_send_pio_cmd(struct esp *esp, u32 addr, u32 > > esp_count, > > src += n; > > esp_count -= n; > > > > - scsi_esp_cmd(esp, ESP_CMD_TI); > > + esp_write8(ESP_CMD_TI, ESP_CMD); > > and here. > Yes, it's deliberate. > The burst of ESP_CMD_TI's in the log was quite useful to spot what went > wrong during PIO. I don't think it's as useful as you seem to think. Compare mac_esp_send_pdma_cmd(). > Maybe mention in the changelog that commands during PIO are no longer > logged? Or introduce a new ESP_EVENT_PIO and log that at the start of > PIO? > Yes, and I did leave a scsi_esp_cmd(esp, cmd) call at the start of PIO. That should be sufficient, right? -- > Cheers, > > Michael > > > > > } > > } > > > > >