Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-27 Thread Wenwei Tao
2016-01-27 17:36 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/27/2016 07:06 AM, Wenwei Tao wrote: >> Thanks. >> >> 2016-01-27 13:52 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: >>> On 01/27/2016 03:21 AM, Wenwei Tao wrote: >>>> >

Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-27 Thread Wenwei Tao
to rrpc, but the code above indeed make me confuse about the sec and page thing. Hope I'm not misunderstand the code. ps: I'm not an expert on flash, if the confusion is caused by lack of knowledge about flash, pleas let me know. 2016-01-27 21:26 GMT+08:00 Matias Bjørling <m...@lightnvm.io>:

Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
Thanks. 2016-01-27 13:52 GMT+08:00 Matias Bjørling : > On 01/27/2016 03:21 AM, Wenwei Tao wrote: >> >> Yes, It's a spelling mistake, will correct it in next version. > > > I can fix it in the version I apply. No problem.

Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
Yes, It's a spelling mistake, will correct it in next version. 2016-01-26 22:52 GMT+08:00 Matias Bjørling : > On 01/26/2016 01:33 PM, Wenwei Tao wrote: >> We can create more than one target on a lightnvm >> device by specifying its begin lun and end lun. >> >> Bu

[PATCH v2 2/2] lightnvm: add non-continuous lun target creation support

2016-01-26 Thread Wenwei Tao
, thus we can improve the backend device's space utilization. Signed-off-by: Wenwei Tao --- Changes since v1: -use NVM_FIXED instead NVM_C_FIXED in gennvm_get_lun -add target creation flags check -rebase to v4.5-rc1 drivers/lightnvm/core.c | 36 --- drivers/lightnvm/gennvm.c | 42

[PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
the targets on the device might use the same logical addresses cause incorrect information in the device's l2p table. Signed-off-by: Wenwei Tao --- Changes since v1: - rename some variables - add parentheses for clarity - make gennvm_get_area return int, and add one more sector_t* parameter to pass

Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
Thanks. 2016-01-27 13:52 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/27/2016 03:21 AM, Wenwei Tao wrote: >> >> Yes, It's a spelling mistake, will correct it in next version. > > > I can fix it in the version I apply. No problem.

Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
Yes, It's a spelling mistake, will correct it in next version. 2016-01-26 22:52 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/26/2016 01:33 PM, Wenwei Tao wrote: >> We can create more than one target on a lightnvm >> device by specifying its begin lun and end lun. &

[PATCH v2 2/2] lightnvm: add non-continuous lun target creation support

2016-01-26 Thread Wenwei Tao
, thus we can improve the backend device's space utilization. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- Changes since v1: -use NVM_FIXED instead NVM_C_FIXED in gennvm_get_lun -add target creation flags check -rebase to v4.5-rc1 drivers/lightnvm/core.c | 36 --- drivers/li

[PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
the targets on the device might use the same logical addresses cause incorrect information in the device's l2p table. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- Changes since v1: - rename some variables - add parentheses for clarity - make gennvm_get_area return int, and add on

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-21 Thread Wenwei Tao
2016-01-21 17:49 GMT+08:00 Matias Bjørling : > On 01/21/2016 10:47 AM, Wenwei Tao wrote: > >> >> Currently a bitmap of luns already added into nvm_dev, every time we >> map the luns we check the bitmap. >> I don't quite understand why we need to add another bit

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-21 Thread Wenwei Tao
2016-01-21 15:53 GMT+08:00 Matias Bjørling : > On 01/21/2016 08:44 AM, Wenwei Tao wrote: >> 2016-01-20 21:19 GMT+08:00 Matias Bjørling : >>> On 01/15/2016 12:44 PM, Wenwei Tao wrote: >>>> When create a target, we specify the begin lunid and >>>> the end l

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-21 Thread Wenwei Tao
2016-01-21 17:49 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/21/2016 10:47 AM, Wenwei Tao wrote: > >> >> Currently a bitmap of luns already added into nvm_dev, every time we >> map the luns we check the bitmap. >> I don't quite understand why we ne

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-21 Thread Wenwei Tao
2016-01-21 15:53 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/21/2016 08:44 AM, Wenwei Tao wrote: >> 2016-01-20 21:19 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: >>> On 01/15/2016 12:44 PM, Wenwei Tao wrote: >>>> When create a target, we spec

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-20 Thread Wenwei Tao
2016-01-20 21:19 GMT+08:00 Matias Bjørling : > On 01/15/2016 12:44 PM, Wenwei Tao wrote: >> When create a target, we specify the begin lunid and >> the end lunid, and get the corresponding continuous >> luns from media manager, if one of the luns is not free, >> we

Re: [RFC PATCH 1/2] lightnvm: specify target's logical address area

2016-01-20 Thread Wenwei Tao
2016-01-20 21:03 GMT+08:00 Matias Bjørling : > On 01/15/2016 12:44 PM, Wenwei Tao wrote: >> We can create more than one target on a lightnvm >> device by specifying its begin lun and end lun. >> >> But only specify the physical address area is not >> enough, we

Re: [RFC PATCH 1/2] lightnvm: specify target's logical address area

2016-01-20 Thread Wenwei Tao
2016-01-20 21:03 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/15/2016 12:44 PM, Wenwei Tao wrote: >> We can create more than one target on a lightnvm >> device by specifying its begin lun and end lun. >> >> But only specify the physical address area

Re: [RFC PATCH 2/2] lightnvm: add non-continuous lun target creation support

2016-01-20 Thread Wenwei Tao
2016-01-20 21:19 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/15/2016 12:44 PM, Wenwei Tao wrote: >> When create a target, we specify the begin lunid and >> the end lunid, and get the corresponding continuous >> luns from media manager, if one of the lun

[PATCH] lightnvm: move the pages per block check out of the loop

2016-01-05 Thread Wenwei Tao
There is no need to check whether dev's pages per block is beyond rrpc support everytime we init a lun, we only need to check it once before enter the lun init loop. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff

Re: [PATCH] lightnvm: add full block direct to the gc list

2016-01-05 Thread Wenwei Tao
, and will not get reclaimed for further use. I think we may need to put the page back when the page is not actually used/programmed. 2016-01-04 19:24 GMT+08:00 Matias Bjørling : > On 01/04/2016 10:54 AM, Wenwei Tao wrote: >> >> We allocate gcb to queue full block to the gc list, >&g

Re: [PATCH] lightnvm: add full block direct to the gc list

2016-01-05 Thread Wenwei Tao
, and will not get reclaimed for further use. I think we may need to put the page back when the page is not actually used/programmed. 2016-01-04 19:24 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 01/04/2016 10:54 AM, Wenwei Tao wrote: >> >> We allocate gcb to queue full

[PATCH] lightnvm: move the pages per block check out of the loop

2016-01-05 Thread Wenwei Tao
There is no need to check whether dev's pages per block is beyond rrpc support everytime we init a lun, we only need to check it once before enter the lun init loop. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 11 +-- 1 file changed, 5 insertions

[PATCH] lightnvm: add full block direct to the gc list

2016-01-04 Thread Wenwei Tao
We allocate gcb to queue full block to the gc list, but gcb allocation may fail, if that happens, the block will not get reclaimed. So add the full block direct to the gc list, omit the queuing step. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 47

[PATCH] lightnvm: add full block direct to the gc list

2016-01-04 Thread Wenwei Tao
We allocate gcb to queue full block to the gc list, but gcb allocation may fail, if that happens, the block will not get reclaimed. So add the full block direct to the gc list, omit the queuing step. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.

[PATCH v2] lightnvm: fix rrpc_lun_gc

2015-12-30 Thread Wenwei Tao
to the list, this makes the block won't get reclaimed in the future. To solve this issue, delete block after gcb allocation. Signed-off-by: Wenwei Tao --- Changed in v2: -Advance the gcb allocation, make the debug log deliver the correct message. drivers/lightnvm/rrpc.c | 12 ++-- 1 file

[PATCH v2] lightnvm: fix rrpc_lun_gc

2015-12-30 Thread Wenwei Tao
to the list, this makes the block won't get reclaimed in the future. To solve this issue, delete block after gcb allocation. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- Changed in v2: -Advance the gcb allocation, make the debug log deliver the correct message. drivers/lightnvm/rrpc.

[PATCH] lightnvm: fix rrpc_lun_gc

2015-12-29 Thread Wenwei Tao
to the list, this makes the block won't get reclaimed in the future. To solve this issue, delete block after gcb allocation. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c

[PATCH] lightnvm: put block back to gc list on its reclaim fail

2015-12-29 Thread Wenwei Tao
We delete a block from the gc list before reclaim it, so put it back to the list on its reclaim fail, otherwize this block will not get reclaimed and be programable in the future. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 18 ++ 1 file changed, 14 insertions(+), 4

[PATCH] lightnvm: put block back to gc list on its reclaim fail

2015-12-29 Thread Wenwei Tao
We delete a block from the gc list before reclaim it, so put it back to the list on its reclaim fail, otherwize this block will not get reclaimed and be programable in the future. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 18 ++ 1 file c

[PATCH] lightnvm: fix rrpc_lun_gc

2015-12-29 Thread Wenwei Tao
to the list, this makes the block won't get reclaimed in the future. To solve this issue, delete block after gcb allocation. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/rr

[PATCH] lightnvm: check bi_error in gc

2015-12-28 Thread Wenwei Tao
We should check last io compeltion status before start another one. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c0886a8..d40c140 100644 --- a/drivers/lightnvm/rrpc.c +++ b

[PATCH] lightnvm: check bi_error in gc

2015-12-28 Thread Wenwei Tao
We should check last io compeltion status before start another one. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c0886a8..d40c140 100644 --- a/d

Re: [PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-21 Thread Wenwei Tao
08:32 AM, Wenwei Tao wrote: >> >> after io submission failed, before free rq, delete rq from >> rrpc's inflight list, leave no bad item in the list. And >> free rq's ppa_list to avoid memory leak. >> >> Signed-off-by: Wenwei Tao >> --- >> driver

Re: [PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-21 Thread Wenwei Tao
.io>: > On 12/21/2015 08:32 AM, Wenwei Tao wrote: >> >> after io submission failed, before free rq, delete rq from >> rrpc's inflight list, leave no bad item in the list. And >> free rq's ppa_list to avoid memory leak. >> >> Signed-off-by: Wenwei Tao <ww

Re: [PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-20 Thread Wenwei Tao
This patch is based on [PATCH] lightnvm: fix bio submission issue https://lkml.org/lkml/2015/12/9/394 2015-12-21 15:32 GMT+08:00 Wenwei Tao : > after io submission failed, before free rq, delete rq from > rrpc's inflight list, leave no bad item in the list. And > free rq's ppa_list

[PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-20 Thread Wenwei Tao
after io submission failed, before free rq, delete rq from rrpc's inflight list, leave no bad item in the list. And free rq's ppa_list to avoid memory leak. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b

Re: [PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-20 Thread Wenwei Tao
This patch is based on [PATCH] lightnvm: fix bio submission issue https://lkml.org/lkml/2015/12/9/394 2015-12-21 15:32 GMT+08:00 Wenwei Tao <ww.tao0...@gmail.com>: > after io submission failed, before free rq, delete rq from > rrpc's inflight list, leave no bad item in the list. And

[PATCH] lightnvm: unlock rq and free ppa_list after submission failed

2015-12-20 Thread Wenwei Tao
after io submission failed, before free rq, delete rq from rrpc's inflight list, leave no bad item in the list. And free rq's ppa_list to avoid memory leak. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH] lightnvm: fix bio submission issue

2015-12-09 Thread Wenwei Tao
put bio when submission fails, since we get it before submission. And return error when backend device driver doesn't provide a submit_io method, thus we can end IO properly. Signed-off-by: Wenwei Tao --- drivers/lightnvm/gennvm.c | 2 +- drivers/lightnvm/rrpc.c | 4 +++- 2 files changed, 4

[PATCH] lightnvm: fix bio submission issue

2015-12-09 Thread Wenwei Tao
put bio when submission fails, since we get it before submission. And return error when backend device driver doesn't provide a submit_io method, thus we can end IO properly. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/gennvm.c | 2 +- drivers/lightnvm/rrpc.c

[PATCH] staging: android: ashmem.c: destroy slabs when init fails

2015-12-08 Thread Wenwei Tao
when ashmem init fails, destroy the slabs, leave no garbage. Signed-off-by: Wenwei Tao --- drivers/staging/android/ashmem.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 3f2a3d6

Re: [PATCH] lightnvm: change rrpc slab creation/destruction time

2015-12-08 Thread Wenwei Tao
in rrpc_core_init,or you have any other concerns ? 2015-12-08 3:45 GMT+08:00 Matias Bjørling : > On Mon, Dec 7, 2015 at 1:16 PM, Wenwei Tao wrote: >> >> create rrpc slabs during rrpc module init, >> thus eliminate the lock contention and slab >> status check in rrpc_core_ini

Re: [PATCH] lightnvm: change rrpc slab creation/destruction time

2015-12-08 Thread Wenwei Tao
in rrpc_core_init,or you have any other concerns ? 2015-12-08 3:45 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On Mon, Dec 7, 2015 at 1:16 PM, Wenwei Tao <ww.tao0...@gmail.com> wrote: >> >> create rrpc slabs during rrpc module init, >> thus eliminate the lock co

[PATCH] staging: android: ashmem.c: destroy slabs when init fails

2015-12-08 Thread Wenwei Tao
when ashmem init fails, destroy the slabs, leave no garbage. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/staging/android/ashmem.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/a

[PATCH] lightnvm: change rrpc slab creation/destruction time

2015-12-07 Thread Wenwei Tao
create rrpc slabs during rrpc module init, thus eliminate the lock contention and slab status check in rrpc_core_init. And destroy them when rrpc exit. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 54 ++--- 1 file changed, 33 insertions

[PATCH] lightnvm: change rrpc slab creation/destruction time

2015-12-07 Thread Wenwei Tao
create rrpc slabs during rrpc module init, thus eliminate the lock contention and slab status check in rrpc_core_init. And destroy them when rrpc exit. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 54 ++---

[PATCH] lightnvm: place unlock sentence in the common path

2015-12-04 Thread Wenwei Tao
move spin_unlock(>lock) to common path to make the code more clean. Signed-off-by: Wenwei Tao --- drivers/lightnvm/gennvm.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 35dde84..ce60254 100

Re: [PATCH RFC 3/3] lightnvm: fix media mgr registration

2015-12-04 Thread Wenwei Tao
n be registered later, that > can manage a device. Only warn if a media manager fails initialization. > > Additionally, protect against the media managed being registered or > deregistered while looping through available media managers. This was > reported by Wenwei Tao. >

Re: [PATCH RFC 1/3] lightnvm: check mm before use

2015-12-04 Thread Wenwei Tao
2015-12-02 20:16 GMT+08:00 Matias Bjørling : > The core can initialize I/Os before a media manager is registered with > the lightnvm subsystem. Make sure that we don't call the media manager > prematurely. > > Signed-off-by: Matias Bjørling > --- > drivers/nvme/host/lightnvm.c | 2 +- > 1 file

Re: [PATCH RFC 3/3] lightnvm: fix media mgr registration

2015-12-04 Thread Wenwei Tao
ated. A media manager can be registered later, that > can manage a device. Only warn if a media manager fails initialization. > > Additionally, protect against the media managed being registered or > deregistered while looping through available media managers. This was > reported by W

Re: [PATCH RFC 1/3] lightnvm: check mm before use

2015-12-04 Thread Wenwei Tao
2015-12-02 20:16 GMT+08:00 Matias Bjørling : > The core can initialize I/Os before a media manager is registered with > the lightnvm subsystem. Make sure that we don't call the media manager > prematurely. > > Signed-off-by: Matias Bjørling > --- >

[PATCH] lightnvm: place unlock sentence in the common path

2015-12-04 Thread Wenwei Tao
move spin_unlock(>lock) to common path to make the code more clean. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/gennvm.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c inde

[PATCH] lightnvm: put blks when luns configure failed

2015-12-03 Thread Wenwei Tao
put the allocated blks back to the free list when the luns configure failed, to make these blks useable to others. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers

[PATCH] lightnvm: put blks when luns configure failed

2015-12-03 Thread Wenwei Tao
put the allocated blks back to the free list when the luns configure failed, to make these blks useable to others. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/d

[PATCH] lightnvm: use flags as input parameter

2015-12-02 Thread Wenwei Tao
rrpc_get_blk use constant 0 as the input parameter of nvm_get_blk, this may result in getting gc block failed unexpectedly. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c

[PATCH] lightnvm: use flags as input parameter

2015-12-02 Thread Wenwei Tao
rrpc_get_blk use constant 0 as the input parameter of nvm_get_blk, this may result in getting gc block failed unexpectedly. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/rrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/rr

Re: [PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-27 Thread Wenwei Tao
Hi Matiasl Just to let you know this patch and previous version both cannot address 'register device with supported manager may blocked while holding the lock' issue. 2015-11-28 3:41 GMT+08:00 Matias Bjørling : > On 11/27/2015 01:04 PM, Wenwei Tao wrote: >> >> Hi Matias >> P

Re: [PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-27 Thread Wenwei Tao
the lock, this is not good. 2015-11-27 16:31 GMT+08:00 Matias Bjørling : > On 11/27/2015 05:09 AM, Wenwei Tao wrote: >> >> To avoid race conditions, traverse dev, media manager, >> and targeet lists and also register, unregister entries >> to/from them, should be always

Re: [PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-27 Thread Wenwei Tao
the lock, this is not good. 2015-11-27 16:31 GMT+08:00 Matias Bjørling <m...@bjorling.me>: > On 11/27/2015 05:09 AM, Wenwei Tao wrote: >> >> To avoid race conditions, traverse dev, media manager, >> and targeet lists and also register, unregister entries >> to/

Re: [PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-27 Thread Wenwei Tao
Hi Matiasl Just to let you know this patch and previous version both cannot address 'register device with supported manager may blocked while holding the lock' issue. 2015-11-28 3:41 GMT+08:00 Matias Bjørling <m...@bjorling.me>: > On 11/27/2015 01:04 PM, Wenwei Tao wrote: >&g

[PATCH v2 0/3] fixes for LightNVM

2015-11-26 Thread Wenwei Tao
set to zero Wenwei Tao (3): lightnvm: missing nvm_lock acquire lightnvm: handle targets when corresponding nvm device exit nvme: change the interface between nvme and lightnvm drivers/lightnvm/core.c | 197 ++- drivers/nvme/host/lightnvm.c |

[PATCH v2 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-26 Thread Wenwei Tao
block creations of new targets, remove exiting targets when underlying device was gone. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 128 +++ include/linux/lightnvm.h | 3 ++ 2 files changed, 87 insertions(+), 44 deletions(-) diff --git

[PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-26 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 73 + 1 file changed

[PATCH v2 3/3] nvme: change the interface between nvme and lightnvm

2015-11-26 Thread Wenwei Tao
When nvme devices were removed, we need to handle the targets build upon them properly: remove the existing targets, block creations of new ones. To do this clean up job well, we need to change the interface between nvme and lightnvm. Signed-off-by: Wenwei Tao --- drivers/nvme/host/lightnvm.c

Re: [PATCH 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-26 Thread Wenwei Tao
015 01:42 PM, Wenwei Tao wrote: >> >> block creations of new targets, remove exiting targets when >> underlying device was gone. >> >> Signed-off-by: Wenwei Tao >> --- >> drivers/lightnvm/core.c | 127 >> ++

[PATCH v2 0/3] fixes for LightNVM

2015-11-26 Thread Wenwei Tao
set to zero Wenwei Tao (3): lightnvm: missing nvm_lock acquire lightnvm: handle targets when corresponding nvm device exit nvme: change the interface between nvme and lightnvm drivers/lightnvm/core.c | 197 ++- drivers/nvme/host/lightnvm.c |

[PATCH v2 3/3] nvme: change the interface between nvme and lightnvm

2015-11-26 Thread Wenwei Tao
When nvme devices were removed, we need to handle the targets build upon them properly: remove the existing targets, block creations of new ones. To do this clean up job well, we need to change the interface between nvme and lightnvm. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- d

[PATCH v2 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-26 Thread Wenwei Tao
block creations of new targets, remove exiting targets when underlying device was gone. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.c | 128 +++ include/linux/lightnvm.h | 3 ++ 2 files changed, 87 insertions(

[PATCH v2 1/3] lightnvm: missing nvm_lock acquire

2015-11-26 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.

Re: [PATCH 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-26 Thread Wenwei Tao
.me>: > On 11/25/2015 01:42 PM, Wenwei Tao wrote: >> >> block creations of new targets, remove exiting targets when >> underlying device was gone. >> >> Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com&g

Re: [PATCH 3/3] nvme: change the interface between nvme and lightnvm

2015-11-25 Thread Wenwei Tao
You are right. Reset it to zero is not necessary. 2015-11-25 23:13 GMT+08:00 Matias Bjørling : > On 11/25/2015 01:42 PM, Wenwei Tao wrote: >> >> When nvme devices were removed, we need to handle the targets >> build upon them properly: remove the existing targets, block >

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
dev; + up_write(_lock); return NULL; } use nvm_find_nvm_dev_locked() and nvm_find_nvm_dev() properly. 2015-11-25 21:11 GMT+08:00 Wenwei Tao : > Hi Matias > > Place the lock inside nvm_find_nvm_dev can make code cleaner, but > sometime may lack of flexibility, cause redundant

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
'return'. I just submit a patch set covering the lock issue and the target issue mentioned before, you can have a look before you apply this patch. Thanks. 2015-11-25 19:37 GMT+08:00 Matias Bjørling : > On 11/25/2015 09:57 AM, Wenwei Tao wrote: >> >> Hi Matias >> I think list_fo

[PATCH 3/3] nvme: change the interface between nvme and lightnvm

2015-11-25 Thread Wenwei Tao
When nvme devices were removed, we need to handle the targets build upon them properly: remove the existing targets, block creations of new ones. To do this clean up job well, we need to change the interface between nvme and lightnvm. Signed-off-by: Wenwei Tao --- drivers/nvme/host/lightnvm.c

[PATCH 1/3] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions

[PATCH 0/3] fixes fo LightNVM

2015-11-25 Thread Wenwei Tao
Hi A couple of fixes. Patch 1 add the missing lock aquire Patch 2-3 handle the targets when corresponding underlying devices were removed Wenwei Tao (3): lightnvm: missing nvm_lock acquire lightnvm: handle targets when corresponding nvm device exit nvme: change the interface between nvme

[PATCH 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-25 Thread Wenwei Tao
block creations of new targets, remove exiting targets when underlying device was gone. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 127 ++- include/linux/lightnvm.h | 3 ++ 2 files changed, 85 insertions(+), 45 deletions(-) diff --git

Re: [PATCH] lightnvm: remove targets when corresponding nvm device exit

2015-11-25 Thread Wenwei Tao
I will send a patch for that. 2015-11-25 2:51 GMT+08:00 Matias : > On 11/24/2015 05:03 PM, Wenwei Tao wrote: >> >> the target should be unreachable when underlying device was gone. >> >> Signed-off-by: Wenwei Tao >> --- >> drivers/lightnvm/core.c |

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
Hi Matias I think list_for_each_entry_safe(pos, n, head, member) cannot avoid race condition the item point by ‘n’ can be deleted and freed in the same time we operate on 'pos' so lock is still necessary. 2015-11-25 2:36 GMT+08:00 Matias : > On 11/24/2015 04:24 PM, Wenwei Tao wr

Re: [PATCH 3/3] nvme: change the interface between nvme and lightnvm

2015-11-25 Thread Wenwei Tao
You are right. Reset it to zero is not necessary. 2015-11-25 23:13 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 11/25/2015 01:42 PM, Wenwei Tao wrote: >> >> When nvme devices were removed, we need to handle the targets >> build upon them properly: remove

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
Hi Matias I think list_for_each_entry_safe(pos, n, head, member) cannot avoid race condition the item point by ‘n’ can be deleted and freed in the same time we operate on 'pos' so lock is still necessary. 2015-11-25 2:36 GMT+08:00 Matias <m...@lightnvm.io>: > On 11/24/2015 04:24 PM, W

Re: [PATCH] lightnvm: remove targets when corresponding nvm device exit

2015-11-25 Thread Wenwei Tao
I will send a patch for that. 2015-11-25 2:51 GMT+08:00 Matias <m...@lightnvm.io>: > On 11/24/2015 05:03 PM, Wenwei Tao wrote: >> >> the target should be unreachable when underlying device was gone. >> >> Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> &

[PATCH 2/3] lightnvm: handle targets when corresponding nvm device exit

2015-11-25 Thread Wenwei Tao
block creations of new targets, remove exiting targets when underlying device was gone. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.c | 127 ++- include/linux/lightnvm.h | 3 ++ 2 files changed, 85 insertions(

[PATCH 0/3] fixes fo LightNVM

2015-11-25 Thread Wenwei Tao
Hi A couple of fixes. Patch 1 add the missing lock aquire Patch 2-3 handle the targets when corresponding underlying devices were removed Wenwei Tao (3): lightnvm: missing nvm_lock acquire lightnvm: handle targets when corresponding nvm device exit nvme: change the interface between nvme

[PATCH 1/3] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.c | 19 +-- 1 file chang

[PATCH 3/3] nvme: change the interface between nvme and lightnvm

2015-11-25 Thread Wenwei Tao
When nvme devices were removed, we need to handle the targets build upon them properly: remove the existing targets, block creations of new ones. To do this clean up job well, we need to change the interface between nvme and lightnvm. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- d

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
'return'. I just submit a patch set covering the lock issue and the target issue mentioned before, you can have a look before you apply this patch. Thanks. 2015-11-25 19:37 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 11/25/2015 09:57 AM, Wenwei Tao wrote: >> >>

Re: [PATCH] lightnvm: missing nvm_lock acquire

2015-11-25 Thread Wenwei Tao
dev; + up_write(_lock); return NULL; } use nvm_find_nvm_dev_locked() and nvm_find_nvm_dev() properly. 2015-11-25 21:11 GMT+08:00 Wenwei Tao <ww.tao0...@gmail.com>: > Hi Matias > > Place the lock inside nvm_find_nvm_dev can make code cleaner, but > sometime may lack

[PATCH] lightnvm: remove targets when corresponding nvm device exit

2015-11-24 Thread Wenwei Tao
the target should be unreachable when underlying device was gone. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index f659e60..b95c6c4 100644 --- a/drivers

[PATCH] lightnvm: missing nvm_lock acquire

2015-11-24 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions

[PATCH] lightnvm: missing nvm_lock acquire

2015-11-24 Thread Wenwei Tao
To avoid race conditions, traverse dev, media manager, and targeet lists and also register, unregister entries to/from them, should be always under the nvm_lock control. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.c | 19 +-- 1 file chang

[PATCH] lightnvm: remove targets when corresponding nvm device exit

2015-11-24 Thread Wenwei Tao
the target should be unreachable when underlying device was gone. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/core.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index f

Re: [PATCH] lightnvm: free allocated memory when gennvm register fails

2015-11-23 Thread Wenwei Tao
This is okay with me. 2015-11-23 16:47 GMT+08:00 Matias Bjørling : > On 11/23/2015 09:29 AM, Wenwei Tao wrote: >> >> free allocated nvm block and gennvm lun structures when >> gennvm register fails, otherwise it will cause memory leak. >> >> Signed-off-by: Wenwei

[PATCH] lightnvm: free allocated memory when gennvm register fails

2015-11-23 Thread Wenwei Tao
free allocated nvm block and gennvm lun structures when gennvm register fails, otherwise it will cause memory leak. Signed-off-by: Wenwei Tao --- drivers/lightnvm/gennvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index ae1fb2b

[PATCH] lightnvm: free allocated memory when gennvm register fails

2015-11-23 Thread Wenwei Tao
free allocated nvm block and gennvm lun structures when gennvm register fails, otherwise it will cause memory leak. Signed-off-by: Wenwei Tao <ww.tao0...@gmail.com> --- drivers/lightnvm/gennvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/lightnvm/gennvm.c b/drivers/li

Re: [PATCH] lightnvm: free allocated memory when gennvm register fails

2015-11-23 Thread Wenwei Tao
This is okay with me. 2015-11-23 16:47 GMT+08:00 Matias Bjørling <m...@lightnvm.io>: > On 11/23/2015 09:29 AM, Wenwei Tao wrote: >> >> free allocated nvm block and gennvm lun structures when >> gennvm register fails, otherwise it will cause memory leak. >> >

Re: [PATCH] lightnvm: calculate device values correctly

2015-11-22 Thread Wenwei Tao
OK, I see. Thanks for the explanation. 2015-11-23 2:34 GMT+08:00 Matias : > On 11/22/2015 02:51 PM, Wenwei Tao wrote: >> >> In the original calculation, the relationships among >> block, plane and lun was confusing, refine it on the >> basis of Open-channelSSDInterface

Re: [PATCH] lightnvm: calculate device values correctly

2015-11-22 Thread Wenwei Tao
I'm a new guy to flash, if I'm wrong about this patch, please correct me. Thanks. 2015-11-22 21:51 GMT+08:00 Wenwei Tao : > In the original calculation, the relationships among > block, plane and lun was confusing, refine it on the > basis of Open-channelSSDInterfaceSpecification. >

[PATCH] lightnvm: calculate device values correctly

2015-11-22 Thread Wenwei Tao
In the original calculation, the relationships among block, plane and lun was confusing, refine it on the basis of Open-channelSSDInterfaceSpecification. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH] lightnvm: do device max sectors boundary check first

2015-11-22 Thread Wenwei Tao
do device max_phys_sect boundary check first, otherwise we will allocate dma_pools for devices whose max sectors are beyond lightnvm support and register them. Signed-off-by: Wenwei Tao --- drivers/lightnvm/core.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

<    1   2   3   >