From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fam Zheng Subject: Re: [PATCH RFC 0/6] epoll: Introduce new syscall "epoll_mod_wait" Date: Tue, 20 Jan 2015 18:53:38 +0800 Message-ID: <20150120105338.GA4040@ad.nay.redhat.com> References: <1421747878-30744-1-git-send-email-famz@redhat.com> <874mrl3fh9.fsf@rasmusvillemoes.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Alexander Viro , Andrew Morton , Kees Cook , Andy Lutomirski , David Herrmann , Alexei Starovoitov , Miklos Szeredi , David Drysdale , Oleg Nesterov , "David S. Miller" , Vivek Goyal , Mike Frysinger , "Theodore Ts'o" , Heiko Carstens , Rashika Kheria , Hugh Dickins , Mathieu Desnoyers , Peter Zijlstra , linux-fsdevel-u79uwXL29TbrhsbdSgBK9A@public.gmane.org To: Rasmus Villemoes Return-path: Content-Disposition: inline In-Reply-To: <874mrl3fh9.fsf-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 01/20 11:37, Rasmus Villemoes wrote: > On Tue, Jan 20 2015, Fam Zheng wrote: > > > DESCRIPTION > > > > The epoll_mod_wait() system call can be seen as an enhanced combination > > of several epoll_ctl(2) calls, which are followed by an epoll_pwait(2) > > call. It is superior in two cases: > > > > 1) When epoll_ctl(2) are followed by epoll_wait(2), using epoll_mod_wait > > will save context switches between user mode and kernel mode; > > > > 2) When you need higher precision than microsecond for wait timeout. > > You probably want to say millisecond. Yes, you see that I just can't make this right. :) > > > struct epoll_mod_cmd { > [...] > > }; > > > > struct epoll_wait_spec { > [...] > > } EPOLL_PACKED; > > Either both or none of these should mention that EPOLL_PACKED is in fact > part of the actual definition. The changelog for 3/6 sorta mentions > that it's not really needed for epoll_mod_cmd. Why is it necessary for > either struct? Yeah. it's probably not really necessary. > > > RETURN VALUE > > > > When successful, epoll_mod_wait() returns the number of file > > descriptors ready for the requested I/O, or zero if no file descriptor > > became ready during the requested timeout milliseconds. > > And here, it doesn't make sense to mention a unit, since the new timeout > is given using struct timespec (this was the whole point, right?). Right! Thanks, Fam