Commit 9ec97a62 authored by Yufen Yu's avatar Yufen Yu Committed by Cheng Jian
Browse files

readahead: introduce FMODE_WILLNEED to read first 2MB of file

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3UHF8


CVE: NA

-------------------------------------------------

In some scenario, likely spark-sql, almost all meta file's size is
less then 2MB and applications read these smaller files in random
mode. That means, it may issue multiple times random io to rotate
disk, which can cause performance degradation.

To improve the small files random read, we try to read the first
2MB into pagecache on the first time of read. Then it can avoid
multiple random io.

In fact, applications can call fadvise system with POSIX_FADV_WILLNEED
to achieve this goal. But, some apps may cannot easily do that.
So, we provide a new file flag FMODE_WILLNEED.

Signed-off-by: default avatarYufen Yu <yuyufen@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 74c61d74
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment