linux-apfs-rw icon indicating copy to clipboard operation
linux-apfs-rw copied to clipboard

It works very slowly on physical medias.

Open 31core opened this issue 2 years ago • 8 comments

This kernel module writes fast with an APFS on a loop back device, however it works slowly when writing file on a USB flash drive. I tested writing 9 files with totally 98.9 MB in size, here are the results:

APFS:

im31core@31core-PC:~$ time sync

real	0m51.889s
user	0m0.000s
sys	0m1.163s

exFat:

im31core@31core-PC:~$ time sync

real	0m3.385s
user	0m0.001s
sys	0m0.003s

My kernel version is 6.2.0-20-generic, and my USB flash is SanDisk Ultra USB 3.0, and the performance test result should be the same on other devices.

31core avatar Jun 14 '23 08:06 31core

That's terrible, thanks for the report. I'll see if I can find an unused usb drive and I'll get back to you.

eafer avatar Jun 14 '23 18:06 eafer

I can't reproduce, the copy takes around 7 seconds for me on the 6.2 kernel. Slower than exfat for sure, but that's expected because I haven't done any profiling for kernel versions other than 5.3.

Have you seen this happen more than once? Right after formatting the usb drive? Do you get any output on dmesg?

eafer avatar Jun 15 '23 02:06 eafer

Calling sync is unfair since page cache of all filesystems will be written to storage. dd to files in mounted fs will be more explanatory and easier to reproduce.

Damenly avatar Jun 15 '23 05:06 Damenly

Right, that's why I asked him if he had seen this happen more than once, I thought maybe his sync flushed some other stuff as well.

eafer avatar Jun 15 '23 18:06 eafer

I can't reproduce, the copy takes around 7 seconds for me on the 6.2 kernel. Slower than exfat for sure, but that's expected because I haven't done any profiling for kernel versions other than 5.3.

Have you seen this happen more than once? Right after formatting the usb drive? Do you get any output on dmesg?

Yeah, I first found this issue when I copied files using my Dell Poweredge R710 with linux kernel 5.15 several months ago. I'm not sure if it's a problem with my device because OpenZFS also performed badly(even worse than APFS). But other file systems on linux have no such problem.

31core avatar Jun 16 '23 16:06 31core

I don't think I can help you much if I can't reproduce this. If you are interested, maybe you can try to run the profiler yourself, and then we could check the output.

eafer avatar Jun 17 '23 01:06 eafer

I don't think I can help you much if I can't reproduce this. If you are interested, maybe you can try to run the profiler yourself, and then we could check the output.

Have you tested it on ubuntu? It might be the problem of ubuntu's kernel configuration, I guess. Maybe you can reproduce it on ubuntu 22.04 or 23.04.

31core avatar Jun 17 '23 15:06 31core

Yes, I tested on Ubuntu 23.04 with your same kernel. It was on a vm, but I was using the physical usb drive, so I don't think it should make a difference. I also tested on Ubuntu 22.04 with 5.15 kernel.

eafer avatar Jun 17 '23 22:06 eafer