]> www.infradead.org Git - users/dwmw2/linux.git/commit
bcache: segregate flash only volume write streams
authorTang Junhui <tang.junhui@zte.com.cn>
Mon, 8 Jan 2018 20:21:21 +0000 (12:21 -0800)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:29 +0000 (21:36 -0400)
commitf5a04746cec0adc782a419e9912e6a4ec4b4fe1e
treef3cfd4cb31ac9c1a4fef1e74256128c04dbb4380
parent14384db155b8ebd01a2a3d33a717b87f5125e8e7
bcache: segregate flash only volume write streams

[ Upstream commit 4eca1cb28d8b0574ca4f1f48e9331c5f852d43b9 ]

In such scenario that there are some flash only volumes
, and some cached devices, when many tasks request these devices in
writeback mode, the write IOs may fall to the same bucket as bellow:
| cached data | flash data | cached data | cached data| flash data|
then after writeback of these cached devices, the bucket would
be like bellow bucket:
| free | flash data | free | free | flash data |

So, there are many free space in this bucket, but since data of flash
only volumes still exists, so this bucket cannot be reclaimable,
which would cause waste of bucket space.

In this patch, we segregate flash only volume write streams from
cached devices, so data from flash only volumes and cached devices
can store in different buckets.

Compare to v1 patch, this patch do not add a additionally open bucket
list, and it is try best to segregate flash only volume write streams
from cached devices, sectors of flash only volumes may still be mixed
with dirty sectors of cached device, but the number is very small.

[mlyle: fixed commit log formatting, permissions, line endings]

Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/md/bcache/alloc.c