mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: virtualization@lists.linux.dev
Cc: linux-kernel@vger.kernel.org, mst@redhat.com,
	jasowang@redhat.com, shan.gavin@gmail.com
Subject: [PATCH v2 0/4] vhost: Cleanup
Date: Mon, 29 Apr 2024 20:13:56 +1000	[thread overview]
Message-ID: <20240429101400.617007-1-gshan@redhat.com> (raw)

This is suggested by Michael S. Tsirkin according to [1] and the goal
is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it,
the caller of the function needn't to worry about memory barriers. Since
we're here, other cleanups are also applied.

[1] https://lore.kernel.org/virtualization/20240327155750-mutt-send-email-mst@kernel.org/

PATCH[1] improves vhost_get_avail_idx() so that smp_rmb() is applied if
         needed. Besides, the sanity checks on the retrieved available
         queue index are also squeezed to vhost_get_avail_idx()
PATCH[2] drops the local variable @last_avail_idx since it's equivalent
         to vq->last_avail_idx
PATCH[3] improves vhost_get_avail_head(), similar to what we're doing
         for vhost_get_avail_idx(), so that the relevant sanity checks
         on the head are squeezed to vhost_get_avail_head()
PATCH[4] Reformat vhost_{get, put}_user() by using tab instead of space
         as the terminator for each line

Gavin Shan (3):
  vhost: Drop variable last_avail_idx in vhost_get_vq_desc()
  vhost: Improve vhost_get_avail_head()
  vhost: Reformat vhost_{get, put}_user()

Michael S. Tsirkin (1):
  vhost: Improve vhost_get_avail_idx() with smp_rmb()

 drivers/vhost/vhost.c | 215 +++++++++++++++++++-----------------------
 1 file changed, 97 insertions(+), 118 deletions(-)

Changelog
=========
v2:
  * Improve vhost_get_avail_idx() as Michael suggested in [1]
    as above                                                     (Michael)
  * Correct @head's type from 'unsigned int' to 'int'            (ltp@intel.com)

-- 
2.44.0


             reply	other threads:[~2024-04-29 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 10:13 Gavin Shan [this message]
2024-04-29 10:13 ` [PATCH v2 1/4] vhost: Improve vhost_get_avail_idx() with smp_rmb() Gavin Shan
2024-04-29 18:44   ` Michael S. Tsirkin
2024-04-29 23:18     ` Gavin Shan
2024-04-29 10:13 ` [PATCH v2 2/4] vhost: Drop variable last_avail_idx in vhost_get_vq_desc() Gavin Shan
2024-04-29 18:45   ` Michael S. Tsirkin
2024-04-29 23:00     ` Gavin Shan
2024-04-29 10:13 ` [PATCH v2 3/4] vhost: Improve vhost_get_avail_head() Gavin Shan
2024-04-29 18:48   ` Michael S. Tsirkin
2024-04-29 10:14 ` [PATCH v2 4/4] vhost: Reformat vhost_{get, put}_user() Gavin Shan
2024-04-29 18:49   ` Michael S. Tsirkin
2024-04-29 18:50 ` [PATCH v2 0/4] vhost: Cleanup Michael S. Tsirkin
2024-04-29 23:31   ` 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=20240429101400.617007-1-gshan@redhat.com \
    --to=gshan@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=shan.gavin@gmail.com \
    --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

all inboxes | Powered by JetHome®