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

2013-02-06 Thread Martin Sustrik
ASK. Returned value shall be the last one written to the eventfd. select(2), poll(2) and similar: When polling on the eventfd marked by EFD_MASK flag, all the events specified in last written 'events' field shall be signaled. Signed-off-by: Martin Sustrik --- fs/eventfd.c| 10

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

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

2013-02-07 Thread Martin Sustrik
the last one written to the eventfd. select(2), poll(2) and similar: When polling on the eventfd marked by EFD_MASK flag, all the events specified in last written 'events' field shall be signaled. Signed-off-by: Martin Sustrik --- fs/eventfd.c| 105

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

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 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, +

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

2013-02-08 Thread Martin Sustrik
fd marked by EFD_MASK. Returned value shall be the last one written to the eventfd. select(2), poll(2) and similar: When polling on the eventfd marked by EFD_MASK flag, all the events specified in last written 'events' field shall be signaled. Signed-off-by: Martin Sustrik --- v2 - Con

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-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 descrip

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
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-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

[PATCH 1/1] eventfd: fix incorrect filename is a comment

2013-01-30 Thread Martin Sustrik
Comment in eventfd.h referred to 'include/asm-generic/fcntl.h' while the correct path is 'include/uapi/asm-generic/fcntl.h'. Signed-off-by: Martin Sustrik --- include/linux/eventfd.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux

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

2013-02-14 Thread Martin Sustrik
Hi Andrew, Thanks for the detailed code review! I'll have a look at all the problems you've pointed out, however, one quick question: - ret = seq_printf(m, "eventfd-count: %16llx\n", -(unsigned long long)ctx->count); + if (ctx->flags& EFD_MASK) { +

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

2013-02-15 Thread Martin Sustrik
On 15/02/13 18:32, Andy Lutomirski wrote: On Thu, Feb 14, 2013 at 9:24 PM, Andrew Morton wrote: On Fri, 15 Feb 2013 04:42:27 +0100 Martin Sustrik wrote: This is a non-back-compatible userspace interface change. A procfs file which previously displayed eventfd-count: can now

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

2013-02-18 Thread Martin Sustrik
On 14/02/13 23:54, Andrew Morton wrote: +/* On x86-64 keep the same binary layout as on i386. */ +#ifdef __x86_64__ +#define EVENTFD_MASK_PACKED __packed +#else +#define EVENTFD_MASK_PACKED +#endif + +struct eventfd_mask { + __u32 events; + __u64 data; +} EVENTFD_MASK_PACKED; The

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

2013-02-18 Thread Martin Sustrik
lling on the eventfd marked by EFD_MASK flag, all the events specified in last written 'events' field shall be signaled. Signed-off-by: Martin Sustrik --- Following changes were made to the patch since v2: - eventfd_mask structure renamed to efd_mask to keep user-space prefixes consisten

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

2013-02-18 Thread Martin Sustrik
On 14/02/13 23:54, Andrew Morton wrote: This patch adds userspace interfaces which will require manpage updates. Please Cc Michael and work with him on getting those changes completed. Right. It adds the efd_mask structure. As far as I understand how it works is that the actual user-space de

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

2015-07-09 Thread Martin Sustrik
n On 2013-02-18 8:34 PM, Martin Sustrik wrote: When implementing network protocols in user space, one has to implement fake file descriptors to represent the sockets for the protocol. Polling on such fake file descriptors is a problem (poll/select/epoll accept only true file descriptors) and f

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

2015-07-09 Thread Martin Sustrik
On 2015-07-09 11:06, Damian Hobson-Garcia wrote: Hi Martin, On 2015-07-09 5:41 PM, Martin Sustrik wrote: Hi Damian, Yes, this patch would be geneally useful for implementing stuff in user space that otherwise would have to live in kernelspace. Unfortunately, I have no cycles left to pursue

Re: [PATCH] eventfd: implementation of EFD_MASK flag

2015-08-09 Thread Martin Sustrik
On 2015-08-10 08:23, Damian Hobson-Garcia wrote: Replying to my own post, but I had the following comments/questions. Martin, if you have any response to my comments I would be very happy to hear them. On 2015-08-10 2:51 PM, Damian Hobson-Garcia wrote: From: Martin Sustrik [snip] write

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

2015-09-15 Thread Martin Sustrik
On 2015-09-16 08:27, Damian Hobson-Garcia wrote: From: Martin Sustrik When implementing network protocols in user space, one has to implement fake file descriptors to represent the sockets for the protocol. Polling on such fake file descriptors is a problem (poll/select/epoll accept only true

Re: [PATCH] eventfd: implementation of EFD_MASK flag

2015-08-10 Thread Martin Sustrik
On 2015-08-10 10:57, Damian Hobson-Garcia wrote: Hi Martin, Thanks for your comments. On 2015-08-10 3:39 PM, Martin Sustrik wrote: On 2015-08-10 08:23, Damian Hobson-Garcia wrote: Replying to my own post, but I had the following comments/questions. Martin, if you have any response to my