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 1251507

Summary: restore_elevator function from /usr/lib/tuned/functions doesn't work correctly
Product: Red Hat Enterprise Linux 7 Reporter: Cameron Ortiz <cameron.ortiz>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: cameron.ortiz, jeder, jskarvad, tcerna
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.7.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 07:23:56 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:
Attachments:
Description Flags
sample tuned profile (tuned.conf and script.sh) none

Description Cameron Ortiz 2015-08-07 14:33:14 UTC
Created attachment 1060380 [details]
sample tuned profile (tuned.conf and script.sh)

Description of problem:

When trying to use the set_elevator and restore_elevator functions in script for a custom tuned policy, the restore_elevator function is unable to correctly reset the elevator.


Version-Release number of selected component (if applicable): 

tuned-2.4.1-1.el7.noarch

How reproducible: Easily


Steps to Reproduce:
1. Make sure the ioscheduler on a given device is set to deadline or noop:
# echo deadline > /sys/block/xvda/queue/scheduler
2. Move the test profile (attached as testprofile.tgz) into /etc/tuned.  This should contain 2 files:
/etc/tuned/testprofile/tuned.conf
/etc/tuned/testprofile/script.sh
3. Switch to the testprofile and you will see that the io schedule is changed to cfq:
# tuned-adm profile testprofile
# cat /sys/block/xvda/queue/scheduler
4. Turn off tuned or switch to a different profile and you will see that the ioscheduler has not been changed back:
# tuned-adm off
# cat /sys/block/xvda/queue/scheduler

Actual results:
The io scheduler is not reverted back when the restore_elevator function is used.

Expected results:
The io scheduler should be reverted back to what was previously set.

Additional info:
Looking into this further I can see that the set_elevator function is creating the following file:

# cat /run/tuned/elevator_xvda.save
noop [deadline] cfq

This is then being echoed into /sys/block/xvda/queue/scheduler which is failing:

write error: Invalid argument

Comment 2 Jaroslav Škarvada 2015-08-21 14:37:52 UTC
Thanks for report.

It is fixed by the following upstream commit:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=04c5222abcb46fef9ba337f279396cd13d711faa

You can also use tuned.conf functionality for this task (recommended). In fact the "functions" library is there for backward compatibility. E.g. tuned.conf content:

[disk_xvda]
type=disk
devices=xvda
elevator=cfq

Comment 4 Tereza Cerna 2016-08-22 06:22:09 UTC
============================
Verified in:
    tuned-2.7.1-2.el7.noarch
PASS
============================

# echo deadline > /sys/block/sda/queue/scheduler
# cat /sys/block/sda/queue/scheduler 
noop [deadline] cfq 
# tuned-adm profile testprofile
# cat /sys/block/sda/queue/scheduler 
noop deadline [cfq] 
# tuned-adm off
# cat /sys/block/sda/queue/scheduler 
noop [deadline] cfq 

============================
Reproduced in:
    tuned-2.4.1-1.el7.noarch
FAIL
============================

# echo deadline > /sys/block/sda/queue/scheduler
# cat /sys/block/sda/queue/scheduler 
noop [deadline] cfq 
# tuned-adm profile testprofile
# cat /sys/block/sda/queue/scheduler 
noop deadline [cfq] 
# tuned-adm off
# cat /sys/block/sda/queue/scheduler 
noop deadline [cfq]

Comment 6 errata-xmlrpc 2016-11-04 07:23:56 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://rhn.redhat.com/errata/RHBA-2016-2479.html