Bug 1121614 - virtio-rng sets timer to bump up quota even if quota does not need adjusting
Summary: virtio-rng sets timer to bump up quota even if quota does not need adjusting
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: pagupta
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-21 11:42 UTC by Amit Shah
Modified: 2016-12-27 10:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-12-27 10:22:12 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Amit Shah 2014-07-21 11:42:47 UTC
Description of problem:

1. Even if max-bytes and period settings are not provided, the timer is armed.
2. When the quota available has reached the max-bytes amount, the timer is still armed.

This just means qemu keeps waking up to service the vrng->rate_limit_timer timer even when there's no work to do upon waking up.  This causes extra load on the host, as well as more power consumption.

The fix would be to not arm the timer when no quota restriction is specified, and also to disable the timer when the entire quota is replenished by a few timer invocations.

Comment 1 Amit Shah 2014-07-21 11:46:21 UTC
To test this, we can use virtio-rng trace events.

The trace events are not yet upstream, but I have posted a patch to do that.  The trace events can be backported as part of this bug.

Before this bug is fixed, the trace events will show the timer firing often in the function virtio_rng_process(), with a trace event like

virtio_rng_requested_size rng 0x7f984c218758: 0 bytes requested, 4294967295 bytes quota left

After the fix, such 0 bytes requested trace events should not occur.

Comment 4 pagupta 2016-12-27 10:22:12 UTC
Fixed in upstream version 2.4.

Note You need to log in before you can comment on or make changes to this bug.