Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3212941lqp; Tue, 26 Mar 2024 03:00:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSB7Elny5XbRSERqrMDipynkALGVt8RRfdxWGWwVuTV4PPXJJmLQegF/lXCGRWsYj/YSgVMXcJ3xv221mEA4KvBDoReOedSpf6gRetKw== X-Google-Smtp-Source: AGHT+IGYp3988q8XuuP0M+0R+mWZx+JUFBpv9kNTZTH9hOjW68lHJsFX/LnakLQN0+SjNSCiZtJ4 X-Received: by 2002:a50:bb2e:0:b0:56b:d013:a67e with SMTP id y43-20020a50bb2e000000b0056bd013a67emr896109ede.18.1711447245154; Tue, 26 Mar 2024 03:00:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711447245; cv=pass; d=google.com; s=arc-20160816; b=BDQ3ErgznuaItatyaad+WRQkrT0wuzng8U/z6p08+/afwFgUtWXofuOjLPs6r5j3UW zrhhrrV7rh7GTIa5x5o9V7EGFCopWiJNYyrxcN1vy9B9d8nPuR6zGMT9GcTk0rE1BSWN t46hLiXPVJBLOh4fy5QJBMtuODQ7PabdFM1YODmd+t05B6pcy8fhgVW0zpLT/YEEKQ5d zvXieHKJEGEH5i8rnWfoV8BKshH+rZxG63XDCcHP58SAlUukryAjtw0QWDFHpoj4bl7n RJhf6QfxReFc3fUJoh+9rauf2BOlXyNcahslBxhBDEGuzValvMpaWypN+Bwh5St4vTjv 6SYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=KICT4ootVVkt82VIPFNRhNaswFEFMB6uWwwdlc+odyo=; fh=4cIezw/um9SGWPEZOd6yLbPdrUMvYirCE/i7e+eADbI=; b=u6vO3dKv2qCtO0GUrdTYjyEGI/ldzMg/qxE2dCc5TXi9XLKcXaEzqHMOHGhmajPvJQ yRijIAykWNZXo1A3g/QE4TbVdR4nIII+Zz084Qyu3FRMdjAPyVWL/QiVamTROOx+mK1e b4rMzokqQBYijem/V8+fP+0hjYOubYEBp/KEpSiWLd0ooGBuKgylatF0ZD7xsEgzQsch kDsKLgMxjKMO+Id3RC8EcqPENdJt+ikOxSPieGKMQXgcw9//YpGPzYBKk11AFZ0TFFME bbfhb+G9jVSJWG9ioub0APP/GrZwQFHFH+N/TlpvOa25cnI+IDGZoBAj/4PWj3JFhPEq xLQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=UOznrKGV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=UOznrKGV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-118730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n13-20020a05640205cd00b0056b9f7393dfsi3578827edx.214.2024.03.26.03.00.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:00:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=UOznrKGV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=UOznrKGV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-118730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 D5E751F3FDFB for ; Tue, 26 Mar 2024 10:00:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3447054BF0; Tue, 26 Mar 2024 10:00:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="UOznrKGV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Nifv0FZX"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="UOznrKGV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Nifv0FZX" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 99992487B5; Tue, 26 Mar 2024 10:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711447231; cv=none; b=MGzi1z18QPNoQw9McJcxCLA+1msLvlg8ozJ9LEtL1Ie+8pZfBOKVK2UKJVHVChBSqKe6ikyPPcVkNCymo5mwI1i3n0EooVQwngyPR554eIdOVjvuEj9my+HVfU/p+aJhmLNrdw9TgMMnYzulnqfsJY2FgqQxUGYfZOIkjhRAMEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711447231; c=relaxed/simple; bh=XJNsynjzhDj0K6HmxLv28+YnYkW2HnZhhLlHe4y7U3k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IaiAKgn+PsDl56UNnHEnrkwZ6QndH2rjHHz3gvvX9X2hWhQSJ6GGmDg9qqmP9/uBpLuf0Y7bRKuUp4SI0oqRFsbiqE6BlZrD5umW2mzn/VslllUiWgvgn2FYaJiI0pkMlxBGkQlSCvNeRaPu32VCtaG7zttnSROLcXUrWJ9Ha8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=UOznrKGV; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Nifv0FZX; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=UOznrKGV; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Nifv0FZX; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 578B55D41B; Tue, 26 Mar 2024 10:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711447227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KICT4ootVVkt82VIPFNRhNaswFEFMB6uWwwdlc+odyo=; b=UOznrKGVKIfFw2Fuszv5rYbTxsSo6NUggGIl4qc4DEs4/FyktjuYR8w/28z9wRcXhmp5DM yuDOfmvFfgFCmZqQuLpc940hGiok4U5tIA1OnKTWVm8hgbCxN1xChmxDD0tz78xhpYhuoV Y4rO/xz2+NyOS6VhgXYbMjfCH5lhB/s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711447227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KICT4ootVVkt82VIPFNRhNaswFEFMB6uWwwdlc+odyo=; b=Nifv0FZX88quizLkdpQphaS7PfqMVM9ArrCcCEpGk+35zdfozitUjml3zkzOyQKwHZ0nLb McctA9slEgNiv+Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711447227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KICT4ootVVkt82VIPFNRhNaswFEFMB6uWwwdlc+odyo=; b=UOznrKGVKIfFw2Fuszv5rYbTxsSo6NUggGIl4qc4DEs4/FyktjuYR8w/28z9wRcXhmp5DM yuDOfmvFfgFCmZqQuLpc940hGiok4U5tIA1OnKTWVm8hgbCxN1xChmxDD0tz78xhpYhuoV Y4rO/xz2+NyOS6VhgXYbMjfCH5lhB/s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711447227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KICT4ootVVkt82VIPFNRhNaswFEFMB6uWwwdlc+odyo=; b=Nifv0FZX88quizLkdpQphaS7PfqMVM9ArrCcCEpGk+35zdfozitUjml3zkzOyQKwHZ0nLb McctA9slEgNiv+Aw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1759B138A1; Tue, 26 Mar 2024 10:00:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id uMT8BLucAmZfeQAAD6G6ig (envelope-from ); Tue, 26 Mar 2024 10:00:27 +0000 Message-ID: <3aa8bdf1-24f6-4e1f-a5c4-8dc2d11ca292@suse.de> Date: Tue, 26 Mar 2024 11:00:26 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 04/11] readahead: rework loop in page_cache_ra_unbounded() Content-Language: en-US To: Pankaj Raghav , Matthew Wilcox Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, gost.dev@samsung.com, chandan.babu@oracle.com, mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@fromorbit.com, akpm@linux-foundation.org, Pankaj Raghav References: <20240313170253.2324812-1-kernel@pankajraghav.com> <20240313170253.2324812-5-kernel@pankajraghav.com> <7217df4e-470b-46ab-a4fc-1d4681256885@suse.de> <5e5523b1-0766-43b2-abb1-f18ea63906d6@pankajraghav.com> From: Hannes Reinecke In-Reply-To: <5e5523b1-0766-43b2-abb1-f18ea63906d6@pankajraghav.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.994]; RCPT_COUNT_TWELVE(0.00)[13]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO On 3/26/24 10:44, Pankaj Raghav wrote: > Hi Hannes, > > On 26/03/2024 10:39, Hannes Reinecke wrote: >> On 3/25/24 19:41, 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? >> >> Hmm. Looks you are right; it should be modified, too. >> Will be fixing it up. >> > You initially had also in the second hunk: > ractl->index += folio_nr_pages(folio); > > and I changed it to what it is now. > > The reason is in my reply to willy: > https://lore.kernel.org/linux-xfs/s4jn4t4betknd3y4ltfccqxyfktzdljiz7klgbqsrccmv3rwrd@orlwjz77oyxo/ > > Let me know if you agree with it. > Bah. That really is overly complicated. When we attempt a conversion that conversion should be stand-alone, not rely on some other patch modifications later on. We definitely need to work on that to make it easier to review, even without having to read the mail thread. Cheers, Hannes