Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbbGONHZ (ORCPT ); Wed, 15 Jul 2015 09:07:25 -0400 Received: from mail.elkosia.lv ([85.15.200.130]:45511 "EHLO mail.elkosia.lv" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbbGONHY (ORCPT ); Wed, 15 Jul 2015 09:07:24 -0400 X-Copfilter: Client is part of local network, skipped Spamassassin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 15 Jul 2015 16:07:17 +0300 From: Madars Vitolins To: Subject: Re: epoll and multiple processes - eliminate unneeded process wake-ups In-Reply-To: References: Message-ID: User-Agent: Roundcube Webmail/0.7.2 X-Copfilter-Originating-IP: 192.168.0.210 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1627 Lines: 45 Any comments? Madars Madars Vitolins @ 2015-07-13 15:34 rakstīja: > Hi Folks, > > I am developing kind of open systems application, which uses multiple > processes/executables where each of them monitors some set of > resources (in this case POSIX Queues) via epoll interface. For > example > when 10 processes on same queue are in state of epoll_wait() and one > message arrives, all 10 processes gets woken up and all of them tries > to read the message from Q. One succeeds, the others gets EAGAIN > error. The problem is with those others, which generates extra > context > switches - useless CPU usage. With more processes inefficiency gets > higher. > > I tried to use EPOLLONESHOT, but no help. Seems this is suitable for > multi-threaded application and not for multi-process application. > > Ideal mechanism for this would be: > 1. If multiple epoll sets in kernel matches same event and one or > more processes are in state of epoll_wait() - then send event only to > one waiter. > 2. If none of processes are in wait state, then send the event to all > epoll sets (as it is currently). Then the first free process will > grab > the event. > > How do you think, would it be real to implement this? How about > concurrency? > Can you please give me some hints from which points in code to start > to implement these changes? > > > Thanks a lot in advance, > Madars -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/