Re: [GIT PULL 02/58] lightnvm: prevent bd removal if busy

2017-10-13 Thread Rakesh Pandit
On Fri, Oct 13, 2017 at 07:58:09AM -0700, Christoph Hellwig wrote: > On Fri, Oct 13, 2017 at 02:45:51PM +0200, Matias Bjørling wrote: > > From: Rakesh Pandit <rak...@tuxera.com> > > > > When a virtual block device is formatted and mounted after creating > >

Re: [PATCH V2] writeback: merge try_to_writeback_inodes_sb_nr() into caller

2017-10-10 Thread Rakesh Pandit
Hi Jens, On Mon, Oct 09, 2017 at 02:00:29PM +0200, Jan Kara wrote: > On Mon 09-10-17 13:34:41, Rakesh Pandit wrote: > > Since commit 925a6efb8ff0c ("Btrfs: stop using > > try_to_writeback_inodes_sb_nr to flush delalloc") this function hasn't > > been

Re: [PATCH 0/5] lightnvm: pblk: audit mempool usage

2017-10-02 Thread Rakesh Pandit
ries even though I am not aware of some aspects of subsystem yet. This series doesn't seem to touch those. Reviewed-by: Rakesh Pandit <rak...@tuxera.com> > > [1] https://patchwork.kernel.org/patch/9940973/ > > Javier González (5): > lightnvm: pblk: fix min size for pa

Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p

2017-10-02 Thread Rakesh Pandit
On Mon, Oct 02, 2017 at 05:16:57PM +0200, Javier González wrote: > > On 2 Oct 2017, at 13.32, Javier González <j...@lightnvm.io> wrote: > > > >> On 1 Oct 2017, at 15.23, Rakesh Pandit <rak...@tuxera.com> wrote: [..] > >> -static int __pblk_rb_update_l2p

Re: [PATCH 6/6] lightnvm: pblk: fix releases of kmem cache in error path

2017-10-02 Thread Rakesh Pandit
On Mon, Oct 02, 2017 at 02:44:23PM +0200, Javier González wrote: > > On 1 Oct 2017, at 15.26, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > If pblk_core_init fails lets destroy all global caches. > > > > Signed-off-by: Rakesh Pandit <rak...@tuxera.com>

Re: [PATCH 5/6] lightnvm: pblk: free up mempool allocation for erases correctly

2017-10-02 Thread Rakesh Pandit
On Mon, Oct 02, 2017 at 03:25:10PM +0300, Rakesh Pandit wrote: > On Mon, Oct 02, 2017 at 02:09:35PM +0200, Javier González wrote: > > > On 1 Oct 2017, at 15.25, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > > > While separating read and erase m

Re: [PATCH 5/6] lightnvm: pblk: free up mempool allocation for erases correctly

2017-10-02 Thread Rakesh Pandit
On Mon, Oct 02, 2017 at 02:09:35PM +0200, Javier González wrote: > > On 1 Oct 2017, at 15.25, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > While separating read and erase mempools in 22da65a1b pblk_g_rq_cache > > was used two times to set aside memory both f

Re: [PATCH] lightnvm: pblk: fix changing GC group list for a line

2017-10-02 Thread Rakesh Pandit
On Mon, Oct 02, 2017 at 01:27:42PM +0200, Javier González wrote: > > On 28 Sep 2017, at 16.40, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > pblk_line_gc_list seems to had a bug since the introduction of pblk in > > getting GC list for a line. In b20ba1bc7 whil

Re: [PATCH 4/6] lightnvm: remove stable extern and unused exported symbols

2017-10-01 Thread Rakesh Pandit
On Sun, Oct 01, 2017 at 04:25:18PM +0300, Rakesh Pandit wrote: > Not all exported symbols are being used outside core and there were > some stable entries in lightnvm.h > If you can replace 'stable' with 'stale' both in subject or body while picking up that would be great. Regards,

[PATCH 6/6] lightnvm: pblk: fix releases of kmem cache in error path

2017-10-01 Thread Rakesh Pandit
If pblk_core_init fails lets destroy all global caches. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-init.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 519e5cf..9

[PATCH 5/6] lightnvm: pblk: free up mempool allocation for erases correctly

2017-10-01 Thread Rakesh Pandit
of pblk modules would eventually result in some leak. The fix is to really use separate kmem cache and track it appropriately. Fixes: 22da65a1b ("lightnvm: pblk: decouple read/erase mempools") Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/

[PATCH 4/6] lightnvm: remove stable extern and unused exported symbols

2017-10-01 Thread Rakesh Pandit
Not all exported symbols are being used outside core and there were some stable entries in lightnvm.h Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/core.c | 129 +++ include/linux/lightnvm.h | 7 --- 2 files chang

[PATCH 3/6] lightnvm: remove unused argument from nvm_set_tgt_bb_tbl

2017-10-01 Thread Rakesh Pandit
vblk isn't being used anyway and if we ever have a usecase we can introduce this again. This makes the logic easier and removes unnecessary checks. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/core.c | 29 - include/linux/lightnvm.

[PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p

2017-10-01 Thread Rakesh Pandit
We already pass the structure pointer so no need to pass the member. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-rb.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c

[PATCH 1/6] lightnvm: pblk: remove useless line

2017-10-01 Thread Rakesh Pandit
Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 1f8aa94..4ffd1d6 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-

[PATCH 0/6] misc cleanups and error path fixes

2017-10-01 Thread Rakesh Pandit
/linux branch for-4.15/pblk So, they can be queued on top of patches already submitted earlier for 4.15. Most of them are trivial found while reading algorithms used during ALPSS yesterday or day before. Rakesh Pandit (6): lightnvm: pblk: remove useless line lightnvm: pblk: reduce arguments

[PATCH] lightnvm: pblk: fix changing GC group list for a line

2017-09-28 Thread Rakesh Pandit
satisfy 'vsc < high_thrs' as high_thrs > mid_thrs always. Fixes: a4bd217b4("lightnvm: physical block device (pblk) target") Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --

Re: [PATCH 3/6] lightnvm: pblk: fix message if L2P MAP is in device

2017-09-22 Thread Rakesh Pandit
On Fri, Sep 22, 2017 at 10:52:19AM +0200, Javier González wrote: > > On 21 Sep 2017, at 13.26, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > This usually happens if we are developing with qemu and ll2pmode has > > default value. Even in that case message se

Re: [PATCH 1/6] lightnvm: pblk: reuse pblk_gc_should_kick

2017-09-22 Thread Rakesh Pandit
On Fri, Sep 22, 2017 at 10:40:57AM +0200, Javier González wrote: > > On 21 Sep 2017, at 13.25, Rakesh Pandit wrote: > > > > This is a trivial change which reuses pblk_gc_should_kick instead of > > repeating it again in pblk_rl_free_lines_inc. > > > &g

[PATCH V2] lightnvm: include NVM Express driver if OCSSD is selected for build

2017-09-21 Thread Rakesh Pandit
Because NVM needs BLK_DEV_NVME, select it automatically if we mark NVM in config file before building kernel. Also append PCI to depends as select doesn't automatically add dependencies. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- V2: appends 'depends' with PCI drivers/li

Re: [PATCH 6/6] lightnvm: include NVM Express driver if OCSSD is selected for build

2017-09-21 Thread Rakesh Pandit
On Thu, Sep 21, 2017 at 01:32:40PM +0200, Matias Bjørling wrote: > On 09/21/2017 01:28 PM, Rakesh Pandit wrote: > > Because NVM needs BLK_DEV_NVME, select it automatically if we mark NVM > > in config file before building kernel. > > > > Signed-off-by: Rakes

[PATCH 5/6] lightnvm: pblk: print incompatible line version correctly

2017-09-21 Thread Rakesh Pandit
Correct it by coverting little endian to cpu endian and also define a macro for line version so that maintenance is easy. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 2 +- drivers/lightnvm/pblk-recovery.c | 4 ++-- drivers/lightnvm/pblk.h

[PATCH 6/6] lightnvm: include NVM Express driver if OCSSD is selected for build

2017-09-21 Thread Rakesh Pandit
Because NVM needs BLK_DEV_NVME, select it automatically if we mark NVM in config file before building kernel. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/lightnvm/Kconfig b/drivers/lightnvm/K

[PATCH 4/6] lightnvm: pblk: improve error message if down_timeout fails

2017-09-21 Thread Rakesh Pandit
The two pr_err messages are useless as they don't even differentiate error code. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/li

[PATCH 3/6] lightnvm: pblk: fix message if L2P MAP is in device

2017-09-21 Thread Rakesh Pandit
This usually happens if we are developing with qemu and ll2pmode has default value. Even in that case message seems wrong. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnv

[PATCH 2/6] lightnvm: pblk: protect line bitmap while submitting meta io

2017-09-21 Thread Rakesh Pandit
It seems pblk_dealloc_page would race against pblk_alloc_pages for line bitmap for sector allocation. The chances are very low but might as well protect the bitmap properly. It's not even in fast path. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 2

[PATCH 0/6] misc patches mostly for pblk

2017-09-21 Thread Rakesh Pandit
These are trivial changes up for review. Most of them I made while skimming through the code base. They are mostly cleanups and they are at random places. Rakesh Pandit (6): lightnvm: pblk: reuse pblk_gc_should_kick lightnvm: pblk: protect line bitmap while submitting meta io lightnvm

[PATCH 1/6] lightnvm: pblk: reuse pblk_gc_should_kick

2017-09-21 Thread Rakesh Pandit
This is a trivial change which reuses pblk_gc_should_kick instead of repeating it again in pblk_rl_free_lines_inc. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-core.c | 1 + drivers/lightnvm/pblk-rl.c | 9 - 2 files changed, 1 insertion(+), 9 del

Re: [PATCH] lightnvm: pblk: fix error path in pblk_lines_alloc_metadata

2017-09-21 Thread Rakesh Pandit
On Thu, Sep 21, 2017 at 11:56:46AM +0200, Javier González wrote: > > On 20 Sep 2017, at 21.50, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > Use appropriate memory free calls based on allocation type used and > > also fix number of times free is called if kmal

[PATCH] lightnvm: pblk: fix error path in pblk_lines_alloc_metadata

2017-09-20 Thread Rakesh Pandit
Use appropriate memory free calls based on allocation type used and also fix number of times free is called if kmalloc fails. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/pblk-init.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/d

Re: [PATCH 08/20] lightnvm: pblk: sched. metadata on write thread

2017-09-20 Thread Rakesh Pandit
On Wed, Sep 20, 2017 at 09:28:34PM +0300, Rakesh Pandit wrote: > Hi Javier, > > one small issue I found for error path while going through changes: > > On Mon, Jun 26, 2017 at 11:57:17AM +0200, Javier González wrote: > .. > > +static int pblk_lines_alloc_me

Re: [PATCH 08/20] lightnvm: pblk: sched. metadata on write thread

2017-09-20 Thread Rakesh Pandit
Hi Javier, one small issue I found for error path while going through changes: On Mon, Jun 26, 2017 at 11:57:17AM +0200, Javier González wrote: .. > +static int pblk_lines_alloc_metadata(struct pblk *pblk) > +{ > + struct pblk_line_mgmt *l_mg = >l_mg; > + struct pblk_line_meta *lm = >lm;

[PATCH] lightnvm: remove already calculated nr_chnls

2017-09-17 Thread Rakesh Pandit
Remove repeated calculation for number of channels while creating a target device. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- This is also a trivial change I found while investigating/working on other issue. drivers/lightnvm/core.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH V2] lightnvm: protect target type list with correct locks

2017-09-16 Thread Rakesh Pandit
nvm_tgt_types list was protected by wrong lock for NVM_INFO ioctl call and can race with addition or removal of target types. Also unregistering target type was not protected correctly. Fixes: 5cd907853 ("lightnvm: remove nested lock conflict with mm") Signed-off-by: Rakesh P

[PATCH] lightnvm: protect target type list with correct locks

2017-09-16 Thread Rakesh Pandit
nvm_tgt_types list was protected by wrong lock for NVM_INFO ioctl call and can race with addition or removal of target types. Fixes: cd9e9808d ("lightnvm: Support for Open-Channel SSDs") Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/core.c | 4 ++-- 1

[PATCH] lightnvm: prevent target type module removal when in use

2017-09-08 Thread Rakesh Pandit
If target type module e.g. pblk here is unloaded (rmmod) while module is in use (after creating target) system crashes. We fix this by using module API refcnt. Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/core.c | 4 drivers/lightnvm/pblk-init.c | 1 + i

[PATCH V3] lightnvm: if LUNs are already allocated fix return

2017-06-27 Thread 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: ade69e243 ("lightnvm: merge gennvm with core") Signed-off-by: Rakesh P

Re: [PATCH V2] lightnvm: if LUNs are already allocated fix return

2017-06-27 Thread Rakesh Pandit
On Tue, Jun 27, 2017 at 01:27:40PM +0200, Frans Klaver wrote: > On Tue, Jun 27, 2017 at 1:23 PM, Rakesh Pandit <rak...@tuxera.com> wrote: > > On Tue, Jun 27, 2017 at 01:01:22PM +0200, Frans Klaver wrote: > >> On Tue, Jun 27, 2017 at 12:43 PM, Rakesh Pandit <rak...@tuxe

Re: [PATCH V2] lightnvm: if LUNs are already allocated fix return

2017-06-27 Thread Rakesh Pandit
On Tue, Jun 27, 2017 at 01:01:22PM +0200, Frans Klaver wrote: > On Tue, Jun 27, 2017 at 12:43 PM, Rakesh Pandit <rak...@tuxera.com> wrote: > > While creating new device with NVM_DEV_CREATE if LUNs are already > > allocated ioctl would return -ENOMEM which is wrong. This

[PATCH V2] lightnvm: if LUNs are already allocated fix return

2017-06-27 Thread 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: ade69e243 ("lightnvm: merge gennvm with core") Signed-off-by: Rakesh P

Re: [PATCH] ligtnvm: if LUNs are already allocated fix return

2017-06-27 Thread Rakesh Pandit
Hi Frans, On Tue, Jun 27, 2017 at 11:06:44AM +0200, Frans Klaver wrote: > On Tue, Jun 27, 2017 at 10:39 AM, Matias Bjørling wrote: > > From: Rakesh Pandit <rak...@tuxera.com> > > > > While creating new device with NVM_DEV_CREATE if LUNs are already > > allocated

Re: [PATCH] nvme: fix hang in remove path

2017-06-06 Thread Rakesh Pandit
On Tue, Jun 06, 2017 at 09:12:23AM +0200, Christoph Hellwig wrote: > On Tue, Jun 06, 2017 at 10:10:45AM +0300, Sagi Grimberg wrote: > > > Note 7 here is NVME_SC_ABORT_REQ. Also we would avoid walking through > all power states inside the nvme_configure_apst as >

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Mon, Jun 05, 2017 at 11:47:33AM +0300, Rakesh Pandit wrote: > On Mon, Jun 05, 2017 at 11:44:34AM +0300, Rakesh Pandit wrote: > > On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > > > > > It would make sense to still add: > > > > >

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Mon, Jun 05, 2017 at 11:44:34AM +0300, Rakesh Pandit wrote: > On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > > > It would make sense to still add: > > > > > > if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTR

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > It would make sense to still add: > > > > if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD) > > return > > > > inside nvme_configure_apst at the top irrespective of this change. > > I'm not sure what

Re: [PATCH] nvme: fix hang in remove path

2017-06-02 Thread Rakesh Pandit
/0x3b0 > [] kthread+0x109/0x140 > [] ret_from_fork+0x2c/0x40 > [] 0x > > Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions") > Reported-by: Rakesh Pandit <rak...@tuxera.com> > Tested-by: Rakesh Pandit <rak...@tuxera.com

Re: [PATCH] ligtnvm: if LUNs are already allocated fix return

2017-05-29 Thread Rakesh Pandit
Hi Matias, On Mon, May 15, 2017 at 06:31:58AM +, Javier Gonzalez wrote: > > > > On 13 May 2017, at 21.50, Rakesh Pandit <rak...@tuxera.com> wrote: > > > > While creating new device with NVM_DEV_CREATE if LUNs are already > > allocated ioctl would return

Re: [PATCH 16/25] fuse: Convert to separately allocated bdi

2017-05-16 Thread Rakesh Pandit
On Tue, May 16, 2017 at 12:48:31PM +0200, Jan Kara wrote: > On Mon 15-05-17 23:34:00, Rakesh Pandit wrote: > > Hi Jan, Miklos, > > > > On Wed, Apr 12, 2017 at 12:24:40PM +0200, Jan Kara wrote: > > > Allocate struct backing_dev_info separately instead of embedding

Re: [PATCH 16/25] fuse: Convert to separately allocated bdi

2017-05-15 Thread Rakesh Pandit
Hi Jan, Miklos, On Wed, Apr 12, 2017 at 12:24:40PM +0200, Jan Kara wrote: > Allocate struct backing_dev_info separately instead of embedding it > inside the superblock. This unifies handling of bdi among users. > > CC: Miklos Szeredi > CC: linux-fsde...@vger.kernel.org >

[PATCH] ligtnvm: if LUNs are already allocated fix return

2017-05-13 Thread 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: ade69e243 ("lightnvm: merge gennvm with core") Signed-off-by: Rakesh P

[PATCH] lightnvm: propagate pblk_init return to userspace

2017-04-20 Thread Rakesh Pandit
eds to go in 4.12. Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/core.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/lightnvm/core.c

[PATCH] ligtnvm: fix double blk_put_queue on same queue

2017-04-19 Thread Rakesh Pandit
: 0001 R08: 0020 R09: 0001 [ 391.809311] R10: 053f R11: 0206 R12: [ 391.809316] R13: R14: 7ffc72edb58d R15: 7ffc72edb581 Signed-off-by: Rakesh Pandit <rak...@tuxera.com> --- drivers/lightnvm/