From nobody Thu Apr 2 23:53:31 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 76C683F8DF9 for ; Thu, 26 Mar 2026 10:49:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774522190; cv=none; b=lCAEroGM2nmLOd/UljLnNmUFLR4zBte7dhJAqtQpH7ELdnLMxihD3ydDcDSpHODMisWQP7v1eAMcuQ/xXR4tukKinRqSglEPu9tD7ad/fqyg95fcBRRbs6MEA6vxevC+5Lqi64mGDyEccrOftujbpPoNl+lj5juy+cj0XDMiaKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774522190; c=relaxed/simple; bh=sU2zUgwIPPM1gWJtEBg6k7zAgJC6dwFXJciLsxo98xs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GDaxM26skzzIBCtjrXGEnq8433NenFCAl9xS+UoZTfzhBLFOdGYhCggYACli165pw9xuFRVUJ3kVs2J2HCULnlcsjbuOkaSFW7DxF3AnNMyiqPlEc3e+DvqzAQV8aA2hvK5wzv8V0PClxz4N9jHJbTbmCnt2E1SOtMs2s4gJLCc= 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=e4uN62Gi; arc=none smtp.client-ip=170.10.133.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="e4uN62Gi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774522188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3dua10S0xY5PQQMwCx5ef5lVGVsxRJy1bcsfs1R39zY=; b=e4uN62GizDPs22ObsVmRiVIli/eJmyHtW7Xvtu+tX57/OBna97yq4LIKWLAfaauPSxK1/h FWElycj/efiR4QqPyh5MMKTaOMPJt0A9dDTZ7v4ueTNXN5Jus9cxTHrexQdYoDjKhRMmAC pQnkin6q6fyNc49x1VX/V9ekQLXo7C8= 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-134-R25vA0AZMP6MQs6h0YVvDg-1; Thu, 26 Mar 2026 06:49:45 -0400 X-MC-Unique: R25vA0AZMP6MQs6h0YVvDg-1 X-Mimecast-MFC-AGG-ID: R25vA0AZMP6MQs6h0YVvDg_1774522182 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 4D85219560A6; Thu, 26 Mar 2026 10:49:42 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.33.121]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 022BA1800576; Thu, 26 Mar 2026 10:49:35 +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 , Eric Van Hensbergen , Dominique Martinet , Ilya Dryomov , Trond Myklebust , 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, Paulo Alcantara Subject: [PATCH 25/26] netfs: Limit the the minimum trigger for progress reporting Date: Thu, 26 Mar 2026 10:45:40 +0000 Message-ID: <20260326104544.509518-26-dhowells@redhat.com> In-Reply-To: <20260326104544.509518-1-dhowells@redhat.com> References: <20260326104544.509518-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" 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 bacf047029fa..6d49f9a6b1f0 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -494,15 +494,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 =3D subreq->rreq; - struct netfs_io_stream *stream =3D &rreq->io_streams[0]; - size_t fsize =3D PAGE_SIZE << rreq->front_folio_order; + struct netfs_io_stream *stream =3D &rreq->io_streams[subreq->stream_nr]; + size_t fsize =3D umax(PAGE_SIZE << rreq->front_folio_order, 256 * 1024); =20 trace_netfs_sreq(subreq, netfs_sreq_trace_progress); =20 /* 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 >=3D stream->collected_to + fsize= && (rreq->origin =3D=3D NETFS_READAHEAD || rreq->origin =3D=3D NETFS_READPAGE || rreq->origin =3D=3D NETFS_READ_FOR_WRITE) &&