From patchwork Fri Jan 5 13:27:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10146585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 460C1601A1 for ; Fri, 5 Jan 2018 13:29:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35CB8287CD for ; Fri, 5 Jan 2018 13:29:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AA7B287D3; Fri, 5 Jan 2018 13:29:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7BC3287CD for ; Fri, 5 Jan 2018 13:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbeAEN3g (ORCPT ); Fri, 5 Jan 2018 08:29:36 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:41565 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbeAEN3f (ORCPT ); Fri, 5 Jan 2018 08:29:35 -0500 Received: by mail-pf0-f196.google.com with SMTP id j28so2179979pfk.8 for ; Fri, 05 Jan 2018 05:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aqMChyTgV1zYuAbqyW+DSOTOZINfHwqqycxlaASP7lo=; b=PrGzK89e1q6OfhApYBtGyFp9mrIAbmjsn/u8mESlRJsuK/GGHvumE3+l4md4nXZwu9 aXa3Ue6w3g5QAgR3X5UQKjjATdh6W5VJ/YNlvSH2GEqaR9QtYqecamL9ZsdO2KkY2I8R Tq4q7/uGDKDihmS8xzR4ur0ZyZT7dz5KjEPvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aqMChyTgV1zYuAbqyW+DSOTOZINfHwqqycxlaASP7lo=; b=NjdOraA4Y2IShsZjzPh3QATW1j5wzZgktin42AnwDYgqB16v65+3kNmwds6Sxv0nfi 7ATSM9kl/Wm0Cw851TlKTahIIF4IWhZHypHrE9t9bZuDnquiS+zL6RPhIX60OqgOFl3Q qLL4LJpXqEhUOoQC7DZ7eoJsti+pJCDemI8KbZ6MpT9YciZQ9qdXz1timFv3xO5Zibz3 acrRSLScCq8Nh0km5RGwZlynx4YAjJ+KPCs2v4kFnIAxVKOzm3Ume4qa3+0Oo/zLZ0Qf shoq6rZC+SgkASAIXa5sWj2vp6/R3vZ22n6w6dXqVZuRtd1GnakSZ7c+6fxYwPS0lhGl w6Ng== X-Gm-Message-State: AKGB3mIpPD9uGAMfscqQh8dwlBKEetynQbxnu4bRURxPqmLOrwqdfM0J IZxQAlNf/kXS/tBiYBAn9xgd1mRG X-Google-Smtp-Source: ACJfBovsEMB9scc1+4Ot/WeajnJ+t/Yn3K3YzR6KupyxEzz5YD/PRvikad3O9dKJa/6dMy29MtdpGg== X-Received: by 10.99.145.68 with SMTP id l65mr2663854pge.210.1515158974347; Fri, 05 Jan 2018 05:29:34 -0800 (PST) Received: from dhcp-135-24-192-142.localdomain ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id 68sm12588733pfx.186.2018.01.05.05.29.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 05:29:33 -0800 (PST) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH 10/14] megaraid_sas: Selectively apply stream detection based on IO type Date: Fri, 5 Jan 2018 05:27:45 -0800 Message-Id: <1515158869-26693-11-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1515158869-26693-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1515158869-26693-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Performance improvement- Current driver calls stream detection unconditionally for all IOs. Stream Detection logic is not required for most of the fast path IO. To improve performance, avoid stream detection logic and do it only if required. Below are the cases where stream detection is required in driver: 1. All non-FastPath IOs (IOs going to FW) 2. Fast Path reads sent to ReadAhead capable VDs. Signed-off-by: Sumit Saxena Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 74dadd052be4..ef36f2ac7cb6 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2664,16 +2664,6 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, praid_context = &io_request->RaidContext; if (instance->adapter_type == VENTURA_SERIES) { - spin_lock_irqsave(&instance->stream_lock, spinlock_flags); - megasas_stream_detect(instance, cmd, &io_info); - spin_unlock_irqrestore(&instance->stream_lock, spinlock_flags); - /* In ventura if stream detected for a read and it is read ahead - * capable make this IO as LDIO - */ - if (is_stream_detected(&io_request->RaidContext.raid_context_g35) && - io_info.isRead && io_info.ra_capable) - fp_possible = false; - /* FP for Optimal raid level 1. * All large RAID-1 writes (> 32 KiB, both WT and WB modes) * are built by the driver as LD I/Os. @@ -2699,6 +2689,20 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, } } + if (!fp_possible || + (io_info.isRead && io_info.ra_capable)) { + spin_lock_irqsave(&instance->stream_lock, + spinlock_flags); + megasas_stream_detect(instance, cmd, &io_info); + spin_unlock_irqrestore(&instance->stream_lock, + spinlock_flags); + /* In ventura if stream detected for a read and it is + * read ahead capable make this IO as LDIO + */ + if (is_stream_detected(&io_request->RaidContext.raid_context_g35)) + fp_possible = false; + } + /* If raid is NULL, set CPU affinity to default CPU0 */ if (raid) megasas_set_raidflag_cpu_affinity(praid_context,