PhotonLibOS icon indicating copy to clipboard operation
PhotonLibOS copied to clipboard

More examples / documentation on Photon Filesystem

Open aley1 opened this issue 1 year ago • 3 comments

Hi, Besides the example on how to init, open and write to a iFile in /tree/main/examples/simple, will there be more examples/documentation provided Photon filesystem? With info on the type of settings (for tuning), read/write APIs I am hoping to test writing and reading sequential files using Photon with io_uring IO Direct, and see how much performance benefit it provides over standard linux fio.

aley1 avatar May 06 '23 09:05 aley1

You may want to upgrade the kernel to 5.17 above to test io_uring, for the best performance.

There are some test code in io/test/test-iouring.cpp. But unfortunately, no detailed docs at present...

class IFileSystem is the abstraction of the fs and IFile is for file. They are all POSIX-like.

For simple case, you can use the photon::fs::open_localfile_adaptor to open a file directly, and let io_engine_type = ioengine_iouring.

For complex case, you may create a fs first, then open a file from that fs.

beef9999 avatar May 06 '23 10:05 beef9999

You may refer to the do_io_test function in io/test/test-iouring.cpp

beef9999 avatar May 06 '23 10:05 beef9999

ALso open with O_DIRECT flag

Even though I don't think direct read/write a file (instead of block) is a brilliant idea.

The advantage of io_uring is that it can use page cache.

beef9999 avatar May 06 '23 10:05 beef9999