]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: set conservative threshold for user writes
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Tue, 11 Dec 2018 19:16:13 +0000 (20:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Dec 2018 19:22:33 +0000 (12:22 -0700)
commitf8b08cc92e5df58aad38c43b1168441d2570c674
treea253b85173c905425e6dc5bcdd285399faa2419f
parent951bf03dc564096c6582a01ed3e9230156cc5b2b
lightnvm: pblk: set conservative threshold for user writes

In a worst-case scenario (random writes), OP% of sectors
in each line will be invalid, and we will then need
to move data out of 100/OP% lines to free a single line.

So, to prevent the possibility of running out of lines,
temporarily block user writes when there is less than
100/OP% free lines.

Also ensure that pblk creation does not produce instances
with insufficient over provisioning.

Insufficient over-provising is not a problem on real hardware,
but often an issue when running QEMU simulations (with few lines).
100 lines is enough to create a sane instance with the standard
(11%) over provisioning.

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-init.c
drivers/lightnvm/pblk-rl.c
drivers/lightnvm/pblk.h