AltraMayor / AltraMayor/f3

f3write using variable block sizes?

未关闭
#255 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Documentation
主要语言
C
星标
3.4k
派生
177
平均合并
2 天 15 小时
30 天内合并 PR
2

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。