All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jia Jia" <physicalmtea@gmail.com>
Cc: bpf@vger.kernel.org, "Eugenio Perez" <eperezma@redhat.com>,
	kvm@vger.kernel.org, virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH net-next v2 5/5] vsock/virtio: defer RX readable notifications until batch unlock
Date: Sat, 10 Oct 2026 14:39:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-166652@kernel.org> (raw)
In-Reply-To: <20261010142247.99223-6-physicalmtea@gmail.com>

> An RX batch can make a socket readable while the worker still owns its
> socket lock. Waking a reader at that point can make it immediately wait
> for the same lock.
> 
> For the callback installed by sock_init_data(), record when the existing
> low-watermark condition is met and issue one notification after the batch
> releases the lock. Save the initial sock_def_readable() callback when the
> AF_VSOCK socket is created because virtio_transport_common can be built as
> a module and cannot refer to that unexported symbol directly.
> 
> When sk_data_ready or sk_write_space no longer matches that initial
> callback, pass queued skbs to the current callback one skb at a time. The
> handoff stops if the callback is the default again or the queue does not
> shrink. After 64 successful callbacks, queue another bounded handoff if
> data remains. vsock_bpf_update_proto() schedules the same handoff so an
> attach or detach outside the worker still drains skbs already queued.
> 
> Always deliver a coalesced write-space event to the saved default callback
> before sampling the callback state. A current replacement is invoked by
> the handoff as well, so a callback change cannot hide the native writer
> wakeup or pending sockmap work.
> 
> Sampling at batch finish takes sk_callback_lock once. The per-packet fast
> path still uses READ_ONCE() and does not take that lock. Control packets,
> state transitions, transport changes and non-batched sockets keep their
> existing behavior.
> 
> Signed-off-by: Jia Jia <physicalmtea@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

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


  reply	other threads:[~2026-10-10 14:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 14:22 [PATCH net-next v2 0/5] vsock/virtio: reduce RX per-packet socket overhead Jia Jia
2026-10-10 14:22 ` [PATCH net-next v2 1/5] vsock/virtio: split socket lookup from locked RX processing Jia Jia
2026-10-10 14:39   ` sashiko-bot
2026-10-11 14:25   ` netdev-bot+sashiko
2026-10-12 21:34   ` Bobby Eshleman
2026-10-13  3:24     ` Jia Jia
2026-10-12 22:02   ` Bobby Eshleman
2026-10-13  3:26     ` Jia Jia
2026-10-13 17:16       ` Bobby Eshleman
2026-10-10 14:22 ` [PATCH net-next v2 2/5] vsock/virtio: amortize RX socket locking for stream packets Jia Jia
2026-10-10 14:39   ` sashiko-bot
2026-10-11 14:25   ` netdev-bot+sashiko
2026-10-12 22:15   ` Bobby Eshleman
2026-10-13  3:28     ` Jia Jia
2026-10-13 17:31       ` Bobby Eshleman
2026-10-10 14:22 ` [PATCH net-next v2 3/5] vsock/virtio: reuse same-flow socket lookup in RX batches Jia Jia
2026-10-10 14:39   ` sashiko-bot
2026-10-12 22:17   ` Bobby Eshleman
2026-10-13  3:30     ` Jia Jia
2026-10-10 14:22 ` [PATCH net-next v2 4/5] vsock/virtio: coalesce RX write-space notifications in lock batches Jia Jia
2026-10-10 14:39   ` sashiko-bot
2026-10-10 14:22 ` [PATCH net-next v2 5/5] vsock/virtio: defer RX readable notifications until batch unlock Jia Jia
2026-10-10 14:39   ` sashiko-bot [this message]
2026-10-11 14:25   ` netdev-bot+sashiko
2026-10-12  5:51     ` 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=sashiko-outbox-166652@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.