SUSE Support

Here When You Need Us

tuned-adm fails to set kernel scheduler for block devices

This document (7024212) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server for SAP Applications 12 SP 4

Situation

In /var/log/tuned/tuned.log the following error is observed
 
2019-10-04 17:33:53,280 ERROR    tuned.utils.commands: Writing to file /sys/block/vda/queue/scheduler error: [Errno 22] Invalid argument
2019-10-04 17:33:53,281 ERROR    tuned.utils.commands: Writing to file /sys/block/vdb/queue/scheduler error: [Errno 22] Invalid argument
 
Checking the scheduler settings for the block devices show they are different from the settings in the selected tuned profile:
 
testvm:~ # lsblk  -o  'NAME,KNAME,MAJ:MIN,FSTYPE,LABEL,RO,RM,MODEL,SIZE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,MOUNTPOINT'
NAME   KNAME MAJ:MIN FSTYPE LABEL RO RM MODEL  SIZE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED       MOUNTPOINT
vda    vda   254:0                 0  0         36G root  disk  brw-rw----         0    512      0     512     512    1 mq-deadline
├─vda1 vda1  254:1   ext3   logs   0  0          2G root  disk  brw-rw----         0    512      0     512     512    1 mq-deadline /var/log/local
└─vda2 vda2  254:2   swap          0  0         33G root  disk  brw-rw----         0    512      0     512     512    1 mq-deadline [SWAP]
vdb    vdb   254:16                1  0        256K root  disk  brw-rw----         0    512      0     512     512    1 mq-deadline
 
Checking the available scheduler settings show different options than the well known ones (deadline, noop, cfq):
 
testvm:~ # cat /sys/block/vd*/queue/scheduler
[mq-deadline] kyber bfq none
[mq-deadline] kyber bfq none

Resolution

An override profile may be created as /etc/tuned/<profile-name>/profile.conf:
During the next steps the <profile-name> "sap-hana" will be used. 
 
  1. mkdir /etc/tuned/sap-hana/
     
  2. cp /usr/lib/tuned/sap-hana/tuned.conf /etc/tuned/sap-hana/tuned.conf
     
  3. Change the line "elevator = " to the preferred scheduler
     
  4. Change the line "script = script.sh" to "script = /usr/lib/tuned/<profile-name>/script.sh"
     
  5. Activate the new settings using tuned-adm profile <profile-name>:
tuned-adm profile sap-hana

Cause

The situation described above was seen when a KVM VM using tuned was configured using the noop scheduler but when checking showed mq-deadline despite correct 
setting in the respective tuned.conf file. Due to changes in the kernel new multiqueue I/O schedulers were introduced and the naming changed, this 
is why "invalid argument" is reported in tuned.log as an
 
echo noop > /sys/block/vda/queue/scheduler
 
is no longer accepted as valid option.

Additional Information

This example demonstrates the change of the kernel scheduler currently using the cfq scheduler. The correct scheduler in this VM scenario would be noop:
 
sles4sap12sp4:~ # lsblk  -o  'NAME,KNAME,MAJ:MIN,FSTYPE,LABEL,RO,RM,MODEL,SIZE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,MOUNTPOINT'
NAME   KNAME MAJ:MIN FSTYPE LABEL RO RM MODEL            SIZE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED MOUNTPOINT
sda    sda     8:0                 0  0 Virtual disk      50G root  disk  brw-rw----         0    512      0     512     512    1 cfq
├─sda1 sda1    8:1   swap          0  0                    2G root  disk  brw-rw----         0    512      0     512     512    1 cfq   [SWAP]
└─sda2 sda2    8:2   btrfs         0  0                   48G root  disk  brw-rw----         0    512      0     512     512    1 cfq   /
 
sles4sap12sp4:~ # mkdir /etc/tuned/sap-hana/
 
sles4sap12sp4:~ # cp /usr/lib/tuned/sap-hana/tuned.conf /etc/tuned/sap-hana/tuned.conf
 
sles4sap12sp4:~ # vi /etc/tuned/sap-hana/tuned.conf
 
sles4sap12sp4:~ # cat /etc/tuned/sap-hana/tuned.conf
#
# basic tuned configuration for SAP NetWeaver, SAP HANA and HANA based products.
# Additional parameters are tuned by script.sh
# For a brief explanation of the parameters, please have a look at the end of
# the central sapconf configuration file /etc/sysconfig/sapconf
#
[main]
summary=Optimize for SAP NetWeaver, SAP HANA and HANA based products
 
[cpu]
#governor = performance
#energy_perf_bias = performance
#min_perf_pct = 100
force_latency = 70
 
[disk]
elevator = noop
 
[script]
script = /usr/lib/tuned/sap-hana/script.sh
 
sles4sap12sp4:~ # tuned-adm profile sap-hana
 
sles4sap12sp4:~ # lsblk  -o  'NAME,KNAME,MAJ:MIN,FSTYPE,LABEL,RO,RM,MODEL,SIZE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,MOUNTPOINT'
NAME   KNAME MAJ:MIN FSTYPE LABEL RO RM MODEL            SIZE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED MOUNTPOINT
sda    sda     8:0                 0  0 Virtual disk      50G root  disk  brw-rw----         0    512      0     512     512    1 noop
├─sda1 sda1    8:1   swap          0  0                    2G root  disk  brw-rw----         0    512      0     512     512    1 noop  [SWAP]
└─sda2 sda2    8:2   btrfs         0  0                   48G root  disk  brw-rw----         0    512      0     512     512    1 noop  /

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7024212
  • Creation Date: 25-Oct-2019
  • Modified Date:09-Mar-2021
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.