Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361581

Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read()

From Vitaly Kuznetsov <vkuznets@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read()
Date 2016-03-21 09:20 +0100
Message-ID <rf3e9-2Ra-7@gated-at.bofh.it> (permalink)
References <rec9Q-3HN-3@gated-at.bofh.it> <rec9Q-3HN-5@gated-at.bofh.it> <rec9R-3HN-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


"K. Y. Srinivasan" <kys@microsoft.com> writes:

> We need to issue a full memory barrier prior making a signalling
> decision.

Any reason this should be mb()? This is pretty strong and will probably
lead to performace regression ... and, btw, we have another mb() in
hv_ringbuffer_read().

Could you please describe the scenarion you're trying to protect against
so we could search for a better solution?

>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/hv/ring_buffer.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
> index 2919395..67dc245 100644
> --- a/drivers/hv/ring_buffer.c
> +++ b/drivers/hv/ring_buffer.c
> @@ -104,6 +104,7 @@ static bool hv_need_to_signal_on_read(struct hv_ring_buffer_info *rbi)
>  	u32 cur_write_sz;
>  	u32 pending_sz;
>
> +	mb();
>  	pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz);
>  	/* If the other end is not blocked on write don't bother. */
>  	if (pending_sz == 0)

-- 
  Vitaly

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Drivers: hv: vmbus  "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-19 00:40 +0100
  [PATCH 4/5] Drivers: hv: vmbus: Use the new virt_xx barrier code "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-19 00:40 +0100
  [PATCH 1/5] Drivers: hv: vmbus: Introduce functions for estimating room in the ring buffer "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-19 00:40 +0100
    [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read() "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-19 00:40 +0100
      Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-03-21 09:20 +0100
        RE: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in  hv_need_to_signal_on_read() KY Srinivasan <kys@microsoft.com> - 2016-03-22 01:10 +0100
          Re: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in hv_need_to_signal_on_read() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-03-22 11:00 +0100
            RE: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in  hv_need_to_signal_on_read() KY Srinivasan <kys@microsoft.com> - 2016-03-22 16:00 +0100
            RE: [PATCH 3/5] Drivers: hv: vmbus: Fix a bug in  hv_need_to_signal_on_read() KY Srinivasan <kys@microsoft.com> - 2016-03-22 18:20 +0100
    [PATCH 5/5] Drivers: hv: vmbus: Implement copy-free read APIs "K. Y. Srinivasan" <kys@microsoft.com> - 2016-03-19 00:40 +0100
      Re: [PATCH 5/5] Drivers: hv: vmbus: Implement copy-free read APIs Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-03-21 09:30 +0100
        RE: [PATCH 5/5] Drivers: hv: vmbus: Implement copy-free read APIs KY Srinivasan <kys@microsoft.com> - 2016-03-22 00:50 +0100
  RE: [PATCH 0/5] Drivers: hv: vmbus  KY Srinivasan <kys@microsoft.com> - 2016-03-23 20:50 +0100

csiph-web