Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-23 Thread Paolo Bonzini
On 22/01/2015 22:12, Andy Lutomirski wrote: > In my application, the set of fds almost never changes, but the set of > events I want changes all the time. The main thing that changes is > whether I care about EPOLLOUT. If I'm ready to send something, then I > want EPOLLOUT. If I'm not ready,

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-23 Thread Paolo Bonzini
On 22/01/2015 22:12, Andy Lutomirski wrote: In my application, the set of fds almost never changes, but the set of events I want changes all the time. The main thing that changes is whether I care about EPOLLOUT. If I'm ready to send something, then I want EPOLLOUT. If I'm not ready, then

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-22 Thread Fam Zheng
On Thu, 01/22 13:12, Andy Lutomirski wrote: > On Wed, Jan 21, 2015 at 3:50 AM, Paolo Bonzini wrote: > > > > > > On 21/01/2015 12:14, Fam Zheng wrote: > >> > My take for simplicity will be leaving epoll_ctl as-is, and my take for > >> > performance will be epoll_pwait1. And I don't really like

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-22 Thread Andy Lutomirski
On Wed, Jan 21, 2015 at 3:50 AM, Paolo Bonzini wrote: > > > On 21/01/2015 12:14, Fam Zheng wrote: >> > My take for simplicity will be leaving epoll_ctl as-is, and my take for >> > performance will be epoll_pwait1. And I don't really like putting my time >> > on >> > epoll_ctl_batch, thinking it

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-22 Thread Fam Zheng
On Thu, 01/22 13:12, Andy Lutomirski wrote: On Wed, Jan 21, 2015 at 3:50 AM, Paolo Bonzini pbonz...@redhat.com wrote: On 21/01/2015 12:14, Fam Zheng wrote: My take for simplicity will be leaving epoll_ctl as-is, and my take for performance will be epoll_pwait1. And I don't really like

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-22 Thread Andy Lutomirski
On Wed, Jan 21, 2015 at 3:50 AM, Paolo Bonzini pbonz...@redhat.com wrote: On 21/01/2015 12:14, Fam Zheng wrote: My take for simplicity will be leaving epoll_ctl as-is, and my take for performance will be epoll_pwait1. And I don't really like putting my time on epoll_ctl_batch, thinking

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 12:14, Fam Zheng wrote: > > My take for simplicity will be leaving epoll_ctl as-is, and my take for > > performance will be epoll_pwait1. And I don't really like putting my time on > > epoll_ctl_batch, thinking it as a ambivalent compromise in between. > > > I agree with Michael

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Wed, 01/21 11:37, Paolo Bonzini wrote: > > > On 21/01/2015 09:58, Fam Zheng wrote: > >> > See my comment in the earlier mail. If you split this into two > >> > APIs, and epoll_ctl_batch() is guaranteed to execute 'cmds' in order, > >> > then the return value of epoll_ctl_batch() could be

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 09:58, Fam Zheng wrote: >> > See my comment in the earlier mail. If you split this into two >> > APIs, and epoll_ctl_batch() is guaranteed to execute 'cmds' in order, >> > then the return value of epoll_ctl_batch() could be used to tell >> > user space how many commands

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 08:52, Michael Kerrisk (man-pages) wrote: >> > The problem is that there is no room for flags field in epoll_pwait1, >> > which is >> > asked for, in previous discussion thread [1]. > Ahh yes, I certainly should not have forgotten that. But that's easily solved. > Do as for

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Wed, 01/21 08:52, Michael Kerrisk (man-pages) wrote: > Hello Fam Zheng, > > On 01/21/2015 05:59 AM, Fam Zheng wrote: > > On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: > >> Hello Fam Zheng, > >> > >> On 01/20/2015 10:57 AM, Fam Zheng wrote: > >>> This syscall is a sequence of > >>> >

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Tue, 01/20 23:56, Omar Sandoval wrote: > On Tue, Jan 20, 2015 at 05:57:57PM +0800, Fam Zheng wrote: > > This syscall is a sequence of > > > > 1) a number of epoll_ctl calls > > 2) a epoll_pwait, with timeout enhancement. > > > > The epoll_ctl operations are embeded so that application doesn't

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 08:52, Michael Kerrisk (man-pages) wrote: The problem is that there is no room for flags field in epoll_pwait1, which is asked for, in previous discussion thread [1]. Ahh yes, I certainly should not have forgotten that. But that's easily solved. Do as for pselect6():

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 09:58, Fam Zheng wrote: See my comment in the earlier mail. If you split this into two APIs, and epoll_ctl_batch() is guaranteed to execute 'cmds' in order, then the return value of epoll_ctl_batch() could be used to tell user space how many commands succeeded. Much

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Wed, 01/21 11:37, Paolo Bonzini wrote: On 21/01/2015 09:58, Fam Zheng wrote: See my comment in the earlier mail. If you split this into two APIs, and epoll_ctl_batch() is guaranteed to execute 'cmds' in order, then the return value of epoll_ctl_batch() could be used to tell

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Paolo Bonzini
On 21/01/2015 12:14, Fam Zheng wrote: My take for simplicity will be leaving epoll_ctl as-is, and my take for performance will be epoll_pwait1. And I don't really like putting my time on epoll_ctl_batch, thinking it as a ambivalent compromise in between. I agree with Michael actually.

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Wed, 01/21 08:52, Michael Kerrisk (man-pages) wrote: Hello Fam Zheng, On 01/21/2015 05:59 AM, Fam Zheng wrote: On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: Hello Fam Zheng, On 01/20/2015 10:57 AM, Fam Zheng wrote: This syscall is a sequence of 1) a number of

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-21 Thread Fam Zheng
On Tue, 01/20 23:56, Omar Sandoval wrote: On Tue, Jan 20, 2015 at 05:57:57PM +0800, Fam Zheng wrote: This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application doesn't have to use

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Omar Sandoval
On Tue, Jan 20, 2015 at 05:57:57PM +0800, Fam Zheng wrote: > This syscall is a sequence of > > 1) a number of epoll_ctl calls > 2) a epoll_pwait, with timeout enhancement. > > The epoll_ctl operations are embeded so that application doesn't have to use > separate syscalls to insert/delete/update

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Michael Kerrisk (man-pages)
Hello Fam Zheng, On 01/21/2015 05:59 AM, Fam Zheng wrote: > On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: >> Hello Fam Zheng, >> >> On 01/20/2015 10:57 AM, Fam Zheng wrote: >>> This syscall is a sequence of >>> >>> 1) a number of epoll_ctl calls >>> 2) a epoll_pwait, with timeout

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Fam Zheng
On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: > Hello Fam Zheng, > > On 01/20/2015 10:57 AM, Fam Zheng wrote: > > This syscall is a sequence of > > > > 1) a number of epoll_ctl calls > > 2) a epoll_pwait, with timeout enhancement. > > > > The epoll_ctl operations are embeded so that

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Michael Kerrisk (man-pages)
Hello Fam Zheng, On 01/20/2015 10:57 AM, Fam Zheng wrote: > This syscall is a sequence of > > 1) a number of epoll_ctl calls > 2) a epoll_pwait, with timeout enhancement. > > The epoll_ctl operations are embeded so that application doesn't have to use > separate syscalls to insert/delete/update

[PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Fam Zheng
This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application doesn't have to use separate syscalls to insert/delete/update the fds before poll. It is more efficient if the set of fds varies from

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Michael Kerrisk (man-pages)
Hello Fam Zheng, On 01/20/2015 10:57 AM, Fam Zheng wrote: This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application doesn't have to use separate syscalls to insert/delete/update the

[PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Fam Zheng
This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application doesn't have to use separate syscalls to insert/delete/update the fds before poll. It is more efficient if the set of fds varies from

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Fam Zheng
On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: Hello Fam Zheng, On 01/20/2015 10:57 AM, Fam Zheng wrote: This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Omar Sandoval
On Tue, Jan 20, 2015 at 05:57:57PM +0800, Fam Zheng wrote: This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The epoll_ctl operations are embeded so that application doesn't have to use separate syscalls to insert/delete/update the

Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait

2015-01-20 Thread Michael Kerrisk (man-pages)
Hello Fam Zheng, On 01/21/2015 05:59 AM, Fam Zheng wrote: On Tue, 01/20 13:50, Michael Kerrisk (man-pages) wrote: Hello Fam Zheng, On 01/20/2015 10:57 AM, Fam Zheng wrote: This syscall is a sequence of 1) a number of epoll_ctl calls 2) a epoll_pwait, with timeout enhancement. The