From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756523AbbAHLMP (ORCPT ); Thu, 8 Jan 2015 06:12:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57407 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754069AbbAHLMM (ORCPT ); Thu, 8 Jan 2015 06:12:12 -0500 Message-ID: <54AE65BB.1020707@redhat.com> Date: Thu, 08 Jan 2015 12:10:51 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Fam Zheng , linux-kernel@vger.kernel.org CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Alexander Viro , Andrew Morton , Miklos Szeredi , Juri Lelli , Zach Brown , David Drysdale , Kees Cook , Alexei Starovoitov , David Herrmann , Dario Faggioli , "Theodore Ts'o" , Peter Zijlstra , Vivek Goyal , Mike Frysinger , Heiko Carstens , Rasmus Villemoes , Oleg Nesterov , Mathieu Desnoyers , Fabian Frederick , Josh Triplett , "David S. Miller" , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, Stefan Hajnoczi Subject: Re: [RESEND PATCH 2/3] epoll: Add implementation for epoll_pwait1 References: <1420708563-21743-1-git-send-email-famz@redhat.com> <1420708563-21743-3-git-send-email-famz@redhat.com> In-Reply-To: <1420708563-21743-3-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2015 10:16, Fam Zheng wrote: > Unlike ppoll(2), which accepts a timespec argument "timeout_ts" to > specify the timeout, epoll_wait(2) and epoll_pwait(2) expect a > microsecond timeout in int type. > > This is an obstacle for applications in switching from ppoll to epoll, > if they want nanosecond resolution in their event loops. > > Therefore, adding this variation of epoll wait interface, giving user an > option with *both* advantages, is a reasonable move: there could be > constantly scalable performance polling many fds, while having a > nanosecond timeout precision (assuming it has properly set up timer > slack with prctl(2)). > > Signed-off-by: Fam Zheng > --- > fs/eventpoll.c | 24 ++++++++++++++++++++++++ > include/linux/syscalls.h | 4 ++++ > kernel/sys_ni.c | 3 +++ > 3 files changed, 31 insertions(+) As mentioned by Miklos in the non-resent version, please add a flags argument. Invalid flags should return -EINVAL. In fact, we could already use the flags argument to specify an absolute timeout, which is a nice thing to have for QEMU too. Paolo