From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796123119; b=YjcYmujsEjUxp1fvK+VyPC9ewtcFBeTdgEU7Qu6JoV6Zp7hVvaeQ2XMymkQulSPoKxJp jV74BZ/+Xq4e4QuvaySGWe2mDEJ8nTLUcSVovouk/NJ7D/MLoXWa5MaGQW9SNZSdxtFMx H7skvKTv2Cv8lJh5e7xPgjOFHmqWNqT2RwECXh5YmbbOp64ufeuy0lK07OoTAHtOMYMYF Jss8Bo18KtHLppvjLE+IyAwhMAk8dbq3Himy+lqbxESluU+dJrIyfIfcuMHxS7OKbvh4b 1lHowG7848rSW6yP79rjKcws5k/MUIb7dq6+yLfGVFBF7iiz5cZVdEXg/naeVXFC5Eg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796123119; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=lKe745uknYbrYwc1CRFfNKChuDoHevW36YtY4wUZa18=; b=aX4OJwooZdjVb2oQC2+IJ5rbm2jU8f3oTtJqB+InENahD3toiPxWs4EOVr7Unjk3L1h+ U+ghEDCE3lsDF8c9wpZB0YZDIwiNsCcs9xI8umaW/w8NSpSHc1GTDynZw7jswBYvP1lgr D+xno1Sic+cK7vW35adBPtsL12HZWrQiRS6we7Za5Ahoj06qeNtbM2tQ0zYFtNgAXiVZt 3x1mWJfFJyIVb1Pu0njiK4unyP7qlopPXrr7sQOjakqvrcK/25507BcE9k6FfQfpFoYcm pvwQQ14GRMuAdp79tRnpmBEzlkeHoTAkfUuiyOTKj9/Qx2FhNLG6PDz06LyI4RFJMfg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ze2/Pa1c"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06820606A31A for ; Tue, 1 Dec 2026 11:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ze2/Pa1c Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D5F71F0089B; Tue, 1 Dec 2026 11:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796123118; bh=lKe745uknYbrYwc1CRFfNKChuDoHevW36YtY4wUZa18=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Ze2/Pa1c3QvUXg99nQXlTJ5w94fThiaY7O/ptgqv6AeNzXERtiVFWYoYkHDw/ErFz GQGwz9bKdMKO77AKrVN//FwVGBTarBV5o8tgMnrcZeS7G+E1XJPgMNo0tum2HqYyq/ t5hf07CnSc1P2xAYGR3V+WTIOsQ3pfoDJpA6RRSGN7XXhmr+5JhqH8xxf2/VeNpDIR KYkuH10F6arOxXcfb3m3Db+NZxZvwg+a6eZUSLAo2Pk2+GENhQFUMvgxgvcHgioISZ Neqte3k0umAGuOH87Kh9HTNwDbcmjD73jSufmBqQycSCoj8NvRU/GUZ91fwMqKLEw+ DRd8kVh7tOROg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 3/5] virtiofs: retry request submission from the worker on -ENOMEM Reply-To: sashiko-reviews@lists.linux.dev To: "Miklos Szeredi" , virtualization@lists.linux.dev Cc: "Michael S. Tsirkin" , "Eugenio Perez" In-Reply-To: <20261201105855.430993-3-mszeredi@redhat.com> References: <20261201105855.430993-1-mszeredi@redhat.com> <20261201105855.430993-3-mszeredi@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 11:05:18 +0000 X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] virtiofs: inaccurate Fixes trailer in commit message -- commit 339631fd56eaa181fdd0c0ebe1ee0c1ec631f226 Author: Miklos Szeredi > virtiofs: retry request submission from the worker on -ENOMEM >=20 > virtio_fs_send_req() enqueues with GFP_ATOMIC, because it may be called > with fc->chan->bg_lock held. The sg arrays and, via > copy_args_to_argbuf(), the bounce buffer are allocated with those flags, > so under memory pressure a request can be failed with -ENOMEM even > though nothing is wrong with it. The buffer is as large as the request > arguments, so this is not limited to tiny allocations: > FUSE_REMOVEMAPPING, for example, can ask for just over 4 KiB, an order-1 > allocation out of the atomic reserves with no reclaim. >=20 > A virtqueue that is merely full is already handled gracefully: -ENOSPC > puts the request on fsvq->queued_reqs and virtio_fs_request_dispatch_work= () > retries it with GFP_KERNEL under memalloc_nofs_save(). A failed atomic > allocation is just as transient, so treat it the same way instead of > ending the request. Unlike -ENOSPC there is no completion to kick the > worker afterwards, so schedule it here. >=20 > virtqueue_add_sgs() can also report -ENOMEM, but only for a DMA mapping > failure, which the retry will not fix (failure to allocate the indirect > descriptor table falls back to direct descriptors and does not return > -ENOMEM). Such a request is retried once and then ended with -ENOMEM by > the worker, so the two cases are not worth telling apart. >=20 > virtio_fs_enqueue_req() queues on -ENOSPC only after checking > fsvq->connected under fsvq->lock; do the same here and fail the request > with -ENOTCONN if the queue is gone. req->argbuf has already been freed > and cleared on the error path, so the retry reallocates it. >=20 > Fixes: a62a8ef9d97d ("virtio-fs: add virtiofs filesystem") > Reviewed-by: Li Wang > Signed-off-by: Miklos Szeredi [Severity: Low] In commit a62a8ef9d97d ("virtio-fs: add virtiofs filesystem"), initial submission already retried on -ENOMEM alongside -ENOSPC, and commit a9bfd9dd3417 ("virtiofs: Retry request submission from worker context") preserved that when moving retries to fsvq->queued_reqs and fsvq->dispatch_work. It was commit 2106e1f444d9 ("virtio-fs: let -ENOMEM bubble up or burst gently") that dropped -ENOMEM from the retry check and caused GFP_ATOMIC allocation failures to end the request immediately. Should the Fixes tag be: Fixes: 2106e1f444d9 ("virtio-fs: let -ENOMEM bubble up or burst gently") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201105855.4309= 93-1-mszeredi@redhat.com?part=3D3