Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: physicalmtea@gmail.com
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux.dev,
	"Eugenio Perez" <eperezma@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 5/5] vsock: defer RX readable notifications until batch unlock
Date: Sat, 03 Oct 2026 07:46:57 +0000	[thread overview]
Message-ID: <20261003074657.71AC91F0089C@smtp.kernel.org> (raw)
In-Reply-To: <20261002074551.318789-6-physicalmtea@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] vsock: unreachable callback replacement abort logic in batching
--

commit 811453fb266663fdded1db37d3b4cf3bde547c9f
Author: Jia Jia <physicalmtea@gmail.com>

vsock: defer RX readable notifications until batch unlock

This commit defers vsock RX data-ready notifications until the batch finishes
and releases the socket lock. It records the initial callback to handle
mid-batch replacements.

> diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c

[ ... ]

> @@ -2015,6 +2040,13 @@ void virtio_transport_recv_pkt_batch(struct virtio_transport *t,
>  		    vsock_addr_equals_addr(&batch->dst, &dst) &&
>  		    virtio_transport_recv_pkt_batchable(t, batch->sk)) {
>  			sk = batch->sk;
> +			defer_data_ready = READ_ONCE(sk->sk_data_ready) ==
> +					   vsock_sk(sk)->default_data_ready;
> +			if (batch->data_ready_pending && !defer_data_ready) {
> +				virtio_transport_rx_batch_finish(batch);
> +				goto lookup;
> +			}
> +

[Severity: Low]
Can this branch ever execute?

The condition checks if a custom callback was installed (!defer_data_ready)
while a default notification is already pending.

Since custom callback attachments (such as BPF sockmap insertion) require
acquiring the exact same socket lock, and the lock is held continuously while
the batch is active, is it possible for the callback to change from default
to custom mid-batch?

Could this bailout branch be unreachable dead code due to the structural mutual
exclusion provided by the socket lock?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261002074551.318789-1-physicalmtea@gmail.com?part=5

  reply	other threads:[~2026-10-03  7:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  7:45 [PATCH 5/5] vsock: defer RX readable notifications until batch unlock physicalmtea
2026-10-03  7:46 ` sashiko-bot [this message]
2026-10-03 23:53   ` Jia Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261003074657.71AC91F0089C@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=physicalmtea@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox