cfq-iosched: fix ncq detection code
authorCorrado Zoccolo <czoccolo@gmail.com>
Thu, 26 Nov 2009 09:02:57 +0000 (10:02 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 26 Nov 2009 09:02:57 +0000 (10:02 +0100)
commite459dd08f45d2aa68abb0c02f8ab045cf8a598b8
treee5bba2c95dbbd93d2880fdc81e1ea7589625a6ed
parent75e7b634309ef4eabf8a93d36e58863f727fa209
cfq-iosched: fix ncq detection code

CFQ's detection of queueing devices initially assumes a queuing device
and detects if the queue depth reaches a certain threshold.
However, it will reconsider this choice periodically.

Unfortunately, if device is considered not queuing, CFQ will force a
unit queue depth for some workloads, thus defeating the detection logic.
This leads to poor performance on queuing hardware,
since the idle window remains enabled.

Given this premise, switching to hw_tag = 0 after we have proved at
least once that the device is NCQ capable is not a good choice.

The new detection code starts in an indeterminate state, in which CFQ behaves
as if hw_tag = 1, and then, if for a long observation period we never saw
large depth, we switch to hw_tag = 0, otherwise we stick to hw_tag = 1,
without reconsidering it again.

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/cfq-iosched.c