mbox series

[v3,0/4] ext4: improve delalloc buffer write performance

Message ID 20210716122024.1105856-1-yi.zhang@huawei.com
Headers show
Series ext4: improve delalloc buffer write performance | expand

Message

Zhang Yi July 16, 2021, 12:20 p.m. UTC
Hi,

Changes since v2:
 - Patch 3: fix misleading comment about data truncate in the error path
            of ext4_write_inline_data_end().

Thanks,
Yi.

--------

Changes since v1:

 - Patch 1: add comments to explain why and how to update i_disksize in
            ext4_da_write_end().
 - Patch 3: update i_disksize only if copied is not zero and drop
            i_size_changed parameter, also drop unused EXT4_STATE_JDATA
            and i_datasync_tid update code hook.

Original description:

This patchset address to improve buffer write performance with delalloc.
The first patch reduce the unnecessary update i_disksize, the second two
patch refactor the inline data write procedure and also do some small
fix, the last patch do improve by remove all unnecessary journal handle
in the delalloc write procedure.

After this patch set, we could get a lot of performance improvement.
Below is the Unixbench comparison data test on my machine with 'Intel
Xeon Gold 5120' CPU and nvme SSD backend.

Test cmd:

  ./Run -c 56 -i 3 fstime fsbuffer fsdisk

Before this patch set:

  System Benchmarks Partial Index           BASELINE       RESULT   INDEX
  File Copy 1024 bufsize 2000 maxblocks       3960.0     422965.0   1068.1
  File Copy 256 bufsize 500 maxblocks         1655.0     105077.0   634.9
  File Copy 4096 bufsize 8000 maxblocks       5800.0    1429092.0   2464.0
                                                                    ========
  System Benchmarks Index Score (Partial Only)                      1186.6

After this patch set:

  System Benchmarks Partial Index           BASELINE       RESULT   INDEX
  File Copy 1024 bufsize 2000 maxblocks       3960.0     732716.0   1850.3
  File Copy 256 bufsize 500 maxblocks         1655.0     184940.0   1117.5
  File Copy 4096 bufsize 8000 maxblocks       5800.0    2427152.0   4184.7
                                                                    ========
  System Benchmarks Index Score (Partial Only)                      2053.0




Zhang Yi (4):
  ext4: check and update i_disksize properly
  ext4: correct the error path of ext4_write_inline_data_end()
  ext4: factor out write end code of inline file
  ext4: drop unnecessary journal handle in delalloc write

 fs/ext4/ext4.h   |   3 -
 fs/ext4/inline.c | 120 ++++++++++++++++++-------------------
 fs/ext4/inode.c  | 150 ++++++++++++-----------------------------------
 3 files changed, 99 insertions(+), 174 deletions(-)

Comments

Zhang Yi Sept. 4, 2021, 3:21 a.m. UTC | #1
Hi, Ted

Do you plan to merge this speed up patch set for 5.15?

Thanks,
Yi.

On 2021/7/16 20:20, Zhang Yi wrote:
> Hi,
> 
> Changes since v2:
>  - Patch 3: fix misleading comment about data truncate in the error path
>             of ext4_write_inline_data_end().
> 
> Thanks,
> Yi.
> 
> --------
> 
> Changes since v1:
> 
>  - Patch 1: add comments to explain why and how to update i_disksize in
>             ext4_da_write_end().
>  - Patch 3: update i_disksize only if copied is not zero and drop
>             i_size_changed parameter, also drop unused EXT4_STATE_JDATA
>             and i_datasync_tid update code hook.
> 
> Original description:
> 
> This patchset address to improve buffer write performance with delalloc.
> The first patch reduce the unnecessary update i_disksize, the second two
> patch refactor the inline data write procedure and also do some small
> fix, the last patch do improve by remove all unnecessary journal handle
> in the delalloc write procedure.
> 
> After this patch set, we could get a lot of performance improvement.
> Below is the Unixbench comparison data test on my machine with 'Intel
> Xeon Gold 5120' CPU and nvme SSD backend.
> 
> Test cmd:
> 
>   ./Run -c 56 -i 3 fstime fsbuffer fsdisk
> 
> Before this patch set:
> 
>   System Benchmarks Partial Index           BASELINE       RESULT   INDEX
>   File Copy 1024 bufsize 2000 maxblocks       3960.0     422965.0   1068.1
>   File Copy 256 bufsize 500 maxblocks         1655.0     105077.0   634.9
>   File Copy 4096 bufsize 8000 maxblocks       5800.0    1429092.0   2464.0
>                                                                     ========
>   System Benchmarks Index Score (Partial Only)                      1186.6
> 
> After this patch set:
> 
>   System Benchmarks Partial Index           BASELINE       RESULT   INDEX
>   File Copy 1024 bufsize 2000 maxblocks       3960.0     732716.0   1850.3
>   File Copy 256 bufsize 500 maxblocks         1655.0     184940.0   1117.5
>   File Copy 4096 bufsize 8000 maxblocks       5800.0    2427152.0   4184.7
>                                                                     ========
>   System Benchmarks Index Score (Partial Only)                      2053.0
> 
> 
> 
> 
> Zhang Yi (4):
>   ext4: check and update i_disksize properly
>   ext4: correct the error path of ext4_write_inline_data_end()
>   ext4: factor out write end code of inline file
>   ext4: drop unnecessary journal handle in delalloc write
> 
>  fs/ext4/ext4.h   |   3 -
>  fs/ext4/inline.c | 120 ++++++++++++++++++-------------------
>  fs/ext4/inode.c  | 150 ++++++++++++-----------------------------------
>  3 files changed, 99 insertions(+), 174 deletions(-)
>
Theodore Ts'o Sept. 9, 2021, 2:55 p.m. UTC | #2
On Fri, 16 Jul 2021 20:20:20 +0800, Zhang Yi wrote:
> Changes since v2:
>  - Patch 3: fix misleading comment about data truncate in the error path
>             of ext4_write_inline_data_end().
> 
> Thanks,
> Yi.
> 
> [...]

Applied, thanks!

[1/4] ext4: check and update i_disksize properly
      commit: 4df031ff5876d94b48dd9ee486ba5522382a06b2
[2/4] ext4: correct the error path of ext4_write_inline_data_end()
      commit: 55ce2f649b9e88111270333a8127e23f4f8f42d7
[3/4] ext4: factor out write end code of inline file
      commit: 6984aef59814fb5c47b0e30c56e101186b5ebf8c
[4/4] ext4: drop unnecessary journal handle in delalloc write
      commit: cc883236b79297f6266ca6f4e7f24f3fd3c736c1

Best regards,