One at a time
Posted Apr 29, 2004 11:29 UTC (Thu) by suparna
In reply to: One at a time
Parent article: A retry-based AIO infrastructure
I'm not sure I read this correctly, but I don't think we have that kind of a limitation in the code. A workqueue thread's tsk->io_wait pointer is set to the address of the ki_wait field inside the iocb that it is handling at that particular time. There is no reason why a worker thread on another CPU cannot process another iocb, by setting its own tsk->io_wait pointer to point to another iocb's ki_wait. The point to notice here is that in these situations "tsk" refers to the task which is processing the iocb at a given time (not the task which originally issued the IO), and the io_wait pointer reflects the wait context of the iocb on whose behalf, so to say, the code is being executed.
That said, it may sometimes be more efficient not to have worker threads on multiple CPUs trying to process iocbs for the same ioctx at the same time (reduces spinlock bouncing on the ioctx lock, as observed by Chris Mason).
Hope that clarifies !
to post comments)