* How to test SATA NCQ feature @ 2006-10-12 16:30 Fajun Chen 2006-10-12 17:12 ` Eric D. Mudama 0 siblings, 1 reply; 6+ messages in thread From: Fajun Chen @ 2006-10-12 16:30 UTC (permalink / raw) To: linux-ide; +Cc: Tejun Heo Hi Folks, I'm writing a program to test SATA Sil3124 NCQ feature. I assume NCQ is supported by libata by default, correct? Multi threading approach is used to send AT commands to device asynchronously. I can verify that data are sent to the device and read back correctly, but I don't know how to verify if NCQ works. Do I expect to see consistent performance gain in random read/write in NCQ mode? Thanks, Fajun ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to test SATA NCQ feature 2006-10-12 16:30 How to test SATA NCQ feature Fajun Chen @ 2006-10-12 17:12 ` Eric D. Mudama 2006-10-12 23:55 ` Fajun Chen 0 siblings, 1 reply; 6+ messages in thread From: Eric D. Mudama @ 2006-10-12 17:12 UTC (permalink / raw) To: Fajun Chen; +Cc: linux-ide, Tejun Heo For small random reads across the full stroke of the disk, you should see 50-80% improvement in performance, regardless of the state of read cache, at a depth of 32. For small random writes across the full stroke, performance should be unchanged if write cache is enabled in the drive. If write cache is disabled, you should see the same 50-80% performance improvement as for random reads. For sequential operations NCQ won't make much of a difference, and as the command block size increases, the performance delta will shrink between queued and non-queued. The exact asymptote is a function of many manufacturer and model-specific details. Remember that these are all ops/sec measurements. Command latency is a different kettle of fish. --eric On 10/12/06, Fajun Chen <fajunchen@gmail.com> wrote: > Hi Folks, > > I'm writing a program to test SATA Sil3124 NCQ feature. I assume NCQ > is supported by libata by default, correct? Multi threading approach > is used to send AT commands to device asynchronously. I can verify > that data are sent to the device and read back correctly, but I don't > know how to verify if NCQ works. Do I expect to see consistent > performance gain in random read/write in NCQ mode? > > Thanks, > Fajun > - > To unsubscribe from this list: send the line "unsubscribe linux-ide" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to test SATA NCQ feature 2006-10-12 17:12 ` Eric D. Mudama @ 2006-10-12 23:55 ` Fajun Chen 2006-10-13 0:42 ` Eric D. Mudama 2006-10-13 8:28 ` Jens Axboe 0 siblings, 2 replies; 6+ messages in thread From: Fajun Chen @ 2006-10-12 23:55 UTC (permalink / raw) To: Eric D. Mudama; +Cc: linux-ide, Tejun Heo Hi Eric, Thanks for your detailed explanation. In terms of ops/sec, I currently implemented it as the amout of data transferred per seconds. Please let me know if I need to implement it differently. I also have a question about NCQ error handling. Among all the outstanding commands, if one command fails, what will happen to the rest of the commands? I understand that all the commands in the device will be aborted by LOG PAGE 10h command, but how about the commands enqueued but haven't been sent to the device? In my particular application, one thread is blocked for every outstanding command. So depending on how libata handles outstanding commands, it will have significant implication to my user space application. Thanks, Fajun On 10/12/06, Eric D. Mudama <edmudama@gmail.com> wrote: > For small random reads across the full stroke of the disk, you should > see 50-80% improvement in performance, regardless of the state of read > cache, at a depth of 32. > > For small random writes across the full stroke, performance should be > unchanged if write cache is enabled in the drive. If write cache is > disabled, you should see the same 50-80% performance improvement as > for random reads. > > For sequential operations NCQ won't make much of a difference, and as > the command block size increases, the performance delta will shrink > between queued and non-queued. The exact asymptote is a function of > many manufacturer and model-specific details. > > Remember that these are all ops/sec measurements. Command latency is > a different kettle of fish. > > --eric > > > On 10/12/06, Fajun Chen <fajunchen@gmail.com> wrote: > > Hi Folks, > > > > I'm writing a program to test SATA Sil3124 NCQ feature. I assume NCQ > > is supported by libata by default, correct? Multi threading approach > > is used to send AT commands to device asynchronously. I can verify > > that data are sent to the device and read back correctly, but I don't > > know how to verify if NCQ works. Do I expect to see consistent > > performance gain in random read/write in NCQ mode? > > > > Thanks, > > Fajun > > - > > To unsubscribe from this list: send the line "unsubscribe linux-ide" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to test SATA NCQ feature 2006-10-12 23:55 ` Fajun Chen @ 2006-10-13 0:42 ` Eric D. Mudama 2006-10-13 8:28 ` Jens Axboe 1 sibling, 0 replies; 6+ messages in thread From: Eric D. Mudama @ 2006-10-13 0:42 UTC (permalink / raw) To: Fajun Chen; +Cc: linux-ide, Tejun Heo On 10/12/06, Fajun Chen <fajunchen@gmail.com> wrote: > Hi Eric, > > Thanks for your detailed explanation. > > In terms of ops/sec, I currently implemented it as the amout of data > transferred per seconds. Please let me know if I need to implement it > differently. Ops/sec and blocks/s can easily be translated. Doesn't really matter which metric you use. > I also have a question about NCQ error handling. Among all the > outstanding commands, if one command fails, what will happen to the > rest of the commands? Per the specification, upon any error, all commands internal to the device are aborted. Now, there's optimizations to this behavior (drives may have internally queued command completions that they can let finish before they report the error) but they don't affect the host in any meaningful way. > I understand that all the commands in the device > will be aborted by LOG PAGE 10h command, but how about the commands > enqueued but haven't been sent to the device? In my particular > application, one thread is blocked for every outstanding command. So > depending on how libata handles outstanding commands, it will have > significant implication to my user space application. If queued in hardware but not yet issued to the device, I am not sure how those would be handled... probably up to each vendor's hardware specification. Don't really know beyond that as I haven't written an HBA driver before. My work has all been on the device side. --eric ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to test SATA NCQ feature 2006-10-12 23:55 ` Fajun Chen 2006-10-13 0:42 ` Eric D. Mudama @ 2006-10-13 8:28 ` Jens Axboe 2006-10-13 15:38 ` Fajun Chen 1 sibling, 1 reply; 6+ messages in thread From: Jens Axboe @ 2006-10-13 8:28 UTC (permalink / raw) To: Fajun Chen; +Cc: Eric D. Mudama, linux-ide, Tejun Heo On Thu, Oct 12 2006, Fajun Chen wrote: > will be aborted by LOG PAGE 10h command, but how about the commands > enqueued but haven't been sent to the device? In my particular Requests not yet issued to the device, all reside in the io scheduler queue. When the drive invalidates its hardware queue, those previously active commands are put back in to the io scheduler queue and now reside with those that were yet to be issued. Once device recovery is complete, queueing at the device level resumes. Does that answer your question? Neither libata nor the device has any knowledge of commands queue but not sent to the device. -- Jens Axboe ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to test SATA NCQ feature 2006-10-13 8:28 ` Jens Axboe @ 2006-10-13 15:38 ` Fajun Chen 0 siblings, 0 replies; 6+ messages in thread From: Fajun Chen @ 2006-10-13 15:38 UTC (permalink / raw) To: Jens Axboe; +Cc: Eric D. Mudama, linux-ide, Tejun Heo Thanks, Jens. This answered my question. Fajun On 10/13/06, Jens Axboe <jens.axboe@oracle.com> wrote: > On Thu, Oct 12 2006, Fajun Chen wrote: > > will be aborted by LOG PAGE 10h command, but how about the commands > > enqueued but haven't been sent to the device? In my particular > > Requests not yet issued to the device, all reside in the io scheduler > queue. When the drive invalidates its hardware queue, those previously > active commands are put back in to the io scheduler queue and now reside > with those that were yet to be issued. Once device recovery is complete, > queueing at the device level resumes. > > Does that answer your question? Neither libata nor the device has any > knowledge of commands queue but not sent to the device. > > -- > Jens Axboe > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-10-13 15:39 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-12 16:30 How to test SATA NCQ feature Fajun Chen 2006-10-12 17:12 ` Eric D. Mudama 2006-10-12 23:55 ` Fajun Chen 2006-10-13 0:42 ` Eric D. Mudama 2006-10-13 8:28 ` Jens Axboe 2006-10-13 15:38 ` Fajun Chen
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.