Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1479184rbb; Mon, 26 Feb 2024 10:25:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXdfKgH4nkbCVXAe5P3Bg3orDgFkbzNZrZRVbQhXy41/N3Byz9cXSA/OufqgiFWbvId0QzuQffBkNxHCrhPL0TxrKiLJjP6sIQKIB/SeQ== X-Google-Smtp-Source: AGHT+IGWNmZZ0K08JkslcXhPkn2rQ+S7I/acYtsO406moL2Asd6JhgCYBZuZk/ZQjdIcptqVh8uI X-Received: by 2002:a17:90a:9293:b0:299:8265:ec70 with SMTP id n19-20020a17090a929300b002998265ec70mr4775347pjo.16.1708971955862; Mon, 26 Feb 2024 10:25:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708971955; cv=pass; d=google.com; s=arc-20160816; b=LfPS4vBnsACxT5sLrI9l2R0nFbc8PKi7q9WD3iyTFrM7e106yn60xDaoB6U14M4879 KOQs/J6SyiIyC4NsombU35QwXSHg5N/QTjKyYVySQC788r60d2KZ66GhXsFDL1+OEcw4 c6+x+LaXQUM5R/zpRMfDPjMMGdDGlca6XcAhAhwXRULau4DmvThnM+++EzfL8C25hzYW rRiH1T0YeQbVrBkj2z/KfHvOR4Yuc9FiA5WolHM8eImxyfl3tMxKilUomUy2UbjXK+mB MJW5mSEC1VWvGM+Io5eYt/qbznds6qkdy05jER18tuHN9bGUyxbEySL/ImQr4Tg3pv3f lxxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=c3UKkTKYCLN0pQgtkmF5pW4a1ghAwfGWMKL7VSuA/Bs=; fh=IrswWLQdr8RUReWLOUl6bTv3Gs7y0bSQu4ieH1tZUiQ=; b=TVE+xR13H5OIy4F/OvvIUdGTySKZNvZWt4XSEqRRJMFQ6gAGw3e4eBXn+Rgfwu0G1Q 0msXXs2m4szsEJfsmU+Sj4QcZjZivrK9IQM3GYd3xfJUpBg30MqP+dFF6kvnoA6xOGtw 2gICSAOPX+DVZeoHWuY58xd8a6qQiPMH2oGZyP4sxV3vpMLSx8cWGVHieh4e8MZJEQxk X47AwRmsjqKBru5nl0EWqbYAEHJS04NJNR9XOEj+0AorrTZIimv/2gXU3yYjAJuanSMN FunjKG7IrYyX1DDiqH8q5SZN13js93OAtWOMp26vrd0ffQ7cWndkZuWKD0Ho1J/NOGKm EpiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Gx/LvP7E"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-81735-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81735-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 fy8-20020a17090b020800b00298fdee2dfesi5991087pjb.165.2024.02.26.10.25.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:25:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81735-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="Gx/LvP7E"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-81735-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81735-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 1208A29B5B6 for ; Mon, 26 Feb 2024 15:08:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6A3612C81F; Mon, 26 Feb 2024 14:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Gx/LvP7E" 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 7889A12C804; Mon, 26 Feb 2024 14:49:06 +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=1708958948; cv=none; b=ZB6XWj+Az0JU8jFOrkyNYv1QMxhamOGXuXAhh1O9rlnWeivbW7mnPoVSCh0i5qrhjUCL2DbMIEphnQB7reXAnb4CaK0Q6xGJscdqqIwmPWpMTEOq7GSaARzEdxvDZrIU2e4+RekI0uGrueFY3OsFU3P7APZcNdhL+ccENutUJIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708958948; c=relaxed/simple; bh=iexwL/htgFG+8RrlWlvApOzkhPjXDjcxRVDjmf2Hkos=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r38T+qhgBs2CfMBVzV17f0on9tD1O0jM8SOsdfZFhGquIMzYanU/1SEEiFhlKbvjST+KsMrGc94DFt5HmyzH7BIeIxZgbBpGNBRg2jfr3hM13GuGZ9dGhxKd9JeM1gP4C5BsQj7biAe+wrw4saIFgOfUCpnaWZ2jMrnog93bJJk= 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=Gx/LvP7E; 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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=c3UKkTKYCLN0pQgtkmF5pW4a1ghAwfGWMKL7VSuA/Bs=; b=Gx/LvP7E9EXUucEHgU+fzRNAZL igMHh+WhwMi1IZrFWTebwuVbrmsubNVoNB52Nq/mM/Gs/B+zwQSPn+0aaYo+tVc7ytsTJ415EG9Z+ ozcwirimTHULZHZz17ru0C/ShAe1F89BhUFoB8F07HRrZqAHi4MvxnhHF0LX0mrlp66dorftyV95R rExz9aL8iQBVltDD6d5BaSfCj6oSj/wUHJCHcuugD9xdbULnY1EuJ5zI0gtQwfAFFkpEZaFR2Nj3z mTdmW6gwowyJZ9ukP9jM/MczICkkTgPl2XnUQSGDA+jx+XDr6p5QH15fyRON+2iPV3LbflLpQjLjT IxGOUHhw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1recHw-0000000HQQ4-2qeY; Mon, 26 Feb 2024 14:49:04 +0000 Date: Mon, 26 Feb 2024 14:49:04 +0000 From: Matthew Wilcox To: "Pankaj Raghav (Samsung)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, ziy@nvidia.com, hare@suse.de, djwong@kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, Pankaj Raghav Subject: Re: [PATCH 05/13] readahead: set file_ra_state->ra_pages to be at least mapping_min_order Message-ID: References: <20240226094936.2677493-1-kernel@pankajraghav.com> <20240226094936.2677493-6-kernel@pankajraghav.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=us-ascii Content-Disposition: inline In-Reply-To: <20240226094936.2677493-6-kernel@pankajraghav.com> On Mon, Feb 26, 2024 at 10:49:28AM +0100, Pankaj Raghav (Samsung) wrote: > From: Luis Chamberlain > > Set the file_ra_state->ra_pages in file_ra_state_init() to be at least > mapping_min_order of pages if the bdi->ra_pages is less than that. Don't we rather want to round up to a multiple of mapping_min_nrpages? > file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping) > { > + unsigned int min_nrpages = mapping_min_folio_nrpages(mapping); > + > ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages; > + if (ra->ra_pages < min_nrpages) > + ra->ra_pages = min_nrpages; > ra->prev_pos = -1;