Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1182781 > unrolled thread

epoll and multiple processes - eliminate unneeded process wake-ups

Started byMadars Vitolins <m@silodev.com>
First post2015-07-13 14:50 +0200
Last post2015-07-15 15:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  epoll and multiple processes - eliminate unneeded process wake-ups Madars Vitolins <m@silodev.com> - 2015-07-13 14:50 +0200
    Re: epoll and multiple processes - eliminate unneeded process  wake-ups Madars Vitolins <m@silodev.com> - 2015-07-15 15:10 +0200

#1182781 — epoll and multiple processes - eliminate unneeded process wake-ups

FromMadars Vitolins <m@silodev.com>
Date2015-07-13 14:50 +0200
Subjectepoll and multiple processes - eliminate unneeded process wake-ups
Message-ID<pLLlg-53X-9@gated-at.bofh.it>
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/

[toc] | [next] | [standalone]


#1184789 — Re: epoll and multiple processes - eliminate unneeded process wake-ups

FromMadars Vitolins <m@silodev.com>
Date2015-07-15 15:10 +0200
SubjectRe: epoll and multiple processes - eliminate unneeded process wake-ups
Message-ID<pMuBI-8op-29@gated-at.bofh.it>
In reply to#1182781
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web