All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq
@ 2016-12-03  3:15 Jens Axboe
  2016-12-03  3:15 ` [PATCH 1/7] block: use legacy path for flush requests for MQ with a scheduler Jens Axboe
                   ` (7 more replies)
  0 siblings, 8 replies; 33+ messages in thread
From: Jens Axboe @ 2016-12-03  3:15 UTC (permalink / raw)
  To: axboe, linux-block; +Cc: paolo.valente

This is by no means done, but it seems to work well enough that
I thought I'd send it out for others to take a look at and play
with.

Basically this allows blk-mq managed devices to run the legacy
IO schedulers, unmodified. The only requirement is that the
blk-mq device has to be single queue for now, though that
limitation would be rather simple to lift.

Since this is a debug patch, the default scheduler is deadline.
You can switch that to the other configured schedulers, as you
would with non-mq devices. Here's an example of a scsi-mq device
that is running deadline, and being switched to CFQ online:

root@leopard:~# cat /sys/block/sda/mq/0/tags 
nr_tags=31, reserved_tags=0, bits_per_word=4
nr_free=31, nr_reserved=0
active_queues=0

root@leopard:~# cat /sys/block/sda/queue/scheduler 
noop [deadline] cfq 

root@leopard:~# echo cfq > /sys/block/sda/queue/scheduler 
root@leopard:~# cat /sys/block/sda/queue/scheduler 
noop deadline [cfq] 

Testing welcome. There's certainly room for improvement here, so
I'm mostly interested in grave performance issues or crashes, if any.

Can also be viewed/fetched via git:

git://git.kernel.dk/linux-block for-4.11/blk-mq-legacy-sched

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCHSET/RFC v2] Make legacy IO schedulers work with blk-mq
@ 2016-12-05 18:26 Jens Axboe
  2016-12-05 18:27 ` [PATCH 3/7] block: use appropriate queue running functions Jens Axboe
  0 siblings, 1 reply; 33+ messages in thread
From: Jens Axboe @ 2016-12-05 18:26 UTC (permalink / raw)
  To: axboe, linux-block, linux-kernel; +Cc: paolo.valente

Version 2 of the hack/patchset, that enables blk-mq to use the legacy
IO schedulers with single queue devices. Original posting is here:

https://marc.info/?l=linux-block&m=148073493203664&w=2

You can also found this version in the following git branch:

git://git.kernel.dk/linux-block blk-mq-legacy-sched.2

and new developments/fixes will happen in the 'blk-mq-legacy-sched'
branch.

Changes since v1:

- Remove the default 'deadline' hard wiring, and provide Kconfig
  entries to set the blk-mq scheduler. This now works like for legacy
  devices.

- Rename blk_use_mq_path() to blk_use_sched_path() to make it more
  clear. Suggested by Johannes Thumshirn.

- Fixup a spot where we did not use the accessor function to determine
  what path to use.

- Flush mq software queues, even if IO scheduler managed. This should
  make paths work that are MQ aware, and using only MQ interfaces.

- Cleanup free path of MQ request.

- Account when IO was queued to a hardware context, similarly to the
  regular MQ path.

- Add BLK_MQ_F_NO_SCHED flag, so that drivers can explicitly ask for
  no scheduling on a queue. Add this for NVMe admin queues.

- Kill BLK_MQ_F_SCHED, since we now have Kconfig entries for setting
  the desired IO scheduler.

- Fix issues with live scheduler switching through sysfs. Should now
  be solid, even with lots of IO running on the device.

- Drop null_blk and SCSI changes, not needed anymore.


 block/Kconfig.iosched   |   29 ++++
 block/blk-core.c        |   77 ++++++-----
 block/blk-exec.c        |   12 +
 block/blk-flush.c       |   40 +++--
 block/blk-merge.c       |    5 
 block/blk-mq.c          |  332 +++++++++++++++++++++++++++++++++++++++++++++---
 block/blk-mq.h          |    1 
 block/blk-sysfs.c       |    2 
 block/blk.h             |   16 ++
 block/cfq-iosched.c     |   22 ++-
 block/elevator.c        |  125 ++++++++++++------
 drivers/nvme/host/pci.c |    1 
 include/linux/blk-mq.h  |    1 
 include/linux/blkdev.h  |    2 
 14 files changed, 555 insertions(+), 110 deletions(-)

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-12-06 19:50 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-03  3:15 [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq Jens Axboe
2016-12-03  3:15 ` [PATCH 1/7] block: use legacy path for flush requests for MQ with a scheduler Jens Axboe
2016-12-05 13:05   ` Christoph Hellwig
2016-12-05 15:07     ` Jens Axboe
2016-12-05 15:49       ` Johannes Thumshirn
2016-12-05 15:49         ` Jens Axboe
2016-12-05 22:40       ` Mike Snitzer
2016-12-05 22:50         ` Jens Axboe
2016-12-06 19:50           ` Mike Snitzer
2016-12-05 17:00   ` Ming Lei
2016-12-05 17:09     ` Jens Axboe
2016-12-05 19:22       ` Ming Lei
2016-12-05 19:35         ` Jens Axboe
2016-12-03  3:15 ` [PATCH 2/7] cfq-iosched: use appropriate run queue function Jens Axboe
2016-12-05  8:48   ` Johannes Thumshirn
2016-12-05 15:12     ` Jens Axboe
2016-12-05 15:18       ` Johannes Thumshirn
2016-12-05 13:06   ` Christoph Hellwig
2016-12-05 15:08     ` Jens Axboe
2016-12-03  3:15 ` [PATCH 3/7] block: use appropriate queue running functions Jens Axboe
2016-12-05  9:01   ` Johannes Thumshirn
2016-12-05 13:07   ` Christoph Hellwig
2016-12-05 15:10     ` Jens Axboe
2016-12-05 17:39       ` Jens Axboe
2016-12-03  3:15 ` [PATCH 4/7] blk-mq: blk_account_io_start() takes a bool Jens Axboe
2016-12-05  9:01   ` Johannes Thumshirn
2016-12-05 13:08   ` Christoph Hellwig
2016-12-03  3:15 ` [PATCH 5/7] blk-mq: test patch to get legacy IO schedulers working Jens Axboe
2016-12-03  3:15 ` [PATCH 6/7] block: drop irq+lock when flushing queue plugs Jens Axboe
2016-12-03  3:15 ` [PATCH 7/7] null_blk: add parameters to ask for mq-sched and write cache Jens Axboe
2016-12-03  4:02 ` [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq Jens Axboe
2016-12-03  4:04   ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2016-12-05 18:26 [PATCHSET/RFC v2] " Jens Axboe
2016-12-05 18:27 ` [PATCH 3/7] block: use appropriate queue running functions Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.