From patchwork Wed Oct 16 02:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L56eA57qiIChYaXVob25nIFdhbmcp?= X-Patchwork-Id: 13837676 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 7DD302206E for ; Wed, 16 Oct 2024 03:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729049717; cv=none; b=RkD09TBkNAUuN/jQdSxfBgrWc+Iw2lset1xcAVzWvZriA0Ug/p9ydePC08CTRcVTHcPDOr9LSw9JJH63ts7kSDBVhgtzJkcltpAN8uDq0iy1SGpmrjyPfFgHCSFStDZWFsAacmM5KwWZYT9moxZfxi0s4alLjwkMw2fJExBlR2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729049717; c=relaxed/simple; bh=5vhbPHK3Lf0vVi0FNmnj/Mq/QQhJ12Fqy9P86uNPUiI=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=P8/yWSURO3M+aRCGDsrEo4dPXci+rRsu9DfzPvtQ5pRXG1Jxn5ZpjRzq5bcvTgy1BAjFDBqtf2PPoeuEZyZd71/NXtlqemS0ft8uWlyuwmDnQPgFcf/nSSv72b2TDoOnYPbXFNCv0gY9koeXYs1fnL95s1DpHGXrm0X70mxD4ZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.spreadtrum.com with ESMTP id 49G2jW0H082453 for ; Wed, 16 Oct 2024 10:45:32 +0800 (+08) (envelope-from Xiuhong.Wang@unisoc.com) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 49G2jGh1081782; Wed, 16 Oct 2024 10:45:16 +0800 (+08) (envelope-from Xiuhong.Wang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XSwLB5Yyhz2PVftg; Wed, 16 Oct 2024 10:45:06 +0800 (CST) Received: from tj10379pcu.spreadtrum.com (10.5.32.15) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 16 Oct 2024 10:45:13 +0800 From: Xiuhong Wang To: , , , , , CC: , , Subject: [PATCH V2] Revert "blk-throttle: Fix IO hang for a corner case" Date: Wed, 16 Oct 2024 10:45:08 +0800 Message-ID: <20241016024508.3340330-1-xiuhong.wang@unisoc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 49G2jGh1081782 This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b. The main purpose of this patch is cleanup. The throtl_adjusted_limit function was removed after commit bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being able to scale after setting bps or iops to 1 will not occur. So revert this commit that bps/iops can be set to 1. Cc: Baolin Wang Cc: Yu Kuai Signed-off-by: Xiuhong Wang Signed-off-by: Zhiguo Niu Acked-by: Tejun Heo Reviewed-by: Yu Kuai --- V1 -> V2: Updated description to clarify this is mostly a cleanup --- block/blk-throttle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 2c4192e12efa..443d1f47c2ce 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1485,13 +1485,13 @@ static ssize_t tg_set_limit(struct kernfs_open_file *of, goto out_finish; ret = -EINVAL; - if (!strcmp(tok, "rbps") && val > 1) + if (!strcmp(tok, "rbps")) v[0] = val; - else if (!strcmp(tok, "wbps") && val > 1) + else if (!strcmp(tok, "wbps")) v[1] = val; - else if (!strcmp(tok, "riops") && val > 1) + else if (!strcmp(tok, "riops")) v[2] = min_t(u64, val, UINT_MAX); - else if (!strcmp(tok, "wiops") && val > 1) + else if (!strcmp(tok, "wiops")) v[3] = min_t(u64, val, UINT_MAX); else goto out_finish;