Bug 1374168

Summary: Files isolated and nohz_full contain values from realtime profile when realtime-virtual-host profile is active
Product: Red Hat Enterprise Linux 7 Reporter: Tereza Cerna <tcerna>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: jeder, jskarvad
Target Milestone: rcKeywords: Patch, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.8.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 12:32:51 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: 1400961    

Description Tereza Cerna 2016-09-08 07:30:56 UTC
Description of problem:
=======================

Bad values were set into files isolated and nohz_full in directory /sys/devices/system/cpu if both configuration files /etc/tuned/realtime-variables.conf and /etc/tuned/realtime-virtual-host-variables.conf are filled, user select profile realtime-virtual-host and reboot system. In isolated and nohz_full files are values of isolated_cores from realtime profile, not from realtime-virtual-host profile. The same problem is also for profile realtime-virtual-guest.

Version:
========

tuned-2.7.1-2.el7.noarch
tuned-profiles-realtime-2.7.1-2.el7.noarch
tuned-profiles-nfv-2.7.1-2.el7.noarch


Steps to Reproduce:
===================

User should have machine with at least 8 cpus.

# cat /etc/tuned/realtime-variables.conf
isolated_cores=1-5
# cat /etc/tuned/realtime-virtual-host-variables.conf
isolated_cores=2-4

# tuned-adm active
Current active profile: balanced
# tuned-adm profile realtime-virtual-host

# reboot

# cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/rhel_intel--wildcatpass--05-root ro crashkernel=auto rd.lvm.lv=rhel_intel-wildcatpass-05/root rd.lvm.lv=rhel_intel-wildcatpass-05/swap net.ifnames=0 console=ttyS0,115200n81 isolcpus=1-5 nohz=on nohz_full=1-5 rcu_nocbs=1-5 intel_pstate=disable nosoftlockup
# cat /sys/devices/system/cpu/nohz_full 
1-5
# cat /sys/devices/system/cpu/isolated 
1-5


Actual results:
===============

Files nohz_full and isolated in directory /sys/devices/system/cpu contain values '1-5'. But this is setting from profile realtime, not from realtime-virtual-host.


Expected results:
=================

There should be value '2-4', setting from profile realtime-virtual-host.

# cat /sys/devices/system/cpu/nohz_full 
2-4
# cat /sys/devices/system/cpu/isolated 
2-4

Comment 3 Jaroslav Škarvada 2017-04-03 15:11:29 UTC
Fixed by following upstream commit:
https://github.com/redhat-performance/tuned/commit/0e7933ff0b3a575acd66791611792d6294df7348

Comment 5 Tereza Cerna 2017-04-26 13:02:16 UTC
============================
Verified in:
    tuned-2.8.0-2.el7.noarch
    tuned-profiles-nfv-guest-2.8.0-2.el7.noarch
    tuned-profiles-nfv-host-2.8.0-2.el7.noarch
PASS
============================

# cat /etc/tuned/realtime-variables.conf
isolated_cores=1-4
# cat /etc/tuned/realtime-virtual-guest-variables.conf
isolated_cores=3-6

# tuned-adm profile realtime-virtual-guest
# tuned-adm active
Current active profile: realtime-virtual-guest

# reboot

# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-514.el7.x86_64 root=/dev/mapper/rhel_intel--wildcatpass--02-root ro crashkernel=auto rd.lvm.lv=rhel_intel-wildcatpass-02/root rd.lvm.lv=rhel_intel-wildcatpass-02/swap console=ttyS0,115200n81 isolcpus=3-6 nohz=on nohz_full=3-6 rcu_nocbs=3-6 intel_pstate=disable nosoftlockup

>> There we can see isolcpus=3-6 nohz=on nohz_full=3-6 rcu_nocbs=3-6

# cat /sys/devices/system/cpu/nohz_full 
3-6

# cat /sys/devices/system/cpu/isolated
3-6

--------------------------------------------------

Tested also by automated test case /CoreOS/tuned/Regression/nfv--error-when-try-to-use-nonexisting-cpu

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Checking for the presence of tuned rpm 
:: [   PASS   ] :: Checking for the presence of tuned-profiles-realtime rpm 
:: [   PASS   ] :: Checking for the presence of tuned-profiles-nfv rpm 
:: [   PASS   ] :: This test need machine with at least 8 CPUs (Assert: "56" should be >= "8")
:: [   PASS   ] :: Command 'tuned-adm profile balanced' (Expected 0, got 0)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME profile - before reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'echo 'isolated_cores=201-203' > /etc/tuned/realtime-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep -v realtime' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   PASS   ] :: Command 'echo 'isolated_cores=1-3' > /etc/tuned/realtime-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep realtime' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 1, got 1)
:: [   PASS   ] :: Command 'touch /var/tmp/tuned.flag1.reboot' (Expected 0, got 0)


### REBOOT ###


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME profile - after reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep '1-3' /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep -v '1-3' /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep 'isolcpus=1-3' /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep -v 'nohz_full=1-3' /proc/cmdline' (Expected 0, got 0)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME-VIRTUAL-HOST profile - before reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'echo 'isolated_cores=202-204' > /etc/tuned/realtime-virtual-host-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep -v realtime-virtual-host' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   PASS   ] :: Command 'echo 'isolated_cores=2-4' > /etc/tuned/realtime-virtual-host-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep realtime-virtual-host' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 1, got 1)
:: [   PASS   ] :: Command 'touch /var/tmp/tuned.flag2.reboot' (Expected 0, got 0)


### REBOOT ###


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME-VIRTUAL-HOST profile - after reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep '2-4' /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep '2-4' /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep 'isolcpus=2-4' /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep 'nohz_full=2-4' /proc/cmdline' (Expected 0, got 0)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME-VIRTUAL-GUEST profile - before reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'echo 'isolated_cores=203-205' > /etc/tuned/realtime-virtual-guest-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep -v realtime-virtual-guest' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 0, got 0)
:: [   PASS   ] :: Command 'echo 'isolated_cores=3-5' > /etc/tuned/realtime-virtual-guest-variables.conf' (Expected 0, got 0)
:: [   PASS   ] :: Command 'tuned-adm active | grep realtime-virtual-guest' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep "Assertion 'isolated_cores contains present CPU(s)' failed" output' (Expected 1, got 1)
:: [   PASS   ] :: Command 'grep "assertion 'isolated_cores contains present CPU(s)' failed" /var/log/tuned/tuned.log' (Expected 1, got 1)
:: [   PASS   ] :: Command 'touch /var/tmp/tuned.flag3.reboot' (Expected 0, got 0)


### REBOOT ###


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test REALTIME-VIRTUAL-GUEST profile - after reboot
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep '3-5' /sys/devices/system/cpu/isolated' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep '3-5' /sys/devices/system/cpu/nohz_full' (Expected 0, got 0)
:: [   PASS   ] :: Command 'cat /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep 'isolcpus=3-5' /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: Command 'grep 'nohz_full=3-5' /proc/cmdline' (Expected 0, got 0)
:: [   PASS   ] :: RESULT: Test REALTIME-VIRTUAL-GUEST profile - after reboot

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'rm output' (Expected 0, got 0)
:: [   PASS   ] :: Command 'rm /var/tmp/tuned.flag1.reboot' (Expected 0, got 0)
:: [   PASS   ] :: Command 'rm /var/tmp/tuned.flag2.reboot' (Expected 0, got 0)
:: [   PASS   ] :: Command 'rm /var/tmp/tuned.flag3.reboot' (Expected 0, got 0)
:: [   PASS   ] :: RESULT: Cleanup

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: /CoreOS/tuned/Regression/nfv--error-when-try-to-use-nonexisting-cpu
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: RESULT: /CoreOS/tuned/Regression/nfv--error-when-try-to-use-nonexisting-cpu

Comment 6 errata-xmlrpc 2017-08-01 12:32:51 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, 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/RHBA-2017:2102