Re: [RFC PATCH 2/2] virtio/s390: fix race in ccw_io_helper()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 09/19/2018 04:07 PM, Cornelia Huck wrote:
>> Yep, I'm for doing something like this first. We can think about doing
>> something more elaborate later. I will send a non-RFC with an extra
>> per-device mutex. Unless you object.
> No, that sounds good to me.
> 

OK.

>> Another thought that crossed my head was making the transport ops
>> mutex on each virtio-ccw device -- see our conversation on get/set
>> config. I don't think it would make a big difference, since the
>> ccw stuff is mutex already, so we only have parallelism for the
>> preparation and for post-processing the results of the ccw io.
> Do you spot any other places where we may need to care about concurrent
> processing (like for the ->config area in the previous patch)?
> 

It is hard to tell, because:
* Synchronization external to the transport could make things work
out just fine.
* virtio_config_ops does not document these requirements if any.
* So it's up to the devices to use the stuff without shooting
  themselves in the foot.
* virtio-pci does not seem to do more to avoid such problems that
  we do.

Back then when learning vritio-ccw I did ask myself such questions
and based on vrito-pci and I was like looks similar, should be
good enough.

But I guess you know all this and that's why you said "any other
places where we *may* need to care". Some of the places I'm not
sure we don't are:
* status get/set, and
* find_vqs, del_vqs

But if I had been sure that these are problematic, I would have
pointed that out.

Status is one byte, and that could save the day. But I can't recall
if the architecture guarantees that we won't observe anything funny.

Regarding find_vqs I think of some external-ish events that could
make us tear down before build-up (find_vqs) finished. Funny thing
is we do protect the list with a lock, but the lock is taken only while
dealing with a single element. So I don't think it would save us.
I hope synchronization external to virtio-ccw takes care of this,
but I cant tell for sure. I'm only sure that I don't fully understand
the interactions. I stated that in the cover letter ;).

Regards,
Halil





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux