Re: [PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-07 Thread Martin K. Petersen
Ming, > As I explained in [1], the use-after-free is inevitable no matter if > clearing 'SCpnt->cmnd' before mempool_free() in sd_uninit_command() or > not, so we need to comment the fact that cdb may point to garbage > data, and this function(especially __scsi_format_command() has to > survive

Re: [PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-07 Thread Ming Lei
On Tue, Dec 05, 2017 at 04:57:51PM -0800, Bart Van Assche wrote: > Avoid that scsi_show_rq() triggers a NULL pointer dereference if > called after sd_uninit_command(). Swap the NULL pointer assignment > and the mempool_free() call in sd_uninit_command() to make it less > likely that scsi_show_rq()

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Martin K. Petersen
Ming, > Jens, Martin, would any of you mind making this patch in V4.15? Since > it fixes real use cases and this way is exact what we do before > 0df21c86bdbf("scsi: implement .get_budget and .put_budget for blk-mq"). Applied to 4.15/scsi-fixes, thank you! -- Martin K. Petersen Oracle

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Ming Lei
On Thu, Dec 07, 2017 at 09:06:58PM +, Bart Van Assche wrote: > On Wed, 2017-12-06 at 00:28 +0800, Ming Lei wrote: > > On Tue, Dec 05, 2017 at 04:08:20PM +, Bart Van Assche wrote: > > > On Tue, 2017-12-05 at 15:52 +0800, Ming Lei wrote: > > > > diff --git a/drivers/scsi/scsi_lib.c

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Ming Lei
On Thu, Dec 07, 2017 at 09:11:54PM +, Bart Van Assche wrote: > On Thu, 2017-12-07 at 09:31 +0800, Ming Lei wrote: > > But if you always call blk_mq_sched_mark_restart_hctx() before a new > > dispatch, that may affect performance on NVMe which may never trigger > > BLK_STS_RESOURCE. > > Hmm

bfq: BUG bfq_queue: Objects remaining in bfq_queue on __kmem_cache_shutdown() after rmmod

2017-12-07 Thread Holger Hoffstätte
So plugging in a device on USB with BFQ as scheduler now works without hiccup (probably thanks to Ming Lei's last patch), but of course I found another problem. Unmounting the device after use, changing the scheduler back to deadline or kyber and rmmod'ing the BFQ module reproducibly gives me:

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Bart Van Assche
On Thu, 2017-12-07 at 09:31 +0800, Ming Lei wrote: > But if you always call blk_mq_sched_mark_restart_hctx() before a new > dispatch, that may affect performance on NVMe which may never trigger > BLK_STS_RESOURCE. Hmm ... only the SCSI core implements .get_budget() and .put_budget() and I

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Bart Van Assche
On Wed, 2017-12-06 at 00:28 +0800, Ming Lei wrote: > On Tue, Dec 05, 2017 at 04:08:20PM +, Bart Van Assche wrote: > > On Tue, 2017-12-05 at 15:52 +0800, Ming Lei wrote: > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > > index db9556662e27..1816dd8259b3 100644 > > > ---

Re: [RFC PATCH] blk-throttle: add burst allowance.

2017-12-07 Thread Vivek Goyal
On Thu, Nov 16, 2017 at 08:50:33AM -0800, Shaohua Li wrote: [..] > Can you describe why we need this? It would be great if you can describe the > usage model and an example. Does this work for io.low/io.max or both? Hi Shaohua, Is there any documentation for "io.low" somewhere now. Should we

Re: blk-mq + bfq: udevd hang on usb2 storages

2017-12-07 Thread Paolo Valente
> Il giorno 04 dic 2017, alle ore 11:57, Ming Lei ha > scritto: > > On Fri, Dec 01, 2017 at 06:04:29PM +0100, Alban Browaeys wrote: >> I initially reported as https://bugzilla.kernel.org/show_bug.cgi?id=198 >> 023 . >> >> I have now bisected this issue to commit

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-07 Thread Oleg Nesterov
On 12/06, Benjamin LaHaise wrote: > > On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: > > > > No. Again, this memory is not properly accounted, and unlike mlock()ed > > memory it is visible to shrinker which will do the unnecessary work on > > memory shortage which in turn will lead

Re: 4.14: WARNING: CPU: 4 PID: 2895 at block/blk-mq.c:1144 with virtio-blk (also 4.12 stable)

2017-12-07 Thread Christian Borntraeger
On 12/07/2017 12:29 AM, Christoph Hellwig wrote: > On Wed, Dec 06, 2017 at 01:25:11PM +0100, Christian Borntraeger wrote: > t > commit 11b2025c3326f7096ceb588c3117c7883850c068-> bad >> blk-mq: create a blk_mq_ctx for each possible CPU >> does not boot on DASD and >> commit