Skip to content
Snippets Groups Projects
Commit 2d24d9ba authored by Coly Li's avatar Coly Li Committed by Cheng Jian
Browse files

bcache: add readahead cache policy options via sysfs interface

mainline inclusion
from mainline-v5.6-rc1
commit 038ba8cc
category: bugfix
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=26


CVE: NA

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

In year 2007 high performance SSD was still expensive, in order to
save more space for real workload or meta data, the readahead I/Os
for non-meta data was bypassed and not cached on SSD.

In now days, SSD price drops a lot and people can find larger size
SSD with more comfortable price. It is unncessary to alway bypass
normal readahead I/Os to save SSD space for now.

This patch adds options for readahead data cache policies via sysfs
file /sys/block/bcache<N>/readahead_cache_policy, the options are,
- "all": cache all readahead data I/Os.
- "meta-only": only cache meta data, and bypass other regular I/Os.

If users want to make bcache continue to only cache readahead request
for metadata and bypass regular data readahead, please set "meta-only"
to this sysfs file. By default, bcache will back to cache all read-
ahead requests now.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarColy Li <colyli@suse.de>
Acked-by: default avatarEric Wheeler <bcache@linux.ewheeler.net>
Cc: Michael Lyle <mlyle@lyle.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarLi Ruilin <liruilin4@huawei.com>
Reviewed-by: default avatarPeng Junyi <pengjunyi1@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarCheng Jian <cj.chengjian@huawei.com>
parent ce4cce2f
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment