From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gavin Shan <gshan@redhat.com>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
jasowang@redhat.com, will@kernel.org, davem@davemloft.net,
stefanha@redhat.com, sgarzare@redhat.com, keirf@google.com,
yihyu@redhat.com, shan.gavin@gmail.com
Subject: Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()
Date: Mon, 22 Apr 2024 16:46:29 -0400 [thread overview]
Message-ID: <20240422164613-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <b41d65de-dc43-45f6-ba6c-ae722fbb70a8@redhat.com>
On Mon, Apr 08, 2024 at 02:15:24PM +1000, Gavin Shan wrote:
> Hi Michael,
>
> On 3/30/24 19:02, Gavin Shan wrote:
> > On 3/28/24 19:31, Michael S. Tsirkin wrote:
> > > On Thu, Mar 28, 2024 at 10:21:49AM +1000, Gavin Shan wrote:
> > > > All the callers of vhost_get_avail_idx() are concerned to the memory
> > > > barrier, imposed by smp_rmb() to ensure the order of the available
> > > > ring entry read and avail_idx read.
> > > >
> > > > Improve vhost_get_avail_idx() so that smp_rmb() is executed when
> > > > the avail_idx is advanced. With it, the callers needn't to worry
> > > > about the memory barrier.
> > > >
> > > > Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> > > > Signed-off-by: Gavin Shan <gshan@redhat.com>
> > >
> > > Previous patches are ok. This one I feel needs more work -
> > > first more code such as sanity checking should go into
> > > this function, second there's actually a difference
> > > between comparing to last_avail_idx and just comparing
> > > to the previous value of avail_idx.
> > > I will pick patches 1-2 and post a cleanup on top so you can
> > > take a look, ok?
> > >
> >
> > Thanks, Michael. It's fine to me.
> >
>
> A kindly ping.
>
> If it's ok to you, could you please merge PATCH[1-2]? Our downstream
> 9.4 need the fixes, especially for NVidia's grace-hopper and grace-grace
> platforms.
>
> For PATCH[3], I also can help with the improvement if you don't have time
> for it. Please let me know.
>
> Thanks,
> Gavin
1-2 are upstream go ahead and post the cleanup.
--
MST
next prev parent reply other threads:[~2024-04-22 20:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 0:21 [PATCH v3 0/3] vhost: Fix stale available ring entries Gavin Shan
2024-03-28 0:21 ` [PATCH v3 1/3] vhost: Add smp_rmb() in vhost_vq_avail_empty() Gavin Shan
2024-03-28 9:47 ` Stefano Garzarella
2024-03-28 0:21 ` [PATCH v3 2/3] vhost: Add smp_rmb() in vhost_enable_notify() Gavin Shan
2024-03-28 9:48 ` Stefano Garzarella
2024-03-28 0:21 ` [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb() Gavin Shan
2024-03-28 3:54 ` Jason Wang
2024-03-28 9:31 ` Michael S. Tsirkin
2024-03-30 9:02 ` Gavin Shan
2024-04-08 4:15 ` Gavin Shan
2024-04-08 7:19 ` Michael S. Tsirkin
2024-04-08 7:33 ` Michael S. Tsirkin
2024-04-22 20:46 ` Michael S. Tsirkin [this message]
2024-04-23 3:36 ` Gavin Shan
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=20240422164613-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=gshan@redhat.com \
--cc=jasowang@redhat.com \
--cc=keirf@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sgarzare@redhat.com \
--cc=shan.gavin@gmail.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=will@kernel.org \
--cc=yihyu@redhat.com \
/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.