Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3215028lqp; Tue, 26 Mar 2024 03:04:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXplNpXN/kxdRfsS7qKDs2bnCc3HY5eKiEmji8vc4+AE1xh4NlVGUoFG0fID2bV1Ws7ZfElgnHOQPkACJi0nAzZHp+TWUuJFzkCz5sZmA== X-Google-Smtp-Source: AGHT+IEzYXbqD2sNe5lei1uiDlLzt4+XsOisNZoqdAOB8BsR9bwLlqRvTeXZyglDXOiHbZn5J+6D X-Received: by 2002:a17:90b:3d0b:b0:29e:80e:96d2 with SMTP id pt11-20020a17090b3d0b00b0029e080e96d2mr584385pjb.43.1711447451193; Tue, 26 Mar 2024 03:04:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711447451; cv=pass; d=google.com; s=arc-20160816; b=wdIA0x1uHrWIUVo8hoqRgf8CZlD5XuWULb49VKgG5NlOk/rxwapYXPoJ8xzAr41QYa GAtCtxV7OWC4JV+Ay8Hagen3U6V5dp5E1+zcVUqC49D04DiqSYFAxcoG8OSZDleXNO81 1scpwlL30fzs+ZuyfYDuR5RV8VIDk3JXdPUZxos77X80OgNzwjT+r8MhYtGb+f4lOqU6 wYUi6sSlGfJrmuhPBTkN8p4hOtiAIceI4t7VHZFGasDVPRTpaVOGXN6PxLtrL0G3TxMW n5S9xIpYMwK0eRUUqjPmRO9IYcQNUENNSO9nSr4SYmkmIpIH/VMcs+wej9Cd/zVvGMGr S4yg== 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=kGl36ZnVCOBSUYs46//SH0vHjzvfLhWPNt9V5YwfBJE=; fh=iezwsc2sf0oPT0zXTXZKkQwTRu/42Go3deg5bO78H28=; b=jpYM4nzebnGs8EqrGbTHFHN7bfqvSqWkloQ9Bd/DEyfmT89fU+tmLMz7dwkdZdqWns 4e+Xlxa0im9kGurLvPpx8ZUl/kRxhmLd8Lx2vIV4RXVQLIujCjAM0GUAiYVvKzoZMWQq JrgTKVH/gZhYusQokOmCmW9OxVRF3asRz92ka/hcgU0f3PqL32Yu3r6yJMfAF+hrHZtx zMh5doioYWcZGZJwzOv1Umr0+4E+OPRvXUTCZOxWuN1yUBjajtDfVKtbpqmsyOyiiAdm 7CnKv6ZLHJNpfrlwrdCQYel1RWYtHX5yZ3vtdPGin1/tPj9zMXkrZ3R8FdgvetEn+6a/ ty8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZbIU7G5D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZbIU7G5D; 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-118698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bt7-20020a17090af00700b0029de0d08841si9207163pjb.39.2024.03.26.03.04.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZbIU7G5D; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZbIU7G5D; 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-118698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118698-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9B6AAB26545 for ; Tue, 26 Mar 2024 09:44:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BA517353B; Tue, 26 Mar 2024 09:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ZbIU7G5D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="a0eJdvzO"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ZbIU7G5D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="a0eJdvzO" 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 284D471723; Tue, 26 Mar 2024 09:39:07 +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=1711445950; cv=none; b=chMBBIlNlwcgqbH/ILsY5syZJH8+pSPOF3aoCpkkDtY90APNQE1eywiqyL7J5sakf4ePppDz/2oQJIOun+vI6eXIZ19TGEt41dN/oHtlvOmkKfSjWEvRiS6uCyZzz0dOCg65p/u6PtsC24e5qntsb7obn/BucVf/ppQuxWkN3KI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711445950; c=relaxed/simple; bh=LIcVoQTdCH6pdWydpKG+x/1RlQHFfp9f/AqkxkYf85g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AUtKYYhAPKCSRq9/ocsSZ1CmzS6LZ6Q/KU69A4PUlvFZByLxSXyZKVLjFNsFO3kkZaZOHZNipim0q3EP+IklJy82a1CHhGZ7bfZYp9Lr4yVaIgsKAXwc+Q/toSx4aQ87NB54vT0py4IBcHi1tswQlS2ne77BfJ5qL4Tc5J2N3II= 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=ZbIU7G5D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=a0eJdvzO; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ZbIU7G5D; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=a0eJdvzO; 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 [IPv6:2a07:de40:b281:104: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 F31485D3D7; Tue, 26 Mar 2024 09:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711445943; 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=kGl36ZnVCOBSUYs46//SH0vHjzvfLhWPNt9V5YwfBJE=; b=ZbIU7G5DkSH+jpZAFdb+J2b0NX74xsnNDpOY1ITDpfwH4Bom+dmZlmUihPYQhqYaG3gt2C hcjA/Ko4BvCTVTFS8bxlYEPvbL7ukootV7TjUPVG8ZbHtpG9nDe8n7w7TtpNcedHFpuzeE maTDQMbsyjlVmrGkoLdHQcP5sgMYyK8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711445943; 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=kGl36ZnVCOBSUYs46//SH0vHjzvfLhWPNt9V5YwfBJE=; b=a0eJdvzOIyEJSe9rsEYCU6FGOTEjDMObliszcUoPG1w9ANsSUmhK2+hgDcueK2UTQC+asC 0+wSYiwa0SNXwBAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711445943; 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=kGl36ZnVCOBSUYs46//SH0vHjzvfLhWPNt9V5YwfBJE=; b=ZbIU7G5DkSH+jpZAFdb+J2b0NX74xsnNDpOY1ITDpfwH4Bom+dmZlmUihPYQhqYaG3gt2C hcjA/Ko4BvCTVTFS8bxlYEPvbL7ukootV7TjUPVG8ZbHtpG9nDe8n7w7TtpNcedHFpuzeE maTDQMbsyjlVmrGkoLdHQcP5sgMYyK8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711445943; 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=kGl36ZnVCOBSUYs46//SH0vHjzvfLhWPNt9V5YwfBJE=; b=a0eJdvzOIyEJSe9rsEYCU6FGOTEjDMObliszcUoPG1w9ANsSUmhK2+hgDcueK2UTQC+asC 0+wSYiwa0SNXwBAg== 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 AEF96138A1; Tue, 26 Mar 2024 09:39:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id EEwMKbaXAmZpcgAAD6G6ig (envelope-from ); Tue, 26 Mar 2024 09:39:02 +0000 Message-ID: <7217df4e-470b-46ab-a4fc-1d4681256885@suse.de> Date: Tue, 26 Mar 2024 10:39:02 +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: Matthew Wilcox , "Pankaj Raghav (Samsung)" 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> From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ZbIU7G5D; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=a0eJdvzO X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.78 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-2.28)[96.64%]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[13]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from] X-Spam-Score: -3.78 X-Rspamd-Queue-Id: F31485D3D7 X-Spam-Flag: NO 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. Cheers, Hannes