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

2015-09-16 Thread Damian Hobson-Garcia
Hi Martin, On 2015-09-16 3:51 PM, Martin Sustrik wrote: > On 2015-09-16 08:27, Damian Hobson-Garcia wrote: >> >> Additionally, to provide a way to associate user-space state with eventfd >> object, it allows to attach user-space data to the file descriptor. > > The above paragraph is a leftover f

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

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 als

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

2013-02-15 Thread Andy Lutomirski
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 also display >> > >>

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

2013-02-14 Thread Andrew Morton
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 also display > > > > eventfd-mask: > > > > So existing userspace could misb

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-14 Thread Andy Lutomirski
On Thu, Feb 14, 2013 at 2:54 PM, Andrew Morton wrote: > On Fri, 8 Feb 2013 09:11:17 +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. > >> if (count < si

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

2013-02-14 Thread Andrew Morton
On Fri, 8 Feb 2013 09:11:17 +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