From patchwork Thu May 9 02:39:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 13659392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96F26C04FFE for ; Thu, 9 May 2024 02:41:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2098B6B0095; Wed, 8 May 2024 22:41:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18C1E6B0099; Wed, 8 May 2024 22:41:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFA026B0098; Wed, 8 May 2024 22:41:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CBBBF6B0093 for ; Wed, 8 May 2024 22:41:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3A38FC125B for ; Thu, 9 May 2024 02:41:21 +0000 (UTC) X-FDA: 82097305962.05.0A5EB7D Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf16.hostedemail.com (Postfix) with ESMTP id 7F324180002 for ; Thu, 9 May 2024 02:41:18 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715222479; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=EzZCz8uKCvyMlEBeYzzF/nbEqHLYxIMTqS6JnCBz5f4=; b=JbpWAQJMf/ArZBaKY5EHdIeErlaLzBm3Y+Is3GO1B61bMdxADFcYu5L0DkLFp81UMXo3nk FR53jANCaxJ4jiKSn330/EtxVfq/1Yej7K0ZkI9M0SeVIIoWc+GPlkcqOSqdNwz7e8PuEr mreJQXdSRk2hiU6q0atIBzKdhUjp5uI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715222479; a=rsa-sha256; cv=none; b=6t79/m90iIc3C4P17EPeMXFTqFMX6N9+7LCrAemsdJWEqXo1oPp990dTwYEGTILZpgKUTX BFOuyD9qIzLIKZXWQ2dckXaU4Miv+XKGQVE1mgXGIwCSkYMtKP2xL+QK9TP/jI7ZjWyW2j Q42UITbCbOvfXRFJTif9gs01kCCBsQk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 4492dhtm051819; Thu, 9 May 2024 10:39:43 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4VZbkD2Xj6z2PGl6X; Thu, 9 May 2024 10:36:36 +0800 (CST) Received: from bj03382pcu01.spreadtrum.com (10.0.73.40) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 9 May 2024 10:39:40 +0800 From: "zhaoyang.huang" To: Andrew Morton , Matthew Wilcox , Jens Axboe , Tejun Heo , Josef Bacik , Baolin Wang , , , , , Zhaoyang Huang , Subject: [RFC PATCH 0/2] introduce budgt control in readahead Date: Thu, 9 May 2024 10:39:35 +0800 Message-ID: <20240509023937.1090421-1-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.0.73.40] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 4492dhtm051819 X-Rspamd-Queue-Id: 7F324180002 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: hmiy4yiy5uudksb7ixbm96ggx9xebh6b X-HE-Tag: 1715222478-922797 X-HE-Meta: U2FsdGVkX18BhGUv/PT17r6z9m0La7HJCy8w6LKodt6Km3QIZlLWDrWyi6SpTorSfeH24wVpCTV6hRXkcRtie4SywTseqV6BNRQPUj6HVEQGp9urTczKBVW/MXNIiSuBEtPSLlrBvts6gxSi94oClF5iw4GXTmtv+1WZBnn/iSjNsMoOI6IX99SP6iIUheU8EDHDMbogF8VxNUlPxyxvklSSB6Hn5mKxLbVeQF9tE+9802v4jc9EKkZrgIvA3bzXlNucukWueKreAfJcKtNtFg+P6oqwRz6CKxSMPjNVkd3Bxvbxgn0IVGkntmQ2DUmV6OsPQTlOzCT6Qn5ru2wn1DdBxxVE/N+4lptAYxcGUy2DzqQfUslovVDC+EpqqXB2npz0CxZrvFf7+BiE9ll81jRfwDTyBbhqfg+/f5ibwsrS4W46jo1CQ3+ia/arbKSCXOLdEQjoWeutxpFcinsI119wjns2HQUXkkjr93uFEdxRx7jaAeBF0v4BblVTS+f3z/jPeUa/2VAJaw9QF4qdHaB0ieOSQ7Klx5uc/2pQZqCqrraZ/8PaY5wwYXcNYIu7Qr6oLtSVGfNQwJU0zjHeTcT1QFMU3gd3SsTJFCBdd+sWsBH3plAGXOfhmDOk9O9IGdWtuz9K51IQpfEHq+yytaAJVAqVKWJFoDkOPlUvKshjot75HSwt7GfQACu/x/QUQriywg2mry1QSeuFzYn8qMG8yyeyoNlPDmGWK5COTl1SCjaeTaOsOdH9dGamRV82fZJMn4Ku3g0gG+7l4CCGgAAKuPg5cwVQ7rzHV7AX+ce2Yr47CIagSN2SAGG3/2qE2qzhrtrGpCBHgv0kY/mqjyEoLE+xGRESvCC1TbQ/yDMqTml4nfIyYb7FAFVN8AddTdiyfJ3nP66lI/+BQpGb87BMMURBRkpMrnVFLtXOE4KQ5JPjuzkYLawONUTueiIcXi2GPZ5hlsjnTDkMCDB XsNZAj0W rIvmF87+dYAp0zS9DGVyFGeSHhlv6sswnRf+7n2XyT3nQvtRUl7rWsKoxkJtCmv56d52whYSwvKNzNlayNR4ZEIyJpDzynYiQIYOzmjoVb81uVY3DrQVim+wxyR08MYrOdZT6t8ILaUdJueuvOZpZoIAv8rWOQWq5MTGrMO/tsjHvxBfo5MvpewOYbdNi73Xa4NsN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Zhaoyang Huang Over-limit bw value is observed during fio test in the throttling group which caused by over-sized bio as there is no control on ra->size during readahead. This series patches would like to introduce the helper function to provide the bytes limit and apply it on readahead. Please find below for the fio test result on v6.6 which presents 2%-10% improvement for BW and lat. Besides, we can also observed stable BW instantaneous value during the test. blkio.throttle.read_bps_device = 1MB/s before: read: IOPS=223, BW=894KiB/s (915kB/s)(175MiB/200919msec) after : read: IOPS=239, BW=960KiB/s (983kB/s)(153MiB/163105msec) before: clat (usec): min=4, max=16795k, avg=4468.74, stdev=265746.14 lat (usec): min=6, max=16795k, avg=4470.57, stdev=265746.14 after : clat (usec): min=11, max=209193, avg=4105.22, stdev=27188.04 lat (usec): min=16, max=209197, avg=4120.03, stdev=27188.04 blkio.throttle.read_bps_device = 10MB/s before: read: IOPS=2380, BW=9524KiB/s (9752kB/s)(1007MiB/108311msec) after : read: IOPS=2438, BW=9754KiB/s (9989kB/s)(1680MiB/176405msec) before: clat (usec): min=4, max=201817, avg=399.58, stdev=8268.85 lat (usec): min=6, max=201819, avg=402.10, stdev=8268.85 after : clat (usec): min=4, max=2494.6k, avg=412.72, stdev=25783.51 lat (usec): min=6, max=2494.6k, avg=414.48, stdev=25783.51 Zhaoyang Huang (2): block: introduce helper function to calculate bps budgt mm: introduce budgt control in readahead block/blk-throttle.c | 44 ++++++++++++++++++++++++++++++++++++++ include/linux/blk-cgroup.h | 10 +++++++++ mm/readahead.c | 33 ++++++++++++++++++++-------- 3 files changed, 78 insertions(+), 9 deletions(-)