qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	xigao@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 0/6] aio: Support epoll by introducing qemu_poll abstraction
Date: Wed, 7 Jan 2015 15:08:08 +0000	[thread overview]
Message-ID: <20150107150808.GE22440@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20141216020438.GA18251@ad.nay.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2285 bytes --]

On Tue, Dec 16, 2014 at 10:04:38AM +0800, Fam Zheng wrote:
> On Thu, 12/04 11:43, Fam Zheng wrote:
> > v2: Emulate nanoseconds precison of timeout with ppoll and timerfd.
> >     Their performance is on par with each other, but both much better than
> >     qemu.git:
> > 
> >     syscall         high # of fd      low # of fd
> >     -------------------------------------------------
> >     qemu.git(ppoll) 44                96
> >     ppoll+epoll     85                101
> >     timerfd+epoll   87                109
> 
> More data points.
> 
> Xiaomei tested this series (applied on top of RHEL 7 qemu-kvm-rhev) and found
> that:
> 
> 0) when # of fds is high, epoll solutions are much better (+30%).
> 
> 1) timerfd+epoll is slightly better than ppoll+epoll, but the difference is
> minimal.
> 
> 2) original code is 2%~5% faster than the new implementations when # of fds is
> low.

What is "high" and "low"?

I'd like to understand whether they are extremes that almost no users
will encounter or whether they are plausible in the real world.

> This leads to the conclusion that that we'll have a small performance
> degradation if merge this series. I'm thinking about possible optimizations.
> Options in my mind are:
> 
> 1) Remove 1ns PR_SET_TIMERSLACK in timerfd+epoll, this doesn't make qemu_poll
> faster than the old qemu_poll_ns, but may have other positive effects that
> compensate the cost.

Sounds like a random hack.  What is the reasoning for messing with timer
slack?

Perhaps it is worth investigating timer slack as an independent issue
though.

> 2) Use dynamic switch between ppoll and timerfd+epoll. In poll-linux.c, We
> start with pure ppoll, while keeping track of elapsed time in ppoll. And
> periodically, we try "timerfd+epoll" for a few iterations, so that we can
> compare if it is faster than pure ppoll. If it is, swap them, use timerfd+epoll
> and and periodically try "ppoll".
> 
> That said, I'll also look at the kernel side. Maybe optimizing ppoll or just
> add EPOLL_NANOSECOND_TIMEOUT to epoll_create1 is a better place for
> engineering.

I agree that a kernel fix would be good.  Even if the patch is rejected,
we might get good ideas on how applications can optimize.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-01-07 15:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  3:43 [Qemu-devel] [PATCH v2 0/6] aio: Support epoll by introducing qemu_poll abstraction Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 1/6] poll: Introduce QEMU Poll API Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 2/6] posix-aio: Use QEMU poll interface Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 3/6] poll: Add epoll implementation for qemu_poll Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 4/6] main-loop: Replace qemu_poll_ns with qemu_poll Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 5/6] tests: Add test case for qemu_poll Fam Zheng
2014-12-04  3:43 ` [Qemu-devel] [PATCH v2 6/6] poll-linux: Add timerfd support Fam Zheng
2014-12-16  2:04 ` [Qemu-devel] [PATCH v2 0/6] aio: Support epoll by introducing qemu_poll abstraction Fam Zheng
2015-01-07 15:08   ` Stefan Hajnoczi [this message]
2015-01-08  2:53     ` Fam Zheng
2015-01-08 13:00       ` Paolo Bonzini

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=20150107150808.GE22440@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xigao@redhat.com \
    /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).