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


Groups > linux.kernel > #1359446

Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait
Date 2016-03-17 00:20 +0100
Message-ID <rdsTo-7vZ-11@gated-at.bofh.it> (permalink)
References <rbuwk-6jM-157@gated-at.bofh.it> <rcGlH-86m-3@gated-at.bofh.it> <rcGYq-9Q-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Laura Abbott <labbott@redhat.com>
Date: Mon, 14 Mar 2016 13:07:06 -0700

> On 03/14/2016 12:24 PM, David Miller wrote:
>> From: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
>> Date: Fri, 11 Mar 2016 13:39:23 +0100
>>
>>> I think I found a problem with the patch submitted by Laura Abbott
>>> ( https://lkml.org/lkml/2016/2/4/711 ): we might miss wakeups.
>>> Since the condition is not checked between the prepare_to_wait and the
>>> schedule(), if a wakeup happens after the condition is checked but
>>> before
>>> the sleep happens, and we miss it. ( A description of the problem can
>>> be
>>> found here: http://www.makelinux.net/ldd3/chp-6-sect-2 ).
>>>
>>> My solution (see patch below) is to shrink the area influenced by
>>> prepare_to_wait, but keeping the fragile section around the condition,
>>> and
>>> keep the rest of the code in "normal" running state.  This way the
>>> sleep is
>>> correct and the other functions don't need to worry.  The only caveat
>>> here
>>> is that the function(s) called to verify the conditions are really not
>>> allowed to sleep, so if you need synchronization in the backend of
>>> e.g.
>>> vsock_stream_has_space(), you should use spinlocks and not mutexes.
>>>
>>> In case we want to be able to sleep while waiting for conditions, we
>>> can
>>> consider this instead: https://lwn.net/Articles/628628/ .
>>>
>>>
>>> I stumbled on this problem while working on fixing the upcoming virtio
>>> backend for vsock, below is the patch I had prepared, with the
>>> original
>>> message.
>>
>> Can someone please look at this?  Who maintains this code anyways?
>>
> 
> Nobody was listed in MAINTAINERS. I tried cc-ing some of the e-mail
> addresses
> of the original authors (vmware?) when sending the original patch and
> they
> all bounced.

Ok, can you please submit this anew?  Your commit message format was
incorrect, you put the commit message content you wanted in the change
after the --- separater instead of beforehand.

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


Thread

Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> - 2016-03-11 13:40 +0100
  Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait David Miller <davem@davemloft.net> - 2016-03-14 20:30 +0100
    Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait Laura Abbott <labbott@redhat.com> - 2016-03-14 21:10 +0100
      Re: [PATCHv2] vsock: Fix blocking ops call in prepare_to_wait David Miller <davem@davemloft.net> - 2016-03-17 00:20 +0100

csiph-web