Skip to content

Draft: file_unix: use liburing to copy

Méven Car requested to merge work/meven/file_unix_copy_iouring into master

The objective here is primarily to fix https://bugs.kde.org/show_bug.cgi?id=281270

But along the way it it is increasing significantly the copy speed. With this patch, I can now pretty much max-out my SSD with this at 500 MBio/s.

There is still some optimizations possible that can increase it.

There is a io_uring_prep_fsync code path commented that allows to have a better estimate of the copy speed. But it is very slow at the moment.

A lot of question are still opened:

// TODO only use if file size is bigger than X?
// TODO adapt the queue size to the kind of medium (SSD > HDD > usb stick)
// TODO use fsync only when required (usb stick, external drive)
// TODO tweak to optimize the fsync path
// TODO handle ENOSPC and more error paths
//  maybe adapt the buffer size to the block size

More ideas:

  • keep the ring for the lifetime of the worker
  • use io_uring_prep_splice
  • use io_uring_register

I had this idea to implement this for a long long time. Finally made some progress 😄

This makes liburing an optional recommended dependency in Linux.

CCBUG: 281270 CCBUG: 342056

Edited by Méven Car

Merge request reports

Loading