From 4d113ee5d3e46bb16d67d5c34b04bfc2cdb0d0c3 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Fri, 7 Jun 2019 12:02:48 +0200 Subject: [PATCH] lib/ftl: allow writes bypassing non-volatile cache Some of the writes doesn't need to go through the non-volatile cache (e.g. relocations, data recovery from the cache). This patch adds IO flag to indicate that the write shouldn't be stored on the non-volatile cache. Change-Id: I3d485fe14cf25b3074832f26491ba0cb12ff0e58 Signed-off-by: Konrad Sztyber Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458100 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Mateusz Kozlowski Reviewed-by: Wojciech Malikowski --- lib/ftl/ftl_core.c | 2 +- lib/ftl/ftl_io.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index 9e08ec7b7..5ce720313 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -1607,7 +1607,7 @@ ftl_rwb_fill(struct ftl_io *io) } if (ftl_io_done(io)) { - if (dev->nv_cache.bdev_desc) { + if (dev->nv_cache.bdev_desc && !(io->flags & FTL_IO_BYPASS_CACHE)) { ftl_write_nv_cache(io); } else { ftl_io_complete(io); diff --git a/lib/ftl/ftl_io.h b/lib/ftl/ftl_io.h index db50ba188..dac3dc3da 100644 --- a/lib/ftl/ftl_io.h +++ b/lib/ftl/ftl_io.h @@ -73,6 +73,8 @@ enum ftl_io_flags { /* Indicates that PPA should be taken from IO struct, */ /* not assigned by wptr, only works if wptr is also in direct mode */ FTL_IO_DIRECT_ACCESS = (1 << 9), + /* Bypass the non-volatile cache */ + FTL_IO_BYPASS_CACHE = (1 << 10), }; enum ftl_io_type {