Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp881461lqo; Wed, 8 May 2024 19:41:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWg/iZc3D09QxNpvB9EqBytt7HYN94KCb1wJ8pvQtCe9705SwhnGh8ZzrVdk1Y+aamvF44rzfRWd90gGC3lrd8f5a9K14qa8MYroM1mUg== X-Google-Smtp-Source: AGHT+IESOkn8zKjxn19WX4btWgT4AD2E1JkTGCYzSeERQ2blBqqeLTG38PfRLkPBSOsFwgXZ+EFR X-Received: by 2002:a05:6e02:1e05:b0:36c:4f8f:d01e with SMTP id e9e14a558f8ab-36caece751emr52607385ab.19.1715222500380; Wed, 08 May 2024 19:41:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715222500; cv=pass; d=google.com; s=arc-20160816; b=fI+QXHwsJQaPzqTkwct7ejdNGSoGjNc325ya/StkLc6v0WJBkTVdf30AhjVXx3ZCni 9CW7sbxWyeFQ222ot6s7drghiz+NTm5trPFH1PgdLhNF+JqdymASJidm+/dZUJMO3reK 40WHTDOZ6hvrm51mkWwcKwghaYVRdJLeIh9qnSjD7abc5TirCr9JAkousuJ2RK0CXM5H fMAsADNVD2NO++7T2ejl5wqqYZhBb1dRNyWLi4fRrcQyF4ckOQinow2753bJ/nK+QghH V5IxeaYHNnfLtsgCadoaTjCGQXbTNUYSpjVsUpcoWk8wjBykFWiheTb7oAb7dXil87qq I8Gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from; bh=EzZCz8uKCvyMlEBeYzzF/nbEqHLYxIMTqS6JnCBz5f4=; fh=aLp6JX2nQZchPp4bZbB1BXrBVzPzKjcTx+fC0wO/zBE=; b=QAEk560Ne/c1PH65APxuXk0+RRKfgZGRBv5x8KTOiuClENjrQvYk6lH41kn7zrSird 7CccY7WbSzQMgFd4q+e+3FACYcCB2/yFRyFrwWntNSV7Oc50YqU95Fu2LXaaIR2bXC5M IFiP6s4YoH4x8LRtf4t8preP7MonIaVmnzYJenymeBvnYzRloZgmid4jmVUQ6q7S8BmJ aFORDU2DvyC4Ph/pDpQlnoTxcbRRaa3gYJmnv79uVTWliO5UuubZk+HNJiKHQP3STLae MJC5LsmWeJaZFKZTBx7pnmW9i6NWIJZIh9zLj1ov8GQv5eQNA9C71N1yXvWs/Mm2CjEt g2Jw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-174064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174064-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4d53asi437652a12.654.2024.05.08.19.41.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 19:41:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-174064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174064-linux.lists.archive=gmail.com@vger.kernel.org" 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 C7FED283B83 for ; Thu, 9 May 2024 02:41:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8495146D52; Thu, 9 May 2024 02:41:29 +0000 (UTC) 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 D616C146A67; Thu, 9 May 2024 02:41:27 +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=1715222489; cv=none; b=bswlfNKitqleiPccwOjuhx/0yy6MorYZB/CvQmMPaIv7pHA0p6Xp7a+mNgNbcroKCLe0eJ/5ClP5yGYqGNPsSy7shKyTOPMb22ZXNhkz8xrgfFmIZ+NnJ82L6hd2Ror97OoLuHQIrjoehudAXvi5bvc2r4UhX7tlx07J+vKGxjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715222489; c=relaxed/simple; bh=lEewC/Whf/QntDU1BLQrxCoQoo0Ce9K5wSuMQsc8PaA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oh7SSBkqLoD9SLw2i+iDiSze5wsaD/P97iYCRBq65uQeSmHpfwOrRiPtilrUIoUBsjC4lqtIE94zh0Gz9RVvPpyj2+aDrcGwNs/05pc5HeXJGCrMIXY1K5A8AqM06MF0OHfvIRhJt8ts2CyXlUCUsCX6sv9XCPNQe6OrEqCv6Ww= 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 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL:SHSQR01.spreadtrum.com 4492dhtm051819 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(-) -- 2.25.1