Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3399779lqp; Tue, 26 Mar 2024 08:12:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+og3i6SqM1xZ3qM4R0wPamP52jpta66UYTuatunn0OXGuKNQQJHPJTBGBZLeYuFHQJCBDI7U9AcyH/DVuyUT8iGXfyAM7Kk6IsQi4kg== X-Google-Smtp-Source: AGHT+IHJKID4e+Xg6s7cMPMuRmVA6hNqvhO9roqSLaXUAhhYAQDRjMeLW7ITj4cSZBzEYoXk18KM X-Received: by 2002:a17:903:2d0:b0:1e0:9b1e:e457 with SMTP id s16-20020a17090302d000b001e09b1ee457mr13063752plk.19.1711465921432; Tue, 26 Mar 2024 08:12:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711465921; cv=pass; d=google.com; s=arc-20160816; b=Nt3PEaOrk3xPCtiNLkd9Z9QtseCFVS9OaLGyTVAtR/ejVplCFfn6P6VrxMc4OJjZzi 8bCIZrlM0tDLDCG//F34mRTRNX8U88kIfbNuwswXW7ccgA8Nygy2F2Q1CfjMbvekXCfF OoiFlR6canYaeTCMTeWil0mz6H52/6V/Z/p9N2EI7agIw5IdhGyxl41k/8HsL0lvurru d8vZfyZ6+r5w6r7mMD5Hc7pgKbK+sRwMeiw7uxaAQYpYy+Z4jDgiXlISI9c6fBI7r8S9 N9nP7gfZUuoP5oFr02AlbjLIdQpt60ZQVr3x3Lr8VsVfxOBeTd0/+cD5J9ddAqiqiGbu Rmrw== 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=3Nr5pbxteCfHgzj/i1W+/blhYMSR+J/eweuH6yYi/Aw=; fh=4BkQj7bEHEpPJCGIFyAHCeh1+r+ebo3THwcGxMRYBbc=; b=imBU7imZXeBDKblYKtRtT6vz9fFwyN+fMFTjz9Dpu/qJxMhKbklpRyFl/bJLUHWIKi 4XJspWU30h0APzd3NyDwa0g7+NH6+FOODG+R5HRA7hX7ICBQKkWN8pLU5kLVjs7r4wjZ QicqCn60rnQKxhpNMtskSvozzTjerq6PB+hss2ToiypRRsO2tdfcn0wwhCEtekOSdJI/ mgGcDW5SzScoupVEQ5HmSZp4PB4L9ZCxwDV8oq7lEpKPj9W5Q2nInvA8V6GiDghwR1XK 3wZ1aMsRaXDLfK5OzkHIDBCIqYA6ZxY/lZBllWT11aaJtzk53CM87UTwG3nCJUOn2cmD ke4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=ckx1i64Z; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-119270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119270-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j15-20020a170903024f00b001e027ccc606si7329377plh.388.2024.03.26.08.12.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 08:12:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=ckx1i64Z; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-119270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119270-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 206E72C6742 for ; Tue, 26 Mar 2024 15:12:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 329B913C831; Tue, 26 Mar 2024 15:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="ckx1i64Z" Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (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 BD8D512B82; Tue, 26 Mar 2024 15:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711465902; cv=none; b=I/SKZ4GuhktGZWq2ffWLZoED1fFtViV4eULpDBL0LhYUEYoh6vu/Bx/oPb05bEleVyasrmLY9Q1kwQtkgO+OSbzUHJWBgAKGDLqSy8MW3etOtnl7sa/TtCLazqmJ7AWYrw+43NmewPK7tI+mZ9jgUmPIoqoN04A4kaqpFADPl14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711465902; c=relaxed/simple; bh=WLa1hi3+Ql113gRhJTdmKN7z9fyxinYMoU43wM1KnpE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YVu7vvmxC22zfihGmHnZwHK5Ypovsbwu6XVqB3tQYxhmVB2C+iyGCjmCT2TIQb+Q0AOph4r7P5ptkyA4+njdl6FBh81VEwQ22G2toFavzm43i+5AhnZWzFBQQNLiQ5lndsoYmyEkJn3us84/vKJ/vewMbzFZekAP06bEgkHumqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=ckx1i64Z; arc=none smtp.client-ip=80.241.56.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4V3tYj0QYqz9sqM; Tue, 26 Mar 2024 16:11:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1711465897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3Nr5pbxteCfHgzj/i1W+/blhYMSR+J/eweuH6yYi/Aw=; b=ckx1i64ZvOdoSlf/gp1LfF6YwXSO3PDpqi2rnltX3PTl7K8dZc83b+H262KO0u8DvboKq3 eM5tH0MilsVxjvMhzhWRTp87YG/yvg7MZuAy2A/2KXBcTHJv9fLjURlfu5WhYzbl/sQZi5 8axc0iDbBul5pMoK0AYCN1DTKc4VDTxvYxQTf3jtFeqtOTWMugNH6btgtA8KZg80nz83kj 2nL5Hawm8YGEwsg9qDH6ITS8VVbSFRofzZvr89iT/Jy+V7TAK9EgioV5IR8V29desK0FXA 4LU6yzkA4OxIkBWQaX68XBpwc9IKaAEiRrHUKkXE8y04TB+bDTg9iy/Ul2/2qA== Date: Tue, 26 Mar 2024 16:11:33 +0100 From: "Pankaj Raghav (Samsung)" To: Matthew Wilcox 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: X-Rspamd-Queue-Id: 4V3tYj0QYqz9sqM On Mon, Mar 25, 2024 at 06:41:01PM +0000, Matthew Wilcox wrote: > 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? After having some back and forth with Hannes, I see where the confusion is coming from. I intended this to be a non-functional change that helps with adding min_order support later. As this is a non-functional change, I will move this patch to be at the start of the series as preparation patches before we start adding min_order helpers and support. -- Pankaj