Bug 1251507 - restore_elevator function from /usr/lib/tuned/functions doesn't work correctly
Summary: restore_elevator function from /usr/lib/tuned/functions doesn't work correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Tereza Cerna
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-07 14:33 UTC by Cameron Ortiz
Modified: 2016-11-04 07:23 UTC (History)
4 users (show)

Fixed In Version: tuned-2.7.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 07:23:56 UTC


Attachments (Terms of Use)
sample tuned profile (tuned.conf and script.sh) (323 bytes, application/x-gzip)
2015-08-07 14:33 UTC, Cameron Ortiz
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2479 normal SHIPPED_LIVE tuned bug fix and enhancement update 2016-11-03 14:08:42 UTC

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


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