From: Ingo Molnar <mingo@kernel.org>
To: Jason Baron <jbaron@akamai.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
peterz@infradead.org, mingo@redhat.com, viro@zeniv.linux.org.uk,
normalperson@yhbt.net, davidel@xmailserver.org,
mtk.manpages@gmail.com, luto@amacapital.net,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-api@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Alexander Viro <viro@ftp.linux.org.uk>
Subject: Re: [PATCH v3 0/3] epoll: introduce round robin wakeup mode
Date: Thu, 5 Mar 2015 10:15:17 +0100 [thread overview]
Message-ID: <20150305091517.GA25158@gmail.com> (raw)
In-Reply-To: <54F7D343.5090106@akamai.com>
* Jason Baron <jbaron@akamai.com> wrote:
> 2) We are using the wakeup in this case to 'assign' work more
> permanently to the thread. That is, in the case of a listen socket
> we then add the connected socket to the woken up threads local set
> of epoll events. So the load persists past the wake up. And in this
> case, doing the round robin wakeups, simply allows us to access more
> cpu bandwidth. (I'm also looking into potentially using cpu affinity
> to do the wakeups as well as you suggested.)
So this is the part that I still don't understand.
What difference does LIFO versus FIFO wakeups make to CPU utilization:
a thread waiting for work is idle, no matter whether it ran most
recently or least recently.
Once an idle worker thread is woken it will compute its own work, for
whatever time it needs to, and won't be bothered by epoll again until
it finished its work and starts waiting again.
So regardless the wakeup order it's the same principal bandwidth
utilization, modulo caching artifacts [*] and modulo scheduling
artifacts [**]:
[*] Caching artifacts: in that sense Andrew's point stands: given
multiple equivalent choices it's more beneficial to pick a thread
that was most recently used (and is thus most cache-hot - i.e.
the current wakeup behavior), versus a thread that was least
recently used (and is thus the most cache-cold - i.e. the
round-robin wakeup you introduce).
[**] The hack patch I posted in my previous reply.
Thanks,
Ingo
next prev parent reply other threads:[~2015-03-05 9:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 21:25 [PATCH v3 0/3] epoll: introduce round robin wakeup mode Jason Baron
2015-02-24 21:25 ` [PATCH v3 1/3] sched/wait: add __wake_up_rotate() Jason Baron
2015-02-24 21:25 ` [PATCH v3 2/3] epoll: restrict wakeups to the overflow list Jason Baron
2015-02-24 21:25 ` [PATCH v3 3/3] epoll: Add EPOLL_ROTATE mode Jason Baron
[not found] ` <cover.1424805740.git.jbaron-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org>
2015-02-25 7:38 ` [PATCH v3 0/3] epoll: introduce round robin wakeup mode Ingo Molnar
2015-02-25 16:27 ` Jason Baron
[not found] ` <54EDF7D8.60201-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org>
2015-02-27 21:10 ` Andrew Morton
[not found] ` <20150227131034.2f2787dcabf285191a1f6ffa-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2015-02-27 21:31 ` Jonathan Corbet
[not found] ` <20150227143147.07785626-T1hC0tSOHrs@public.gmane.org>
2015-03-02 5:04 ` Jason Baron
2015-02-27 22:01 ` Jason Baron
2015-02-27 22:31 ` Andrew Morton
2015-03-05 0:02 ` Ingo Molnar
2015-03-05 3:53 ` Jason Baron
2015-03-05 9:15 ` Ingo Molnar [this message]
[not found] ` <20150305091517.GA25158-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-05 20:24 ` Jason Baron
2015-03-07 12:35 ` Jason Baron
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=20150305091517.GA25158@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=jbaron@akamai.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=mtk.manpages@gmail.com \
--cc=normalperson@yhbt.net \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ftp.linux.org.uk \
--cc=viro@zeniv.linux.org.uk \
/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).