Bug 1121614

Summary: virtio-rng sets timer to bump up quota even if quota does not need adjusting
Product: Red Hat Enterprise Linux 7 Reporter: Amit Shah <amit.shah>
Component: qemu-kvm-rhevAssignee: pagupta
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: huding, juzhang, virt-maint, w90p710, xfu, xhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-27 10:22:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.