]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: do not remove instance under global lock
authorIgor Konopko <igor.j.konopko@intel.com>
Sat, 4 May 2019 18:38:09 +0000 (20:38 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 May 2019 16:19:19 +0000 (10:19 -0600)
commit7a9acb2dc5ce09c980ab0893da5540d6f22b060f
treeed19a493affd72fbfafbc763cf3149f0d441aa7c
parent7f7499d3258dea6a1a765bf22f7f99a4cac84e06
lightnvm: do not remove instance under global lock

Currently all the target instances are removed under global nvm_lock.
This was needed to ensure that nvm_dev struct will not be freed by
hot unplug event during target removal. However, current implementation
has some drawbacks, since the same lock is used when new nvme subsystem
is registered, so we can have a situation, that due to long process of
target removal on drive A, registration (and listing in OS) of the
drive B will take a lot of time, since it will wait for that lock.

Now when we have kref which ensures that nvm_dev will not be freed in
the meantime, we can easily get rid of this lock for a time when we are
removing nvm targets.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/core.c