RE: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-29 Thread Dexuan Cui
project.org; o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; vkuzn...@redhat.com; > cav...@redhat.com; KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; j...@perches.com > Subject: Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V So

Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-28 Thread Rick Jones
On 06/28/2016 02:59 AM, Dexuan Cui wrote: The idea here is: IMO the syscalls sys_read()/write() shoudn't return -ENOMEM, so I have to make sure the buffer allocation succeeds? I tried to use kmalloc with __GFP_NOFAIL, but I hit a warning in in mm/page_alloc.c: WARN_ON_ONCE((gfp_flags &

RE: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-28 Thread Dexuan Cui
...@canonical.com; jasow...@redhat.com; vkuzn...@redhat.com; > cav...@redhat.com; KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; j...@perches.com > Subject: Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets > > From: Dexuan Cui <

Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-28 Thread David Miller
From: Dexuan Cui Date: Tue, 28 Jun 2016 09:59:21 + > The idea here is: IMO the syscalls sys_read()/write() shoudn't return > -ENOMEM, so I have to make sure the buffer allocation succeeds? You have to fail if resources cannot be allocated.

RE: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-28 Thread Dexuan Cui
...@canonical.com; jasow...@redhat.com; vkuzn...@redhat.com; > cav...@redhat.com; KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; j...@perches.com > Subject: Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets > > From: Dexuan Cui <

Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets

2016-06-28 Thread David Miller
From: Dexuan Cui Date: Fri, 24 Jun 2016 07:45:24 + > + while ((ret = vmalloc(size)) == NULL) > + ssleep(1); This is completely, and entirely, unacceptable. If the allocation fails, you return an error and release your resources. You don't just loop