Linux kernel AIO, open system call

后端 未结 2 1407
栀梦
栀梦 2021-02-19 15:03

Why Linux Kernel AIO does not support async \'open\' system call? Because \'open\' can block on filesystem for long time, cant it?

2条回答
  •  感动是毒
    2021-02-19 15:56

    I wrote a fairly simple yet powerful cpaio C utility that copies a bunch of files using Linux native aio+O_DIRECT (io_submit, io_getevents). I just made it open files as early as possible, queue initial aio reads and only bother to look for the results of the reads once it opened enough files (or all of them if there were few enough). It would have been nice to have a way to async open a file, but in the end it wasn't a big deal.
    I've copied tens of TB with this tool.
    In the end I think not having async open makes sense. Its a complex operation, the kernel would essentially have to fire a thread to handle it anyways.

提交回复
热议问题