You are not logged in.

#1 2019-12-26 11:39:10

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

[SOLVED] remove the "flush" mount option for usb sticks?

Hi, I'm using an usb stick which is supposed to be very fast.
If i mount it manually (vfat fs), it reaches about 40MBps on an usb2 port, but if i mout via udisksctlk, it writes at 18MBps.
Tests are done via dd with a block size of 1MB and conv=fsync.
Udisks mounts it with the flush parameter that somehow hurts performance, is it possible to workaround it?
From the man page it seems a "noflush" parameter is missing, so i cannot just changing options by remount it, right?
Also, i'm unable to find a way to tell udisks2 to change the default options.

No luck here:

for file in $(pacman -Ql udisks2); do grep flush $file 2>/dev/null && echo "Match was here: $file" ; done
Binary file /usr/bin/udisksctl matches
Match was here: /usr/bin/udisksctl
Binary file /usr/lib/udisks2/udisksd matches
Match was here: /usr/lib/udisks2/udisksd
<td><p>Writes are acknowledged when data has been cached for writing to stable storage; data which has not been flushed is not guaranteed to persist in this mode.</p></td>
<td><p>VDO will check the storage device and determine whether it supports flushes. If it does, VDO will run in async mode, otherwise it will run in sync mode.</p></td>
<td><p><span class="term">bios_acknowledged_discard, bios_acknowledged_flush, bios_acknowledged_fua, bios_acknowledged_read, bios_acknowledged_write</span></p></td>
<td><p><span class="term">bios_acknowledged_partial_discard, bios_acknowledged_partial_flush, bios_acknowledged_partial_fua, bios_acknowledged_partial_read, bios_acknowledged_partial_write</span></p></td>
<td><p><span class="term">bios_in_discard, bios_in_flush, bios_in_fua, bios_in_read, bios_in_write</span></p></td>
<td><p><span class="term">bios_in_partial_discard, bios_in_partial_flush, bios_in_partial_fua, bios_in_partial_read, bios_in_partial_write</span></p></td>
<td><p><span class="term">bios_in_progress_discard, bios_in_progress_flush, bios_in_progress_fua, bios_in_progress_read, bios_in_progress_write</span></p></td>
<td><p><span class="term">bios_journal_completed_discard, bios_journal_completed_flush, bios_journal_completed_fua, bios_journal_completed_read, bios_journal_completed_write</span></p></td>
<td><p><span class="term">bios_journal_discard, bios_journal_flush, bios_journal_fua, bios_journal_read, bios_journal_write</span></p></td>
<td><p><span class="term">bios_meta_completed_discard, bios_meta_completed_flush, bios_meta_completed_fua, bios_meta_completed_read, bios_meta_completed_write</span></p></td>
<td><p><span class="term">bios_meta_discard, bios_meta_flush, bios_meta_fua, bios_meta_read", bios_meta_write</span></p></td>
<td><p><span class="term">bios_out_completed_discard, bios_out_completed_flush, bios_out_completed_fua, bios_out_completed_read, bios_out_completed_write</span></p></td>
<td><p><span class="term">bios_out_discard, bios_out_flush, bios_out_fua, bios_out_read, bios_out_write</span></p></td>
<td><p><span class="term">bios_page_cache_completed_discard, bios_page_cache_completed_flush, bios_page_cache_completed_fua, bios_page_cache_completed_read, bios_page_cache_completed_write</span></p></td>
<td><p><span class="term">bios_page_cache_discard, bios_page_cache_flush, bios_page_cache_fua, bios_page_cache_read, bios_page_cache_write</span></p></td>
<td><p><span class="term">block_map_flush_count</span></p></td>
<td><p>The total number of flushes issued by the block map.</p></td>
<td><p><span class="term">flush_out</span></p></td>
<td><p>The number of flush requests submitted by VDO to the underlying storage.</p></td>
<td><p><span class="term">slab_journal_flush_count</span></p></td>
<td><p>The number of times an entry was added to a slab journal that was over the flush threshold.</p></td>
<td><p>Writes are acknowledged when data has been cached for writing to stable storage; data which has not been flushed is not guaranteed to persist in this mode.</p></td>
<td><p>VDO will check the storage device and determine whether it supports flushes. If it does, VDO will run in async mode, otherwise it will run in sync mode.</p></td>
Match was here: /usr/share/gtk-doc/html/udisks2/gdbus-org.freedesktop.UDisks2.Block.VDO.html
<td><p>Writes are acknowledged when data has been cached for writing to stable storage; data which has not been flushed is not guaranteed to persist in this mode.</p></td>
<td><p>VDO will check the storage device and determine whether it supports flushes. If it does, VDO will run in async mode, otherwise it will run in sync mode.</p></td>
Match was here: /usr/share/gtk-doc/html/udisks2/gdbus-org.freedesktop.UDisks2.Manager.VDO.html

Last edited by kokoko3k (2019-12-26 16:59:34)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2019-12-26 12:41:14

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,396

Re: [SOLVED] remove the "flush" mount option for usb sticks?

fat filesystems on linux use delayed writes.
Data is written to memory, then send to the drive to be written at the pace the drive can handle.
Programs don't have to wait for the drive to finish writing the data, but can continue much sooner.

Downside of this is that the data on the drive is not what user/program thinks until everything has been written to the drive.
Flushing locks the drive, sends all data to the drive and waits until everything has been written before unlocking the drive.

All the flush parameter does is tell the kernel to flush more often.
The total time spend in writing depends on the data , not on the frequency of flushes.

Which do you prefer : many short periods where the drive is locked or a few looong periods ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2019-12-26 13:44:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,371

Re: [SOLVED] remove the "flush" mount option for usb sticks?

To answer the question in regards to changing udisk mount options, apparently not really

Offline

#4 2019-12-26 13:54:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] remove the "flush" mount option for usb sticks?

kokoko3k wrote:

If i mount it manually (vfat fs), it reaches about 40MBps on an usb2 port, but if i mout via udisksctlk, it writes at 18MBps.

For the reasons in Lone_Wolf's post, this is a faulty comparison.  If you want to compare these methods, compare the udisksctl mounted performance with manual mount copy followed by a "flush" command (and wait for it to finish).  The actual data rate will be comparable - perhaps even worse with the manual mount method.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-12-26 16:59:05

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: [SOLVED] remove the "flush" mount option for usb sticks?

Indeed my measurements were wrong, thank you all.

Last edited by kokoko3k (2019-12-26 16:59:22)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB