From patchwork Wed May 29 09:58:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 165364 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9655528ili; Wed, 29 May 2019 03:00:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJn+97rEzRjkbBSZGgOnRD0UciND3utLueuYWDIPIPBil1iPBBqRRXpgAWfGeosJrSXuLA X-Received: by 2002:a63:2844:: with SMTP id o65mr51045645pgo.297.1559124025585; Wed, 29 May 2019 03:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559124025; cv=none; d=google.com; s=arc-20160816; b=jGMH8Jjk5u7SfLKBLIlLzHzSOcWMWHyWjnq5B71Q7QaXfdvyf6QTRKbi7+illwxyV5 IJHrrXZl9+SBz8xQ/VRVXN9+R7BN4NuMKeLcr7c3d5Vb3rJfvRwFIM2BLoA0zPKZNj7r N2W0TkKEegl0CTXZpGMrvp31QxFgLUDGcdDWsVLad2UK2LH+C/RGhrKM2yjO7hRRP2X4 ZK8fgOX8jXpCk2lpqtVy68r8F5fEShW+d90S0Ph5T4U+ATuIxeHyMHxWVmgHTjCl887U 005kyixK+HQz+8iMV+hMUXeTlFZAXAxLQnmmPCFISWrXzpyDu4Y1uM5a+dmjeGzYwtJB KpEA== 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:in-reply-to :message-id:date:subject:cc:to:from; bh=mNwXC65/izIgjhg5hWENV/EiLDd8DKyr2mLP5TdWf50=; b=sdsinv0wIluOjKwSRYtsne68Wjxvb+NYrqeX7JESgQUdcAYVFk56NBiq3f+d2f9iqm Mli82QVH/kLm5v4G9fuW9XKPVxptRODQ7cJW4YzefdWDEObY+ba5PJdqHTA/uelqRF7O FbZDH5H6dGDaVUG0mrj9Xzsm8uHSiTZtgvmWDj13RhcTT0pWteTQoPH8o15OCeWe6vO7 E8DBqBZXQfs4SpkrOGZeer5UgiIp9NUINL8ZdSrxa+w/DKq2lWqzNz7wXSPjCCQow3G8 aSgjnJ2PEc29VE73mQiYbGQo6aDCosJtcmZ0ktcxapNZxWeo/hra5GZPbCgmqW59hPuK +row== 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 d23si24713060pgv.513.2019.05.29.03.00.25; Wed, 29 May 2019 03:00:25 -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 S1726701AbfE2KAY (ORCPT + 30 others); Wed, 29 May 2019 06:00:24 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57488 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725894AbfE2KAV (ORCPT ); Wed, 29 May 2019 06:00:21 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 873DAA6CDEC2254E07E; Wed, 29 May 2019 18:00:18 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Wed, 29 May 2019 18:00:11 +0800 From: John Garry To: , CC: , , , John Garry , "dann frazier" Subject: [PATCH 3/6] scsi: hisi_sas: Reduce HISI_SAS_SGE_PAGE_CNT in size Date: Wed, 29 May 2019 17:58:44 +0800 Message-ID: <1559123927-160502-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1559123927-160502-1-git-send-email-john.garry@huawei.com> References: <1559123927-160502-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Macro HISI_SAS_SGE_PAGE_CNT is defined to SG_CHUNK_SIZE, which is 128. This means that sizeof(struct hisi_sas_slot_buf_table) is 4192. This is just over a 4K, which can mean inefficient DMA memory usage (for no PI). Reduce the size of HISI_SAS_SGE_PAGE_CNT to 124 to fit in a 4K page. With this change, we experience no performance hit. Cc: dann frazier Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index fc87994b5d73..06f22fb372b1 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -484,12 +484,12 @@ struct hisi_sas_command_table_stp { u8 atapi_cdb[ATAPI_CDB_LEN]; }; -#define HISI_SAS_SGE_PAGE_CNT SG_CHUNK_SIZE +#define HISI_SAS_SGE_PAGE_CNT (124) struct hisi_sas_sge_page { struct hisi_sas_sge sge[HISI_SAS_SGE_PAGE_CNT]; } __aligned(16); -#define HISI_SAS_SGE_DIF_PAGE_CNT SG_CHUNK_SIZE +#define HISI_SAS_SGE_DIF_PAGE_CNT HISI_SAS_SGE_PAGE_CNT struct hisi_sas_sge_dif_page { struct hisi_sas_sge sge[HISI_SAS_SGE_DIF_PAGE_CNT]; } __aligned(16);