Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp322282lqo; Fri, 10 May 2024 00:19:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXD4BLWIRdFwKkwbUdhebIjtRcLpNwEnQFBP8xFx17IAtoP5F7T+hzabEYRdX3qvOC31FTkzfqgI/hvQwr5csviLKz9pke6uospXYpPag== X-Google-Smtp-Source: AGHT+IH6iEXt7mVcF8t/0/pqBxtyiIt4mz07vWTfLdwlshX5Xu7NPFMt3i7IaLj6ZNWdYU2xJ6Dq X-Received: by 2002:a05:6358:c015:b0:17e:2943:c75e with SMTP id e5c5f4694b2df-193bb5197b7mr190098955d.12.1715325573582; Fri, 10 May 2024 00:19:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715325573; cv=pass; d=google.com; s=arc-20160816; b=UQ09YIvwFhdZYuSTNDMaUhH3i+jyTNQwjo+HQZ14s87/yvNmusSo5ZAeRUZKajHvlH JZjfZW9m5692ItPAQyGs8RrNiFfgAOMUDrxVGunTSa81kPTV1JTvLu+iC8lqzMQxsagc BvXpQgxo5D5j9aNyyGijfvPfdayRaAAmRRDWFjAvbZR6bDkIFjcRW7QnoDzbhFw23Dqg nehcT/nIKmdq/bSjhiFSp4CQ6jJbQWHYrxmTyaqul7vevaNncLN2pXOg86Cky5oUldrY tIOgOTPzzkTABrfAhPcXGZ60XVjJTSgDR373nLVXt/NxxS7+vZEu72S0WRq54+jF5D2T rTxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qmAXbJMEtBWvZ+lBO/0Abu9PwbNNUeRaerpScRMSK8k=; fh=DlOgxzh5ks7IPnngY9pdLWQvZUmoBPoiIt2Q56v1088=; b=Mq5ELvX5GhyGH6KKRxibyFE6UkWsUmwLOtq+/0PL/z3pUf/PzNgDGrDnZFYztD8kZX aB5VwT/OeE1dDvG0qUnVX4PB5jszpqvpfIb4iwKXwZfTQAfymIyQCaaVRNCvCesyCuiK bZO4h9RNBeQSEIpFZnsdST2e1lxrqOkCb1RE8/wAGtRJqVthoZxZ/us7PHnqpg3Ok+LU kZjepdkXTA+9ods6j2jRK/JQhSULSvVtCF0dJPmtW7FxAS2kg6O/lpN2vHiR89QFUIou mdXIVVlw21KWx9klvt3om4P/9RcwaBHnTEnKqQkGlbMqMm2+OTH3ergcMBVZDkoJHvWp 2H9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Q0KGq4l5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-175272-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175272-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-63412a4da88si3032944a12.701.2024.05.10.00.19.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 00:19:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175272-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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Q0KGq4l5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-175272-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175272-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 B4CFF282BE0 for ; Fri, 10 May 2024 04:14:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68576149E07; Fri, 10 May 2024 04:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Q0KGq4l5" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B7BE6148FF2; Fri, 10 May 2024 04:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715314469; cv=none; b=pKokbRWpOrdKbr8bPoQRTpwqfP6sFEMipnki5ZkOTqk59Td90VsrI7kxpskNssC3NV8KxVR1mgjBGLKECTisrbuHaDkX85ncW/ELvQDI/QPyUqT+UScDaYfZ9X75mE8obglAC9tb+FFt79uWJXUJJEjaQn1uHuWs+qQqW8jU5+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715314469; c=relaxed/simple; bh=POEVGQkIDGey8i2b8b6rAWZfkiTdHx0do0eQTTK1dsg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GgyG5KQKSvAKgeBEZn76oNwEYUi7Jb014jJU6SbiNDPiWwa0Bl2KwcbROUKpC0kSGX2V9f8kM6iELwK3vXVYPBqoiVkV+60f4+i3eV1EIB369Tf/oocK9MvsxtrhGHaDwdmeLFkxvKS4CH3aDUTjg3zYZtXm8I1EIgF3FyUsRoo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Q0KGq4l5; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=qmAXbJMEtBWvZ+lBO/0Abu9PwbNNUeRaerpScRMSK8k=; b=Q0KGq4l5svbfb8bV1B8v1oX3fN z8hLxrvefMZU5s0PK9znUQTBe/rylZSu2vbN9Zu+8J1TqMDBEjbe2xGv1o0B51Hwn5t63CsxIkdOm UFpuolw9Axa2f2tiHBZXaCJvLCsehr8B14yD3v08aDj9nNRdJQ2AB2TcnB6qI7E7P8OMmIEILOgve 4kkn3FOhteQongeGQes35W64tRtCxq4wZFiLvPhr2TxRLO49BUus5Y4bNlmiJfM+5AacdBYDFTJVd uIdRo15ikOh8CvHJml64znveMysZiE9mjmNPkM2+qz+iZa+Ac2eLnzDLTCoCoq37ym4B1mq/d8iOD FCoAXokA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5He6-00000002Dzz-0hY4; Fri, 10 May 2024 04:14:10 +0000 Date: Fri, 10 May 2024 05:14:10 +0100 From: Matthew Wilcox To: Zhaoyang Huang Cc: Christoph Hellwig , "zhaoyang.huang" , Andrew Morton , 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 Subject: Re: [RFC PATCH 2/2] mm: introduce budgt control in readahead Message-ID: References: <20240509023937.1090421-1-zhaoyang.huang@unisoc.com> <20240509023937.1090421-3-zhaoyang.huang@unisoc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, May 10, 2024 at 11:06:14AM +0800, Zhaoyang Huang wrote: > On Thu, May 9, 2024 at 8:40 PM Christoph Hellwig wrote: > > > > > + unsigned long budgt = 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------------ what you could do is have blk-throttle fail bios that are tagged as readahead if we've hit the threshold?