From patchwork Mon Aug 5 13:48:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 170560 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4321799ile; Mon, 5 Aug 2019 06:50:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvdpQHNWkWrMmt3Q8e993h24w212VbSNXwNbzCyRbhIrl0Z++961AxWjfEaHa1JOIcQD7M X-Received: by 2002:a62:5c47:: with SMTP id q68mr74508672pfb.205.1565013030928; Mon, 05 Aug 2019 06:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565013030; cv=none; d=google.com; s=arc-20160816; b=ecdfBotMF6IwCrxoxYNwi+ySDhtJ66iVHU7+YvERQ7fijIsUWZzqYnv8wUWPIdRUOi YMwPuTS6UVCas2CCFbNkei+8IWc8udg+qtjgRaJRt2G6qlaOhi/IVvYci6JE6hlsuzCc g829I/zNZocxlOfIXF1seTunFTEGFD4LG97zgFjt+SQoZS1okrIIqRB5HxIbeXBBVEyL TjOZpBlNXfYsBa90UogLoEOL1ss7CPtcHl+upGwcq8ukBBxRc4L8B8QWp75xivNKaaFf Y9bZs9nXECk9ZHqhBYAQMWz1MxM0E+KfkVCzgrB4ViNg1SxkrLyJzaCssJD10Ff82PYA MQ7A== 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=OC5qDc0uyAGVNHCgSwkPbX2DW80VzAN8gD9YkaekSAQ=; b=g6/wrDB8ticmNrmGz5ci1WBB61JollRWSPckSC7t0r1WxKIelbtFpW7Og1LD9qKqQa 7zUS0ljaOffb4IoxWGuI6pZmTsHufL2EH9hx8S+6yf+nf8eo+iE6qdUjnEgtlVw5oIma zxc4TmQxPJjBJyuPWnNcCOXrS19jWYqQBMtCjvPTDusQ/PCEIOyBPCch+Hs8/AH6QMpU Pram8si1CpiPD2Ncw9ITho3xM5WRn3hKgxfwKmwE7SFmXZq8drYzYI1k6fh6XGbUl5zE NhA27eWTDopvtZiQmtIGnbw1GUfW0loQ5TZlS9phfkamXTAa431zq3fcXKWPi8ec+0M5 RoSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 k13si45940146pfa.17.2019.08.05.06.50.30 for ; Mon, 05 Aug 2019 06:50:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730043AbfHENu3 (ORCPT ); Mon, 5 Aug 2019 09:50:29 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44560 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729866AbfHENu2 (ORCPT ); Mon, 5 Aug 2019 09:50:28 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 29691A460A766AD89F5A; Mon, 5 Aug 2019 21:50:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 5 Aug 2019 21:50:13 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 07/15] scsi: hisi_sas: Don't bother clearing status buffer IU in task prep Date: Mon, 5 Aug 2019 21:48:04 +0800 Message-ID: <1565012892-75940-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1565012892-75940-1-git-send-email-john.garry@huawei.com> References: <1565012892-75940-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen For struct hisi_sas_status_buffer, it contains struct hisi_sas_err_record and iu[1024]. The struct iu[1024] will be filled fully by the response of disks, so it is not need to initialize them to 0, but for the struct hisi_sas_err_record, SAS controller only fill some fields of hisi_sas_err_record according to hw designer, so it should be initialised to 0. After the change, cpu utilization percentage of memset() is changed from 1.7% to 0.12%. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 02ad91c01a44..7efa8dfa0cc1 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -545,7 +545,8 @@ static int hisi_sas_task_prep(struct sas_task *task, memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); memset(hisi_sas_cmd_hdr_addr_mem(slot), 0, HISI_SAS_COMMAND_TABLE_SZ); - memset(hisi_sas_status_buf_addr_mem(slot), 0, HISI_SAS_STATUS_BUF_SZ); + memset(hisi_sas_status_buf_addr_mem(slot), 0, + sizeof(struct hisi_sas_err_record)); switch (task->task_proto) { case SAS_PROTOCOL_SMP: @@ -2005,7 +2006,8 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id, memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); memset(hisi_sas_cmd_hdr_addr_mem(slot), 0, HISI_SAS_COMMAND_TABLE_SZ); - memset(hisi_sas_status_buf_addr_mem(slot), 0, HISI_SAS_STATUS_BUF_SZ); + memset(hisi_sas_status_buf_addr_mem(slot), 0, + sizeof(struct hisi_sas_err_record)); hisi_sas_task_prep_abort(hisi_hba, slot, device_id, abort_flag, task_tag);