From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697AbbBQTqi (ORCPT ); Tue, 17 Feb 2015 14:46:38 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:42882 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbbBQTqg (ORCPT ); Tue, 17 Feb 2015 14:46:36 -0500 MIME-Version: 1.0 In-Reply-To: References: From: Andy Lutomirski Date: Tue, 17 Feb 2015 11:46:14 -0800 Message-ID: Subject: Re: [PATCH v2 0/2] Add epoll round robin wakeup mode To: Jason Baron Cc: Peter Zijlstra , Ingo Molnar , Al Viro , Andrew Morton , Eric Wong , Davide Libenzi , Michael Kerrisk-manpages , "linux-kernel@vger.kernel.org" , Linux FS Devel , Linux API 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 Tue, Feb 17, 2015 at 11:33 AM, Jason Baron wrote: > When we are sharing a wakeup source among multiple epoll fds, we end up with > thundering herd wakeups, since there is currently no way to add to the > wakeup source exclusively. This series introduces 2 new epoll flags, > EPOLLEXCLUSIVE for adding to a wakeup source exclusively. And EPOLLROUNDROBIN > which is to be used in conjunction to EPOLLEXCLUSIVE to evenly > distribute the wakeups. This patch was originally motivated by a desire to > improve wakeup balance and cpu usage for a listen socket() shared amongst > multiple epoll fd sets. > > See: http://lwn.net/Articles/632590/ for previous test program and testing > resutls. > > Epoll manpage text: > > EPOLLEXCLUSIVE > Provides exclusive wakeups when attaching multiple epoll fds to a > shared wakeup source. Must be specified with an EPOLL_CTL_ADD operation. > > EPOLLROUNDROBIN > Provides balancing for exclusive wakeups when attaching multiple epoll > fds to a shared wakeup soruce. Depends on EPOLLEXCLUSIVE being set and > must be specified with an EPOLL_CTL_ADD operation. > > Thanks, What permissions do you need on the file descriptor to do this? This will be the first case where a poll-like operation has side effects, and that's rather weird IMO. --Andy > > -Jason > > > Jason Baron (2): > sched/wait: add round robin wakeup mode > epoll: introduce EPOLLEXCLUSIVE and EPOLLROUNDROBIN > > fs/eventpoll.c | 25 ++++++++++++++++++++----- > include/linux/wait.h | 11 +++++++++++ > include/uapi/linux/eventpoll.h | 6 ++++++ > kernel/sched/wait.c | 10 ++++++++-- > 4 files changed, 45 insertions(+), 7 deletions(-) > > -- > 1.8.2.rc2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-api" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Andy Lutomirski AMA Capital Management, LLC