Hi, I did some tests about NCQ. It appears enabling NCQ sometimes will make disk slower than disabling it (well it does improve performance in random io case). Test using fio with attached script. With queue_depth 1 (so NCQ is disabled), the disk speed is about 27m/s. with queue_depth 2 - 31, the speed is about 24m/s. blktrace shows the Q2C time with NCQ enabled increases about 10%. Specifically the D2C time increases and time of other stages hasn't obvious changes. I added a 'udelay()' at the end of ahci_qc_issue(), as my test does 'submit a request, wait it and then submit another', so if the udelay time is shorter than the disk io time, the udelay should not be harmful. My test shows when the udelay time is smaller than 90us, the delay hasn't any impact to the ncq enabled case. On the other hand, the udelay time should be shorter than 30us otherwise the ncq disabled case has obvious performance downgrade. This test seems suggesting diskio is slower in ncq enabled. Is the single diskio slow in ncq case expected? Thanks, Shaohua
[global] ioengine=libaio direct=1 size=256m directory=/tmp/a ioscheduler=cfq invalidate=1 [a] rw=read iodepth=1 cpus_allowed=0