Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-14 Thread Michał Mirosław
2013/2/8 Martin Sustrik : > When implementing network protocols in user space, one has to implement > fake user-space file descriptors to represent the sockets for the protocol. [...] > This patch implements new EFD_MASK flag which attempts to solve this problem. [...] > @@ -55,6 +64,9 @@ __u64 eve

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-09 Thread Martin Sustrik
On 2013-02-09 12:51, Eric Wong wrote: Yes, your eventfd change is probably the best way if you want/need to only watch a subset of your sockets, especially if you want poll/select to be an option. Yes, the poll/select thing is the important point. I wouldn't care if the only problem was that

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-09 Thread Eric Wong
Martin Sustrik wrote: > On 09/02/13 04:54, Eric Wong wrote: > >>>Using one eventfd per userspace socket still seems a bit wasteful. > >> > >>Wasteful in what sense? Occupying a slot in file descriptor table? > >>That's the price for having the socket uniquely identified by the > >>fd. > > > >Yes.

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Martin Sustrik
On 09/02/13 04:54, Eric Wong wrote: Using one eventfd per userspace socket still seems a bit wasteful. Wasteful in what sense? Occupying a slot in file descriptor table? That's the price for having the socket uniquely identified by the fd. Yes. I realize eventfd is small, but I don't think

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Eric Wong
Martin Sustrik wrote: > On 08/02/13 23:21, Eric Wong wrote: > >Martin Sustrik wrote: > >>To address the question, I've written down detailed description of > >>the challenges of the network protocol development in user space and > >>how the proposed feature addresses the problems. > >> > >>It can

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Martin Sustrik
On 08/02/13 23:08, Eric Wong wrote: poll(2) function (POLLIN, POLLOUT, POLLERR, POLLHUP etc.) Specified events will be signaled when polling (select, poll, epoll) on the eventfd is done later on. 'ptr' is an opaque pointer that is not interpreted by eventfd object. How does this interact with

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Martin Sustrik
Hi Eric, On 08/02/13 23:21, Eric Wong wrote: Martin Sustrik wrote: On 07/02/13 23:44, Andrew Morton wrote: That's a nice changelog but it omitted a critical thing: why do you think the kernel needs this feature? What's the value and use case for being able to poll these descriptors? To add

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Eric Wong
Martin Sustrik wrote: > On 07/02/13 23:44, Andrew Morton wrote: > >That's a nice changelog but it omitted a critical thing: why do you > >think the kernel needs this feature? What's the value and use case for > >being able to poll these descriptors? > > To address the question, I've written down

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Eric Wong
Andy Lutomirski wrote: > On Thu, Feb 7, 2013 at 12:11 PM, Martin Sustrik wrote: > > On 07/02/13 20:12, Andy Lutomirski wrote: > >> On 02/06/2013 10:41 PM, Martin Sustrik wrote: > >>> The value of 'events' should be any combination of event flags as defined > >>> by > >>> poll(2) function (POLLIN,

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-08 Thread Martin Sustrik
On 07/02/13 23:44, Andrew Morton wrote: That's a nice changelog but it omitted a critical thing: why do you think the kernel needs this feature? What's the value and use case for being able to poll these descriptors? To address the question, I've written down detailed description of the chal

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Martin Sustrik
On 08/02/13 07:36, Andy Lutomirski wrote: On 08/02/13 02:03, Andy Lutomirski wrote: There may be some advantage to adding (later on, if needed) an option to change the flags set in: + if (waitqueue_active(&ctx->wqh)) + wake_up_locked_poll(&ctx->wqh, +

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Andy Lutomirski
On Thu, Feb 7, 2013 at 9:26 PM, Martin Sustrik wrote: > Hi Andy, > > > On 08/02/13 02:03, Andy Lutomirski wrote: >> >> There may be some >> advantage to adding (later on, if needed) an option to change the >> flags set in: >> >> + if (waitqueue_active(&ctx->wqh)) >> +

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Martin Sustrik
Hi Andy, On 08/02/13 02:03, Andy Lutomirski wrote: There may be some advantage to adding (later on, if needed) an option to change the flags set in: + if (waitqueue_active(&ctx->wqh)) + wake_up_locked_poll(&ctx->wqh, + (unsigned

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Andy Lutomirski
On Thu, Feb 7, 2013 at 12:11 PM, Martin Sustrik wrote: > On 07/02/13 20:12, Andy Lutomirski wrote: >> >> On 02/06/2013 10:41 PM, Martin Sustrik wrote: >>> >>> When implementing network protocols in user space, one has to implement >>> fake user-space file descriptors to represent the sockets for t

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Martin Sustrik
On 07/02/13 23:44, Andrew Morton wrote: So please update the changelog and then cc net...@vger.kernel.org on the patch - the netdev people are probably best-situated to comment on the proposal. OK. Done. Thanks for the advice! Martin -- To unsubscribe from this list: send the line "unsubscr

[PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Martin Sustrik
When implementing network protocols in user space, one has to implement fake user-space file descriptors to represent the sockets for the protocol. While all the BSD socket API functionality for such descriptors may be faked as well (myproto_send(), myproto_recv() etc.) this approach doesn't work

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Andrew Morton
On Thu, 7 Feb 2013 07:41:32 +0100 Martin Sustrik wrote: > When implementing network protocols in user space, one has to implement > fake user-space file descriptors to represent the sockets for the protocol. > > While all the BSD socket API functionality for such descriptors may be faked > as

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Martin Sustrik
On 07/02/13 20:12, Andy Lutomirski wrote: On 02/06/2013 10:41 PM, Martin Sustrik wrote: When implementing network protocols in user space, one has to implement fake user-space file descriptors to represent the sockets for the protocol. While all the BSD socket API functionality for such descrip

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-07 Thread Andy Lutomirski
On 02/06/2013 10:41 PM, Martin Sustrik wrote: > When implementing network protocols in user space, one has to implement > fake user-space file descriptors to represent the sockets for the protocol. > > While all the BSD socket API functionality for such descriptors may be faked > as > well (mypro

[PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-06 Thread Martin Sustrik
When implementing network protocols in user space, one has to implement fake user-space file descriptors to represent the sockets for the protocol. While all the BSD socket API functionality for such descriptors may be faked as well (myproto_send(), myproto_recv() etc.) this approach doesn't work