Re: [USB-hacking] [PATCH] aio_run_iocb should always retry
"Jamey Sharp" <[email protected]>
| Newsgroups | gmane.linux.usb.devel,gmane.linux.kernel.aio.general |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for the detailed reply, Zach! On 9/24/07, Zach Brown wrote: > In any case, I don't think this is the right solution. gadgetfs is > pretty unusual in using one ki_retry to submit and then switching to > another to copy the result to userspace and free. The intent of > ki_retry is to, well, retry. I tried to trace the O_DIRECT AIO path to figure out how AIO was intended to be implemented, and got hopelessly lost. At least the approach of switching to a different ki_retry is simple and pretty easy to understand. > In the cases where sys_io_cancel() finds that it shouldn't call > ki_cancel it could return EAGAIN. EAGAIN never seems like the right answer to me for cancel, but you understand this system better than I want to. :-) Shouldn't sys_io_cancel block until it can either successfully cancel or report that the iocb already completed? > - ki_cancel will not be called after aio_complete() has been called > > Serializing ki_retry and ki_cancel calls will be easy because they're > called from process context from fs/aio.c. Serializing with > aio_complete() will be harder as its called from interrupts from > subsystems. I don't understand why that makes it harder. Can't you pull it off with a spinlock in the kiocb? > If this sounds OK I could roll some patches. Sounds good to me! Jamey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: http://firegpg.tuxfamily.org iD8DBQFG+smVp1aplQ4I9mURAm2PAJ9jpxo9uxL3nScG96MB4a+w36e0tACfYON/ 7pvkTc5YJoIcWSJ1n+cb+X4= =pLKn -----END PGP SIGNATURE----- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel