From patchwork Tue Dec 12 11:55:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maramaina Naresh X-Patchwork-Id: 13489061 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NWVyH30Q" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13329ED; Tue, 12 Dec 2023 03:56:16 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BCBb2ac002317; Tue, 12 Dec 2023 11:55:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=0FRukNNF18VJMMl2yW09BzFDbh1WXwDOP6Tma6+Pye4=; b=NW VyH30QC6FkLs6u01biKutrPtUOY4uvefp+3aVofd0hCi40TbOVzkMBpX5hIx6OIt MDffQQc3XGUuHlvk/2c49NGiJB1yDkQYRUy4YZeR6zobzHLNiFAKlSl34EUjcI0U SLBchWsPAzcoHCWhyJJCmb/262d20h1PbitrzhZmsVm5kVKdaHLegFF+Rp4csiMQ 7YGamPro1nOPj5Om1ETVJQkvmItQhj/o365RcwE5pKahpPuo0hgfgOt9Na7SpHrW PFyWJ6uX3s6UNrp22fA2ZxWDijIDbv7E/6jup4ZMgPrYTU/f9iryV/184x+xVCQX Nz7yv/9OOuBEFmKnK12w== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uxpsu813w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 11:55:42 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BCBtfZ8014166 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 11:55:41 GMT Received: from hu-mnaresh-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 12 Dec 2023 03:55:35 -0800 From: Maramaina Naresh To: "James E.J. Bottomley" , "Martin K. Petersen" , Peter Wang , "Matthias Brugger" , AngeloGioacchino Del Regno , CC: Alim Akhtar , Avri Altman , Bart Van Assche , Stanley Jhu , , , , , , Subject: [PATCH V3 0/2] Add CPU latency QoS support for ufs driver Date: Tue, 12 Dec 2023 17:25:08 +0530 Message-ID: <20231212115510.30935-1-quic_mnaresh@quicinc.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: OheJxlbHn3qvbC4jKFr1jXU8WYYlhqQ2 X-Proofpoint-ORIG-GUID: OheJxlbHn3qvbC4jKFr1jXU8WYYlhqQ2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=703 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1011 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120096 Add CPU latency QoS support for ufs driver. This improves random io performance by 15% for ufs. tiotest benchmark tool io performance results on sm8550 platform: 1. Without PM QoS support Type (Speed in) | Average of 18 iterations Random Read(IPOS) | 37101.3 Random Write(IPOS) | 41065.13 2. With PM QoS support Type (Speed in) | Average of 18 iterations Random Read(IPOS) | 42943.4 Random Write(IPOS) | 46784.9 (Improvement with PM QoS = ~15%). This patch is based on below patch by Stanley Chu [1]. Moving the PM QoS code to ufshcd.c and making it generic. [1] https://lore.kernel.org/r/20220623035052.18802-8-stanley.chu@mediatek.com Changes from v2: - Addressed bvanassche and mani comments - Provided sysfs interface to enable/disable PM QoS feature Changes from v1: - Addressed bvanassche comments to have the code in core ufshcd - Design is changed from per-device PM QoS to CPU latency QoS based support - Reverted existing PM QoS feature from MEDIATEK UFS driver Maramaina Naresh (2): ufs: core: Add CPU latency QoS support for ufs driver ufs: ufs-mediatek: Enable CPU latency PM QoS support for MEDIATEK SoC drivers/ufs/core/ufshcd.c | 127 ++++++++++++++++++++++++++++++++ drivers/ufs/host/ufs-mediatek.c | 20 +---- drivers/ufs/host/ufs-mediatek.h | 3 - include/ufs/ufshcd.h | 6 ++ 4 files changed, 136 insertions(+), 20 deletions(-)