summaryrefslogtreecommitdiff
path: root/fs/ext4/extents_status.h
diff options
context:
space:
mode:
authorYang Guo <guoyang2@huawei.com>2019-08-28 18:19:23 +0300
committerTheodore Ts'o <tytso@mit.edu>2019-08-28 18:19:23 +0300
commit520f897a3554b0665af1ae5d5ba286f290cecf5c (patch)
tree362c3faf7e1f8f026276be06334b25249d2a262f /fs/ext4/extents_status.h
parent7727ae52975d4f4ef7ff69ed8e6e25f6a4168158 (diff)
downloadlinux-520f897a3554b0665af1ae5d5ba286f290cecf5c.tar.xz
ext4: use percpu_counters for extent_status cache hits/misses
@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: Yang Guo <guoyang2@huawei.com> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Diffstat (limited to 'fs/ext4/extents_status.h')
-rw-r--r--fs/ext4/extents_status.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h
index 5e5c4a40d863..825313c59752 100644
--- a/fs/ext4/extents_status.h
+++ b/fs/ext4/extents_status.h
@@ -70,8 +70,8 @@ struct ext4_es_tree {
struct ext4_es_stats {
unsigned long es_stats_shrunk;
- unsigned long es_stats_cache_hits;
- unsigned long es_stats_cache_misses;
+ struct percpu_counter es_stats_cache_hits;
+ struct percpu_counter es_stats_cache_misses;
u64 es_stats_scan_time;
u64 es_stats_max_scan_time;
struct percpu_counter es_stats_all_cnt;