Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1788009

Summary: Request nx_huge_pages=N as default value to avoid kvm-rt guest large latency spike
Product: Red Hat Enterprise Linux 7 Reporter: Pei Zhang <pezhang>
Component: kernel-rtAssignee: Marcelo Tosatti <mtosatti>
kernel-rt sub component: KVM QA Contact: Pei Zhang <pezhang>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: bhu, chayang, dhoward, fherrman, jinzhao, juzhang, lcapitulino, lgoncalv, mtosatti, nilal, trix, virt-maint, williams
Version: 7.8Keywords: ZStream
Target Milestone: rc   
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1788352 1812944 1812945 (view as bug list) Environment:
Last Closed: 2020-09-29 19:00:08 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1672377, 1781947, 1788352, 1812944, 1812945    

Description Pei Zhang 2020-01-06 06:13:07 UTC
Description of problem:

There is latency spike when testing kvm-rt guest with nx_huge_pages=Y( >= 50us). Testing with nx_huge_pages=N, the max latency can be lower 22us.

Version-Release number of selected component (if applicable):
rt-tests-1.5-9.el7.x86_64
qemu-kvm-rhev-2.12.0-41.el7.x86_64
libvirt-4.5.0-31.el7.x86_64
microcode_ctl-2.1-61.el7.x86_64
kernel-rt-3.10.0-1121.rt56.1085.el7.x86_64
tuned-2.11.0-8.el7.noarch


How reproducible:
100%


Steps to Reproduce:
1. Setup RT host

2. Set nx_huge_pages_recovery_ratio=0 in host

# modprobe -r kvm_intel
# modprobe -r kvm
# modprobe kvm nx_huge_pages_recovery_ratio=0
# modprobe kvm_intel

# systool -vm kvm | grep nx_huge_pages
    nx_huge_pages_recovery_ratio= "0"
    nx_huge_pages       = "Y"

2. Boot RT guest with 10vCPUs (2 for housekeeping CPUs and 8 for rt vCPUs)

3. Start 24h cyclictest in guest, max latency can reach 50us.

- Single VM with 8 rt vCPUs(max latency is 50us):
# Min Latencies: 00006 00008 00008 00007 00008 00008 00008 00007
# Avg Latencies: 00008 00008 00008 00008 00008 00008 00008 00008
# Max Latencies: 00044 00050 00020 00047 00022 00021 00026 00041

4. If set nx_huge_pages=N, the max latency of 24h cyclictest in above guest is 22us.

# modprobe -r kvm_intel
# modprobe -r kvm
# modprobe kvm nx_huge_pages_recovery_ratio=0 nx_huge_pages=N
# modprobe kvm_intel

# systool -vm kvm | grep nx_huge_pages
    nx_huge_pages_recovery_ratio= "0"
    nx_huge_pages       = "N"

- Single VM with 8 rt vCPUs(max latency is 22us):
# Min Latencies: 00006 00008 00008 00008 00008 00008 00008 00008
# Avg Latencies: 00008 00008 00008 00008 00008 00008 00008 00008
# Max Latencies: 00019 00019 00019 00022 00019 00020 00019 00020


Actual results:
There is large latency spike when testing with default nx_huge_pages value which is Y now.

Expected results:
There should be no large latency spike when testing with default nx_huge_pages value, we request to set it to be default N.

Additional info:
1. We hit this issue on rhel7.6.z kernel-rt-3.10.0-957.42.1.rt56.955.el7.x86_64.

- Single VM with 8 rt vCPUs(max latency is 99us):
# Min Latencies: 00006 00007 00007 00007 00007 00007 00007 00007
# Avg Latencies: 00008 00007 00007 00007 00007 00007 00007 00007
# Max Latencies: 00084 00082 00098 00099 00085 00033 00027 00019

Comment 14 Pei Zhang 2020-02-29 03:16:42 UTC
Verified with 3.10.0-1127.3.rt56.1096.el7.x86_64:

1. Default value of  nx_huge_pages is N.

# systool -vm kvm | grep nx_huge
    nx_huge_pages_recovery_ratio= "0"
    nx_huge_pages       = "N"

2. KVM-RT acceptance testing looks good. 6h cyclictest max latency is 18us.

(1)Single VM with 1 rt vCPU:
# Min Latencies: 00005
# Avg Latencies: 00007
# Max Latencies: 00016

(2)Single VM with multiple rt vCPUs:
# Min Latencies: 00006 00008 00008 00008 00008 00008 00008 00008
# Avg Latencies: 00007 00008 00008 00008 00008 00008 00008 00008
# Max Latencies: 00017 00016 00016 00016 00016 00016 00016 00016

(3)
- VM1
# Min Latencies: 00006
# Avg Latencies: 00007
# Max Latencies: 00018

- VM2
# Min Latencies: 00006
# Avg Latencies: 00007
# Max Latencies: 00016

- VM3
# Min Latencies: 00006
# Avg Latencies: 00007
# Max Latencies: 00017

- VM4

# Min Latencies: 00006
# Avg Latencies: 00007
# Max Latencies: 00018

So this bug has been fixed very well.

Comment 17 Pei Zhang 2020-02-29 04:20:55 UTC
Move to 'verified' as Comment 14.

Comment 22 errata-xmlrpc 2020-09-29 19:00:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: kernel-rt security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4062