Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp466916rdh; Tue, 19 Dec 2023 04:38:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhAEnSy4XJ5tR1B0uO51MpOLE7JzG+8d7lNS/KH/IXVkxP/NTcrkt27HUVFgqq64dundVB X-Received: by 2002:a05:6870:355:b0:203:f3b8:412a with SMTP id n21-20020a056870035500b00203f3b8412amr754772oaf.49.1702989493603; Tue, 19 Dec 2023 04:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702989493; cv=none; d=google.com; s=arc-20160816; b=w0HMNEWlzqQvoHoSu2Bi5BrzE3T6rnLl2/dgatp69V6T6e1Y0+cOru4wi9BolX84UW iNJ97FWbck2AlriRom4FsH0zqqE7fwedSjMaTbjab42tGE6o0xV/DxMTxy4t3SU7QLYO Q9s5DFQxrztDP5OPIuy+C0xPcNv7yU4uetsdmvvYu+u/yu79OHbCPmZwYz7KfLYK8xmj V+lcl5dpigdiagQ7Ba2M2Wjv9aQB2fjgDXqj3G00jHTes7TCIHhU+O4wp6Y67KUk/ZHo dXhmeHJT241ZS22sYdaIMwgPcymEsEVwSCEa8Z6SQUq3iyFUSnUQ7HQL/7QTY2kgnQ/d MDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=NawkK+6zy7f2PHuiiEWPPizPr1GY7iL4+ANOhbIBr24=; fh=nIufmHu5noZrjJiRB9W7eT9xpqF+yZxN2pF+TqzqXqo=; b=WyPx4uVLZ0ExDP09iQ5kVvW4wLLpC6Z49DMMzoarPbtBHNPFT+V8v5RAV0XzIuNQAK iCWPlicL62mfeY3a3btsZW0mlDwYXN2oJKW9aNd34ntXiYun/Ix+yJMbl490i88wqO5p eXj6rCBF5XkkfHEINnnKQrc0PbwzWCZkHUrC41MqwvQfTNqi8IDkV+2c2R3NfgTaXpvq HF2ddAyJjLLVBw8ERRdTwvsaCP7ONhJix83p9Xb454QpBVDTYshzCQHt6PwIFJESy603 IL4F/TOyJB0FBUD9nubRCz+5gmhDzvRy5h4HV88eRFtBzZTyHs/VW+R4McVl6artQXnQ dUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=A5iGsgYA; spf=pass (google.com: domain of linux-kernel+bounces-5176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k128-20020a633d86000000b005cdc05e6631si506854pga.261.2023.12.19.04.38.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:38:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=A5iGsgYA; spf=pass (google.com: domain of linux-kernel+bounces-5176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3FC09286D4D for ; Tue, 19 Dec 2023 12:38:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE90B1863E; Tue, 19 Dec 2023 12:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="A5iGsgYA" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C71FA18623; Tue, 19 Dec 2023 12:38:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BJ794Gs022908; Tue, 19 Dec 2023 12:37:46 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=NawkK+6zy7f2PHuiiEWPPizPr1GY7iL4+ANOhbIBr24=; b=A5 iGsgYAB9IulXPv8qIjiNFJjEAnPAzXSadoBF0mcDcLqxHpe1XqlrSvPSOhG9LM8P fWJR8vzUEavJYLzI7EWaa0okX4vyyHrrovChdZ+TMUxez5cmgBKMfslVSE8BCMEg Cg7GqxJ+4MQsEKBC1Cje5eZO6UZny5JKr/C6DVUCCdg6y1pgKLXe9Piud2mzpjx8 Hy1RjYYs+6ZTHHKSq+iEO4W/nmuOdyuR4WOhYhesJnJyD493fqt/3nt5uCOUKk2X f5XxpqXETEPzq1oChEtK9XnXejePl1O3v6JhJGaIIES0jUmeP+kXm0eb6n4047Yr A5JYT2F6fNUgGRNFRYzg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v34bj95c5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 12:37:46 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BJCbjAg021044 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 12:37:45 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, 19 Dec 2023 04:37:40 -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 V6 0/2] Add CPU latency QoS support for ufs driver Date: Tue, 19 Dec 2023 18:07:04 +0530 Message-ID: <20231219123706.6463-1-quic_mnaresh@quicinc.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: dLMfhtIfVGhVU1qbDhObTZkch_cbmNJC X-Proofpoint-ORIG-GUID: dLMfhtIfVGhVU1qbDhObTZkch_cbmNJC 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 mlxlogscore=716 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312190094 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 v5: - Addressed bvanassche comment to use kstrtobool instead kstrtou32 - Addressed bvanassche comment to add sys attribute into an existing group Changes from v4: - Addressed angelogioacchino's comment to update commit text - Addressed angelogioacchino's comment to code alignment Changes from v3: - Removed UFSHCD_CAP_PM_QOS capability flag from patch#2 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 - Added PM QoS capability for both QCOM and MEDIATEK SoCs Maramaina Naresh (2): ufs: core: Add CPU latency QoS support for ufs driver ufs: ufs-mediatek: Migrate to UFSHCD generic CPU latency PM QoS support drivers/ufs/core/ufs-sysfs.c | 49 ++++++++++++++++++++++++++++++++ drivers/ufs/core/ufshcd.c | 50 +++++++++++++++++++++++++++++++++ drivers/ufs/host/ufs-mediatek.c | 17 ----------- drivers/ufs/host/ufs-mediatek.h | 3 -- include/ufs/ufshcd.h | 6 ++++ 5 files changed, 105 insertions(+), 20 deletions(-) -- 2.17.1