Re: [PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-10 Thread Fam Zheng
On Tue, 03/10 09:59, Dan Rosenberg wrote: > On 03/09/2015 09:49 PM, Fam Zheng wrote: > > + if (!cmds || ncmds <= 0 || ncmds > EP_MAX_BATCH) > > + return -EINVAL; > > + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; > > + /* TODO: optimize for small arguments like select/poll with

Re: [PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-10 Thread Dan Rosenberg
On 03/09/2015 09:49 PM, Fam Zheng wrote: > + if (!cmds || ncmds <= 0 || ncmds > EP_MAX_BATCH) > + return -EINVAL; > + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; > + /* TODO: optimize for small arguments like select/poll with a stack > + * allocated buffer */ > +

Re: [PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-10 Thread Dan Rosenberg
On 03/09/2015 09:49 PM, Fam Zheng wrote: + if (!cmds || ncmds = 0 || ncmds EP_MAX_BATCH) + return -EINVAL; + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; + /* TODO: optimize for small arguments like select/poll with a stack + * allocated buffer */ + +

Re: [PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-10 Thread Fam Zheng
On Tue, 03/10 09:59, Dan Rosenberg wrote: On 03/09/2015 09:49 PM, Fam Zheng wrote: + if (!cmds || ncmds = 0 || ncmds EP_MAX_BATCH) + return -EINVAL; + cmd_size = sizeof(struct epoll_ctl_cmd) * ncmds; + /* TODO: optimize for small arguments like select/poll with a stack

[PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-09 Thread Fam Zheng
This new syscall is a batched version of epoll_ctl. It will execute each command as specified in cmds in given order, and stop at first failure or upon completion of all commands. Signed-off-by: Fam Zheng --- fs/eventpoll.c | 50 ++

[PATCH v4 4/9] epoll: Add implementation for epoll_ctl_batch

2015-03-09 Thread Fam Zheng
This new syscall is a batched version of epoll_ctl. It will execute each command as specified in cmds in given order, and stop at first failure or upon completion of all commands. Signed-off-by: Fam Zheng f...@redhat.com --- fs/eventpoll.c | 50