1. 28 6月, 2017 36 次提交
  2. 27 6月, 2017 4 次提交
    • R
      lightnvm: if LUNs are already allocated fix return · 12e9a6d6
      Rakesh Pandit 提交于
      While creating new device with NVM_DEV_CREATE if LUNs are already
      allocated ioctl would return -ENOMEM which is wrong.  This patch
      propagates -EBUSY from nvm_reserve_luns which is correct response.
      
      Fixes: ade69e24 ("lightnvm: merge gennvm with core")
      Reviewed-by: NFrans Klaver <fransklaver@gmail.com>
      Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      12e9a6d6
    • J
      lightnvm: pblk: fail gracefully on irrec. error · 588726d3
      Javier González 提交于
      Due to user writes being decoupled from media writes because of the need
      of an intermediate write buffer, irrecoverable media write errors lead
      to pblk stalling; user writes fill up the buffer and end up in an
      infinite retry loop.
      
      In order to let user writes fail gracefully, it is necessary for pblk to
      keep track of its own internal state and prevent further writes from
      being placed into the write buffer.
      
      This patch implements a state machine to keep track of internal errors
      and, in case of failure, fail further user writes in an standard way.
      Depending on the type of error, pblk will do its best to persist
      buffered writes (which are already acknowledged) and close down on a
      graceful manner. This way, data might be recovered by re-instantiating
      pblk. Such state machine paves out the way for a state-based FTL log.
      Signed-off-by: NJavier González <javier@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <matias@cnexlabs.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      588726d3
    • J
      lightnvm: pblk: set mempool and workqueue params. · ef576494
      Javier González 提交于
      Make constants to define sizes for internal mempools and workqueues. In
      this process, adjust the values to be more meaningful given the internal
      constrains of the FTL. In order to do this for workqueues, separate the
      current auxiliary workqueue into two dedicated workqueues to manage
      lines being closed and bad blocks.
      Signed-off-by: NJavier González <javier@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <matias@cnexlabs.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ef576494
    • J
      lightnvm: pblk: redesign GC algorithm · b20ba1bc
      Javier González 提交于
      At the moment, in order to get enough read parallelism, we have recycled
      several lines at the same time. This approach has proven not to work
      well when reaching capacity, since we end up mixing valid data from all
      lines, thus not maintaining a sustainable free/recycled line ratio.
      
      The new design, relies on a two level workqueue mechanism. In the first
      level, we read the metadata for a number of lines based on the GC list
      they reside on (this is governed by the number of valid sectors in each
      line). In the second level, we recycle a single line at a time. Here, we
      issue reads in parallel, while a single GC write thread places data in
      the write buffer. This design allows to (i) only move data from one line
      at a time, thus maintaining a sane free/recycled ration and (ii)
      maintain the GC writer busy with recycled data.
      Signed-off-by: NJavier González <javier@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <matias@cnexlabs.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b20ba1bc