Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3030164lqp; Mon, 25 Mar 2024 17:46:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5oQt08Dvv7cIXQhjKh+Hkc0X8M4C/jVmYa7mb6s36vFQLxSdW6NSIxSu5bSg5tUNiBKP16bp2Z9B9gXg1w2BqV8jAoBEfplhGvXHqBA== X-Google-Smtp-Source: AGHT+IH9xR02+fRJwzbDorskOE7zmcuWbTHgdVGePZ8KijjIDJDWDEa+OvmPCb8pRPP35FnIXT1d X-Received: by 2002:a17:906:f1c4:b0:a45:bde1:a334 with SMTP id gx4-20020a170906f1c400b00a45bde1a334mr7302126ejb.27.1711414018428; Mon, 25 Mar 2024 17:46:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711414018; cv=pass; d=google.com; s=arc-20160816; b=GN9ZDf9XoLj4T/hJrWy1VOcGwKXebHuo8UczaiDVCHTOk3dwDlysikz788LUnfimxO Pqbk5lIBeBHfmkYoHILldlgbYwzZztW/hMtJkXxoD8Ic1bY4j3nvjbNGQhivS8mN4Weh z878ScUnC/k/XRTwCQtLQ/asEqDXkAnx9vNdzF85U8ZkpqC++KfvbX8V5UfszjoMvZDR KLipwDhRTX6JipwCQs7jBgiE+raI3IRFhq0BjDWqXc2BWKVzs4SBGcb9hWxBd68hHuno 6TMudEK1CFQAJH6KjAyiNAHgVUX9q2CKPtqXocgpN0/ALc+EwPtsBVvCtgCFMwo8VC5Q Rvmw== 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=GyHaUurcX/968cY6G8Evo8k5/1kOtA+IGwx5RE4txdg=; fh=orJjJvyEwaV5M4bBWhICE74rxtqEfPg7DRA68dX8YsY=; b=LxaJlMLcw3IE1YWUzpR+PYPtKOl+1O7OxuN854AL3Mn4jxlAYFr2xPwtrD5J9GFhY1 TJYQ+YP9w/PZNqpS/DCt4LiHdBotgb3hKuSdw5oiXV2j01HLY5BM6VLIWQCMStRhsIrJ 0qkIhdnGV5OoqXK8KIQOWjY0X3JrlgoVUNXMFz/PVfGU1ArPHV3gdq1eK3YUyU6+KHkX HMYSuRtnlhxLdNcX0ZZx7zrRYYAz3hN3PXdjahmaqiydMW/5fmGqcNgDG2IzPrC2hGBG 7Edv4tEo5IQKsItvJb1ZGSGkK/T9446xBh7BxjT5FE7b9X4zHKkguKIwSu8nRIhk5Cl9 BFKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="fshS5v6/"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-117731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117731-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i14-20020a170906250e00b00a4745954c9dsi2657921ejb.695.2024.03.25.17.46.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 17:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117731-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=@infradead.org header.s=casper.20170209 header.b="fshS5v6/"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-117731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117731-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 am.mirrors.kernel.org (Postfix) with ESMTPS id F0BDD1FA580D for ; Mon, 25 Mar 2024 18:49:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E22705EE64; Mon, 25 Mar 2024 18:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fshS5v6/" 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 8EBC155798; Mon, 25 Mar 2024 18:41:05 +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=1711392067; cv=none; b=surr+CYfFPviQSpp0xEHJE2/HtTnmsq7K9mAeJNOTCbtHiLN4BI7b/Yw1OAm9dtIOr1vsbUPGnHiWImWD2kALw2zHqP1jWqR0qQlK99l1z1YJZlD/6g//LAraLRQcfUkL1pF9ppKO2RYM4D6OerW4LQwi3ZtJJ+v4fqThkKd0Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711392067; c=relaxed/simple; bh=hl9tDRwDQKsW9LtTGgLdCiTOPJLvskJO2eBDzKut1dA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OT2Jemx0WXZ669UuQFBs7rZrl88SdAo9s4ZHDll2kPl6Pi4xGqYmKqMvWZYkagc8T6bOXQmvZWyR5qBeONnY1fvg1kpu1nKecS/WtCeexLDgsKopjZRIZ+34yGC/r1oIkvzwNaAfJNbiHVI2vTyJ6qqCOSuyaNyN06euAuBtzdE= 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=fshS5v6/; 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=GyHaUurcX/968cY6G8Evo8k5/1kOtA+IGwx5RE4txdg=; b=fshS5v6/H1+vcNiHKHJ4eI3/k2 kRvn30zyth5jPfJWNf3A0fuUTOL6O9yB+oN/BSWsTWYY9LsGxkLySli6I2ropzZIqMTYf2iCnuqKc dMdm+4udG8q2NprRt2PxtwLhazt36yuGLydUWwisVi4vgSPrrUqfKy4xX103qcloQM3WVComDJzKQ GDq2NpkPTTw3NCK3cucNAgOfLzznMYfkd25JOReAC/ZgiJnP3DFMak8UB00PbBsOGyDArFLHlwjH1 UVphT3YhFbiXUOv+CPCOs72Im93u2tyDhs+ryi1OxrYHc4TeCneP7KkMRtSjbYSshmbsXvjyTZaoT wi8fwebg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1ropFl-0000000H5As-3Ade; Mon, 25 Mar 2024 18:41:01 +0000 Date: Mon, 25 Mar 2024 18:41:01 +0000 From: Matthew Wilcox To: "Pankaj Raghav (Samsung)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, gost.dev@samsung.com, chandan.babu@oracle.com, hare@suse.de, mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@fromorbit.com, akpm@linux-foundation.org, Pankaj Raghav Subject: Re: [PATCH v3 04/11] readahead: rework loop in page_cache_ra_unbounded() Message-ID: References: <20240313170253.2324812-1-kernel@pankajraghav.com> <20240313170253.2324812-5-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: <20240313170253.2324812-5-kernel@pankajraghav.com> On Wed, Mar 13, 2024 at 06:02:46PM +0100, Pankaj Raghav (Samsung) wrote: > @@ -239,8 +239,8 @@ void page_cache_ra_unbounded(struct readahead_control *ractl, > * not worth getting one just for that. > */ > read_pages(ractl); > - ractl->_index++; > - i = ractl->_index + ractl->_nr_pages - index - 1; > + ractl->_index += folio_nr_pages(folio); > + i = ractl->_index + ractl->_nr_pages - index; > continue; > } > > @@ -252,13 +252,14 @@ void page_cache_ra_unbounded(struct readahead_control *ractl, > folio_put(folio); > read_pages(ractl); > ractl->_index++; > - i = ractl->_index + ractl->_nr_pages - index - 1; > + i = ractl->_index + ractl->_nr_pages - index; > continue; > } You changed index++ in the first hunk, but not the second hunk. Is that intentional?