How to use the Noop or None IO Schedulers

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 4, 5, 6, 7, 8

Issue

  • How to turn on the noop scheduler for a device?
  • How to turn on the none scheduler for a device?
  • What are the tunables for noop or none schedulers and what do they do?
  • How does the logic within the scheduler work in choosing which I/O to dispatch next?
  • How do you turn on the noop scheduler in RHEL 8?

Resolution

 

The noop scheduler is called none starting in RHEL 8.

Enable noop or none I/O scheduler

  • Per device: (at runtime, lost once rebooted)

    • RHEL 8:[1] none scheduler option

      $ echo 'none' > /sys/block/sda/queue/scheduler
      $ cat           /sys/block/sda/queue/scheduler
      [none] mq-deadline kyber bfq 
    • RHEL 4,5,6,7:[1] noop scheduler option
      $ echo 'noop' > /sys/block/sda/queue/scheduler
      $ cat           /sys/block/sda/queue/scheduler
      [noop] anticipatory deadline cfq 
  • All devices (at boot):

    • RHEL 7, 8: you can set none (RHEL 8) or noop (RHEL7) for all devices via editing /etc/default/grub as show below and then rebuilding the grub2 configuration file: (add option to existing GRUB_CMDLINE_LINUX line)

      [root@host ~]# cat /etc/default/grub
      GRUB_TIMEOUT=5
      GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
      GRUB_DEFAULT=saved
      GRUB_DISABLE_SUBMENU=true
      GRUB_TERMINAL_OUTPUT="console"
      GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel00/root rd.lvm.lv=rhel00/swap elevator=none"     <<= RHEL8 or later
      GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel00/root rd.lvm.lv=rhel00/swap elevator=noop"     <<= RHEL7
      GRUB_DISABLE_RECOVERY="true"
      • Verify the /etc/default/grub file contains only one copy GRUB_CMDLINE_LINUX=

        # grep "GRUB_CMDLINE_LINUX" etc/default/grub | egrep -v "^#|GRUB_CMDLINE_LINUX_DEFAULT"
        1
      • Rebuild the /boot/grub2/grub.cfg file by running the grub2-mkconfig command as follows:
        • On BIOS-based machines:

          [root@host ~]# grub2-mkconfig -o /boot/grub2/grub.cfg 
          Generating grub configuration file ...
          Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
          Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
          Found linux image: /boot/vmlinuz-0-rescue-537dacc8159a4d4caaa419342da0b820
          Found initrd image: /boot/initramfs-0-rescue-537dacc8159a4d4caaa419342da0b820.img
          done

        • On UEFI-based machines:
          [root@host ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg 
          Generating grub configuration file ...
          Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
          Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
          Found linux image: /boot/vmlinuz-0-rescue-537dacc8159a4d4caaa419342da0b820
          Found initrd image: /boot/initramfs-0-rescue-537dacc8159a4d4caaa419342da0b820.img
          done

    • RHEL 4, 5, 6: you can set noop for all devices via adding elevator=noop to the end of the kernel line in /etc/grub.conf file:

      title Red Hat Enterprise Linux Server (2.6.9-67.EL)
      root (hd0,0)
      kernel /vmlinuz-2.6.9-67.EL ro root=/dev/vg0/lv0 elevator=noop
      initrd /initrd-2.6.9-67.EL.img

 
tunables for none or noop IO schedulers
Individual IO scheduler personality tunables are located in /sys/block/sdN/queue./iosched. As seen below, the directory of tunables is empty - there are no tunables for the none (RHEL8) or noop (RHEL 4-7) IO schedulers.

  • RHEL8:

    $ ls            /sys/block/sda/queue/iosched
    $
  • RHEL 4,5,6,7:

    $ ls            /sys/block/sda/queue/iosched
    $

See Understanding the Noop IO Scheduler for further information.

noop vs none

The noop scheduler option within previous versions of RHEL is now called none withn RHEL 8 and later versions. Although it has a new name, it still is same functions the same as RHEL 4-7's noop io scheduler.

  • From RHEL 8's "Available disk schedulers", the none scheduler is describes as follows:

    none
    Implements a first-in first-out (FIFO) scheduling algorithm. It merges requests at
    the generic block layer through a simple last-hit cache.
  • From RHEL 7's "I/O schedulers", the noop scheduler is described as follows:
    noop
    The noop I/O scheduler implements a simple FIFO (first-in first-out) scheduling
    algorithm. Requests are merged at the generic block layer through a simple last-hit cache.

The two I/O schedulers perform the same function.

 

References

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

5 Comments

On UEFI- based machines, one must execute grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg instead of grub2-mkconfig -o /boot/grub2/grub.cfg.

For more info, see: Customizing the GRUB 2 Configuration File.

Is this persistent across kernel updates? Or will we, say after upgrade to newer kernel release, perform this change again? If so, wouldn't a udev rule based setting be more efficient ?

grubby --update-kernel=ALL --remove-args="rhgb quiet" --args="elevator=noop" works carries over to new kernels as well. It modifies /boot/grub2/grub.cfg

My question is why does it not change /etc/default/grub or am I doing something wrong?

I'm thinking this doesn't update the /etc/default/grub file because that's exactly that... the DEFAULT settings. grubby updates the live grub.cfg file directly, so you don't lose any previous edits that may have already been made with grubby

Just wondering why the "grubby" solution to edit grub.cfg directly isn't shown here also? the grub2-mkconfig command rebuilds grub.cfg based on the /etc/default/grub file, which potentially may not have been updated with other changes made to the live grub file.