From: Javier González Date: Fri, 30 Jun 2017 15:56:37 +0000 (+0200) Subject: lightnvm: pblk: schedule if data is not ready X-Git-Tag: v4.13-rc1~212^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10888129783cc8daeeb9c47942876b917532b58c;p=platform%2Fkernel%2Flinux-exynos.git lightnvm: pblk: schedule if data is not ready When user threads place data into the write buffer, they reserve space and do the memory copy out of the lock. As a consequence, when the write thread starts persisting data, there is a chance that it is not copied yet. In this case, avoid polling, and schedule before retrying. Signed-off-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c index 665a4cc..2dda874 100644 --- a/drivers/lightnvm/pblk-rb.c +++ b/drivers/lightnvm/pblk-rb.c @@ -578,8 +578,10 @@ unsigned int pblk_rb_read_to_bio(struct pblk_rb *rb, struct nvm_rq *rqd, */ try: flags = READ_ONCE(entry->w_ctx.flags); - if (!(flags & PBLK_WRITTEN_DATA)) + if (!(flags & PBLK_WRITTEN_DATA)) { + io_schedule(); goto try; + } page = virt_to_page(entry->data); if (!page) {