From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 72B7B31691A for ; Wed, 22 Jul 2026 13:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784725583; cv=none; b=sD9c+UCFbU+ZMpSFRrIbJd6Q9K24MISTNgxdxLrl3m/07K9+MtSdYwfd3onb4alb8E+IC3Np7fgMZ0rEStn5iV+Ai2Q63vincLIj6sG7UDu5aig8MiC2ZkVFn+1pE8kaBVs6StXbsNe/rfarXzKKR/zj+7byC6PYfnuJJp5Kxpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784725583; c=relaxed/simple; bh=OIcjsLsi3tpZodG3CXoGBxTE08zkkvD8qBtW0LoFOyk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=HuyAmGBIVNrI0X8zU8yFxPco1VAJosvAMnWPIqoVlSIQvFLXfnnddxFg55Z0uC05IQUAdyCfBkL7bIDVDIh56zDLkJA1d0Cjjksjkfh0265vcdY+8rHGNQLZEKZI4iWTmsaY8CrEEitx7rhuc14++vUQKsQIw1Wlg9N4sujqzV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aPzq2cl3; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aPzq2cl3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784725581; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XjmqU+TQv9dOwFQCTSQcpCfZXqib4NV6zArlL12dlXg=; b=aPzq2cl3wFoqEWSehU5WVLqnsCx/5gGlr5zeFBox2OadEVT9BcdssD3pmdlHylMSYO1K7/ 7rD79vu/tmlRryxSTM+Pyl6GEmRP/Tv9PztObCV4XNuFcaV5jkc/Y95XqTzDHKrHIizWdw QQX0mcTfGU6A8xdv8fHLCxPn7lIrsRU= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-3Zng3GNqNmya9mxtaKj4CA-1; Wed, 22 Jul 2026 09:06:18 -0400 X-MC-Unique: 3Zng3GNqNmya9mxtaKj4CA-1 X-Mimecast-MFC-AGG-ID: 3Zng3GNqNmya9mxtaKj4CA_1784725575 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 189B4195FDCB; Wed, 22 Jul 2026 13:06:15 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.33.159]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4687218008FA; Wed, 22 Jul 2026 13:06:09 +0000 (UTC) From: David Howells To: Christian Brauner , Matthew Wilcox , Christoph Hellwig Cc: David Howells , Paulo Alcantara , Jens Axboe , Leon Romanovsky , Steve French , ChenXiaoSong , Marc Dionne , Stefan Metzmacher , Eric Van Hensbergen , Dominique Martinet , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 28/29] netfs: Limit the minimum trigger for progress reporting Date: Wed, 22 Jul 2026 14:02:15 +0100 Message-ID: <20260722130218.78958-29-dhowells@redhat.com> In-Reply-To: <20260722130218.78958-1-dhowells@redhat.com> References: <20260722130218.78958-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: netfs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: jP16SecONTt6DXg4mJj84aEsvh8JpEjz6MuCr1NPnFM_1784725575 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true For really big read RPC ops that span multiple folios, netfslib allows the filesystem to give progress notifications to wake up the collector thread to do a collection of folios that have now been fetched, even if the RPC is still ongoing, thereby allowing the application to make progress. The trigger for this is that at least one folio has been downloaded since the clean point. If, however, the folios are small, this means the collector thread is constantly being woken up - which has a negative performance impact on the system. Set a minimum trigger of 256KiB or the size of the folio at the front of the queue, whichever is larger. Also, fix the base to be the stream collection point, not the point at which the collector has cleaned up to (which is currently 0 until something has been collected). Signed-off-by: David Howells cc: Paulo Alcantara cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/read_collect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c index ea65483d2537..2abfdefa6bbb 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -527,15 +527,15 @@ void netfs_read_collection_worker(struct work_struct *work) void netfs_read_subreq_progress(struct netfs_io_subrequest *subreq) { struct netfs_io_request *rreq = subreq->rreq; - struct netfs_io_stream *stream = &rreq->io_streams[0]; - size_t fsize = PAGE_SIZE << rreq->front_folio_order; + struct netfs_io_stream *stream = &rreq->io_streams[subreq->stream_nr]; + size_t fsize = umax(PAGE_SIZE << rreq->front_folio_order, 256 * 1024); trace_netfs_sreq(subreq, netfs_sreq_trace_progress); /* If we are at the head of the queue, wake up the collector, * getting a ref to it if we were the ones to do so. */ - if (subreq->start + subreq->transferred > rreq->cleaned_to + fsize && + if (subreq->start + subreq->transferred >= stream->collected_to + fsize && (rreq->origin == NETFS_READAHEAD || rreq->origin == NETFS_READPAGE || rreq->origin == NETFS_READ_FOR_WRITE) &&