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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40167C5518F for ; Tue, 4 Aug 2026 10:05:59 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4hDq1d6DqHz308j; Tue, 04 Aug 2026 20:05:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1785837957; cv=none; b=YFDYgC/rS0pgOnPKw/MlGLvXxvBWUDeKkUENyaFTqSuEwB5qDFQpW4eftIEaEZ8czs8JPrCHHHzjFDI5yiYbxT98IVTMs1hjeQXV2RtM9dPLWUSHy8x09tCQ8JdM2q/ZlIVOG76ACNxDlMYBQcA+W+pKmMIT08sYKAtqaR7yh11xjKQ0M4UJIN14kmIM/ONGV3DGvmI69o8MOu9n4YSTzpUjKMBu6Hg3QtQxuIuJOieOaLpdBkMuF2FtZRK3KXPy5FbkyDZ7ozJUiFIlPzwCnwUx0buNVDc0kjDisrG+mIKOz58ysxm1Z8iHDIun2zPsHQMvGJ89GZ/2sr2jUB27pg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1785837957; c=relaxed/relaxed; bh=58EnWeVw/aCExa0iTOXPB+bzmYeLpkKxoGX2MExHLNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=Mlo07QPP8J+8Op1qV+/H69qZKVfyVG9QjprbroBqyVpqR86sTg6GG6uWUlG0Lh0QvIPTrY5yDsGt9I8bQWJiIhI4v9mmVDSpNWbiJyT88z5+ytBAvkl8vuEToP7tEyaY90+IwBdtaEJ09WgwiS4RnFmMn7eaLZecvtCsm8bnB2KWs8KV/UeBToMpqLvLVGdR0Vpc+WS6RCZc8XgJ+3CZpdlpcYmWt22Dn7rimoE92ktO9xdJXet+NPzGmBFxle+wY5u5ej9Rot3bJJWuXjxGpqEo+ZemAKDDjptrzKzIc15KwLCmtsVBl99hc/qIS+W0xyOX1M4NTuRv9imn8ImfGQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BFn0YJpR; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Hidh8tu7; dkim-atps=neutral; spf=pass (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=dhowells@redhat.com; receiver=lists.ozlabs.org) smtp.mailfrom=redhat.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BFn0YJpR; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Hidh8tu7; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=dhowells@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4hDq1c6rLCz2xpn for ; Tue, 04 Aug 2026 20:05:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785837953; 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=58EnWeVw/aCExa0iTOXPB+bzmYeLpkKxoGX2MExHLNQ=; b=BFn0YJpREQSBY0UUfOcSmyWWeS955krpB1pXjW2DZcsyFTbCUnZ11AyHX37zrI27WWRCim HxZ6nT1iVzoAD/ajMs+1R9NiPhBNrFQV+7T6pjPqRDEE1/Ipty2eqSwRgFrF0df27bQSJ9 oKIzQzbV5sFMgbNxM9gsWqxPVTYvZf0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785837954; 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=58EnWeVw/aCExa0iTOXPB+bzmYeLpkKxoGX2MExHLNQ=; b=Hidh8tu7f/PjjXcR8fFaV0WRHT2NwF+mRUQbQE8Xqhvj3WknbdB+BEC+hvrV8FSShpNhra LTOs8IJ+x9DO91378ZzsLMY2K8CuNcNhCxpWyUB5sJmJzcG+CYdChMDPPcGBiRs8NvSz+m lzOoGVmOO+5m8lZ0lrcSxWzaBzIMm2Y= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-H95tr50UN8eGDffFpw3dxA-1; Tue, 04 Aug 2026 06:05:48 -0400 X-MC-Unique: H95tr50UN8eGDffFpw3dxA-1 X-Mimecast-MFC-AGG-ID: H95tr50UN8eGDffFpw3dxA_1785837945 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C18618002C0; Tue, 4 Aug 2026 10:05:45 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.32.44]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8AD4C1800480; Tue, 4 Aug 2026 10:05:39 +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 v8 23/25] netfs: Limit the minimum trigger for progress reporting Date: Tue, 4 Aug 2026 11:02:18 +0100 Message-ID: <20260804100224.2748935-24-dhowells@redhat.com> In-Reply-To: <20260804100224.2748935-1-dhowells@redhat.com> References: <20260804100224.2748935-1-dhowells@redhat.com> X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: 0ndq7-HKx1xzYrvH35uSSZIt3C73oZhvck4sin3aVAU_1785837945 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 8ab27103a86d..408208f29c0c 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -528,15 +528,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) &&