diff options
Diffstat (limited to 'drivers/lightnvm/pblk-rl.c')
-rw-r--r-- | drivers/lightnvm/pblk-rl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-rl.c b/drivers/lightnvm/pblk-rl.c index b014957dde0b..a5f8bc2defbc 100644 --- a/drivers/lightnvm/pblk-rl.c +++ b/drivers/lightnvm/pblk-rl.c | |||
@@ -233,10 +233,15 @@ void pblk_rl_init(struct pblk_rl *rl, int budget, int threshold) | |||
233 | /* To start with, all buffer is available to user I/O writers */ | 233 | /* To start with, all buffer is available to user I/O writers */ |
234 | rl->rb_budget = budget; | 234 | rl->rb_budget = budget; |
235 | rl->rb_user_max = budget; | 235 | rl->rb_user_max = budget; |
236 | rl->rb_max_io = threshold ? (budget - threshold) : (budget - 1); | ||
237 | rl->rb_gc_max = 0; | 236 | rl->rb_gc_max = 0; |
238 | rl->rb_state = PBLK_RL_HIGH; | 237 | rl->rb_state = PBLK_RL_HIGH; |
239 | 238 | ||
239 | /* Maximize I/O size and ansure that back threshold is respected */ | ||
240 | if (threshold) | ||
241 | rl->rb_max_io = budget - pblk->min_write_pgs_data - threshold; | ||
242 | else | ||
243 | rl->rb_max_io = budget - pblk->min_write_pgs_data - 1; | ||
244 | |||
240 | atomic_set(&rl->rb_user_cnt, 0); | 245 | atomic_set(&rl->rb_user_cnt, 0); |
241 | atomic_set(&rl->rb_gc_cnt, 0); | 246 | atomic_set(&rl->rb_gc_cnt, 0); |
242 | atomic_set(&rl->rb_space, -1); | 247 | atomic_set(&rl->rb_space, -1); |