Skip to content

Commit 8a57fc3

Browse files
Zhoujie Wuaxboe
authored andcommitted
lightnvm: pblk: consider max hw sectors supported for max_write_pgs
When do GC, the number of read/write sectors are determined by max_write_pgs(see gc_rq preparation in pblk_gc_line_prepare_ws). Due to max_write_pgs doesn't consider max hw sectors supported by nvme controller(128K), which leads to GC tries to read 64 * 4K in one command, and see below error caused by pblk_bio_map_addr in function pblk_submit_read_gc. [ 2923.005376] pblk: could not add page to bio [ 2923.005377] pblk: could not allocate GC bio (18446744073709551604) Signed-off-by: Zhoujie Wu <zjwu@marvell.com> Reviewed-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a70985f commit 8a57fc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/lightnvm/pblk-init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ static int pblk_core_init(struct pblk *pblk)
407407
pblk->min_write_pgs = geo->ws_opt;
408408
max_write_ppas = pblk->min_write_pgs * geo->all_luns;
409409
pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA);
410+
pblk->max_write_pgs = min_t(int, pblk->max_write_pgs,
411+
queue_max_hw_sectors(dev->q) / (geo->csecs >> SECTOR_SHIFT));
410412
pblk_set_sec_per_write(pblk, pblk->min_write_pgs);
411413

412414
pblk->pad_dist = kcalloc(pblk->min_write_pgs - 1, sizeof(atomic64_t),

0 commit comments

Comments
 (0)