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

2015-04-08 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 39e5f7f..50d7f87 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -713,7 +713,7 @@ static int __nbd_ioctl(struct

[PATCH v1 5/7] block: dasd_genhd: convert to blkdev_reread_part

2015-04-08 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

[PATCH v1 7/7] s390/block/dasd: remove obsolete while -EBUSY loop

2015-04-08 Thread Ming Lei
d CC: Sebastian Ott CC: Fabian Frederick CC: Ming Lei CC: David Herrmann CC: Andrew Morton CC: Peter Zijlstra CC: nbd-gene...@lists.sourceforge.net CC: linux-s...@vger.kernel.org Signed-off-by: Jarod Wilson --- drivers/s390/block/dasd_genhd.c | 13 +++-- 1 file changed, 3 insertions(+

[PATCH v1 6/7] block: replace trylock with mutex_lock in blkdev_reread_part()

2015-04-08 Thread Ming Lei
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 |9 +++-- 1 file changed, 7 inse

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

2015-04-08 Thread Ming Lei
hecking lo_refcnt in lo_release(), then lo_ctl_mutex is only required for the last release. Signed-off-by: Ming Lei --- drivers/block/loop.c | 19 +++ drivers/block/loop.h |2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/block/loop.c b/drivers/bloc

Re: [RFC][PATCH] firmware: Drop WARN from usermodehelper_read_trylock error case

2015-04-28 Thread Ming Lei
On Wed, Apr 29, 2015 at 8:11 AM, Laura Abbott wrote: > We've received a number of reports of warnings when coming > out of suspend with certain bluetooth firmware configurations: > > WARNING: CPU: 3 PID: 3280 at drivers/base/firmware_class.c:1126 > _request_firmware+0x558/0x810() > Modules linked

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

2015-04-28 Thread Ming Lei
On Wed, Apr 29, 2015 at 12:36 AM, Jeff Moyer wrote: > Ming Lei writes: > >> If there are too many pending per work I/O, too many >> high priority work thread can be generated so that >> system performance can be effected. >> >> This patch limits the max pen

Re: [RFC][PATCH] firmware: Drop WARN from usermodehelper_read_trylock error case

2015-04-30 Thread Ming Lei
On Thu, Apr 30, 2015 at 7:04 AM, Marcel Holtmann wrote: > Hi Laura, > We've received a number of reports of warnings when coming out of suspend with certain bluetooth firmware configurations: WARNING: CPU: 3 PID: 3280 at drivers/base/firmware_class.c:1126 _request_firmware

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

2015-04-30 Thread Ming Lei
On Fri, May 1, 2015 at 12:59 AM, Jeff Moyer wrote: > Ming Lei writes: > >> On Wed, Apr 29, 2015 at 12:36 AM, Jeff Moyer wrote: >>> Ming Lei writes: >>> >>>> If there are too many pending per work I/O, too many >>>> high priority work threa

Re: panic with CPU hotplug + blk-mq + scsi-mq

2015-04-17 Thread Ming Lei
hotplug - in case of shared tags, during CPU online handling, about setting and checking hctx->tags So could you please test the attached two patches to see if they fix your issue? I run them in my VM, and looks opps does disappear. Thanks, Ming Lei > > Regards, > Dongsu >

Re: panic with CPU hotplug + blk-mq + scsi-mq

2015-04-19 Thread Ming Lei
On Sat, Apr 18, 2015 at 4:30 PM, Jens Axboe wrote: > On 04/17/2015 10:23 PM, Ming Lei wrote: >> >> Hi Dongsu, >> >> On Fri, Apr 17, 2015 at 5:41 AM, Dongsu Park >> wrote: >>> >>> Hi, >>> >>> there's a critical bug regardi

[PATCH 0/2] blk-mq: fix oops caused by CPU hotplug

2015-04-19 Thread Ming Lei
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 at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[PATCH 1/2] blk-mq: fix race between timeout and CPU hotplug

2015-04-19 Thread Ming Lei
has been disabled, otherwise still use-after-free on tags can be triggered. Cc: Reported-by: Dongsu Park Signed-off-by: Ming Lei --- block/blk-mq.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 67f01a0..6804028 100644 --

[PATCH 2/2] blk-mq: fix CPU hotplug handling

2015-04-19 Thread Ming Lei
ted-by: Dongsu Park Signed-off-by: Ming Lei --- block/blk-mq.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 6804028..9da05b3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1580,15 +1580,20 @@ stat

Re: panic with CPU hotplug + blk-mq + scsi-mq

2015-04-20 Thread Ming Lei
On Mon, Apr 20, 2015 at 4:07 PM, Dongsu Park wrote: > Hi Ming, > > On 18.04.2015 00:23, Ming Lei wrote: >> > Does anyone have an idea? >> >> As far as I can see, at least two problems exist: >> - race between timeout and CPU hotplug >> - in case of shar

Re: panic with CPU hotplug + blk-mq + scsi-mq

2015-04-20 Thread Ming Lei
On Mon, 20 Apr 2015 17:52:40 +0200 Dongsu Park wrote: > On 20.04.2015 21:12, Ming Lei wrote: > > On Mon, Apr 20, 2015 at 4:07 PM, Dongsu Park > > wrote: > > > Hi Ming, > > > > > > On 18.04.2015 00:23, Ming Lei wrote: > > >> > Does anyone

[PATCH v1 0/2] blk-mq: fix oops caused by CPU hotplug

2015-04-20 Thread Ming Lei
ions(+), 24 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.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

[PATCH v1 1/2] blk-mq: fix race between timeout and CPU hotplug

2015-04-20 Thread Ming Lei
has been unmapped, otherwise still use-after-free on tags can be triggered. Cc: Reported-by: Dongsu Park Tested-by: Dongsu Park Signed-off-by: Ming Lei --- block/blk-mq.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c in

[PATCH v1 2/2] blk-mq: fix CPU hotplug handling

2015-04-20 Thread Ming Lei
Tested-by: Dongsu Park Signed-off-by: Ming Lei --- block/blk-mq.c | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 1fccb98..76f460e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1574,22 +1574,6

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

2015-04-20 Thread Ming Lei
On Mon, Apr 13, 2015 at 5:22 PM, Christoph Hellwig wrote: > The series looks fine to me: > > Reviewed-by: Christoph Hellwig Jens, could you share us if you are OK with this patchset? Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to m

Re: [PATCH v3 2/3] clk: fractional-divider: keep mwidth and nwidth internally

2015-04-09 Thread Ming Lei
> + u8 nwidth; > u32 nmask; > u8 flags; > spinlock_t *lock; > -- > 2.1.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.

Re: [PATCH v1 7/7] s390/block/dasd: remove obsolete while -EBUSY loop

2015-04-08 Thread Ming Lei
On Thu, Apr 9, 2015 at 2:00 AM, Jarod Wilson wrote: > On Wed, Apr 08, 2015 at 07:32:24PM +0200, Sebastian Ott wrote: >> On Wed, 8 Apr 2015, Ming Lei wrote: >> > From: Jarod Wilson >> > >> > With the mutex_trylock bit gone from blkdev_reread_part(), the retr

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

2015-04-11 Thread Ming Lei
nbd.c |2 +- drivers/s390/block/dasd_genhd.c | 19 --- include/linux/fs.h |3 +++ 6 files changed, 79 insertions(+), 33 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

[PATCH v2 6/7] block: replace trylock with mutex_lock in blkdev_reread_part()

2015-04-11 Thread Ming Lei
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. Tested-by: Jarod Wilson Acked-by: Jarod Wilson Signed-off-by: Ming Lei --- bloc

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

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

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

2015-04-11 Thread Ming Lei
hecking lo_refcnt in lo_release(), then lo_ctl_mutex is only required for the last release. Tested-by: Jarod Wilson Acked-by: Jarod Wilson Signed-off-by: Ming Lei --- drivers/block/loop.c | 19 +++ drivers/block/loop.h |2 +- 2 files changed, 12 insertions(+), 9 deletions(-) di

[PATCH v2 7/7] s390/block/dasd: remove obsolete while -EBUSY loop

2015-04-11 Thread Ming Lei
d CC: Sebastian Ott CC: Fabian Frederick CC: Ming Lei CC: David Herrmann CC: Andrew Morton CC: Peter Zijlstra CC: nbd-gene...@lists.sourceforge.net CC: linux-s...@vger.kernel.org Acked-by: Sebastian Ott Signed-off-by: Ming Lei Signed-off-by: Jarod Wilson --- drivers/s390/block/dasd_genhd.c |

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

2015-04-11 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 v2 4/7] block: nbd: convert to blkdev_reread_part()

2015-04-11 Thread Ming Lei
Tested-by: Jarod Wilson Acked-by: Jarod Wilson 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 39e5f7f..50d7f87 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c

[PATCH v2 5/7] block: dasd_genhd: convert to blkdev_reread_part

2015-04-11 Thread Ming Lei
Also remove the obsolete comment. Tested-by: Jarod Wilson Acked-by: Jarod Wilson Acked-by: Sebastian Ott 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

Re: [PATCH] driver core: move uevent call to driver_register

2012-07-16 Thread Ming Lei
bus_remove_driver(drv); > + > + kobject_uevent(&drv->p->kobj, KOBJ_ADD); You should just send the uevent if 'ret' equals to zero., otherwise OOPS may be triggered by kobject_uevent() after the 'drv' has been removed. Thanks, -- Ming Lei -- To unsubscribe from t

Re: linux-next: Tree for July 12 (v4l2-ioctl.c)

2012-07-16 Thread Ming Lei
This is the beginning few lines of the errors: I see the errors on ARM too. 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/

[RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
_unlock(&pm_mutex); return error; 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: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
t; defining a new SYSTEM_SUSPEND state. > > So are you sure you really need it? If the approach is workable, I will rename SYSTEM_SUSPEND_DISK as SYSTEM_SUSPEND since SYSTEM_SUSPEND_DISK is not used now. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe li

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
SYSTEM_RUNNING during S2R or hibernation. 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: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
is no special requirement for the error handling of request_firmware, just like other failures' handling, undo things which has been done, isn't there? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to maj

Re: task kworker / kloopd blocked for more than 120 seconds

2015-05-28 Thread Ming Lei
[1] https://projects.archlinux.org/archiso.git/ > [2] https://projects.archlinux.org/archiso.git/tree/docs/README.bootparams > -- > main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH" > "CX:;",b;for(a/*Chris get my mail address:*/=0;b=c[a++];) >

[PATCH v4 1/5] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-28 Thread Ming Lei
, and other ITER_BVEC and ITER_KVEC cases might benefit from it too, then it can be used for other dio cases which may have different rules to deal with page dirtying. The patch is based on previous Dave's patch. Cc: Dave Kleikamp Signed-off-by: Ming Lei --- fs/direct-io.c | 9 ++--

[PATCH v4 0/4] block: loop: improve loop with AIO

2015-05-28 Thread Ming Lei
Hi Guys, There are about 3 advantages to use direct I/O and AIO on read/write loop's backing file: 1) double cache can be avoided, then memory usage gets decreased a lot 2) not like user space direct I/O, there isn't cost of pinning pages 3) avoid context switch for obtaining good throughput -

[PATCH v4 5/5] block: loop: support DIO & AIO

2015-05-28 Thread Ming Lei
3/lo-nonaio-1job.pdf [5] sar graph when running fio over loop with the patchset http://kernel.ubuntu.com/~ming/block/loop-aio/v3/lo-aio-1job.pdf Signed-off-by: Ming Lei --- drivers/block/loop.c | 72 +--- drivers/block/loop.h | 2 ++ 2 files changed

[PATCH v4 4/5] block: loop: prepare for supporing direct IO

2015-05-28 Thread Ming Lei
ct I/O can be used on current loop setting. Signed-off-by: Ming Lei --- drivers/block/loop.c | 76 drivers/block/loop.h | 1 + 2 files changed, 77 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 555b895..0b1ee2b 10

[PATCH v4 2/5] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop

2015-05-28 Thread Ming Lei
It doesn't make sense to enable merge because the I/O submitted to backing file is handled page by page. Signed-off-by: Ming Lei --- drivers/block/loop.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 40580dc..10cc583 100644

[PATCH v4 3/5] block: loop: use kthread_work

2015-05-28 Thread Ming Lei
owing AIO support, it is better to use multi hw-queue with per-hwq kthread than current work approach suppose there is so high performance requirement for loop. [1] http://marc.info/?t=14308267842&r=1&w=2 Signed-off-by: Ming Lei --- drivers/bloc

Re: task kworker / kloopd blocked for more than 120 seconds

2015-05-29 Thread Ming Lei
On Fri, May 29, 2015 at 8:15 PM, Christian Hesse wrote: > Ming Lei on Thu, 2015/05/28 20:20: > On Thu, May 28, 2015 at 5:37 PM, Christian Hesse wrote: >> > Assembling the root filesystem stack always succeeds, but sometimes boot >> > hangs with a lot of: >> >

Re: [PATCH v5 5/5] block: loop: support DIO & AIO

2015-06-22 Thread Ming Lei
On Wed, Jun 10, 2015 at 3:46 PM, Christoph Hellwig wrote: >> + int ret; >> + >> + /* nomerge for loop request queue */ >> + WARN_ON(cmd->rq->bio != cmd->rq->biotail); >> + >> + bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); >> + iov_iter_bvec(&iter, ITER_BVEC | rw, bvec

Re: [PATCH v5 4/5] block: loop: prepare for supporing direct IO

2015-06-22 Thread Ming Lei
On Wed, Jun 10, 2015 at 3:40 PM, Christoph Hellwig wrote: > On Tue, Jun 09, 2015 at 09:49:25PM +0800, Ming Lei wrote: >> This patches provides two approaches for enabling direct IO >> from user space: >> >> - userspace(such as losetup) can pass 'file&#x

Re: [PATCH v5 5/5] block: loop: support DIO & AIO

2015-06-22 Thread Ming Lei
On Tue, Jun 23, 2015 at 12:00 AM, Christoph Hellwig wrote: > On Mon, Jun 22, 2015 at 08:09:55PM +0800, Ming Lei wrote: >> For the general async interface, it is a bit complicated than sync >> interfaces: >> >> - iocb need to be one parameter, because it often depends

Re: [PATCH v5 5/5] block: loop: support DIO & AIO

2015-06-23 Thread Ming Lei
On Mon, Jun 22, 2015 at 8:09 PM, Ming Lei wrote: > On Wed, Jun 10, 2015 at 3:46 PM, Christoph Hellwig wrote: >>> + int ret; >>> + >>> + /* nomerge for loop request queue */ >>> + WARN_ON(cmd->rq->bio != cmd->rq->biotail); >>

Re: [PATCH 1/4] blk-mq: fix sysfs registration/unregistration race

2015-06-24 Thread Ming Lei
gt;sysfs_up_lock); > hctx->queue = q; > hctx->queue_num = hctx_idx; > hctx->flags = set->flags; > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index 2056a99..78cd4f3 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-m

Re: [PATCH 2/4] blk-mq: fix q->mq_map access race

2015-06-24 Thread Ming Lei
cally redo blk_mq_init_queue with queue frozen */ > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > Please read the FAQ at http://www.tux.org/lkml/ -- 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: [PATCH 3/4] blk-mq: establish new mapping before cpu starts handling requests

2015-06-24 Thread Ming Lei
> blk_mq_unfreeze_queue(q); > diff --git a/block/blk-mq.h b/block/blk-mq.h > index 6a48c4c..f4fea79 100644 > --- a/block/blk-mq.h > +++ b/block/blk-mq.h > @@ -51,7 +51,8 @@ void blk_mq_disable_hotplug(void); > * CPU -> queue mappings > */ > exter

Re: [PATCH 4/4] blk-mq: fix mq_usage_counter race when switching to percpu mode

2015-06-24 Thread Ming Lei
h > @@ -484,6 +484,12 @@ struct request_queue { > struct rcu_head rcu_head; > wait_queue_head_t mq_freeze_wq; > struct percpu_ref mq_usage_counter; > + /* > +* Protect concurrent access from percpu_ref_switch_to_percpu and > +

[PATCH v6 0/5] block: loop: improve loop with AIO

2015-06-24 Thread Ming Lei
Hi Guys, There are about 3 advantages to use direct I/O and AIO on read/write loop's backing file: 1) double cache can be avoided, then memory usage gets decreased a lot 2) not like user space direct I/O, there isn't cost of pinning pages 3) avoid context switch for obtaining good throughput -

[PATCH v6 2/5] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop

2015-06-24 Thread Ming Lei
It doesn't make sense to enable merge because the I/O submitted to backing file is handled page by page. Signed-off-by: Ming Lei --- drivers/block/loop.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 40580dc..10cc583 100644

[PATCH v6 3/5] block: loop: use kthread_work

2015-06-24 Thread Ming Lei
owing AIO support, it is better to use multi hw-queue with per-hwq kthread than current work approach suppose there is so high performance requirement for loop. [1] http://marc.info/?t=14308267842&r=1&w=2 Signed-off-by: Ming Lei --- drivers/bloc

[PATCH v6 1/5] fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read

2015-06-24 Thread Ming Lei
/ITER_KVEC direct read, and loop should be the 1st case to use ITER_BVEC/ITER_KVEC for direct read I/O. The patch is based on previous Dave's patch. Cc: Dave Kleikamp Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- fs/direct-io.c | 9 ++--- 1 file changed, 6 insertions(

[PATCH v6 4/5] block: loop: prepare for supporing direct IO

2015-06-24 Thread Ming Lei
ange is to introduce LO_FLAGS_DIRECT_IO flag for userspace to know if direct IO is used to access backing file. Cc: linux-...@vger.kernel.org Signed-off-by: Ming Lei --- drivers/block/loop.c | 56 +++ drivers/block/loop.h | 1 + include/

[PATCH v6 5/5] block: loop: support DIO & AIO

2015-06-24 Thread Ming Lei
3/lo-nonaio-1job.pdf [5] sar graph when running fio over loop with the patchset http://kernel.ubuntu.com/~ming/block/loop-aio/v3/lo-aio-1job.pdf Signed-off-by: Ming Lei --- drivers/block/loop.c | 98 ++-- drivers/block/loop.h | 2 ++ 2 files changed

Re: [PATCH 3/4] blk-mq: establish new mapping before cpu starts handling requests

2015-06-24 Thread Ming Lei
On Wed, Jun 24, 2015 at 10:34 PM, Akinobu Mita wrote: > Hi Ming, > > 2015-06-24 18:46 GMT+09:00 Ming Lei : >> On Sun, Jun 21, 2015 at 9:52 PM, Akinobu Mita wrote: >>> ctx->index_hw is zero for the CPUs which have never been onlined since >>> the block queue wa

Re: [PATCH 3/4] blk-mq: establish new mapping before cpu starts handling requests

2015-06-25 Thread Ming Lei
On Thu, Jun 25, 2015 at 10:56 AM, Akinobu Mita wrote: > 2015-06-25 1:24 GMT+09:00 Ming Lei : >> On Wed, Jun 24, 2015 at 10:34 PM, Akinobu Mita >> wrote: >>> Hi Ming, >>> >>> 2015-06-24 18:46 GMT+09:00 Ming Lei : >>>> On Sun, Jun 21,

Re: [PATCH v4 0/4] block: loop: improve loop with AIO

2015-06-05 Thread Ming Lei
Hi Guys, On Fri, May 29, 2015 at 2:35 PM, Ming Lei wrote: > Hi Guys, > > There are about 3 advantages to use direct I/O and AIO on > read/write loop's backing file: > > 1) double cache can be avoided, then memory usage gets > decreased a lot > > 2) not like us

Re: [PATCH v4 1/5] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-06-05 Thread Ming Lei
On Fri, Jun 5, 2015 at 11:03 PM, Christoph Hellwig wrote: > As mentioned last time a big fat NAK for this one. We generally > do not dirty kernel pages anywhere, so a flag that must alway be set > for default behavior just to prepare for a highy hypothetical user that > in the future might want t

Re: [REGRESSION] 4.1-rc6 unloading loop OOPS

2015-06-04 Thread Ming Lei
1831&r=1&w=2 Thanks, Ming > > Best regards, > > Stefan > -- > Stefan Seyfried > Linux Consultant & Developer -- GPG Key: 0x731B665B > > B1 Systems GmbH > Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de > GF: Ralph Dehner

[PATCH] blk-mq: free hctx->ctxs in queue's release handler

2015-06-04 Thread Ming Lei
ristoph Hellwig Cc: sta...@vger.kernel.org (v4.0) Signed-off-by: Ming Lei --- block/blk-mq.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index e68b71b..594eea0 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1600,6 +1600,7 @@ static int

Re: [PATCH] blk-mq: free hctx->ctxs in queue's release handler

2015-06-04 Thread Ming Lei
On Thu, Jun 4, 2015 at 9:14 PM, Ming Lei wrote: > Now blk_cleanup_queue() can be called before calling > del_gendisk()[1], inside which hctx->ctxs is touched > from blk_mq_unregister_hctx(), but the variable has > been freed by blk_cleanup_queue() at that time. > > So this p

[PATCH v1] blk-mq: free hctx->ctxs in queue's release handler

2015-06-04 Thread Ming Lei
ng the oops reported by Stefan. [1], 6cd18e711dd8075 (block: destroy bdi before blockdev is unregistered) Reported-by: Stefan Seyfried Cc: NeilBrown Cc: Christoph Hellwig Cc: sta...@vger.kernel.org (v4.0) Signed-off-by: Ming Lei --- V1: - fix commit log block/blk-mq.c | 8 +

[RFC PATCH] blk-mq: fix failure case of blk_mq_init_allocated_queue

2015-06-04 Thread Ming Lei
Generally blk_cleanup_queue() is called for cleaning up the request queue, just like what blk_mq_init_queue() does, so blk_mq_init_allocated_queue() should return failue simply in case blk_mq_init_hw_queues() fails, otherwise double-free may be triggered. Cc: Mike Snitzer Signed-off-by: Ming Lei

Re: [REGRESSION] 4.1-rc6 unloading loop OOPS

2015-06-04 Thread Ming Lei
On Thu, Jun 4, 2015 at 10:36 PM, Stefan Seyfried wrote: > Hi Ming, > > Am 04.06.2015 um 12:24 schrieb Ming Lei: >> On Thu, Jun 4, 2015 at 5:11 PM, Stefan Seyfried >> wrote: > >>> I can reproduce the backtrace after a reboot once (subsequent >>> modpr

Re: [PATCH v1] blk-mq: free hctx->ctxs in queue's release handler

2015-06-09 Thread Ming Lei
ming/block/bug/4.1-rc7-blk-mq-oops.txt 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: [PATCH v4 1/5] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-06-09 Thread Ming Lei
On Tue, Jun 9, 2015 at 2:29 PM, Christoph Hellwig wrote: > On Sat, Jun 06, 2015 at 08:42:33AM +0800, Ming Lei wrote: >> Both ITER_KVEC and ITER_BVEC doesn't mean the pages are kernel >> page, for example of loop and swap. That is why this patch is more flexiable, >>

[PATCH v5 0/5] block: loop: improve loop with AIO

2015-06-09 Thread Ming Lei
Hi Guys, There are about 3 advantages to use direct I/O and AIO on read/write loop's backing file: 1) double cache can be avoided, then memory usage gets decreased a lot 2) not like user space direct I/O, there isn't cost of pinning pages 3) avoid context switch for obtaining good throughput -

[PATCH v5 1/5] fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read

2015-06-09 Thread Ming Lei
/ITER_KVEC direct read, and loop should be the 1st case to use ITER_BVEC/ITER_KVEC for direct read I/O. The patch is based on previous Dave's patch. Cc: Dave Kleikamp Signed-off-by: Ming Lei --- fs/direct-io.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/d

[PATCH v5 3/5] block: loop: use kthread_work

2015-06-09 Thread Ming Lei
owing AIO support, it is better to use multi hw-queue with per-hwq kthread than current work approach suppose there is so high performance requirement for loop. [1] http://marc.info/?t=14308267842&r=1&w=2 Signed-off-by: Ming Lei --- drivers/bloc

[PATCH v5 5/5] block: loop: support DIO & AIO

2015-06-09 Thread Ming Lei
3/lo-nonaio-1job.pdf [5] sar graph when running fio over loop with the patchset http://kernel.ubuntu.com/~ming/block/loop-aio/v3/lo-aio-1job.pdf Signed-off-by: Ming Lei --- drivers/block/loop.c | 72 +--- drivers/block/loop.h | 2 ++ 2 files changed

[PATCH v5 2/5] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop

2015-06-09 Thread Ming Lei
It doesn't make sense to enable merge because the I/O submitted to backing file is handled page by page. Signed-off-by: Ming Lei --- drivers/block/loop.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 40580dc..10cc583 100644

[PATCH v5 4/5] block: loop: prepare for supporing direct IO

2015-06-09 Thread Ming Lei
ct I/O can be used on current loop setting. Signed-off-by: Ming Lei --- drivers/block/loop.c | 76 drivers/block/loop.h | 1 + 2 files changed, 77 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 555b895..0b1ee2b 10

Re: [PATCH v5 2/5] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop

2015-06-21 Thread Ming Lei
On Wed, Jun 10, 2015 at 3:36 PM, Christoph Hellwig wrote: > On Tue, Jun 09, 2015 at 09:49:23PM +0800, Ming Lei wrote: >> It doesn't make sense to enable merge because the I/O >> submitted to backing file is handled page by page. > > Looks fine, but does it make any diff

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

2018-05-24 Thread Ming Lei
fo/?l=linux-mm&m=147745525801433&w=2 [5], http://marc.info/?t=14956948457&r=1&w=2 [6], http://marc.info/?t=14982021534&r=1&w=2 Ming Lei (33): block: rename bio_for_each_segment* with bio_for_each_page* block: rename rq_for_each_segment as rq_for_each_pa

Re: [PATCH V2] nvme-pci: assign separate irq vectors for adminq and ioq0

2018-03-01 Thread Ming Lei
On Wed, Feb 28, 2018 at 05:47:26PM +0100, Christoph Hellwig wrote: > Note that we originally allocates irqs this way, and Keith changed > it a while ago for good reasons. So I'd really like to see good > reasons for moving away from this, and some heuristics to figure > out which way to use. E.g.

Re: [PATCH V3 4/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-04-03 Thread Ming Lei
On Tue, Apr 03, 2018 at 03:32:21PM +0200, Thomas Gleixner wrote: > On Thu, 8 Mar 2018, Ming Lei wrote: > > 1) before 84676c1f21 ("genirq/affinity: assign vectors to all possible > > CPUs") > > irq 39, cpu list 0 > > irq 40, cpu list 1 > > ir

Re: [PATCH V3 4/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-04-04 Thread Ming Lei
On Wed, Apr 04, 2018 at 10:25:16AM +0200, Thomas Gleixner wrote: > On Wed, 4 Apr 2018, Ming Lei wrote: > > On Tue, Apr 03, 2018 at 03:32:21PM +0200, Thomas Gleixner wrote: > > > On Thu, 8 Mar 2018, Ming Lei wrote: > > > > 1) before 84676c1f21 ("genirq/affin

Re: [PATCH V3 4/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-04-04 Thread Ming Lei
On Wed, Apr 04, 2018 at 02:45:18PM +0200, Thomas Gleixner wrote: > On Wed, 4 Apr 2018, Thomas Gleixner wrote: > > I'm aware how that hw-queue stuff works. But that only works if the > > spreading algorithm makes the interrupts affine to offline/not-present CPUs > > when the block device is initiali

Re: [PATCH V15 14/18] block: enable multipage bvecs

2019-02-27 Thread Ming Lei
On Wed, Feb 27, 2019 at 08:47:09PM +, Jon Hunter wrote: > > On 21/02/2019 08:42, Marek Szyprowski wrote: > > Dear All, > > > > On 2019-02-15 12:13, Ming Lei wrote: > >> This patch pulls the trigger for multi-page bvecs. > >> > >> Revie

Re: bio_iov_iter_get_pages() + page_alloc.shuffle=1 migrating failures

2019-04-25 Thread Ming Lei
mem in $(ls -d /sys/devices/system/memory/memory*); do > i=$((i + 1)) > echo "iteration: $i" > echo offline > $mem/state > if [ $? -eq 0 ] && [ $found -eq 0 ]; then > found=1 > continue > fi > echo online > $mem/state > done Please try the following patch: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-5.2/block&id=0257c0ed5ea3de3e32cb322852c4c40bc09d1b97 Thanks, Ming Lei

Re: Linux-next 20190218: am57xx-evm: mmc1: ADMA error

2019-02-25 Thread Ming Lei
96] mmc1: sdhci: Host ctl2: 0x0004 > >> [5.718364] mmc1: sdhci: ADMA Err: 0x00000007 | ADMA Ptr: 0xab868218 > >> > > > > I see this as well on my setup. Trying to bisect now. Will keep you posted. > > > Reverting the following commit fixes this. > comm

Re: Linux-next 20190218: am57xx-evm: mmc1: ADMA error

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 2:47 PM Faiz Abbas wrote: > > Hi Ming Lei, > > On 26/02/19 7:11 AM, Ming Lei wrote: > > On Mon, Feb 25, 2019 at 9:14 PM Faiz Abbas wrote: > >> > >> Hi Naresh, > >> > >> + Commit authors. > >> > >> O

Re: Linux-next 20190218: am57xx-evm: mmc1: ADMA error

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 6:06 PM Ming Lei wrote: > > On Tue, Feb 26, 2019 at 2:47 PM Faiz Abbas wrote: > > > > Hi Ming Lei, > > > > On 26/02/19 7:11 AM, Ming Lei wrote: > > > On Mon, Feb 25, 2019 at 9:14 PM Faiz Abbas wrote: > > >&g

Re: Linux-next 20190218: am57xx-evm: mmc1: ADMA error

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 05:04:40PM +0530, Faiz Abbas wrote: > Hi, > > On 26/02/19 3:36 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 2:47 PM Faiz Abbas wrote: > >> > >> Hi Ming Lei, > >> > >> On 26/02/19 7:11 AM, Ming Lei wrote: >

Re: [PATCH v7 21/23] block: Avoid that flushing triggers a lockdep complaint

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 07:08:02PM +0100, Peter Zijlstra wrote: > On Fri, Feb 15, 2019 at 10:26:59AM +0800, Ming Lei wrote: > > There might be lots of blk_flush_queue instance which is allocated > > for each hctx, then lots of class key slot may be wasted. > > What is &#x

Re: [PATCH v7 21/23] block: Avoid that flushing triggers a lockdep complaint

2019-02-27 Thread Ming Lei
On Wed, Feb 27, 2019 at 03:24:51PM +0100, Peter Zijlstra wrote: > On Wed, Feb 27, 2019 at 09:35:56AM +0800, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 07:08:02PM +0100, Peter Zijlstra wrote: > > > On Fri, Feb 15, 2019 at 10:26:59AM +0800, Ming Lei wrote: > > &g

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

2021-02-24 Thread Ming Lei
On Wed, Feb 24, 2021 at 09:18:25AM +0100, Christoph Hellwig wrote: > On Wed, Feb 24, 2021 at 11:58:26AM +0800, Ming Lei wrote: > > Hi Guys, > > > > The two patches changes block ioctl(BLKRRPART) for avoiding drop & > > re-add partitions if partitions state isn'

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

2021-02-18 Thread Ming Lei
On Wed, Feb 17, 2021 at 08:16:29AM +0100, Christoph Hellwig wrote: > On Wed, Feb 17, 2021 at 11:07:14AM +0800, Ming Lei wrote: > > Do you think it is correct for ioctl(BLKRRPART) to always drop/re-add > > partition device node? > > Yes, that is what it is designed to do. Th

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-02 Thread Ming Lei
On Tue, Feb 02, 2021 at 03:43:55PM -0500, David Jeffery wrote: > On Tue, Feb 02, 2021 at 11:33:43AM +0800, Ming Lei wrote: > > > > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > > When a stacked block device inserts a request into another

Re: [PATCH v4 1/2] bio: limit bio max size

2021-02-02 Thread Ming Lei
On Tue, Feb 02, 2021 at 01:12:04PM +0900, Changheun Lee wrote: > > On Mon, Feb 01, 2021 at 11:52:48AM +0900, Changheun Lee wrote: > > > > On Fri, Jan 29, 2021 at 12:49:08PM +0900, Changheun Lee wrote: > > > > > bio size can grow up to 4GB when muli-page bvec is enabled. > > > > > but sometimes it w

Re: [PATCH v4 1/2] bio: limit bio max size

2021-01-28 Thread Ming Lei
On Fri, Jan 29, 2021 at 12:49:08PM +0900, Changheun Lee wrote: > bio size can grow up to 4GB when muli-page bvec is enabled. > but sometimes it would lead to inefficient behaviors. > in case of large chunk direct I/O, - 32MB chunk read in user space - > all pages for 32MB would be merged to a bio s

Re: [PATCH v4 1/2] bio: limit bio max size

2021-01-31 Thread Ming Lei
On Mon, Feb 01, 2021 at 11:52:48AM +0900, Changheun Lee wrote: > > On Fri, Jan 29, 2021 at 12:49:08PM +0900, Changheun Lee wrote: > > > bio size can grow up to 4GB when muli-page bvec is enabled. > > > but sometimes it would lead to inefficient behaviors. > > > in case of large chunk direct I/O, -

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-01 Thread Ming Lei
On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > When a stacked block device inserts a request into another block device > using blk_insert_cloned_request, the request's nr_phys_segments field gets > recalculated by a call to blk_recalc_rq_segments in > blk_cloned_rq_check_limits. B

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Ming Lei
On Wed, Feb 03, 2021 at 11:23:37AM -0500, David Jeffery wrote: > On Wed, Feb 03, 2021 at 10:35:17AM +0800, Ming Lei wrote: > > > > On Tue, Feb 02, 2021 at 03:43:55PM -0500, David Jeffery wrote: > > > The return 0 does seem to be an old relic that does not make sense >

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Ming Lei
return nr_phys_segs; > + } > + /* fall through */ > case REQ_OP_SECURE_ERASE: > case REQ_OP_WRITE_ZEROES: > return 0; blk_rq_nr_discard_segments() always returns >=1 segments, so no similar issue in case of single range discard. Reviewed-by: Ming Lei And it can be thought as: Fixes: 1e739730c5b9 ("block: optionally merge discontiguous discard bios into a single request") -- Ming

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

2021-02-04 Thread Ming Lei
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 disappear anytime when ioctl(BLKRRPART). Ming Lei (2): block: move partitions check code in

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