]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: guarantee that backpointer is respected on writer stall
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:12:15 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:08 +0000 (08:25 -0600)
commit20a0df7b4ae14a20e9cc964c48b9d43d77c4dd38
tree36e7d365c27ed8c6173375b4ba59d5b6980dbdfa
parent9e4fa2bc3c8c41fbe4a07e592d6349f82e5f4df1
lightnvm: pblk: guarantee that backpointer is respected on writer stall

pblk's write buffer must guarantee that it respects the device's
constrains for reads (i.e., mw_cunits). This is done by maintaining a
backpointer that updates the L2P table as entries wrap up, making them
point to the media instead of pointing to the write buffer.

This mechanism can race in case that the write thread stalls, as the
write pointer will protect the last written entry, thus disregarding the
read constrains.

This patch adds an extra check on wrap up, making sure that the
threshold is respected at all times, preventing new entries to overwrite
committed data, also in case of write thread stall.

Reported-by: Heiner Litz <hlitz@ucsc.edu>
Signed-off-by: Javier González <javier@cnexlabs.com>
Reviewed-by: Heiner Litz <hlitz@ucsc.edu>
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-rb.c
drivers/lightnvm/pblk.h