From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755012AbbAVVNX (ORCPT ); Thu, 22 Jan 2015 16:13:23 -0500 Received: from mail-lb0-f180.google.com ([209.85.217.180]:47468 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754673AbbAVVNV (ORCPT ); Thu, 22 Jan 2015 16:13:21 -0500 MIME-Version: 1.0 In-Reply-To: <54BF9294.3070902@redhat.com> References: <1421747878-30744-1-git-send-email-famz@redhat.com> <1421747878-30744-6-git-send-email-famz@redhat.com> <54BE4F1D.7090807@gmail.com> <20150121045903.GA2858@fam-t430.nay.redhat.com> <54BF5ACE.6030206@gmail.com> <20150121085827.GB23024@ad.nay.redhat.com> <54BF814F.7090703@redhat.com> <20150121111404.GA3804@ad.nay.redhat.com> <54BF9294.3070902@redhat.com> From: Andy Lutomirski Date: Thu, 22 Jan 2015 13:12:59 -0800 Message-ID: Subject: Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait To: Paolo Bonzini Cc: Fam Zheng , "Michael Kerrisk (man-pages)" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Alexander Viro , Andrew Morton , Kees Cook , David Herrmann , Alexei Starovoitov , Miklos Szeredi , David Drysdale , Oleg Nesterov , "David S. Miller" , Vivek Goyal , Mike Frysinger , "Theodore Ts'o" , Heiko Carstens , Rasmus Villemoes , Rashika Kheria , Hugh Dickins , Mathieu Desnoyers , Peter Zijlstra , Linux FS Devel , Linux API , Josh Triplett Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 as a ambivalent compromise in between. >> >> > I agree with Michael actually. The big change is going from O(n) >> > epoll_ctl calls to O(1), and epoll_ctl_batch achieves that just fine. >> > Changing 2 syscalls to 1 is the icing on the cake, but we're talking of >> > a fraction of a microsecond. >> >> Maybe I'm missing something, but in common cases, the set of fds for epoll_wait >> doesn't change that radically from one iteration to another, does it? > > That depends on the application. 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 I don't want EPOLLOUT. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait Date: Thu, 22 Jan 2015 13:12:59 -0800 Message-ID: References: <1421747878-30744-1-git-send-email-famz@redhat.com> <1421747878-30744-6-git-send-email-famz@redhat.com> <54BE4F1D.7090807@gmail.com> <20150121045903.GA2858@fam-t430.nay.redhat.com> <54BF5ACE.6030206@gmail.com> <20150121085827.GB23024@ad.nay.redhat.com> <54BF814F.7090703@redhat.com> <20150121111404.GA3804@ad.nay.redhat.com> <54BF9294.3070902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Fam Zheng , "Michael Kerrisk (man-pages)" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Alexander Viro , Andrew Morton , Kees Cook , David Herrmann , Alexei Starovoitov , Miklos Szeredi , David Drysdale , Oleg Nesterov , "David S. Miller" , Vivek Goyal , Mike Frysinger , "Theodore Ts'o" , Heiko Carstens , Rasmus Villemoes , Rashika Kheria , Hugh Dickins Return-path: In-Reply-To: <54BF9294.3070902@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 as a ambivalent compromise in between. >> >> > I agree with Michael actually. The big change is going from O(n) >> > epoll_ctl calls to O(1), and epoll_ctl_batch achieves that just fine. >> > Changing 2 syscalls to 1 is the icing on the cake, but we're talking of >> > a fraction of a microsecond. >> >> Maybe I'm missing something, but in common cases, the set of fds for epoll_wait >> doesn't change that radically from one iteration to another, does it? > > That depends on the application. 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 I don't want EPOLLOUT. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH RFC 5/6] epoll: Add implementation for epoll_mod_wait Date: Thu, 22 Jan 2015 13:12:59 -0800 Message-ID: References: <1421747878-30744-1-git-send-email-famz@redhat.com> <1421747878-30744-6-git-send-email-famz@redhat.com> <54BE4F1D.7090807@gmail.com> <20150121045903.GA2858@fam-t430.nay.redhat.com> <54BF5ACE.6030206@gmail.com> <20150121085827.GB23024@ad.nay.redhat.com> <54BF814F.7090703@redhat.com> <20150121111404.GA3804@ad.nay.redhat.com> <54BF9294.3070902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <54BF9294.3070902@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Paolo Bonzini Cc: Fam Zheng , "Michael Kerrisk (man-pages)" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Alexander Viro , Andrew Morton , Kees Cook , David Herrmann , Alexei Starovoitov , Miklos Szeredi , David Drysdale , Oleg Nesterov , "David S. Miller" , Vivek Goyal , Mike Frysinger , Theodore Ts'o , Heiko Carstens , Rasmus Villemoes , Rashika Kheria , Hugh Dickins List-Id: linux-api@vger.kernel.org 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 as a ambivalent compromise in between. >> >> > I agree with Michael actually. The big change is going from O(n) >> > epoll_ctl calls to O(1), and epoll_ctl_batch achieves that just fine. >> > Changing 2 syscalls to 1 is the icing on the cake, but we're talking of >> > a fraction of a microsecond. >> >> Maybe I'm missing something, but in common cases, the set of fds for epoll_wait >> doesn't change that radically from one iteration to another, does it? > > That depends on the application. 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 I don't want EPOLLOUT. --Andy