Re: [RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-23 Thread Ming Lin
On Thu, Mar 23, 2017 at 10:51 AM, Josef Bacik wrote: > Yeah I think this is ok, I’ll throw it on my queue for fixes for this cycle. > Thanks, Great. Thanks. > > Josef

Re: [RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-23 Thread Ming Lin
On Thu, Mar 23, 2017 at 10:51 AM, Josef Bacik wrote: > Yeah I think this is ok, I’ll throw it on my queue for fixes for this cycle. > Thanks, Great. Thanks. > > Josef

Re: [Nbd] [RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-22 Thread Ming Lin
On Mon, Mar 20, 2017 at 3:58 PM, Ming Lin <m...@kernel.org> wrote: > From: Ratna Manoj Bolla <manoj...@gmail.com> > > When a filesystem is mounted on a nbd device and on a disconnect, because > of kill_bdev(), and resetting bdev size to zero, buffer_head mappings are &

Re: [Nbd] [RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-22 Thread Ming Lin
On Mon, Mar 20, 2017 at 3:58 PM, Ming Lin wrote: > From: Ratna Manoj Bolla > > When a filesystem is mounted on a nbd device and on a disconnect, because > of kill_bdev(), and resetting bdev size to zero, buffer_head mappings are > getting destroyed under mounted filesystem. > &

[RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-20 Thread Ming Lin
From: Ratna Manoj Bolla When a filesystem is mounted on a nbd device and on a disconnect, because of kill_bdev(), and resetting bdev size to zero, buffer_head mappings are getting destroyed under mounted filesystem. After a bdev size reset(i.e bdev->bd_inode->i_size = 0) on

[RFC PATCH 0/1] nbd: fix crash when unmaping nbd device with fs still mounted

2017-03-20 Thread Ming Lin
Hi all, I run into a BUG_ON(!buffer_mapped(bh)) crash with below script. $ rbd-nbd map mypool/myimg $ mkfs.ext4 /dev/nbd0 $ mount /dev/nbd0 /mnt/ $ rbd-nbd unmap /dev/nbd0 $ umount /mnt [ 1248.870131] kernel BUG at /home/mlin/linux/fs/buffer.c:3103! [ 1248.871214] invalid opcode: [#1]

[RFC PATCH 1/1] nbd: replace kill_bdev() with __invalidate_device()

2017-03-20 Thread Ming Lin
From: Ratna Manoj Bolla When a filesystem is mounted on a nbd device and on a disconnect, because of kill_bdev(), and resetting bdev size to zero, buffer_head mappings are getting destroyed under mounted filesystem. After a bdev size reset(i.e bdev->bd_inode->i_size = 0) on a disconnect,

[RFC PATCH 0/1] nbd: fix crash when unmaping nbd device with fs still mounted

2017-03-20 Thread Ming Lin
Hi all, I run into a BUG_ON(!buffer_mapped(bh)) crash with below script. $ rbd-nbd map mypool/myimg $ mkfs.ext4 /dev/nbd0 $ mount /dev/nbd0 /mnt/ $ rbd-nbd unmap /dev/nbd0 $ umount /mnt [ 1248.870131] kernel BUG at /home/mlin/linux/fs/buffer.c:3103! [ 1248.871214] invalid opcode: [#1]

Re: [PATCH 4/5] nvmet-rdma: add a NVMe over Fabrics RDMA target driver

2016-06-09 Thread Ming Lin
On Thu, Jun 9, 2016 at 2:42 PM, Steve Wise wrote: > Should the above error path actually goto a block that frees the rsps? Like > this? > > diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c > index c184ee5..8aaa36f 100644 > ---

Re: [PATCH 4/5] nvmet-rdma: add a NVMe over Fabrics RDMA target driver

2016-06-09 Thread Ming Lin
On Thu, Jun 9, 2016 at 2:42 PM, Steve Wise wrote: > Should the above error path actually goto a block that frees the rsps? Like > this? > > diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c > index c184ee5..8aaa36f 100644 > --- a/drivers/nvme/target/rdma.c > +++

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, 2016-06-07 at 22:49 -0600, Jens Axboe wrote: > On 06/06/2016 03:21 PM, Christoph Hellwig wrote: > > From: Ming Lin <min...@ssi.samsung.com> > > > > For some protocols like NVMe over Fabrics we need to be able to > > send > > initialization comma

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, 2016-06-07 at 22:49 -0600, Jens Axboe wrote: > On 06/06/2016 03:21 PM, Christoph Hellwig wrote: > > From: Ming Lin > > > > For some protocols like NVMe over Fabrics we need to be able to > > send > > initialization commands to a specific queue. > &

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 8:27 AM, Ming Lin <m...@kernel.org> wrote: > On Tue, Jun 7, 2016 at 7:57 AM, Keith Busch <keith.bu...@intel.com> wrote: >> On Mon, Jun 06, 2016 at 11:21:52PM +0200, Christoph Hellwig wrote: >>> +struct request *blk_mq_alloc_request_hctx(s

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 8:27 AM, Ming Lin wrote: > On Tue, Jun 7, 2016 at 7:57 AM, Keith Busch wrote: >> On Mon, Jun 06, 2016 at 11:21:52PM +0200, Christoph Hellwig wrote: >>> +struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, >>> +

Re: NVMe over Fabrics target implementation

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 2:02 PM, Andy Grover wrote: > On 06/06/2016 11:23 PM, Nicholas A. Bellinger wrote: >> >> Hi HCH & Co, >> >> On Mon, 2016-06-06 at 23:22 +0200, Christoph Hellwig wrote: >>> >>> This patch set adds a generic NVMe over Fabrics target. The >>> implementation

Re: NVMe over Fabrics target implementation

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 2:02 PM, Andy Grover wrote: > On 06/06/2016 11:23 PM, Nicholas A. Bellinger wrote: >> >> Hi HCH & Co, >> >> On Mon, 2016-06-06 at 23:22 +0200, Christoph Hellwig wrote: >>> >>> This patch set adds a generic NVMe over Fabrics target. The >>> implementation conforms to the

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 7:57 AM, Keith Busch wrote: > On Mon, Jun 06, 2016 at 11:21:52PM +0200, Christoph Hellwig wrote: >> +struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, >> + unsigned int flags, unsigned int hctx_idx) >> +{ >> +

Re: [PATCH 1/8] blk-mq: add blk_mq_alloc_request_hctx

2016-06-07 Thread Ming Lin
On Tue, Jun 7, 2016 at 7:57 AM, Keith Busch wrote: > On Mon, Jun 06, 2016 at 11:21:52PM +0200, Christoph Hellwig wrote: >> +struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, >> + unsigned int flags, unsigned int hctx_idx) >> +{ >> + struct blk_mq_hw_ctx

[PATCH] blk-mq: clear q->mq_ops if init fail

2016-05-26 Thread Ming Lin
From: Ming Lin <min...@samsung.com> blk_mq_init_queue() calls blk_mq_init_allocated_queue(), but q->mq_ops was not cleared when blk_mq_init_allocated_queue() fails. Then blk_cleanup_queue() calls blk_mq_free_queue() which will crash because: - q->all_q_node is not added to all_q_

[PATCH] blk-mq: clear q->mq_ops if init fail

2016-05-26 Thread Ming Lin
From: Ming Lin blk_mq_init_queue() calls blk_mq_init_allocated_queue(), but q->mq_ops was not cleared when blk_mq_init_allocated_queue() fails. Then blk_cleanup_queue() calls blk_mq_free_queue() which will crash because: - q->all_q_node is not added to all_q_list yet - q->tag_set is NU

Re: [PATCH v2] lib: make sg_pool tristate instead of bool

2016-04-23 Thread Ming Lin
lt as a module by anyone, > and that tripped my audit looking for modular code that is essentially > orphaned (i.e. module_exit, and .remove fcns in non-modular drivers.) > > In the following discussion, Ming Lin indicated that the original > intention was to have it tristate, so here we

Re: [PATCH v2] lib: make sg_pool tristate instead of bool

2016-04-23 Thread Ming Lin
pped my audit looking for modular code that is essentially > orphaned (i.e. module_exit, and .remove fcns in non-modular drivers.) > > In the following discussion, Ming Lin indicated that the original > intention was to have it tristate, so here we convert it accordingly. > &g

Re: [PATCH] lib: make sg_pool explicitly non-modular

2016-04-20 Thread Ming Lin
On Wed, 2016-04-20 at 23:02 -0400, Paul Gortmaker wrote: >  > > > > So the .config will have CONFIG_SG_POOL=m > > That is impossible currently, since as per above, the variable is > bool > and not tristate.  Did you mean to make it tristate? I didn't notice that. Yes, it should be tristate.

Re: [PATCH] lib: make sg_pool explicitly non-modular

2016-04-20 Thread Ming Lin
On Wed, 2016-04-20 at 23:02 -0400, Paul Gortmaker wrote: >  > > > > So the .config will have CONFIG_SG_POOL=m > > That is impossible currently, since as per above, the variable is > bool > and not tristate.  Did you mean to make it tristate? I didn't notice that. Yes, it should be tristate.

Re: [PATCH] lib: make sg_pool explicitly non-modular

2016-04-20 Thread Ming Lin
> one might want to consider moving it to subsys_initcall if it is to > be ready ahead of SCSI drivers wanting this and using device_initcall. > > Cc: Christoph Hellwig <h...@lst.de> > Cc: Ming Lin <min...@ssi.samsung.com> > Cc: Sagi Grimberg <s...@grimberg.me> > Cc: Mart

Re: [PATCH] lib: make sg_pool explicitly non-modular

2016-04-20 Thread Ming Lin
> one might want to consider moving it to subsys_initcall if it is to > be ready ahead of SCSI drivers wanting this and using device_initcall. > > Cc: Christoph Hellwig > Cc: Ming Lin > Cc: Sagi Grimberg > Cc: Martin K. Petersen > Signed-off-by: Paul Gortmaker > --- > lib/sg_po

Re: [PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-11 Thread Ming Lin
On Mon, Apr 11, 2016 at 2:34 PM, Martin K. Petersen <martin.peter...@oracle.com> wrote: >>>>>> "Ming" == Ming Lin <m...@kernel.org> writes: > > Ming> Are we ready to merge it? > > We're still missing an ack from Sagi. Thought we already had a ack from Bart. OK, let's get one more from Sagi.

Re: [PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-11 Thread Ming Lin
On Mon, Apr 11, 2016 at 2:34 PM, Martin K. Petersen wrote: >>>>>> "Ming" == Ming Lin writes: > > Ming> Are we ready to merge it? > > We're still missing an ack from Sagi. Thought we already had a ack from Bart. OK, let's get one more from Sagi.

Re: [PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-10 Thread Ming Lin
On Tue, Apr 5, 2016 at 7:55 AM, Tejun Heo <t...@kernel.org> wrote: > On Mon, Apr 04, 2016 at 02:48:10PM -0700, Ming Lin wrote: >> From: Ming Lin <min...@ssi.samsung.com> >> >> Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount >>

Re: [PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-10 Thread Ming Lin
On Tue, Apr 5, 2016 at 7:55 AM, Tejun Heo wrote: > On Mon, Apr 04, 2016 at 02:48:10PM -0700, Ming Lin wrote: >> From: Ming Lin >> >> Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount >> we fit into a single scatterlist chunk. >> >

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-04-07 Thread Ming Lin
On Thu, Apr 7, 2016 at 9:43 AM, Ming Lin <m...@kernel.org> wrote: > On Thu, Apr 7, 2016 at 7:56 AM, Bart Van Assche > <bart.vanass...@sandisk.com> wrote: >> On 03/15/16 15:39, Ming Lin wrote: >>> >>> +static void sg_mempoll_free(struct scatterlist *sgl,

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-04-07 Thread Ming Lin
On Thu, Apr 7, 2016 at 9:43 AM, Ming Lin wrote: > On Thu, Apr 7, 2016 at 7:56 AM, Bart Van Assche > wrote: >> On 03/15/16 15:39, Ming Lin wrote: >>> >>> +static void sg_mempoll_free(struct scatterlist *sgl, unsigned int nents) >> >> >> Please cha

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-04-07 Thread Ming Lin
On Thu, Apr 7, 2016 at 7:56 AM, Bart Van Assche <bart.vanass...@sandisk.com> wrote: > On 03/15/16 15:39, Ming Lin wrote: >> >> +static void sg_mempoll_free(struct scatterlist *sgl, unsigned int nents) > > > Please change mempoll into mempool. Good catch. Thanks Bart!

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-04-07 Thread Ming Lin
On Thu, Apr 7, 2016 at 7:56 AM, Bart Van Assche wrote: > On 03/15/16 15:39, Ming Lin wrote: >> >> +static void sg_mempoll_free(struct scatterlist *sgl, unsigned int nents) > > > Please change mempoll into mempool. Good catch. Thanks Bart!

[PATCH v3 0/5] mempool based chained scatterlist alloc/free api

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> The fist 4 patches make the SG related definitions/structs/functions in SCSI code generic and the last patch move it to lib/sg_pool.c. v3: - Resend for Tejun to review. No code change since v2. - Add review/ack tags v2: - do modification i

[PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount we fit into a single scatterlist chunk. Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. Will move these 2 generic definitions to scatterlist.h later. Reviewed-by: Chr

[PATCH v3 0/5] mempool based chained scatterlist alloc/free api

2016-04-04 Thread Ming Lin
From: Ming Lin The fist 4 patches make the SG related definitions/structs/functions in SCSI code generic and the last patch move it to lib/sg_pool.c. v3: - Resend for Tejun to review. No code change since v2. - Add review/ack tags v2: - do modification in scsi code first then move to lib

[PATCH v3 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-04 Thread Ming Lin
From: Ming Lin Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount we fit into a single scatterlist chunk. Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. Will move these 2 generic definitions to scatterlist.h later. Reviewed-by: Christoph Hellwig Acked-by: Bart Van

[PATCH v3 2/5] scsi: replace "mq" with "first_chunk" in SG functions

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Parameter "bool mq" is block driver specific. Change it to "first_chunk" to make it more generic. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_l

[PATCH v3 2/5] scsi: replace "mq" with "first_chunk" in SG functions

2016-04-04 Thread Ming Lin
From: Ming Lin Parameter "bool mq" is block driver specific. Change it to "first_chunk" to make it more generic. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 20 ++-- 1 file changed, 10 insertions(+), 10 dele

[PATCH v3 1/5] scsi: replace "scsi_data_buffer" with "sg_table" in SG functions

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Replace parameter "struct scsi_data_buffer" with "struct sg_table" in SG alloc/free functions to make them generic. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lin <min...@ssi.samsung.com

[PATCH v3 3/5] scsi: rename SG related struct and functions

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Rename SCSI specific struct and functions to more genenic names. Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_lib.c | 52 ---

[PATCH v3 1/5] scsi: replace "scsi_data_buffer" with "sg_table" in SG functions

2016-04-04 Thread Ming Lin
From: Ming Lin Replace parameter "struct scsi_data_buffer" with "struct sg_table" in SG alloc/free functions to make them generic. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 41 +++-- 1 file ch

[PATCH v3 3/5] scsi: rename SG related struct and functions

2016-04-04 Thread Ming Lin
From: Ming Lin Rename SCSI specific struct and functions to more genenic names. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers

[PATCH v3 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Now it's ready to move the mempool based SG chained allocator code from SCSI driver to lib/sg_pool.c, which will be compiled only based on a Kconfig symbol CONFIG_SG_POOL. SCSI selects CONFIG_SG_POOL. Reviewed-by: Christoph Hellwig <h...@lst.d

[PATCH v3 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
From: Ming Lin Now it's ready to move the mempool based SG chained allocator code from SCSI driver to lib/sg_pool.c, which will be compiled only based on a Kconfig symbol CONFIG_SG_POOL. SCSI selects CONFIG_SG_POOL. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lin --- drivers/scsi

Re: [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
On Mon, Apr 4, 2016 at 1:17 PM, Christoph Hellwig <h...@lst.de> wrote: > On Mon, Apr 04, 2016 at 01:15:45PM -0700, Ming Lin wrote: >> cleanup_sdb: >> for (i = 0; i < SG_MEMPOOL_NR; i++) { >> struct sg_pool *sgp = sg_pools + i; &g

Re: [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
On Mon, Apr 4, 2016 at 1:17 PM, Christoph Hellwig wrote: > On Mon, Apr 04, 2016 at 01:15:45PM -0700, Ming Lin wrote: >> cleanup_sdb: >> for (i = 0; i < SG_MEMPOOL_NR; i++) { >> struct sg_pool *sgp = sg_pools + i; >>

Re: [PATCH v2 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-04 Thread Ming Lin
On Tue, Mar 22, 2016 at 3:03 PM, Ming Lin <m...@kernel.org> wrote: > From: Ming Lin <min...@ssi.samsung.com> > > Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount > we fit into a single scatterlist chunk. > > Rename SCSI_MAX_SG_CHAIN_SEGMENTS to

Re: [PATCH v2 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-04-04 Thread Ming Lin
On Tue, Mar 22, 2016 at 3:03 PM, Ming Lin wrote: > From: Ming Lin > > Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount > we fit into a single scatterlist chunk. > > Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. > > Will move the

Re: [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
ving the system] > > url: > https://github.com/0day-ci/linux/commits/Ming-Lin/mempool-based-chained-scatterlist-alloc-free-api/20160323-060710 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next > > > coccinelle warnings: (new ones prefixed by &g

Re: [PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-04-04 Thread Ming Lin
t; > url: > https://github.com/0day-ci/linux/commits/Ming-Lin/mempool-based-chained-scatterlist-alloc-free-api/20160323-060710 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next > > > coccinelle warnings: (new ones prefixed by >>) > >&g

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-04-04 Thread Ming Lin
On Mon, Mar 28, 2016 at 7:48 AM, Ming Lin <m...@kernel.org> wrote: > On Thu, Mar 24, 2016 at 8:46 AM, James Bottomley > <james.bottom...@hansenpartnership.com> wrote: >> On Thu, 2016-03-24 at 08:09 -0700, Ming Lin wrote: >>> On Wed, Mar 23, 2016 at 12:40 A

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-04-04 Thread Ming Lin
On Mon, Mar 28, 2016 at 7:48 AM, Ming Lin wrote: > On Thu, Mar 24, 2016 at 8:46 AM, James Bottomley > wrote: >> On Thu, 2016-03-24 at 08:09 -0700, Ming Lin wrote: >>> On Wed, Mar 23, 2016 at 12:40 AM, Christoph Hellwig >>> wrote: >>> > On Tue, Mar 22

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-28 Thread Ming Lin
On Thu, Mar 24, 2016 at 8:46 AM, James Bottomley <james.bottom...@hansenpartnership.com> wrote: > On Thu, 2016-03-24 at 08:09 -0700, Ming Lin wrote: >> On Wed, Mar 23, 2016 at 12:40 AM, Christoph Hellwig <h...@lst.de> >> wrote: >> > On Tue, Mar 22, 2016

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-28 Thread Ming Lin
On Thu, Mar 24, 2016 at 8:46 AM, James Bottomley wrote: > On Thu, 2016-03-24 at 08:09 -0700, Ming Lin wrote: >> On Wed, Mar 23, 2016 at 12:40 AM, Christoph Hellwig >> wrote: >> > On Tue, Mar 22, 2016 at 03:03:11PM -0700, Ming Lin wrote: >> > > From: Ming L

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-24 Thread Ming Lin
On Wed, Mar 23, 2016 at 12:40 AM, Christoph Hellwig <h...@lst.de> wrote: > On Tue, Mar 22, 2016 at 03:03:11PM -0700, Ming Lin wrote: >> From: Ming Lin <min...@ssi.samsung.com> >> >> The fist 4 patches make the SG related definitions/structs/functions >> in SC

Re: [PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-24 Thread Ming Lin
On Wed, Mar 23, 2016 at 12:40 AM, Christoph Hellwig wrote: > On Tue, Mar 22, 2016 at 03:03:11PM -0700, Ming Lin wrote: >> From: Ming Lin >> >> The fist 4 patches make the SG related definitions/structs/functions >> in SCSI code generic and the last patch move it to l

[PATCH v2 1/5] scsi: replace "scsi_data_buffer" with "sg_table" in SG functions

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Replace parameter "struct scsi_data_buffer" with "struct sg_table" in SG alloc/free functions to make them generic. Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_lib.c | 41 +++--

[PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> The fist 4 patches make the SG related definitions/structs/functions in SCSI code generic and the last patch move it to lib/sg_pool.c. I still keep the macro "SG_MEMPOOL_NR" since it's used in 3 places. v2: - do modification in scsi code

[PATCH v2 1/5] scsi: replace "scsi_data_buffer" with "sg_table" in SG functions

2016-03-22 Thread Ming Lin
From: Ming Lin Replace parameter "struct scsi_data_buffer" with "struct sg_table" in SG alloc/free functions to make them generic. Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 41 +++-- 1 file changed, 23 insertions(+), 18 dele

[PATCH v2 0/5] mempool based chained scatterlist alloc/free api

2016-03-22 Thread Ming Lin
From: Ming Lin The fist 4 patches make the SG related definitions/structs/functions in SCSI code generic and the last patch move it to lib/sg_pool.c. I still keep the macro "SG_MEMPOOL_NR" since it's used in 3 places. v2: - do modification in scsi code first then move to lib

[PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Now it's ready to move the mempool based SG chained allocator code from SCSI driver to lib/sg_pool.c, which will be compiled only based on a Kconfig symbol CONFIG_SG_POOL. SCSI selects CONFIG_SG_POOL. Signed-off-by: Ming Lin <min...@ssi.sa

[PATCH v2 3/5] scsi: rename SG related struct and functions

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Rename SCSI specific struct and functions to more genenic names. Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_lib.c | 52 - 1 file changed, 26 insertions(+), 26 deleti

[PATCH v2 5/5] lib: scatterlist: move SG pool code from SCSI driver to lib/sg_pool.c

2016-03-22 Thread Ming Lin
From: Ming Lin Now it's ready to move the mempool based SG chained allocator code from SCSI driver to lib/sg_pool.c, which will be compiled only based on a Kconfig symbol CONFIG_SG_POOL. SCSI selects CONFIG_SG_POOL. Signed-off-by: Ming Lin --- drivers/scsi/Kconfig| 1 + drivers

[PATCH v2 3/5] scsi: rename SG related struct and functions

2016-03-22 Thread Ming Lin
From: Ming Lin Rename SCSI specific struct and functions to more genenic names. Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi

[PATCH v2 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount we fit into a single scatterlist chunk. Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. Will move these 2 generic definitions to scatterlist.h later. Signed-off-by: Ming Li

[PATCH v2 2/5] scsi: replace "mq" with "first_chunk" in SG functions

2016-03-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Parameter "bool mq" is block driver specific. Change it to "first_chunk" to make it more generic. Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_lib.c | 20 ++-- 1 file changed

[PATCH v2 4/5] scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS

2016-03-22 Thread Ming Lin
From: Ming Lin Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount we fit into a single scatterlist chunk. Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS. Will move these 2 generic definitions to scatterlist.h later. Signed-off-by: Ming Lin --- drivers/ata

[PATCH v2 2/5] scsi: replace "mq" with "first_chunk" in SG functions

2016-03-22 Thread Ming Lin
From: Ming Lin Parameter "bool mq" is block driver specific. Change it to "first_chunk" to make it more generic. Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-03-21 Thread Ming Lin
On Wed, 2016-03-16 at 09:23 +0100, Christoph Hellwig wrote: > >  > We can defintively kill this one. We want to support different size of pools. How can we kill this one? Or did you mean we just create a single pool with size SG_CHUNK_SIZE? > > > +static __init int sg_mempool_init(void) > > +{

Re: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-03-21 Thread Ming Lin
On Wed, 2016-03-16 at 09:23 +0100, Christoph Hellwig wrote: > >  > We can defintively kill this one. We want to support different size of pools. How can we kill this one? Or did you mean we just create a single pool with size SG_CHUNK_SIZE? > > > +static __init int sg_mempool_init(void) > > +{

Re: [PATCH RFC 0/2] mempool based chained scatterlist alloc/free api api

2016-03-15 Thread Ming Lin
On Tue, 2016-03-15 at 16:12 -0700, James Bottomley wrote: > On Tue, 2016-03-15 at 15:39 -0700, Ming Lin wrote: > > From: Ming Lin <min...@ssi.samsung.com> > > > > Hi list, > > > > This moves the mempool based chained scatterlist alloc/free code >

Re: [PATCH RFC 0/2] mempool based chained scatterlist alloc/free api api

2016-03-15 Thread Ming Lin
On Tue, 2016-03-15 at 16:12 -0700, James Bottomley wrote: > On Tue, 2016-03-15 at 15:39 -0700, Ming Lin wrote: > > From: Ming Lin > > > > Hi list, > > > > This moves the mempool based chained scatterlist alloc/free code > > from > > scsi_lib.c to

[PATCH RFC 0/2] mempool based chained scatterlist alloc/free api api

2016-03-15 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> Hi list, This moves the mempool based chained scatterlist alloc/free code from scsi_lib.c to lib/scatterlist.c. So other drivers(for example, the under development NVMe over fabric drivers) can also use it. Ming Lin (2): scatterlist: add mempool

[PATCH RFC 2/2] scsi: use the new chained SG api

2016-03-15 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This removes the old code and uses the new chained SG alloc/free api. Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- drivers/scsi/scsi_lib.c | 129 +++- 1 file changed, 7 insertions(+), 1

[PATCH RFC 0/2] mempool based chained scatterlist alloc/free api api

2016-03-15 Thread Ming Lin
From: Ming Lin Hi list, This moves the mempool based chained scatterlist alloc/free code from scsi_lib.c to lib/scatterlist.c. So other drivers(for example, the under development NVMe over fabric drivers) can also use it. Ming Lin (2): scatterlist: add mempool based chained SG alloc/free

[PATCH RFC 2/2] scsi: use the new chained SG api

2016-03-15 Thread Ming Lin
From: Ming Lin This removes the old code and uses the new chained SG alloc/free api. Signed-off-by: Ming Lin --- drivers/scsi/scsi_lib.c | 129 +++- 1 file changed, 7 insertions(+), 122 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers

[PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-03-15 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> This copied code from scsi_lib.c to scatterlist.c and modified it a bit. Signed-off-by: Ming Lin <min...@ssi.samsung.com> --- include/linux/scatterlist.h | 12 lib/scatterlist.c | 156 +

[PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api

2016-03-15 Thread Ming Lin
From: Ming Lin This copied code from scsi_lib.c to scatterlist.c and modified it a bit. Signed-off-by: Ming Lin --- include/linux/scatterlist.h | 12 lib/scatterlist.c | 156 2 files changed, 168 insertions(+) diff --git a/include

Re: e827091cb1 "block: merge: get the 1st and last bvec via helpers" broken

2016-03-12 Thread Ming Lin
On Fri, Mar 11, 2016 at 11:43 PM, Kent Overstreet wrote: > I don't know exactly how it's broken, but with that patch segment counting is > broken - I'm seeing blk_rq_map_sg() overrun the end of the sgtable. > > I suggest reverting it for 4.5... + Ming Lei

Re: e827091cb1 "block: merge: get the 1st and last bvec via helpers" broken

2016-03-12 Thread Ming Lin
On Fri, Mar 11, 2016 at 11:43 PM, Kent Overstreet wrote: > I don't know exactly how it's broken, but with that patch segment counting is > broken - I'm seeing blk_rq_map_sg() overrun the end of the sgtable. > > I suggest reverting it for 4.5... + Ming Lei

RE: 4.4-final: 28 bioset threads on small notebook

2016-02-21 Thread Ming Lin-SSI
>-Original Message- >From: Kent Overstreet [mailto:kent.overstr...@gmail.com] > >On Sat, Feb 20, 2016 at 09:55:19PM +0100, Pavel Machek wrote: >> Hi! >> >> > > > You're directing this concern to the wrong person. >> > > > >> > > > I already told you DM is _not_ contributing any extra

RE: 4.4-final: 28 bioset threads on small notebook

2016-02-21 Thread Ming Lin-SSI
>-Original Message- >From: Kent Overstreet [mailto:kent.overstr...@gmail.com] > >On Sat, Feb 20, 2016 at 09:55:19PM +0100, Pavel Machek wrote: >> Hi! >> >> > > > You're directing this concern to the wrong person. >> > > > >> > > > I already told you DM is _not_ contributing any extra

Re: block: re-add discard_granularity and alignment checks

2015-10-27 Thread Ming Lin
On Thu, Oct 22, 2015 at 10:03 AM, Mike Snitzer wrote: > On Thu, Oct 22 2015 at 12:59pm -0400, > Ming Lin wrote: > >> From: Ming Lin >> >> In commit b49a087("block: remove split code in >> blkdev_issue_{discard,write_same}"), discard_granularity an

Re: block: re-add discard_granularity and alignment checks

2015-10-27 Thread Ming Lin
On Thu, Oct 22, 2015 at 10:03 AM, Mike Snitzer <snit...@redhat.com> wrote: > On Thu, Oct 22 2015 at 12:59pm -0400, > Ming Lin <m...@kernel.org> wrote: > >> From: Ming Lin <min...@ssi.samsung.com> >> >> In commit b49a087("block: remove

[PATCH] block: re-add discard_granularity and alignment checks

2015-10-22 Thread Ming Lin
From: Ming Lin In commit b49a087("block: remove split code in blkdev_issue_{discard,write_same}"), discard_granularity and alignment checks were removed. Ideally, with bio late splitting, the upper layers shouldn't need to depend on device's limits. Christoph reported a discard

[PATCH] block: re-add discard_granularity and alignment checks

2015-10-22 Thread Ming Lin
From: Ming Lin <min...@ssi.samsung.com> In commit b49a087("block: remove split code in blkdev_issue_{discard,write_same}"), discard_granularity and alignment checks were removed. Ideally, with bio late splitting, the upper layers shouldn't need to depend on device's limits. Ch

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 14:18 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 1:33pm -0400, > Ming Lin wrote: > > > On Wed, 2015-10-21 at 12:19 -0400, Mike Snitzer wrote: > > > On Wed, Oct 21 2015 at 12:02pm -0400, > > > Mike Snitzer wrote: > > > &g

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 12:19 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 12:02pm -0400, > Mike Snitzer wrote: > > > On Wed, Oct 14 2015 at 9:27am -0400, > > Christoph Hellwig wrote: > > > > > On Tue, Oct 13, 2015 at 10:44:11AM -0700, Ming Lin wr

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 11:33 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 11:01am -0400, > Ming Lin wrote: > > > On Wed, 2015-10-21 at 09:39 -0400, Jeff Moyer wrote: > > > Christoph Hellwig writes: > > > > > > > Jens, Ming: > > > &

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 09:39 -0400, Jeff Moyer wrote: > Christoph Hellwig writes: > > > Jens, Ming: > > > > are you fine with the one liner change to get back to the old I/O > > pattern? While it looks like the cards fault I'd like to avoid this > > annoying regression. > > I'm not Jens or

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 09:39 -0400, Jeff Moyer wrote: > Christoph Hellwig writes: > > > Jens, Ming: > > > > are you fine with the one liner change to get back to the old I/O > > pattern? While it looks like the cards fault I'd like to avoid this > > annoying regression. > >

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 11:33 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 11:01am -0400, > Ming Lin <m...@kernel.org> wrote: > > > On Wed, 2015-10-21 at 09:39 -0400, Jeff Moyer wrote: > > > Christoph Hellwig <h...@infradead.org> writes: > > >

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 12:19 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 12:02pm -0400, > Mike Snitzer <snit...@redhat.com> wrote: > > > On Wed, Oct 14 2015 at 9:27am -0400, > > Christoph Hellwig <h...@infradead.org> wrote: > > > > > On

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-21 Thread Ming Lin
On Wed, 2015-10-21 at 14:18 -0400, Mike Snitzer wrote: > On Wed, Oct 21 2015 at 1:33pm -0400, > Ming Lin <m...@kernel.org> wrote: > > > On Wed, 2015-10-21 at 12:19 -0400, Mike Snitzer wrote: > > > On Wed, Oct 21 2015 at 12:02pm -0400, > > >

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-13 Thread Ming Lin
On Tue, Oct 13, 2015 at 4:50 AM, Christoph Hellwig wrote: > On Wed, Aug 12, 2015 at 12:07:15AM -0700, Ming Lin wrote: >> From: Ming Lin >> >> The split code in blkdev_issue_{discard,write_same} can go away >> now that any driver that cares does the split. We have to ma

Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same}

2015-10-13 Thread Ming Lin
On Tue, Oct 13, 2015 at 4:50 AM, Christoph Hellwig <h...@infradead.org> wrote: > On Wed, Aug 12, 2015 at 12:07:15AM -0700, Ming Lin wrote: >> From: Ming Lin <min...@ssi.samsung.com> >> >> The split code in blkdev_issue_{discard,write_same} can go away >&

Re: 32-bit bio regression with 4.3 [was: Re: cgroup/loop Bad page state oops in Linux v4.2-rc3-136-g45b4b782e848]

2015-09-12 Thread Ming Lin
On Sat, Sep 12, 2015 at 12:34 AM, Ming Lin wrote: > On Fri, 2015-09-11 at 21:43 -0700, Ming Lin wrote: >> On Fri, Sep 11, 2015 at 2:43 PM, Mike Snitzer wrote: >> > Ming, Jens, others: >> > >> > Please see this BZ comment that speaks to a 4.3 regression due to

Re: 32-bit bio regression with 4.3 [was: Re: cgroup/loop Bad page state oops in Linux v4.2-rc3-136-g45b4b782e848]

2015-09-12 Thread Ming Lin
On Fri, 2015-09-11 at 21:43 -0700, Ming Lin wrote: > On Fri, Sep 11, 2015 at 2:43 PM, Mike Snitzer wrote: > > Ming, Jens, others: > > > > Please see this BZ comment that speaks to a 4.3 regression due to the > > late bio splitting changes: > > https://bugzilla.r

  1   2   3   4   5   >