From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D9F5D65527 for ; Tue, 26 Nov 2024 16:55:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DBFA96B0082; Tue, 26 Nov 2024 11:55:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D48B56B0083; Tue, 26 Nov 2024 11:55:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE92B6B0085; Tue, 26 Nov 2024 11:55:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9D9D06B0082 for ; Tue, 26 Nov 2024 11:55:40 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 23E5E120EFE for ; Tue, 26 Nov 2024 16:55:40 +0000 (UTC) X-FDA: 82828847346.09.4E18184 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id CB6B240003 for ; Tue, 26 Nov 2024 16:55:35 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=C3OyJxhw; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732640136; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tPsdjbpH4KrZ7VjJrvC7Z+8yrw3XNOthduOr07lzPY4=; b=UUxlvICaIMQ7P4uiz9leLfOgHGnTx0kWgtDF2jH1dvweVjBzyY5QPHixS//EE4KB9RThqP XwisqfVHRNK/5MEmyK7hHHWns8K6po2nEoUNEod8pusHIKon1e7Ebi7xe1Rt61v1ARdh2v sthfrYU8t/+2EUJXjXZbbV/qe8uGZBE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732640136; a=rsa-sha256; cv=none; b=ux8Pg9LmQZIMUtbtLB5PYAYooCUBSAMer8y/5QTM0d09A9TNgvxQjoCxHe36pR230QALKF Va3XvDD/fX0U7FKiqOV2zg1k/8HHQDfrjgIFyZkM4ZrfpgAoOHp4O2so3/W0PxgPDItSYX CZmh3aAVMpxLX/i/U90Cv3DouRJFoA8= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=C3OyJxhw; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=tPsdjbpH4KrZ7VjJrvC7Z+8yrw3XNOthduOr07lzPY4=; b=C3OyJxhw6Gkjv74IJwN11by+uL +OPjlPpcUN4X035iTxfQrqjK0S+J+paHb4Eaqxq5xhy2lZllttZSXFPK5jP0DSIc5/+YuzeSt3h55 Wu0whn1fufvvr2lwtCIMOHt3bq+tsTyEY7tqDXESh+96gYGuqGTu0LIrvv81RLD975dq9n9gpKdNK brL0zcDSvtZXZSEPt0HNJhLCtxBrRKdUiibjsifNt7rmr7dfCrOnJ+Q4C0IRj53KyRv4+Hri2ldc9 ity2Z76mVG0llOxHIayxzm0JWB2qr3SVcGuhK6kUy9iJbRu7YC4QMX5YfMj0Bs8MOQwR89S7D387I c6iSvTFQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tFyqc-00000000CcE-3Loj; Tue, 26 Nov 2024 16:55:34 +0000 Date: Tue, 26 Nov 2024 16:55:34 +0000 From: Matthew Wilcox To: Anders Blomdell Cc: Jan Kara , Philippe Troin , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, NeilBrown Subject: Re: Regression in NFS probably due to very large amounts of readahead Message-ID: References: <49648605-d800-4859-be49-624bbe60519d@gmail.com> <3b1d4265b384424688711a9259f98dec44c77848.camel@fifi.org> <4bb8bfe1-5de6-4b5d-af90-ab24848c772b@gmail.com> <20241126103719.bvd2umwarh26pmb3@quack3> <20241126150613.a4b57y2qmolapsuc@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam10 X-Stat-Signature: w98kke853hxfxizum5huwtwhtu11mdx9 X-Rspamd-Queue-Id: CB6B240003 X-Rspam-User: X-HE-Tag: 1732640135-708844 X-HE-Meta: U2FsdGVkX18ddZTxerlXB+j6sxbbVvIXomyWVLAtWj/SEJVRJ9LE/6JUsxZsmklFYHoYhIhdFoG5D5CBIEfOVxEKfkj4vDjZnV5DnLpeQhEVb/bb8zMWes1Xk745ijNKt1KTsnq3Yl0r0tvVvNdMPjuWcHXZS76dQCEcGtJvDmFklYqsyxMv7m2KmsjMmSnQq9R5DfybNP9OckKg+dcH46yi0B1mEpFk/uhhkoQ0nuhzgmKy0WYCWzV8wsw0VV6huIOphoIJS1XLr6Gn+ORX6spb3dW4VLn7ibjlysFeTVWyqJbGCwYnvBBa58qHEP6cI+P1zK8w8kvwAkD0gE6fEoMZchokd5J+3szYyZ7uJYGNy1ZxBVRWtn+OC78nJd6M9XSMF3Hd78pSuV3Mxt+5cwq/1FcKCp0VZ56qHwzEe0izeJsxmURaSCG7ha5+d85okEcA2snRdPRFRAMhcnKisyPPT1quSPZHYAf9h7GxPaW0dbC5Y6csUkBLEokm3SfXXxIaOdgPjFcI4Fxk6l7CBtbUrjqcL2jJhmYMqADRz+XBXojumb952kjy4QWH/jJKJvGhSuMczNjHzDUJwYTMH8Rzhqrm3YbfJJm1GjOHuNJq6EaOOthQkZSvAmzRnMxdHVPE/NDmORv7ZpDxyw7tA5sAl3TKYKvHy+rqm4Fz3SDh+Z19Qo2Aeh4a6cnNIwtGW+tBjuuxZ17X9x63eCb35400dzEoIpuO12tKbhmTke2hnwD+cyM+nquyU7HX/cz6J9KFr8hBChttv6mSrf2PfHdS0oFFXzhu2n5R7MxL7mESrVYNOLRokmxzSm4piV8ZVvm2E6FIHVYZgcBNsXch+luioYACA2KVCBybtowWF2fAFTdrVk0djtO4RR6iAVsf5drJBJbMQmiB8usp04JtrgstJQUd2D5EiDyIjqJaGz5hEP1plNBQcf2EVdy11H0ldyuTaaO3T48YCk1KGBe ZS3cEtUV aiOLDfbSf5V4oGShMiwDQC8in4ZaCIUictFWtAHb85YcLLfWuLjEgKxIb8O/Nv1XunLYeHiuqXI8JyeapxN4tr5jMmgEB9rFpFhPNJhUEq+mQyPiSm5JlGqxw486gXI7nNWBFjalmKyTTqD26YV+4LYxApN/F2WkR9qowDrdLuYPhvwAsO0iK6hjonVgAGcyEQnu6afrY/KZqc3/bNDai1Yt6KmxdgWkTW83YruiSdpPYdC9jcGcHJtd6H5WSy1N7RcsGFjLjUp/svRj0Cab8KMVhQh1uTLIj0HezsRZmHCmUdN0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 26, 2024 at 04:28:04PM +0100, Anders Blomdell wrote: > On 2024-11-26 16:06, Jan Kara wrote: > > Hum, checking the history the update of ra->size has been added by Neil two > > years ago in 9fd472af84ab ("mm: improve cleanup when ->readpages doesn't > > process all pages"). Neil, the changelog seems as there was some real > > motivation behind updating of ra->size in read_pages(). What was it? Now I > > somewhat disagree with reducing ra->size in read_pages() because it seems > > like a wrong place to do that and if we do need something like that, > > readahead window sizing logic should rather be changed to take that into > > account? But it all depends on what was the real rationale behind reducing > > ra->size in read_pages()... > > My (rather limited) understanding of the patch is that it was intended to read those pages > that didn't get read because the allocation of a bigger folio failed, while not redoing what > readpages already did; how it was actually going to accomplish that is still unclear to me, > but I even don't even quite understand the comment... > > /* > * If there were already pages in the page cache, then we may have > * left some gaps. Let the regular readahead code take care of this > * situation. > */ > > the reason for an unchanged async_size is also beyond my understanding. This isn't because we couldn't allocate a folio, this is when we allocated folios, tried to read them and we failed to submit the I/O. This is a pretty rare occurrence under normal conditions.