• Yang Guo's avatar
    ext4: use percpu_counters for extent_status cache hits/misses · 520f897a
    Yang Guo authored
    @es_stats_cache_hits and @es_stats_cache_misses are accessed frequently in
    ext4_es_lookup_extent function, it would influence the ext4 read/write
    performance in NUMA system. Let's optimize it using percpu_counter,
    it is profitable for the performance.
    
    The test command is as below:
    fio -name=randwrite -numjobs=8 -filename=/mnt/test1 -rw=randwrite
    -ioengine=libaio -direct=1 -iodepth=64 -sync=0 -norandommap
    -group_reporting -runtime=120 -time_based -bs=4k -size=5G
    
    And the result is better 10% than the initial implement:
    without the patch,IOPS=197k, BW=770MiB/s (808MB/s)(90.3GiB/120002msec)
    with the patch,  IOPS=218k, BW=852MiB/s (894MB/s)(99.9GiB/120002msec)
    
    Cc: "Theodore Ts'o" <tytso@mit.edu>
    Cc: Andreas Dilger <adilger.kernel@dilger.ca>
    Cc: Eric Biggers <ebiggers@kernel.org>
    Signed-off-by: default avatarYang Guo <guoyang2@huawei.com>
    Signed-off-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
    520f897a
extents_status.c 59.7 KB