[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 12/13] aio: self-tune polling time
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 12/13] aio: self-tune polling time |
Date: |
Tue, 6 Dec 2016 17:22:44 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Tue, Dec 06, 2016 at 11:12:45AM +0100, Christian Borntraeger wrote:
> On 12/06/2016 10:20 AM, Stefan Hajnoczi wrote:
> > On Mon, Dec 05, 2016 at 09:06:17PM +0100, Christian Borntraeger wrote:
> >> On 12/01/2016 08:26 PM, Stefan Hajnoczi wrote:
> >>> This patch is based on the algorithm for the kvm.ko halt_poll_ns
> >>> parameter in Linux. The initial polling time is zero.
> >>>
> >>> If the event loop is woken up within the maximum polling time it means
> >>> polling could be effective, so grow polling time.
> >>>
> >>> If the event loop is woken up beyond the maximum polling time it means
> >>> polling is not effective, so shrink polling time.
> >>>
> >>> If the event loop makes progress within the current polling time then
> >>> the sweet spot has been reached.
> >>>
> >>> This algorithm adjusts the polling time so it can adapt to variations in
> >>> workloads. The goal is to reach the sweet spot while also recognizing
> >>> when polling would hurt more than help.
> >>>
> >>> Two new trace events, poll_grow and poll_shrink, are added for observing
> >>> polling time adjustment.
> >>>
> >>> Signed-off-by: Stefan Hajnoczi <address@hidden>
> >>
> >> Not sure way, but I have 4 host ramdisks with the same iothread as guest
> >> virtio-blk. running fio in the guest on one of these disks will poll, as
> >> soon as I have 2 disks in fio I almost always see shrinks (so polling
> >> stays at 0) and almost no grows.
> >
> > Shrinking occurs when polling + ppoll(2) time exceeds poll-max-ns.
> >
> > What is the value of poll-max-ns
>
> I used 50000ns as poll value. When using 500000ns it is polling again.
>
> > and how long is run_poll_handlers_end - run_poll_handlers_begin?
>
> Too long. I looked again and I realized that I used cache=none without
> io=native. After adding io=native things are better. Even with 4 disks
> polling still happens. So it seems that the mileage will vary depending
> on the settings
Okay, it could be the things I mentioned. The self-tuning can be too
conservative and poll less than we'd hope for. On the other hand it's
hard to predict the actual ideal polling amount so I guess being
conservative is alright. Maybe the algorithm can be refined later.
Stefan
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v4 07/13] virtio-blk: suppress virtqueue kick during processing, (continued)
- [Qemu-devel] [PATCH v4 07/13] virtio-blk: suppress virtqueue kick during processing, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 05/13] linux-aio: poll ring for completions, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 08/13] virtio-scsi: suppress virtqueue kick during processing, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 09/13] virtio: turn vq->notification into a nested counter, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 11/13] virtio: disable virtqueue notifications during polling, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 10/13] aio: add .io_poll_begin/end() callbacks, Stefan Hajnoczi, 2016/12/01
- [Qemu-devel] [PATCH v4 12/13] aio: self-tune polling time, Stefan Hajnoczi, 2016/12/01
[Qemu-devel] [PATCH v4 13/13] iothread: add poll-grow and poll-shrink parameters, Stefan Hajnoczi, 2016/12/01
Re: [Qemu-devel] [PATCH v4 00/13] aio: experimental virtio-blk polling mode, Paolo Bonzini, 2016/12/02
Re: [Qemu-devel] [PATCH v4 00/13] aio: experimental virtio-blk polling mode, Stefan Hajnoczi, 2016/12/02
Re: [Qemu-devel] [PATCH v4 00/13] aio: experimental virtio-blk polling mode, Fam Zheng, 2016/12/05
Re: [Qemu-devel] [PATCH v4 00/13] aio: experimental virtio-blk polling mode, Christian Borntraeger, 2016/12/05