From: Jason Baron <jbaron@akamai.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: "lsf-pc@lists.linux-foundation.org"
<lsf-pc@lists.linux-foundation.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"famz@redhat.com" <famz@redhat.com>
Subject: Re: [LSF/MM TOPIC] epoll topics
Date: Tue, 20 Jan 2015 15:37:33 -0500 [thread overview]
Message-ID: <54BEBC8D.3020802@akamai.com> (raw)
In-Reply-To: <20150120195812.GA5549@dcvr.yhbt.net>
On 01/20/2015 02:58 PM, Eric Wong wrote:
> Jason Baron <jbaron@akamai.com> wrote:
>> On 01/18/2015 10:50 PM, Eric Wong wrote:
>>> Jason Baron <jbaron@akamai.com> wrote:
>>>> In addition, we've observed some short comings from our production systems.
>>>> Because wait queues are woken up in order, we can get unfair loading
>>>> across threads,
>>> Are you referring to LIFO scheduling of epoll_wait calling
>>> __add_wait_queue_exclusive? I always thought LIFO was preferable
>>> since it kept the same threads active to reduce cache misses.
>> So the specific case I had in mind was where you have an epfd
>> per-thread that is attached to a single listen socket. When a
>> POLLIN occurs on the listen socket, all threads in epoll_wait will
>> be woken up in the order they were added. Then, network
>> traffic ends up being processed on the thread which does the
>> accept(). This tends to result in an unbalanced load across the
>> threads.
> Ah, yes. Non-blocking listen sockets is a problem with epoll.
>
> Have you tried using a dedicated thread for blocking accept() and
> EPOLL_CTL_ADD?
That's a possibility for us - I am also wondering if the idea of rotating
the wait queue will work well in practice, since epoll will naturally tend
to wake up the thread that is least busy at the moment (since any
threads sitting in epoll_wait will tend to process the wakeup first).
Thanks,
-Jason
prev parent reply other threads:[~2015-01-20 20:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 4:08 [LSF/MM TOPIC] epoll topics Jason Baron
2015-01-19 3:50 ` Eric Wong
2015-01-20 18:55 ` Jason Baron
2015-01-20 19:58 ` Eric Wong
2015-01-20 20:37 ` Jason Baron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54BEBC8D.3020802@akamai.com \
--to=jbaron@akamai.com \
--cc=famz@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=normalperson@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).