From: Krzysztof Opasiak <k.opasiak@samsung.com>
To: Alan Stern <stern@rowland.harvard.edu>,
Jeremy White <jwhite@codeweavers.com>
Cc: Oliver Neukum <oneukum@suse.com>,
Hans de Goede <hdegoede@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
spice-devel@lists.freedesktop.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [Spice-devel] [RFC PATCH 1/1] Add a usbredir kernel module to remotely connect USB devices over IP.
Date: Fri, 03 Jul 2015 10:51:11 +0200 [thread overview]
Message-ID: <55964CFF.1090803@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1507021615250.1320-100000@iolanthe.rowland.org>
On 07/02/2015 10:20 PM, Alan Stern wrote:
> On Thu, 2 Jul 2015, Jeremy White wrote:
>
>>> Oliver is talking about the danger of having part of the communication
>>> path for a block device run through userspace.
>>>
>>> Imagine a situation where the client uses a USB storage device provided
>>> by the server as a swap device. And suppose a userspace daemon on the
>>> client has to process USB packets as they pass between the client and
>>> the server. If the daemon is idle for some time, parts of its address
>>> space may get stored in the swap area on the server and paged out.
>>>
>>> Now consider what happens when those parts of memory need to be paged
>>> back in. The client submits a request to read from the swap area.
>>> The request is transformed into USB packets and sent through the
>>> userspace daemon for transmission to the server. But the daemon can't
>>> process the packets because it is waiting for its missing parts to be
>>> paged back! Result: deadlock.
>>
>> Right. I followed that. Oliver also asserted that he believed that the
>> current usbip implementation has this flaw; I do not follow that. The
>> concept is that the usbip device driver virtualizes the device behavior;
>> isolating the running kernel from the vagaries of the network transport.
>> All proposed usbredir implementations, even if they move the network
>> transport to user space, would retain that behavior.
>
> The point is that a device driver like usbip _cannot_ isolate the
> running kernel from the vagaries of the network transport if part of
> that transport occurs in userspace.
>
> If any part of the transport passes through userspace, you can end up
> in a situation like what I outlined above, where a message can't be
> transported until after its reply has been received. There's no way
> for a device driver to prevent a deadlock when this occurs, no matter
> what it virtualizes.
>
Doesn't we have the same problem with functionfs/gadgetfs and dummy_hcd?
Or with fuse?
It's a very generic problem for all "virtualized devices" and it is
known for quite a long time. This is why many tutorials about swap warns
that swap should be set up only on real block devices which are fully
served in kernel.
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
next prev parent reply other threads:[~2015-07-03 8:51 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 21:44 [RFC PATCH 0/1] RFC - Implement a usbredir kernel module Jeremy White
2015-06-30 21:44 ` [RFC PATCH 1/1] Add a usbredir kernel module to remotely connect USB devices over IP Jeremy White
2015-06-30 23:48 ` Greg KH
2015-07-01 3:34 ` Jeremy White
2015-07-01 5:44 ` Greg KH
2015-07-01 15:55 ` Jeremy White
2015-07-01 16:13 ` Greg KH
2015-07-01 18:39 ` Hans de Goede
2015-07-07 16:47 ` Jeremy White
2015-07-08 7:11 ` Hans de Goede
2015-07-09 0:19 ` Jeremy White
2015-07-01 9:06 ` [Spice-devel] " Daniel P. Berrange
2015-07-01 18:31 ` Jeremy White
2015-07-01 18:45 ` Hans de Goede
2015-07-02 8:45 ` Oliver Neukum
2015-07-02 11:35 ` Hans de Goede
2015-07-02 12:10 ` Oliver Neukum
2015-07-02 15:57 ` Jeremy White
2015-07-02 18:46 ` Oliver Neukum
2015-07-02 19:02 ` Jeremy White
2015-07-02 19:59 ` Alan Stern
2015-07-02 20:06 ` Jeremy White
2015-07-02 20:20 ` Alan Stern
2015-07-03 8:51 ` Krzysztof Opasiak [this message]
2015-07-03 14:04 ` Alan Stern
2015-07-06 8:20 ` Oliver Neukum
2015-07-06 20:14 ` Jeremy White
2015-07-06 20:22 ` Alan Stern
[not found] ` <mnlh2b$1cs$1@ger.gmane.org>
2015-07-22 14:03 ` Jeremy White
2015-07-22 14:34 ` Greg KH
2015-07-22 16:55 ` Jeremy White
2015-07-22 17:59 ` Sean O. Stalley
2015-07-23 0:20 ` Jeremy White
2015-12-09 22:32 ` Jeremy White
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=55964CFF.1090803@samsung.com \
--to=k.opasiak@samsung.com \
--cc=berrange@redhat.com \
--cc=hdegoede@redhat.com \
--cc=jwhite@codeweavers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=spice-devel@lists.freedesktop.org \
--cc=stern@rowland.harvard.edu \
/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 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.