AltraMayor / AltraMayor/f3

f3write using variable block sizes?

Abierto
#255 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Documentation
Lenguaje dominante
C
Estrellas
3.4k
Forks
177
Merge medio
2 d 15 h
PR fusionados (30 d)
2

Descripción

While wondering about the slowness of f3write, I ran strace on it.
Before I believed f3write would write 1MB blocks until the test file had 1GB of size, but during strace it seems f3write is actually using variable block sizes to write.

Example:
Block sizes seen:
```
...
1641984
1646080
1644032
1645056
1645568
1645568
1646080
1647104
1646592
1647104
1648128
...
1824768
1825280
1826304
1828352
1832448
1830400
1831424
1831936
1831936
1831424
1831424
1831936
...
```
Is that intentional?
The filesystem is VFAT directly on the device:
```
# blkid /dev/sda
/dev/sda: LABEL_FATBOOT="K-DT50-16G" LABEL="K-DT50-16G" UUID="3D08-B134" BLOCK_SIZE="512" TYPE="vfat"
# file - 32 MB), FAT (32 bit), sectors/FAT 14752, reserved 0x1, serial number 0x3d08b134, label: "K-DT50-16G "
```
Using `f3-8.0-bp156.3.6.x86_64` of OpenSUSE Leap 15.6.

Details
---
strace output looked like this:
```
...
fadvise64(3, 0, 0, POSIX_FADV_DONTNEED) = 0
write(1, "\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10 "..., 108) = 108
write(3, "\0R:(\0\0\0\0\21\316j[\2R:(\20\23B[4\234\325\266\1\36\337X!:\306\21"..., 1641984) = 1641984
fdatasync(3) = 0
fadvise64(3, 0, 0, POSIX_FADV_DONTNEED) = 0
write(1, "\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10 "..., 108) = 108
write(3, "\0`S(\0\0\0\0\21\240\342\\\2`S(\20aGq4@\305\271\1\260.\243\"$\326S"..., 1646080) = 1646080
...
```
so I extracted the write sizes with `awk '$1 == "write(3," { print $NF }'`.

When also using `strace` on `f3read` it seems the only block size being used is 2MB.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.