From patchwork Tue Oct 10 13:11:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 9996111 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 34CAB603B5 for ; Tue, 10 Oct 2017 13:15:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25B1C285C9 for ; Tue, 10 Oct 2017 13:15:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AA22285CC; Tue, 10 Oct 2017 13:15:11 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 C2BD3285C9 for ; Tue, 10 Oct 2017 13:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756274AbdJJNMO (ORCPT ); Tue, 10 Oct 2017 09:12:14 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:45800 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756265AbdJJNML (ORCPT ); Tue, 10 Oct 2017 09:12:11 -0400 Received: by mail-qt0-f178.google.com with SMTP id p1so13582394qtg.2 for ; Tue, 10 Oct 2017 06:12:11 -0700 (PDT) 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=wD3Wl+wp9daGd8RulgEB45zpo4JNcZyvgdtWCbyitVc=; b=FBIN5fFpVuWLdtnU+OmusIMYKi5CvkbnZUqo+m+qAK0NoRq5JkF25il/aVGTysJx5W Le3bYHjlEAGYWGu/gUR95OhIwI53RccKmq1ajscRbQny7jC7f0DrGWQ615tXWVb+ODrl aCN88m2mM7k4OKhWOcYCzCbpwRl2Ko4AYpK9A= 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=wD3Wl+wp9daGd8RulgEB45zpo4JNcZyvgdtWCbyitVc=; b=a6mQBwpDNOCeyxYzNt+bUZD/W/1KlbRikvJeSYxnN4IBVHw0sVHcGIvYX+8x5BGn9f +5lXt1eYB81kbmqGjnLudY7VDKD/9KNiwvCAZyUUXGn2e/fOjFlds3xZFvOhKwIJ+khm WyKYb7rnTOlg9RwLy37kYBWJvF0d+kmCAgfJ9iL2jcwDm7y6II0T/3Ued/xivfStIBSK dXrI2KlFqAUKyvPhVCr+FtpbglCwFKhyQNiKuhVjgHu6UmlxeVx5zYELiexgprUYHb/v Of/b2CEIWaBpNJWQO4W7jYDzo2HHLxU7Ril8PTBaD4BRJ/wAOptm7OMIiPsQIjqFAQNG Md9Q== X-Gm-Message-State: AMCzsaVM0eLrFgMf7r4ZdykimH7vG+EEHhyIJN/o2lS2+rtbbKNNjLJK TM8E1zbnc4+S0TQAK7N6c6zG22jx X-Google-Smtp-Source: AOwi7QC9PmyM1CySPdEHMmBHINA61Jsbny+sgTvveNAQfP2vuSRZTt48WGDuYB7NQ44oyScPkuHEtA== X-Received: by 10.55.132.194 with SMTP id g185mr4077588qkd.18.1507641130374; Tue, 10 Oct 2017 06:12:10 -0700 (PDT) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id h135sm634004qke.5.2017.10.10.06.12.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 06:12:09 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, JBottomley@Parallels.com, Sathya.Prakash@broadcom.com, linux-kernel@vger.kernel.org, Sreekanth Reddy Subject: [PATCH 03/10] mpt3sas: Reduce memory footprints in kdump kernel Date: Tue, 10 Oct 2017 18:41:16 +0530 Message-Id: <1507641083-20207-4-git-send-email-Sreekanth.Reddy@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1507641083-20207-1-git-send-email-Sreekanth.Reddy@broadcom.com> References: <1507641083-20207-1-git-send-email-Sreekanth.Reddy@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 To reduce the memory footprints of the driver in kdump kernel, we have made below driver setting when system boots in to kdump kernel, 1. Used single MSI-x vector. 2. Disable RDPQ mode. 3. Set sg_table_size to 32 by default. 4) Set SCSI IO Queue depth to 200. Signed-off-by: Sreekanth Reddy Signed-off-by: Tomas Henzl --- drivers/scsi/mpt3sas/mpt3sas_base.c | 14 +++++++++++--- drivers/scsi/mpt3sas/mpt3sas_base.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 844e29c..11c6afe 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1990,7 +1990,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ioc->cpu_count, max_msix_vectors); if (!ioc->rdpq_array_enable && max_msix_vectors == -1) - local_max_msix_vectors = 8; + local_max_msix_vectors = (reset_devices) ? 1 : 8; else local_max_msix_vectors = max_msix_vectors; @@ -3308,6 +3308,11 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) sg_tablesize = MPT3SAS_SG_DEPTH; } + /* max sgl entries <= MPT_KDUMP_MIN_PHYS_SEGMENTS in KDUMP mode */ + if (reset_devices) + sg_tablesize = min_t(unsigned short, sg_tablesize, + MPT_KDUMP_MIN_PHYS_SEGMENTS); + if (sg_tablesize < MPT_MIN_PHYS_SEGMENTS) sg_tablesize = MPT_MIN_PHYS_SEGMENTS; else if (sg_tablesize > MPT_MAX_PHYS_SEGMENTS) { @@ -3340,7 +3345,10 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) ioc->internal_depth, facts->RequestCredit); if (max_request_credit > MAX_HBA_QUEUE_DEPTH) max_request_credit = MAX_HBA_QUEUE_DEPTH; - } else + } else if (reset_devices) + max_request_credit = min_t(u16, facts->RequestCredit, + (MPT3SAS_KDUMP_SCSI_IO_DEPTH + ioc->internal_depth)); + else max_request_credit = min_t(u16, facts->RequestCredit, MAX_HBA_QUEUE_DEPTH); @@ -4446,7 +4454,7 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc) if ((facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID)) ioc->ir_firmware = 1; if ((facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_RDPQ_ARRAY_CAPABLE)) + MPI2_IOCFACTS_CAPABILITY_RDPQ_ARRAY_CAPABLE) && (!reset_devices)) ioc->rdpq_array_capable = 1; if (facts->IOCCapabilities & MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ) ioc->atomic_desc_capable = 1; diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index a77bb7d..95ee1c6 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -92,6 +92,7 @@ */ #define MPT_MAX_PHYS_SEGMENTS SG_CHUNK_SIZE #define MPT_MIN_PHYS_SEGMENTS 16 +#define MPT_KDUMP_MIN_PHYS_SEGMENTS 32 #ifdef CONFIG_SCSI_MPT3SAS_MAX_SGE #define MPT3SAS_SG_DEPTH CONFIG_SCSI_MPT3SAS_MAX_SGE @@ -111,6 +112,7 @@ #define MPT3SAS_SATA_QUEUE_DEPTH 32 #define MPT3SAS_SAS_QUEUE_DEPTH 254 #define MPT3SAS_RAID_QUEUE_DEPTH 128 +#define MPT3SAS_KDUMP_SCSI_IO_DEPTH 200 #define MPT3SAS_RAID_MAX_SECTORS 8192