Commit b368cc5
f2fs: compress: fix overwrite may reduce compress ratio unproperly
when overwrite only first block of cluster, since cluster is not full, it
will call f2fs_write_raw_pages when f2fs_write_multi_pages, and cause the
whole cluster become uncompressed eventhough data can be compressed.
this may will make random write bench score reduce a lot.
root# dd if=/dev/zero of=./fio-test bs=1M count=1
root# sync
root# echo 3 > /proc/sys/vm/drop_caches
root# f2fs_io get_cblocks ./fio-test
root# dd if=/dev/zero of=./fio-test bs=4K count=1 oflag=direct conv=notrunc
w/o patch:
root# f2fs_io get_cblocks ./fio-test
189
w/ patch:
root# f2fs_io get_cblocks ./fio-test
192
Signed-off-by: Fengnan Chang <[email protected]>
Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>1 parent 71f2c82 commit b368cc5
3 files changed
+39
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
884 | 903 | | |
885 | 904 | | |
886 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3040 | 3040 | | |
3041 | 3041 | | |
3042 | 3042 | | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
3043 | 3047 | | |
3044 | 3048 | | |
3045 | 3049 | | |
| |||
3058 | 3062 | | |
3059 | 3063 | | |
3060 | 3064 | | |
3061 | | - | |
3062 | | - | |
3063 | | - | |
3064 | | - | |
| 3065 | + | |
| 3066 | + | |
3065 | 3067 | | |
3066 | | - | |
| 3068 | + | |
3067 | 3069 | | |
3068 | 3070 | | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
3081 | | - | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
3082 | 3082 | | |
3083 | 3083 | | |
3084 | 3084 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4052 | 4052 | | |
4053 | 4053 | | |
4054 | 4054 | | |
| 4055 | + | |
| 4056 | + | |
4055 | 4057 | | |
4056 | 4058 | | |
4057 | 4059 | | |
| |||
0 commit comments