[RESEND PATCH V5 24/33] f2fs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/f2fs/data.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c

[RESEND PATCH V5 32/33] block: always define BIO_MAX_PAGES as 256

2018-05-24 Thread Ming Lei
Now multipage bvec can cover CONFIG_THP_SWAP, so we don't need to increase BIO_MAX_PAGES for it. Signed-off-by: Ming Lei --- include/linux/bio.h | 8 1 file changed, 8 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index fc8a8238805e..839dddf81d09 100644

[RESEND PATCH V5 28/33] block: kill bio_for_each_page_all()

2018-05-24 Thread Ming Lei
No one uses it any more, so kill it and we can reuse this helper name. Signed-off-by: Ming Lei --- include/linux/bio.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 5ae2bc876295..c5e692d43f23 100644 --- a/include/linux

[RESEND PATCH V5 31/33] block: bio: pass segments to bio if bio_add_page() is bypassed

2018-05-24 Thread Ming Lei
Under some situations, such as block direct I/O, we can't use bio_add_page() for merging pages into multipage bvec, so a new function is implemented for converting page array into one segment array, then these cases can benefit from multipage bvec too. Signed-off-by: Ming Lei --- block/

[RESEND PATCH V5 33/33] block: document usage of bio iterator helpers

2018-05-24 Thread Ming Lei
Now multipage bvec is supported, and some helpers may return page by page, and some may return segment by segment, this patch documents the usage for helping us use them correctly. Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 32 1 file changed

[RESEND PATCH V5 29/33] block: rename bio_for_each_page_all2 as bio_for_each_page_all

2018-05-24 Thread Ming Lei
Now bio_for_each_page_all() is gone, we can reuse the name to iterate bio page by page, which is done via bio_for_each_page_all2() now. Signed-off-by: Ming Lei --- block/bio.c | 14 +++--- block/blk-zoned.c | 4 ++-- block/bounce.c| 4 ++-- drivers/md

[RESEND PATCH V5 30/33] block: enable multipage bvecs

2018-05-24 Thread Ming Lei
This patch pulls the trigger for multipage bvecs. Now any request queue which supports queue cluster will see multipage bvecs. Signed-off-by: Ming Lei --- block/bio.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/bio.c b/block/bio.c index c160c143cc1b..bc3992f52fe8

[RESEND PATCH V5 23/33] ext4: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/ext4/page-io.c | 3 ++- fs/ext4/readpage.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/page

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > On 5/24/18 10:53 PM, Kent Overstreet wrote: > > On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > >> Hi, > >> > >> This patchset brings multipage bvec into block layer: > > > >

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Sun, May 27, 2018 at 07:44:52PM -0600, Jens Axboe wrote: > On 5/27/18 1:23 AM, Ming Lei wrote: > > On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > >> On 5/24/18 10:53 PM, Kent Overstreet wrote: > >>> On Fri, May 25, 2018 at 11:45:48AM +0

Re: Another NVMe failure, this time with AER info

2018-05-11 Thread Ming Lei
software intervention, and AER logs them for informational purposes. > > But it seems very likely that these corrected errors are related to > the nvme timeout: the first corrected errors were logged at > 12720.894411, nvme_io_timeout defaults to 30 seconds, and the nvme > timeout was at 12750.281158. The following patchset might help this issue: https://marc.info/?l=linux-block&m=152604179903505&w=2 -- Ming Lei

Re: [PATCH] block: kyber: make kyber more friendly with merging

2018-05-30 Thread Ming Lei
On Wed, May 30, 2018 at 4:36 PM, jianchao.wang wrote: > Hi ming > > Thanks for your kindly response. > > On 05/30/2018 04:22 PM, Ming Lei wrote: >>>> you could keep the software queues as-is but add our own version of >>>> flush_busy_ctxs() that only remo

Re: [PATCH 0/3] Provide more fine grained control over multipathing

2018-05-30 Thread Ming Lei
On Tue, May 29, 2018 at 09:22:40AM +0200, Johannes Thumshirn wrote: > On Mon, May 28, 2018 at 11:02:36PM -0400, Mike Snitzer wrote: > > No, what both Red Hat and SUSE are saying is: cool let's have a go at > > "Plan A" but, in parallel, what harm is there in allowing "Plan B" (dm > > multipath) to

Re: [PATCH V2 1/2] blk-mq: init hctx sched after update ctx and hctx mapping

2018-08-17 Thread Ming Lei
> > + /* > +* switch io scheduler to NULL to clean up the data in it. > +* will get it back after update mapping between cpu and hw queues. > +*/ > + list_for_each_entry(q, &set->tag_list, tag_set_list) { > + if (!q->elevator) { > + q->elv_type = NULL; > + continue; > + } > + q->elv_type = q->elevator->type; > + mutex_lock(&q->sysfs_lock); > + /* > +* elevator_release will put it. > +*/ > + __module_get(q->elv_type->elevator_owner); I understand what elevator_release() frees is the 'ref-counter' got in elevator_get(), but who will be the counter-pair of the above __module_get()? Thanks, Ming Lei

Re: [PATCH V2 1/3] blk-mq: refactor the code of issue request directly

2018-10-28 Thread Ming Lei
On Sat, Oct 27, 2018 at 12:01:09AM +0800, Jianchao Wang wrote: > Merge blk_mq_try_issue_directly and __blk_mq_try_issue_directly > into one interface which is able to handle the return value from > .queue_rq callback. Due to we can only issue directly w/o io > scheduler, so remove the blk_mq_get_dr

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread Ming Lei
On Thu, Oct 11, 2018 at 02:12:11PM +0100, John Garry wrote: > On 11/10/2018 11:15, Christoph Hellwig wrote: > > On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: > > > > > > > blk-mq tags are always per-host (which has actually caused problems for > > > > ATA, which is now using its own

[PATCH 2/4] irq: move 2-stage irq spread into one helper

2018-11-02 Thread Ming Lei
No functional change, and prepare for the following patch to support allocating (and affinitizing) sets of IRQs. Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Cc: Hannes Reinecke Cc: Ming Lei Cc: Keith Busch Cc: Sagi Grimberg Signed-off-by: Ming Lei --- kernel/irq/affinity.c | 92

[PATCH 4/4] irq: add support for allocating (and affinitizing) sets of IRQs

2018-11-02 Thread Ming Lei
Gleixner Cc: linux-kernel@vger.kernel.org Reviewed-by: Hannes Reinecke Reviewed-by: Ming Lei Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Ming Lei --- drivers/pci/msi.c | 14 ++ include/linux/interrupt.h | 4 +++ kernel/irq

Re: [PATCH] block: respect virtual boundary mask in bvecs

2018-11-05 Thread Ming Lei
On Mon, Nov 05, 2018 at 12:50:50PM +0100, Johannes Thumshirn wrote: > On 05/11/2018 11:55, Ming Lei wrote: > > On Mon, Nov 05, 2018 at 11:23:01AM +0100, Johannes Thumshirn wrote: > >> With drivers like iSer we are seeing a lot of bio splitting and smaller > >> I/Os

[PATCH 0/4] blk-mq: allow to unfreeze queue when io isn't drained

2018-09-18 Thread Ming Lei
draininig IO. The 4th patch applies blk_mq_unfreeze_queue_no_drain_io() to NVMe PCI timeout, so that IO hang may be avoided inside nvme_reset_work() when new IO timeout is triggered. Part of idea is from Jianchao's early work: https://marc.info/?l=linux-kernel&m=153612052611020&w=2

Re: [PATCH 0/2] block: avoid to drop & re-add partitions if partitions aren't changed

2021-02-14 Thread Ming Lei
On Fri, Feb 05, 2021 at 10:17:06AM +0800, Ming Lei wrote: > Hi Guys, > > The two patches changes block ioctl(BLKRRPART) for avoiding drop & > re-add partitions if partitions state isn't changed. The current > behavior confuses userspace because partitions can disapp

Re: [PATCH v2] block: recalculate segment count for multi-segment discards correctly

2021-02-14 Thread Ming Lei
i-segment discards. It calculates the correct discard segment > count by counting the number of bio as each discard bio is considered its > own segment. > > Fixes: 1e739730c5b9 ("block: optionally merge discontiguous discard bios into > a single request") > Signed-off-b

Re: [PATCH 0/2] block: avoid to drop & re-add partitions if partitions aren't changed

2021-02-16 Thread Ming Lei
On Tue, Feb 16, 2021 at 09:44:30AM +0100, Christoph Hellwig wrote: > On Mon, Feb 15, 2021 at 12:03:41PM +0800, Ming Lei wrote: > > Hello, > > I think this is a fundamentally bad idea. We should not keep the > parsed partition state around forever just to work around some

Re: [PATCH] blk-mq: prevent unmapped hw queue from being scheduled

2014-12-08 Thread Ming Lei
On Wed, Dec 3, 2014 at 7:38 PM, Ming Lei wrote: > When one hardware queue has no mapped software queues, it > shouldn't have been scheduled. Otherwise WARNING or OOPS > can triggered. > > blk_mq_hw_queue_mapped() helper is introduce for fixing > the problem. >

Re: wl1251: NVS firmware data

2014-12-08 Thread Ming Lei
On Tue, Dec 9, 2014 at 4:57 AM, Greg Kroah-Hartman wrote: > On Mon, Dec 08, 2014 at 05:47:30PM +0100, Pali Rohár wrote: >> On Monday 08 December 2014 17:37:14 Greg Kroah-Hartman wrote: >> > On Mon, Dec 08, 2014 at 11:18:18PM +0800, Ming Lei wrote: >> > > On Sat, Dec

Re: [PATCH] blk-mq: prevent unmapped hw queue from being scheduled

2014-12-08 Thread Ming Lei
On Tue, Dec 9, 2014 at 12:39 PM, Jens Axboe wrote: > On 12/08/2014 05:41 PM, Ming Lei wrote: > > > Picked up for 3.19, sorry for the delay. I'm curious how this queue gets Thanks! > scheduled, though. My worry here would be that we are masking a bug that > should be fix

Re: [PATCH v3 0/5] block: loop: convert to blk-mq

2014-12-31 Thread Ming Lei
atches attached. > > - Sedat - > > [1] http://marc.info/?l=linux-kernel&m=142003220301459&w=2 > [2] > http://wiki.mikejung.biz/Benchmarking#Fio_Random_Write_Test_using_libaio_and_direct_flags Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel

Re: [PATCH v3 0/5] block: loop: convert to blk-mq

2014-12-31 Thread Ming Lei
On Thu, Jan 1, 2015 at 8:18 AM, Sedat Dilek wrote: > On Thu, Jan 1, 2015 at 1:01 AM, Ming Lei wrote: >> Hi Sedat, >> >> On Thu, Jan 1, 2015 at 6:32 AM, Sedat Dilek wrote: >>> Forgot to CC LKML and linux-fsdevel. >>> >>> - Sedat - >> >>

Re: [PATCH V8 00/33] loop: Issue O_DIRECT aio using bio_vec

2014-12-31 Thread Ming Lei
ted to play with "block: loop: convert to blk-mq (v3)", so I >>> recalled this other improvement. ) >> >> It met with some harsh resistance, so I backed off on it. Then Al Viro >> got busy re-writing the iov_iter infrastructure and I put my patchset on >

Re: [PATCH v3 0/5] block: loop: convert to blk-mq

2015-01-01 Thread Ming Lei
On Thu, Jan 1, 2015 at 11:14 PM, Sedat Dilek wrote: > On Thu, Jan 1, 2015 at 1:29 AM, Ming Lei wrote: > [...] >>> How did you test with fio (your fio lines)? >> >> Your fio command line is basically same with my fio config, and you >> can attach one image t

[PATCH] block: fix checking return value of blk_mq_init_queue

2015-01-02 Thread Ming Lei
Check IS_ERR_OR_NULL(return value) instead of just return value. Signed-off-by: Ming Lei --- drivers/block/null_blk.c |2 +- drivers/block/nvme-core.c |2 +- drivers/block/virtio_blk.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/null_blk.c

Re: [next-20141231] sched: WARNING: CPU: 1 PID: 2539 at kernel/sched/core.c:7303 __might_sleep+0xbd/0xd0()

2015-01-03 Thread Ming Lei
t;> [ 88.028750] [] ? hrtimer_get_res+0x50/0x50 >> [ 88.028753] [] ? lookup_ioctx+0xd0/0x140 >> [ 88.028755] [] SyS_io_getevents+0x62/0x100 >> [ 88.028759] [] ? trace_hardirqs_on_thunk+0x3a/0x3f >> [ 88.028762] [] system_call_fastpath+0x16/0x1b >> [ 88.0287

Re: [PATCH V8 00/33] loop: Issue O_DIRECT aio using bio_vec

2015-01-06 Thread Ming Lei
On 1/6/15, Maxim Patlasov wrote: > On 12/31/2014 04:52 PM, Ming Lei wrote: >> On Thu, Jan 1, 2015 at 6:35 AM, Sedat Dilek >> wrote: >>> On Wed, Dec 31, 2014 at 10:52 PM, Dave Kleikamp >>> wrote: >>>> On 12/31/2014 02:38 PM, Sedat Dilek wrote: >

Re: wl1251: NVS firmware data

2014-12-08 Thread Ming Lei
irmware from user space, and this way is simpler and more flexible since we have request_firmware_direct() already. Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: wl1251: NVS firmware data

2014-12-08 Thread Ming Lei
On Mon, Dec 8, 2014 at 11:22 PM, Pali Rohár wrote: > On Monday 08 December 2014 16:18:18 Ming Lei wrote: >> On Sat, Dec 6, 2014 at 9:02 PM, Pali Rohár > wrote: >> > On Saturday 06 December 2014 13:49:54 Pavel Machek wrote: >> > /** >> > >> > + *

Re: [RFC PATCH 01/17] block: make generic_make_request handle arbitrarily sized bios

2014-12-24 Thread Ming Lei
k/brd.c) > * mtip_submit_request (drivers/block/mtip32xx/mtip32xx.c) > * loop_make_request > * null_queue_bio > * bcache's make_request fns I guess the above drivers haven't max_sectors/max_segment limit. Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsub

[PATCH v3 2/5] block: loop: improve performance via blk-mq

2014-12-31 Thread Ming Lei
ntime, performance of write and randwrite isn't hurted basically. Another benefit is that loop driver code gets simplified much after blk-mq conversion, and the patch can be thought as cleanup too. Signed-off-by: Ming Lei --- drivers/block/loo

[PATCH v3 5/5] block: loop: don't handle REQ_FUA explicitly

2014-12-31 Thread Ming Lei
block core handles REQ_FUA by its flush state machine, so won't do it in loop explicitly. Signed-off-by: Ming Lei --- drivers/block/loop.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 018af27..18

[PATCH v3 4/5] block: loop: introduce lo_discard() and lo_req_flush()

2014-12-31 Thread Ming Lei
No behaviour change, just move the handling for REQ_DISCARD and REQ_FLUSH in these two functions. Signed-off-by: Ming Lei --- drivers/block/loop.c | 73 +++--- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/drivers/block/loop.c b

[PATCH v3 3/5] block: loop: say goodby to bio

2014-12-31 Thread Ming Lei
Switch to block request completely. Signed-off-by: Ming Lei --- drivers/block/loop.c | 45 - 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index c678eb2..d958901 100644 --- a/drivers

[PATCH v3 0/5] block: loop: convert to blk-mq

2014-12-31 Thread Ming Lei
loop.c | 417 drivers/block/loop.h | 17 +- include/linux/blk-mq.h |2 + 5 files changed, 221 insertions(+), 220 deletions(-) Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.o

[PATCH v3 1/5] blk-mq: export blk_mq_freeze_queue and blk_mq_unfreeze_queue

2014-12-31 Thread Ming Lei
It is handy to use the two helpers for switching backend file in loop driver, so export them. Signed-off-by: Ming Lei --- block/blk-mq.c |4 +++- block/blk-mq.h |1 - include/linux/blk-mq.h |2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/block

Re: cleanup and refactor BLOCK_PC mapping helpers V2

2015-01-25 Thread Ming Lei
contains magic for the sg and tape drivers that's still missing from blk_rq_map_user_iov Looks all are nice cleanup: Reviewed-by: Ming Lei Also patches passed xfstests(check -g auto) against v3.19-rc4_next-20150115. Thanks, Ming Lei -- To unsubscribe from this list: send the

[PATCH] block: bio: stop to pin pages if bio can't hold more

2015-01-25 Thread Ming Lei
It doesn't make sense to continue to pin user pages when bio can't hold more pages. Also this patch fixes possible double page release issue when get_user_pages_fast() failure happens just after some of pages in last round weren't added in the bio. Signed-off-by: Ming Lei -

Re: [PATCH v2 1/4] aio: add aio_kernel_() interface

2015-01-26 Thread Ming Lei
VEC))) > > Why do you want to limit what the iov_iter can contain? iovec based > ones seem very useful, and athough I can come up with a use case > for vectors pointing to userspace address I can't see anything that > speaks against allowing them either. > call this from drive

[PATCH v2 0/4] block & aio: improve loop with kernel aio

2015-01-13 Thread Ming Lei
l_submit() drivers/block/loop.c | 173 -- drivers/block/loop.h | 11 fs/aio.c | 121 +++ fs/direct-io.c |9 ++- include/linux/aio.h | 17 - 5 files changed, 323 insertions(+),

[PATCH v2 3/4] block: loop: introduce 'use_aio' sysfs file

2015-01-13 Thread Ming Lei
So that users can control if kernel aio is used to submit I/O. Signed-off-by: Ming Lei --- drivers/block/loop.c | 33 + drivers/block/loop.h |1 + 2 files changed, 34 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d1f168b

[PATCH v2 4/4] block: loop: support to submit I/O via kernel aio based

2015-01-13 Thread Ming Lei
st 2 http://kernel.ubuntu.com/~ming/block/loop-mq-aio/v2/vm-loop-mq-fio-disk.pdf [4], linux kernel base plus kernel aio patch: sar monitor result in case of fio test 2 http://kernel.ubuntu.com/~ming/block/loop-mq-aio/v2/vm-loop-mq-aio-fio-disk.pdf Cc: Maxim Patlasov

[PATCH v2 1/4] aio: add aio_kernel_() interface

2015-01-13 Thread Ming Lei
che problem too - socket users may benifit from the APIs too Cc: Maxim Patlasov Cc: Zach Brown Cc: Dave Kleikamp Cc: Benjamin LaHaise Cc: Alexander Viro Cc: linux-fsde...@vger.kernel.org Cc: linux-...@kvack.org (open list:AIO) Signed-off-by: Ming Lei --- fs/aio.c

[PATCH v2 2/4] fd/direct-io: introduce should_dirty for kernel aio

2015-01-13 Thread Ming Lei
atlasov Cc: Omar Sandoval Cc: Zach Brown Cc: Dave Kleikamp Cc: Benjamin LaHaise Cc: Alexander Viro Cc: linux-fsde...@vger.kernel.org Signed-off-by: Ming Lei --- fs/direct-io.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/direct-io.c b/fs/direct-io.c in

Re: NBD Maintainer

2015-01-14 Thread Ming Lei
rk, if there are >> any. > > There is a network timeout issue, which is probably one of the more > important fixes to get in: > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770479 Last time I studied nbd driver a while to see if socket aio can be used to improve perf

Re: [PATCH v2 0/4] block & aio: improve loop with kernel aio

2015-01-14 Thread Ming Lei
On Wed, Jan 14, 2015 at 12:23 AM, Christoph Hellwig wrote: > On Tue, Jan 13, 2015 at 11:44:44PM +0800, Ming Lei wrote: >> Follows benefits from using kernel aio in loop: >> - avoid double cache, and memory usage decreased a lot >> - system load gets much decrea

Re: [PATCH] firmware class: remove from pending list on load failure

2015-01-06 Thread Ming Lei
*/ > + mutex_lock(&fw_lock); > + list_del_init(&buf->pending_list); > + mutex_unlock(&fw_lock); The buf is always removed before the complete_all(), isn't it? Or did you observe the issue? Thanks, Ming Lei > + } >

Re: [LKP] [null_blk] f2298c0403b:

2015-01-07 Thread Ming Lei
. It's a test tool for storage stack development. > > I understand that null block is just for testing. > > I just think the message like: > > [1.971628] nullb0: unknown partition table > > may confuse the end user. They may think there are something wrong. > B

Re: [PATCH] firmware class: remove from pending list on load failure

2015-01-07 Thread Ming Lei
On Thu, Jan 8, 2015 at 12:39 AM, Sasha Levin wrote: > On 01/06/2015 11:52 PM, Ming Lei wrote: >> On Mon, Jan 5, 2015 at 11:41 PM, Sasha Levin wrote: >>> > If we failed loading the firmware we have to make sure it leaves the >>> > pending >>&

Re: [PATCH] firmware class: remove from pending list on load failure

2015-01-07 Thread Ming Lei
On Thu, Jan 8, 2015 at 10:37 AM, Sasha Levin wrote: > On 01/07/2015 09:15 PM, Ming Lei wrote: >> On Thu, Jan 8, 2015 at 12:39 AM, Sasha Levin wrote: >>> On 01/06/2015 11:52 PM, Ming Lei wrote: >>>> On Mon, Jan 5, 2015 at 11:41 PM, Sasha Levin >>>&

Re: [PATCH] firmware class: remove from pending list on load failure

2015-01-07 Thread Ming Lei
On Thu, Jan 8, 2015 at 11:06 AM, Ming Lei wrote: > On Thu, Jan 8, 2015 at 10:37 AM, Sasha Levin wrote: >> On 01/07/2015 09:15 PM, Ming Lei wrote: >>> On Thu, Jan 8, 2015 at 12:39 AM, Sasha Levin wrote: >>>> On 01/06/2015 11:52 PM, Ming Lei wrote: >>>&g

Re: [PATCH V8 00/33] loop: Issue O_DIRECT aio using bio_vec

2015-01-10 Thread Ming Lei
Hi Guys, On 1/6/15, Ming Lei wrote: > On 1/6/15, Maxim Patlasov wrote: >> On 12/31/2014 04:52 PM, Ming Lei wrote: >>> On Thu, Jan 1, 2015 at 6:35 AM, Sedat Dilek >>> wrote: >>>> On Wed, Dec 31, 2014 at 10:52 PM, Dave Kleikamp >>>> wro

[PATCH 1/2] firmware_loader: abort request if wait_for_completion is interrupted

2015-01-12 Thread Ming Lei
If current request is interrupted by signal, such as 'ctrl + c', this request has to be aborted for the following reasons: - the buf need to be removed from pending list - same requests from other contexts need to be completed Reported-by: Sasha Levin Signed-off-by

[PATCH 2/2] firmware_loader: handle timeout via wait_for_completion_interruptible_timeout()

2015-01-12 Thread Ming Lei
It is simpler to handle timeout by wait_for_completion_interruptible_timeout(), so remove previous delay work for timeout. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/base

Re: [PATCH] blk-mq: free hctx only when the kobject is released

2015-01-16 Thread Ming Lei
On Fri, Jan 16, 2015 at 4:08 AM, Sasha Levin wrote: > When releasing hctx, we do not know that the embedded kobject has been > released until it's ->release() callback has been called. It is unsafe > to unconditionally free the underlying memory until the ->release() > callback has been called sin

[PATCH] blk-mq: fix hctx/ctx kobject use-after-free

2015-01-19 Thread Ming Lei
in q->mq_kobj's release handler. Signed-off-by: Sasha Levin (fix ctx kobjects) Signed-off-by: Ming Lei --- block/blk-mq-sysfs.c | 25 +++-- block/blk-mq.c |6 +- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/block/blk-mq-sysfs.c b/block/b

Re: [PATCH v2 3/4] block: loop: introduce 'use_aio' sysfs file

2015-01-26 Thread Ming Lei
On 1/25/15, Christoph Hellwig wrote: > On Tue, Jan 13, 2015 at 11:44:47PM +0800, Ming Lei wrote: >> So that users can control if kernel aio is used to submit I/O. > > Why do you want a sysfs flag for this instead of a flags in ->lo_flags > at setup time? That's how

Re: [PATCH v2 1/4] aio: add aio_kernel_() interface

2015-01-27 Thread Ming Lei
On Tue, Jan 27, 2015 at 1:00 AM, Christoph Hellwig wrote: > On Tue, Jan 27, 2015 at 12:18:23AM +0800, Ming Lei wrote: >> > Also it might make sense to just offer aio_kernel_read/write intefaces >> > instead of the common submit wrapper, as that's much closer to o

Re: [PATCH v2 2/4] fd/direct-io: introduce should_dirty for kernel aio

2015-01-27 Thread Ming Lei
On 1/25/15, Christoph Hellwig wrote: > On Tue, Jan 13, 2015 at 11:44:46PM +0800, Ming Lei wrote: >> >> -if (dio->is_async && dio->rw == READ) >> +if (dio->is_async && dio->rw == READ && dio->should_dirty) >>

Re: [PATCH] blk-mq: Fix a recently introduced scsi-mq regression

2015-01-28 Thread Ming Lei
] worker_thread+0x11b/0x460 > [] kthread+0xef/0x110 > [] ret_from_fork+0x7c/0xb0 > > Signed-off-by: Bart Van Assche > Cc: Ming Lei > Cc: Sasha Levin > Cc: Christoph Hellwig > --- > block/blk-mq-sysfs.c | 15 +-- > block/blk-mq.c | 12 +++- &g

Re: [PATCH v2 4/4] block: loop: support to submit I/O via kernel aio based

2015-03-19 Thread Ming Lei
On Fri, Mar 20, 2015 at 12:37 AM, Maxim Patlasov wrote: > On 03/18/2015 07:57 PM, Ming Lei wrote: >> >> On Thu, Mar 19, 2015 at 2:28 AM, Maxim Patlasov >> wrote: >>> >>> On 01/13/2015 07:44 AM, Ming Lei wrote: >>>> >>>> Part of t

[PATCH 0/3] block: loop: switch to VFS ITER_BVEC

2015-03-22 Thread Ming Lei
-fsdevel&m=142159370107007&w=2 [2], kiocb split patchset http://marc.info/?t=14223814584&r=1&w=2 Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info

[PATCH 3/3] block: loop: use vfs ITER_BVEC to read/write backing file

2015-03-22 Thread Ming Lei
Now loop code gets simplified a lot, and becomes more clean. Also one extra page copy is avoided for READ in case of none transfer. Signed-off-by: Ming Lei --- drivers/block/loop.c | 285 ++ drivers/block/loop.h |3 + 2 files changed, 127

[PATCH 1/3] block: loop: use kmap(page) instead of page_address(page)

2015-03-22 Thread Ming Lei
The raw page allocated in lo_send() can be a highmem page, so kmap(page) should be used for read/write on the page. Also the patch removes kmap()/kunmap() in lo_send() because it isn't needed at all. Signed-off-by: Ming Lei --- drivers/block/loop.c | 11 ++- 1 file chang

[PATCH 2/3] block: loop: unify interface type of lo_send and lo_receive

2015-03-22 Thread Ming Lei
Preparing for conversion to vfs iterator based read/write, also pass 'loop_cmd' instead of 'request' so that rw common stuff can be put into loop_cmd easily. Signed-off-by: Ming Lei --- drivers/block/loop.c | 29 +++-- 1 file changed, 23 insert

[PATCH 0/6] block: reread partitions changes and fix for loop

2015-04-05 Thread Ming Lei
t the conversion. [1], https://lkml.org/lkml/2015/1/26/137 [2], https://lkml.org/lkml/2015/3/31/888 Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kerne

[PATCH 1/6] block: export blkdev_reread_part()

2015-04-05 Thread Ming Lei
blkdev_reread_part_no_lock() too for this requirment. Signed-off-by: Ming Lei --- block/ioctl.c | 14 ++ include/linux/fs.h |9 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c index 7d8befd..7dce19a 100644 --- a/block

[RFC PATCH 6/6] block: replace trylock with mutex_lock in __blkdev_reread_part()

2015-04-05 Thread Ming Lei
e acquired in I/O path at that time. - so the conversion won't cause deadlock for nbd For dasd, both dasd_open(), dasd_release() and request function don't acquire any mutex/semphone, so the conversion should be safe. Signed-off-by: Ming Lei --- block/ioctl.c | 10 -- 1 file c

[PATCH 3/6] block: loop: fix another reread part failure

2015-04-05 Thread Ming Lei
. In the meantime, this patch switches to new kernel APIs of blkdev_reread_part() and blkdev_reread_part_nolock(). Signed-off-by: Ming Lei --- drivers/block/loop.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/block/loop.c b/drivers

[PATCH 4/6] block: nbd: convert to blkdev_reread_part()

2015-04-05 Thread Ming Lei
Signed-off-by: Ming Lei --- drivers/block/nbd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index a98c41f..7e9d26e 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -734,7 +734,7 @@ static int __nbd_ioctl(struct

[PATCH 2/6] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-05 Thread Ming Lei
e of loop_index_mutex - lo_open_mutex is used for syncing open() and loop_clr_fd() - both open() and release() have been serialized by bd_mutex already 2) don't hold lo_ctl_mutex for decreasing/checking lo_refcnt in lo_release(), then lo_ctl_mutex is only required for the last release

[PATCH 5/6] block: dasd_genhd: convert to blkdev_reread_part

2015-04-05 Thread Ming Lei
Also remove the obsolete comment. Signed-off-by: Ming Lei --- drivers/s390/block/dasd_genhd.c |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 90f39f7..2af4619 100644 --- a/drivers/s390/block

Re: [PATCH 2/6] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-05 Thread Ming Lei
On Sun, Apr 5, 2015 at 3:24 PM, Ming Lei wrote: > The lo_ctl_mutex is held for running all ioctl handlers, and > in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for > rereading partitions, which requires bd_mutex. > > So it is easy to cause failure because trylock(bd_mu

Re: [PATCH 1/6] block: export blkdev_reread_part()

2015-04-05 Thread Ming Lei
is more clean, but with extra acquiring lock cost for the failure cases, especially when we replace trylock with mutex_lock(). > > Please also add a lockdep_assert_held to blkdev_reread_part_nolock to > ensure callers actually do hold the lock. Good point! Thanks, Ming Lei -- To unsubscribe from this l

Re: [PATCH 5/6] block: dasd_genhd: convert to blkdev_reread_part

2015-04-06 Thread Ming Lei
On Mon, Apr 6, 2015 at 9:46 PM, Jarod Wilson wrote: > On Sun, Apr 05, 2015 at 03:24:47PM +0800, Ming Lei wrote: >> Also remove the obsolete comment. >> >> Signed-off-by: Ming Lei >> --- >> drivers/s390/block/dasd_genhd.c |9 +++-- >> 1 fil

Re: [PATCH 5/6] block: dasd_genhd: convert to blkdev_reread_part

2015-04-06 Thread Ming Lei
On Mon, Apr 6, 2015 at 9:51 PM, Jarod Wilson wrote: >> >> Note: patch 6/6 in the series makes this whole while() loops pointless, >> since the possibility of the -EBUSY return goes away. > > Minor clarification: the -EBUSY due to the trylock, which is why that > retry loop exists, goes away. You *

Re: [PATCH 1/6] block: export blkdev_reread_part()

2015-04-06 Thread Ming Lei
On Mon, Apr 6, 2015 at 10:50 PM, Christoph Hellwig wrote: > On Mon, Apr 06, 2015 at 12:40:12AM +0800, Ming Lei wrote: >> > int blkdev_reread_part(struct block_device *bdev) >> > { >> > if (!mutex_trylock(&bdev->bd_mutex

Re: [PATCH 1/6] block: export blkdev_reread_part()

2015-04-06 Thread Ming Lei
On Mon, Apr 6, 2015 at 9:42 PM, Jarod Wilson wrote: > On Mon, Apr 06, 2015 at 12:40:12AM +0800, Ming Lei wrote: >> On Mon, Apr 6, 2015 at 12:12 AM, Christoph Hellwig >> wrote: >> >> +/* >> >> + * This is exported as API for block driver, can be called &

Re: [PATCH 2/2] blk-plug: don't flush nested plug lists

2015-04-07 Thread Ming Lei
Hi Jeff, On Tue, Apr 7, 2015 at 3:14 AM, Jeff Moyer wrote: > The way the on-stack plugging currently works, each nesting level > flushes its own list of I/Os. This can be less than optimal (read > awful) for certain workloads. For example, consider an application > that issues asynchronous O_DI

Re: [PATCH v2 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-23 Thread Ming Lei
On Sat, Apr 11, 2015 at 7:30 PM, Ming Lei wrote: > The lo_ctl_mutex is held for running all ioctl handlers, and > in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for > rereading partitions, which requires bd_mutex. > > So it is easy to cause failure because trylock(bd_mu

Re: loop block-mq conversion scalability issues

2015-04-23 Thread Ming Lei
WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 0); + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_UNBOUND, 32); if (!loop_wq) { err = -ENOMEM; goto misc_out; Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-

[PATCH] fs: direct-io: increase bio refcount as batch

2015-03-31 Thread Ming Lei
Each bio is always submitted to block device one by one, so it isn't necessary to increase the bio refcount by one each time with holding dio->bio_lock. Signed-off-by: Ming Lei --- fs/direct-io.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff

Re: [PATCH] fs: direct-io: increase bio refcount as batch

2015-03-31 Thread Ming Lei
Hi, On Tue, Mar 31, 2015 at 10:02 PM, Jeff Moyer wrote: > Ming Lei writes: > >> Each bio is always submitted to block device one by one, >> so it isn't necessary to increase the bio refcount by one >> each time with holding dio->bio_lock. > > This patch op

Re: [PATCH] block/loop: improve reliability of partition scanning

2015-04-01 Thread Ming Lei
hich is typically due to an -EBUSY trying to rescan > partitions on loop device removal. This one is because bd_mutex has been held in release path already. Would you mind testing the attached patch which implements the above idea? Thanks, Ming Lei > > CC: Jens Axboe > CC: Ming Lei

Re: loop block-mq conversion scalability issues

2015-04-25 Thread Ming Lei
On Sat, Apr 25, 2015 at 5:46 AM, Justin M. Forbes wrote: > On Fri, 2015-04-24 at 10:59 +0800, Ming Lei wrote: >> Hi Justin, >> >> Thanks for the report. >> >> On Thu, 23 Apr 2015 16:04:10 -0500 >> "Justin M. Forbes" wrote: >> >> >

Re: loop block-mq conversion scalability issues

2015-04-26 Thread Ming Lei
Hi Justin, On Fri, 24 Apr 2015 16:46:02 -0500 "Justin M. Forbes" wrote: > On Fri, 2015-04-24 at 10:59 +0800, Ming Lei wrote: > > Hi Justin, > > > > Thanks for the report. > > > > On Thu, 23 Apr 2015 16:04:10 -0500 > > "Justin M. Forbes&q

[PATCH] block: loop: avoiding too many pending per work I/O

2015-04-28 Thread Ming Lei
...@vger.kernel.org (v4.0) Reported-by: Justin M. Forbes Tested-by: Justin M. Forbes Signed-off-by: Ming Lei --- drivers/block/loop.c | 19 +-- drivers/block/loop.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-07 Thread Ming Lei
Hi Jarod, On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: > From: Ming Lei > > The lo_ctl_mutex is held for running all ioctl handlers, and > in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for > rereading partitions, which requires bd_mutex. > > So it is

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-08 Thread Ming Lei
On Wed, Apr 8, 2015 at 10:00 PM, Jarod Wilson wrote: > On Wed, Apr 08, 2015 at 09:40:34AM -0400, Jarod Wilson wrote: >> On Wed, Apr 08, 2015 at 02:50:59PM +0800, Ming Lei wrote: >> > Hi Jarod, >> > >> > On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: >

Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Ming Lei
> > CC: Christoph Hellwig > CC: Jens Axboe > CC: Tejun Heo > CC: Alexander Viro > CC: Markus Pargmann > CC: Stefan Weinhuber > CC: Stefan Haberland > CC: Sebastian Ott > CC: Fabian Frederick > CC: Ming Lei > CC: David Herrmann > CC: Mike Gal

Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Ming Lei
On Wed, Apr 8, 2015 at 11:03 PM, Peter Zijlstra wrote: > On Wed, Apr 08, 2015 at 10:50:56PM +0800, Ming Lei wrote: >> > +/* >> > + * This is an exported API for the block driver, and will not >> > + * acquire bd_mutex, leaving it up to the caller to handle

[PATCH v1 0/7] block: reread partitions changes and fix for loop

2015-04-08 Thread Ming Lei
/fs.h |3 +++ 6 files changed, 79 insertions(+), 34 deletions(-) [1], https://lkml.org/lkml/2015/1/26/137 [2], https://lkml.org/lkml/2015/3/31/888 Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a me

[PATCH v1 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Ming Lei
introduce __blkdev_reread_part for use in such cases. CC: Christoph Hellwig CC: Jens Axboe CC: Tejun Heo CC: Alexander Viro CC: Markus Pargmann CC: Stefan Weinhuber CC: Stefan Haberland CC: Sebastian Ott CC: Fabian Frederick CC: Ming Lei CC: David Herrmann CC: Andrew Morton CC: Peter

[PATCH v1 3/7] block: loop: fix another reread part failure

2015-04-08 Thread Ming Lei
, this patch switches to new kernel APIs of blkdev_reread_part() and __blkdev_reread_part(). Signed-off-by: Jarod Wilson Signed-off-by: Ming Lei --- drivers/block/loop.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/block/loop.c b

<    3   4   5   6   7   8   9   10   11   12   >