All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Ed Swierk <eswierk@skyportsystems.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] virtio-scsi-pci iothread spins at 100%
Date: Thu, 9 Feb 2017 09:47:28 +0800	[thread overview]
Message-ID: <20170209014728.GF22807@lemon.lan> (raw)
In-Reply-To: <CAO_EM_m9Z7WcxRZthAGgeDgJ6UuwKXwAOEH7NC2=hL8Cd4jABg@mail.gmail.com>

On Wed, 02/08 08:33, Ed Swierk wrote:
> Recently I noticed that when I configure a virtio-scsi-pci device
> using an iothread, as soon as the guest virtio-scsi driver loads, the
> iothread spins at 100%:
> 
>   -object iothread,id=iothread1 -device virtio-scsi-pci,iothread=iothread1
> 
> This occurs whether or not a disk is attached, with either
> poll-max-ns=0 or poll-max-ns=32768, and with Linux 3.13, 4.1 and 4.4
> guests. The iothread stops spinning as soon as the guest driver is
> unloaded.
> 
> I bisected the issue to commit 684e508c23d28af8d6ed2c62738a0f60447c8274:
> 
>   aio: add .io_poll_begin/end() callbacks
> 
> It doesn't seem to affect performance, but obviously consuming CPU
> cycles when there's no disk attached is undesirable. Is this an
> expected side effect of implementing iothread polling?

No, something is wrong. The polling shouldn't keep running when there is no I/O
activity.

Can you try "perf top" to see what poll handlers are spinning?

Fam

  parent reply	other threads:[~2017-02-09  1:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 16:33 [Qemu-devel] virtio-scsi-pci iothread spins at 100% Ed Swierk
2017-02-08 16:54 ` Ed Swierk
2017-02-09  1:47 ` Fam Zheng [this message]
2017-02-09  2:11   ` Ed Swierk
2017-02-09  2:52     ` Fam Zheng
2017-02-09  3:44       ` Ed Swierk
2017-02-09  5:39         ` Fam Zheng
2017-02-09  6:43           ` Fam Zheng
2017-02-09 10:12         ` Fam Zheng
2017-02-09 13:52           ` Ed Swierk
2017-02-09 14:16             ` Fam Zheng

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=20170209014728.GF22807@lemon.lan \
    --to=famz@redhat.com \
    --cc=eswierk@skyportsystems.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.