diff options
author | Javier González <jg@lightnvm.io> | 2017-06-26 05:57:20 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-26 18:27:39 -0400 |
commit | f9c101523da75cd483b95f04c21242bb83960d93 (patch) | |
tree | a6d20ae407bb1768d844bab613f165617d7ddff3 /drivers/lightnvm/pblk.h | |
parent | 0880a9aa2d91ff5131ecd0902a758afe760b9c1c (diff) |
lightnvm: pblk: issue multiplane reads if possible
If a read request is sequential and its size aligns with a
multi-plane page size, use the multi-plane hint to process the I/O in
parallel in the controller.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk.h')
-rw-r--r-- | drivers/lightnvm/pblk.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 50f30434718f..6dc58d360077 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h | |||
@@ -1075,9 +1075,27 @@ static inline int pblk_set_progr_mode(struct pblk *pblk, int type) | |||
1075 | return flags; | 1075 | return flags; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | static inline int pblk_set_read_mode(struct pblk *pblk) | 1078 | enum { |
1079 | PBLK_READ_RANDOM = 0, | ||
1080 | PBLK_READ_SEQUENTIAL = 1, | ||
1081 | }; | ||
1082 | |||
1083 | static inline int pblk_set_read_mode(struct pblk *pblk, int type) | ||
1084 | { | ||
1085 | struct nvm_tgt_dev *dev = pblk->dev; | ||
1086 | struct nvm_geo *geo = &dev->geo; | ||
1087 | int flags; | ||
1088 | |||
1089 | flags = NVM_IO_SUSPEND | NVM_IO_SCRAMBLE_ENABLE; | ||
1090 | if (type == PBLK_READ_SEQUENTIAL) | ||
1091 | flags |= geo->plane_mode >> 1; | ||
1092 | |||
1093 | return flags; | ||
1094 | } | ||
1095 | |||
1096 | static inline int pblk_io_aligned(struct pblk *pblk, int nr_secs) | ||
1079 | { | 1097 | { |
1080 | return NVM_IO_SNGL_ACCESS | NVM_IO_SUSPEND | NVM_IO_SCRAMBLE_ENABLE; | 1098 | return !(nr_secs % pblk->min_write_pgs); |
1081 | } | 1099 | } |
1082 | 1100 | ||
1083 | #ifdef CONFIG_NVM_DEBUG | 1101 | #ifdef CONFIG_NVM_DEBUG |