All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] vhost: Cleanup
@ 2024-04-23  3:24 Gavin Shan
  2024-04-23  3:24 ` [PATCH 1/4] vhost: Drop variable last_avail_idx in vhost_get_vq_desc() Gavin Shan
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Gavin Shan @ 2024-04-23  3:24 UTC (permalink / raw)
  To: virtualization; +Cc: linux-kernel, mst, jasowang, shan.gavin

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/20240327075940-mutt-send-email-mst@kernel.org/

PATCH[1] drops the local variable @last_avail_idx since it's equivalent
         to vq->last_avail_idx
PATCH[2] 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[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 (4):
  vhost: Drop variable last_avail_idx in vhost_get_vq_desc()
  vhost: Improve vhost_get_avail_idx() with smp_rmb()
  vhost: Improve vhost_get_avail_head()
  vhost: Reformat vhost_{get, put}_user()

 drivers/vhost/vhost.c | 199 +++++++++++++++++++-----------------------
 1 file changed, 88 insertions(+), 111 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-29 10:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  3:24 [PATCH 0/4] vhost: Cleanup Gavin Shan
2024-04-23  3:24 ` [PATCH 1/4] vhost: Drop variable last_avail_idx in vhost_get_vq_desc() Gavin Shan
2024-04-23  3:24 ` [PATCH 2/4] vhost: Improve vhost_get_avail_idx() with smp_rmb() Gavin Shan
2024-04-23  3:24 ` [PATCH 3/4] vhost: Improve vhost_get_avail_head() Gavin Shan
2024-04-25 20:42   ` kernel test robot
2024-04-25 22:45     ` Gavin Shan
2024-04-23  3:24 ` [PATCH 4/4] vhost: Reformat vhost_{get, put}_user() Gavin Shan
2024-04-29  7:02 ` [PATCH 0/4] vhost: Cleanup Michael S. Tsirkin
2024-04-29 10:17   ` Gavin Shan

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.