Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp241670lqo; Thu, 9 May 2024 20:06:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVr7wwZBDP4zVTsDYzMjNRoSJzbxz2GUlWNBexf6Ch6EibLKC8VOewK3ec3LfegxINbZCQb62uirgnWamZQ67j3a9B5NSKZ1py04qgVKA== X-Google-Smtp-Source: AGHT+IF4J0/qQgre+MGFn0FnSAJciaIIORxlxMKYXfDhxWxJThFbS49MUEi66dEDbsH+Tq2M6fEa X-Received: by 2002:a17:906:4948:b0:a59:cbcb:1cca with SMTP id a640c23a62f3a-a5a115f2d5bmr387664266b.13.1715310400360; Thu, 09 May 2024 20:06:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715310400; cv=pass; d=google.com; s=arc-20160816; b=vt3rwpguOT6gQH/DhbW13w6iirBHC/0SSQm7TDoxowGXxEWF299vKFdOnPbtiF/4nG My4ZZsdkDDYTaHR2jKo4k36sat52T9DN1fXvfaD5ICdC1hzeY/nV8ULAf8D1wlM/fhfl mpPtBSeCMATgdCOWouYRMYLATZzDL3dTBRSy+ZdOePuqyaFDnJMfzmqhjbKM35DYm5kW btYv7Ti28ayhb5imWS5UeiJqyOl0KFTLonwDBYmkZZ4RfG44/6d3bMLfmEFllR/8wB1j wWiQitseM5cO9dm44ksu/XAwA5O34p6Oph7rNPC6zEQGk1JlpMdQaMv9iLBXd64cgmWS hQfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=OpvuySBIeO4vzs2xHm0aakYIlKfoDjkApIsuTSeBQbM=; fh=wkEBt6Ld+dHyxLKI351Y96hdoglrXYqeFVHWtbtN70k=; b=MFQIrZD26RCdtyHkUv8ROS77JMPZKiZBqm9oMhKVuppPXQOIAha5AjCDpZDagEi3yp df3pHOLXpdU0WBmDZ3YEGzPv4IPB/O9MSo/GA/EfvFhk+KZPX+ve3g3S9zUnwhKhwleN A2aMIQ+Bt5a2uR4deQVFGPXTLJR7UY3mqVoobqy2dTk43HrTStncEwy8XRxn7He2Cwj+ TCsJJEgwAzQ/k35TpvlJzhYvMcjrICZvGAMkRxpnVVTSQVPiF51QNaI5WAhBaI8WeuVI zrUGtkrFS/e6VffYG4NNVK2FxYAHoqd0RqPNTSPT9WS5l8kZsxmOxRUPwto5U5R76YC/ e4pA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fWDbgxfh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-175228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c3a1si151846966b.933.2024.05.09.20.06.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 20:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fWDbgxfh; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-175228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E7F0E1F22932 for ; Fri, 10 May 2024 03:06:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4ED4148FE1; Fri, 10 May 2024 03:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fWDbgxfh" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8827729CE1; Fri, 10 May 2024 03:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715310389; cv=none; b=GPmnWiP3ZcuaTdXDE/zyrFh6XJ2+cOoM8TOCv+q8fz9Y4HNJ3UX0fxSGyuNdB/LViEqm6SWCYUUFfOAekd9x5eK67h5FhJ4c65sfvRvnlCST3tmr31aAgK6s+KO5+s9MsWk4VL454bM2zJOEjV5A1OjisSmvVI4QDpilVnRrneQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715310389; c=relaxed/simple; bh=8xtk44jSOd8araYzrVz2AKcFhCesWZbEvqWPEiUg80I=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Kn3tabKTSLycPjjUaLTiFD6VMywmLwNwi475Bi3H3W4NCFruUMXEr2oGPhDA/1Me6JgSCR9xdzObfIFV2T3WnGtehjv/p0oz9jPUJ6SEsn537h37dFe2HnlFbD+IjnNb3thJiab3UNBCBMjKP6QwoiJy1LNDXBR9QqY0SgEOtEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fWDbgxfh; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-51fcb7dc722so1435792e87.1; Thu, 09 May 2024 20:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715310386; x=1715915186; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OpvuySBIeO4vzs2xHm0aakYIlKfoDjkApIsuTSeBQbM=; b=fWDbgxfhhAkT/woi6by21c+ITLZVKI9aoCAxK6gd21ruazKH1sAfjgpDSsxhpOtcSX EEX9c+ibb+1dQ2OTxxKe6cQZ6qOUvsWXZa5nzJQu8MGmB7QO1Tjam6tWxGi4BnHMeL58 wgZMD/M0PeHm3EG+a/nr9VGX25GmTxBxcCTcuC7qgWchbirOywvlBRO3/a4LAQOBvgZ8 pNNWmcGNkpedgS8DfOEVbMJFAu8xqOiXTVpQDvl/2xOrUzCL9LQ3maFgkub2PDGJLdtm LE2y41VzQq9n4W4jfNo5Ws1eNQiJm2yxp3OexsO5IUYLavjazwfD1eW9f24Gac/BCcTG 9gKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715310386; x=1715915186; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OpvuySBIeO4vzs2xHm0aakYIlKfoDjkApIsuTSeBQbM=; b=BVJ3en4mtGo7eS4JKdmCnohMkzVivU/VV+LSnUwU5A+PxjU+jLr1HVDATpjxAeR4vD MWX+hkbpPAmgCgOMUeXlnp8cv6QahyzBrAHthfeDDeE5khShW+dGleDiLegqSte5UmpB p5W00+9lulkdhG3elp50wT3JF7lNalMkdQYSghGwLJljEAGNYXIBEzZvuFj1uQNoh1DU P7eCxE5kvJo+5lWHefLNN/mzxrQ3a+waKZjMJvIHvlJOmkMlKY6BaG99o2QTD/r68gXd 2d23RyhvfpywlFMnGLfvG0K6//4UPZyVbLT8DWqRIVjgr2QAJKgBNFtLaAEFVo+jCaLo eQSw== X-Forwarded-Encrypted: i=1; AJvYcCWHAkR4evRgC+iXDEm3Dxf5//wsiaG4pO98MbEXrDtqePkttatuwOakH/NgacJBhBaqI0b1+awafItJFFBVJSgSP5vWBBxCm5jYqK90754Z1dgxbmXQPo8WCnVBcmfUAXxDwYxo1ekfYEoJTrWlGZQn17i4KK+SjjdtKczGlBu4SPG9 X-Gm-Message-State: AOJu0YzIFWg1fLg96a5DwmhZ1rO1IqfDObq+n4FtnUOpg+7OHk79NL/V EtVmbwGPEmVUqEAcyziWeFnZ0xyMx9NJxFa6Aove7/+yZnoR9+SFys1psx5KQK/Q15gQAfjkEBC TD2Jx531+OkHwqiAwuQmfjlJ5wxM= X-Received: by 2002:a05:6512:684:b0:51c:590f:4305 with SMTP id 2adb3069b0e04-5220e3736c2mr404774e87.8.1715310385488; Thu, 09 May 2024 20:06:25 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240509023937.1090421-1-zhaoyang.huang@unisoc.com> <20240509023937.1090421-3-zhaoyang.huang@unisoc.com> In-Reply-To: From: Zhaoyang Huang Date: Fri, 10 May 2024 11:06:14 +0800 Message-ID: Subject: Re: [RFC PATCH 2/2] mm: introduce budgt control in readahead To: Christoph Hellwig Cc: "zhaoyang.huang" , Andrew Morton , Matthew Wilcox , Jens Axboe , Tejun Heo , Josef Bacik , Baolin Wang , linux-mm@kvack.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, steve.kang@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 9, 2024 at 8:40=E2=80=AFPM Christoph Hellwig wrote: > > > + unsigned long budgt =3D inode->i_sb->s_bdev ? > > + blk_throttle_budgt(inode->i_sb->s_bdev) : 0; > > The readahead code is used for all file systems, you can't just call > into block layer code here. > ok. I would like to know any suggestions on introducing throttle budget control into readahead which actually works as a negative feedback path. IMO, negative feedback is a good methodology which has been used in scheduler(EAS) and thermal control(IPA) and memory(MGLRU). I would like to suggest to have a try on have it work cross the boundary of memory and block layer. vfs_read / page fault | readahead <---------| | | aops->readpages | | | block_layer------------