Are there any adverse implications when lowering the default values of either write_expire and/or read_expire of deadline IO scheduler?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux
    • Deadline IO scheduler

Issue

  • Are there any adverse implications when lowering the default values of either write_expire and/or read_expire of deadline IO scheduler?

Resolution

No adverse implications will occur with deadline io scheduler in tuning the read/write expire times. The scheduler will just switch faster between the four queues that it manages.

Following are the default values in RHEL7

/sys/block/sda/queue/iosched/read_expire:500      {time in milliseconds}
/sys/block/sda/queue/iosched/write_expire:5000    {time in milliseconds}

Details.

There are four queues within the deadline scheduler; two read and two write. Each pair of queues has a sorted io queue (by lba) and time ordered (sorted by time the io was submitted into the scheduler, so essentially fifo) io queue. The scheduler normally pulls from the lba sorted queue. It pull so many reads (the specified ratio limit) and then does checks as to which queue to pull io from next. These checks are

  1. are there any writes to perform, and
  2. are there any writes past the expire limit on the write fifo (time ordered) queue,
  3. if there are no writes are then any reads expired, and
  4. if not pull from the sorted read queue.

It then dispatches any writes, if present, from the selected write queue. It will perform up to a batch limit of writes if the writes are sequential. It then will perform a queue switch to reads and perform the same type of check: any reads at all pending, any past the expire time in the fifo queue -- select the appropriate queue, dispatch up to ratio limit reads. And so it ping-pongs back and forth between the two types of io: reads -> writes -> reads -> writes and at switch over to the different io type performs a queue evaluation of whether to pull from the sorted or fifo (time ordered) queue. Lowering the write expire time just allows older io to jump ahead of the sorted write io in terms of dispatch priority.

Components
Category

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.