RE: [PATCH v5 04/11] usbip: kernel module for userspace URBs transmission

2016-01-04 Thread fx IWATA NOBUO
Dear Oliver,

> You cannot honor GFP_NOIO

GFP_NOIO is used in original kernel space transmission relating sk_buf.
It is not used for userspace transmission.
I added 'if' statement around the block to skip the block where GFP_NOIO
is used for kernel space transmission.

> the cleanest solution would be an additional flag to match requiring
> a kernel space driver

Other allocations are regular GFP_KERNEL or GFP_ATOMIC.

Thank you,

n.iwata
//
> -Original Message-
> From: linux-usb-ow...@vger.kernel.org
> [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Oliver Neukum
> Sent: Sunday, January 03, 2016 2:07 AM
> To: fx IWATA NOBUO
> Cc: valentina.mane...@gmail.com; shuah...@samsung.com;
> gre...@linuxfoundation.org; linux-usb@vger.kernel.org; fx MICHIMURA
> TADAO; Alan Stern
> Subject: Re: [PATCH v5 04/11] usbip: kernel module for userspace URBs
> transmission
> 
> On Wed, 2015-12-30 at 15:10 +0900, Nobuo Iwata wrote:
> > Originally, USB/IP transmits requests and response PDUs for
> > preparation to transfer URBs in user space, after the preparation,
> > URBs are transmitted in kernel space.
> >
> > To make easy to introduce application network protocols like WebSocket
> > and so on, the driver, usbip_ux.ko, forwards URBs to USB/IP user space
> > utilities. It's just like fuse driver for user space file system.
> > Then, utilities transfer URBs in user space.
> 
> Hi,
> 
> this raises fundamental questions. Just like fuse you are importing
> limitations this way. Fuse cannot do shared writable memory mappings because
> the VM can deadlock if you drop the GFP_NOFS requirement. That is inevitable
> if you go to user space, as user space is paged memory. Putting a HCD into
> user space the problem becomes even worse. You cannot honor GFP_NOIO.
> That means that essentially no block device can run without the risk of
> a deadlock.
> 
> It seems to me that the cleanest solution would be an additional flag to
> match requiring a kernel space driver would be the cleanest solution.
> 
>   Regards
>   Oliver
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 04/11] usbip: kernel module for userspace URBs transmission

2016-01-02 Thread Oliver Neukum
On Wed, 2015-12-30 at 15:10 +0900, Nobuo Iwata wrote:
> Originally, USB/IP transmits requests and response PDUs for
> preparation 
> to transfer URBs in user space, after the preparation, URBs are 
> transmitted in kernel space.
> 
> To make easy to introduce application network protocols like
> WebSocket 
> and so on, the driver, usbip_ux.ko, forwards URBs to USB/IP user
> space 
> utilities. It's just like fuse driver for user space file system. 
> Then, utilities transfer URBs in user space.

Hi,

this raises fundamental questions. Just like fuse you are importing
limitations this way. Fuse cannot do shared writable memory
mappings because the VM can deadlock if you drop the GFP_NOFS
requirement. That is inevitable if you go to user space, as
user space is paged memory. Putting a HCD into user space
the problem becomes even worse. You cannot honor GFP_NOIO.
That means that essentially no block device can run without
the risk of a deadlock.

It seems to me that the cleanest solution would be an additional
flag to match requiring a kernel space driver would be the cleanest
solution.

Regards
Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 04/11] usbip: kernel module for userspace URBs transmission

2015-12-30 Thread kbuild test robot
Hi Nobuo,

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v4.4-rc7 next-20151223]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Nobuo-Iwata/usbip-features-to-USB-over-WebSocket/20151230-150013
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 
usb-testing
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:228:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
>> drivers/usb/usbip/usbip_ux.c:163:14: sparse: incompatible types in 
>> comparison expression (different address spaces)
   drivers/usb/usbip/usbip_ux.c:281:14: sparse: incompatible types in 
comparison expression (different address spaces)
   drivers/usb/usbip/usbip_ux.c:400:14: sparse: incompatible types in 
comparison expression (different address spaces)

vim +163 drivers/usb/usbip/usbip_ux.c

   147  if (ret) {
   148  return ret;
   149  } else if (USBIP_UX_IS_TX_INT(ux)) {
   150  return -ERESTARTSYS;
   151  }
   152  return ux->tx_error;
   153  }
   154  
   155  int usbip_ux_sendmsg(struct usbip_device *ud, struct msghdr *msg, 
   156  struct kvec *vec, size_t num, size_t size)
   157  {
   158  int ret, i, count = 0;
   159  usbip_ux_t *ux;
   160  
   161  usbip_dbg_ux("sendmsg.\n");
   162  rcu_read_lock();
 > 163  ux = rcu_dereference(ud->ux);
   164  if (ux == NULL) {
   165  pr_info("Send to unlinked ux (0).\n");
   166  ret = 0;
   167  goto err_unlock_rcu;
   168  }
   169  ret = usbip_ux_get(ux);
   170  if (ret) {
   171  pr_err("Fail to get ux.\n");

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html