Re: [PATCH v6 10/10] scsi: Implement blk_mq_ops.show_rq()

2017-04-26 Thread Hannes Reinecke
On 04/26/2017 10:47 PM, Bart Van Assche wrote: > Show the SCSI CDB for pending SCSI commands in > /sys/kernel/debug/block/*/mq/*/dispatch and */rq_list. An example > of how SCSI commands are displayed by this code: > > 8801703245c0 {.op=READ, .cmd_flags=META PRIO, .rq_flags=DONTPREP IO_STAT >

Re: [PATCH v6 09/10] blk-mq: Add blk_mq_ops.show_rq()

2017-04-26 Thread Hannes Reinecke
On 04/26/2017 10:47 PM, Bart Van Assche wrote: > This new callback function will be used in the next patch to show > more information about SCSI requests. > > Signed-off-by: Bart Van Assche > Reviewed-by: Omar Sandoval > Cc: Hannes Reinecke > --- > block/blk-mq-debugfs.c | 6 +- > include/

Re: small dm mpath cleanups

2017-04-26 Thread h...@lst.de
On Wed, Apr 26, 2017 at 06:41:27PM +, Bart Van Assche wrote: > On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > > this series has some prep patches for my work to have proper, type > > checked block errors codes. One fallout of that is that we need to > > get rid of how dm overloa

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-26 Thread Christoph Hellwig
On Wed, Apr 26, 2017 at 06:48:43PM +0800, Ming Lei wrote: > Looks there are some choices for this issue: > > 1) if internal ops uses independent tag space > - we need to clean up the mtip32xx driver > > 2) if internal ops shares tag space with normal request > - export blk_mq_get_driver_tag() for

Re: [RFC PATCH] x86, uaccess, pmem: introduce copy_from_iter_writethru for dax + pmem

2017-04-26 Thread Ingo Molnar
* Dan Williams wrote: > +#ifdef CONFIG_ARCH_HAS_UACCESS_WRITETHRU > +#define __HAVE_ARCH_MEMCPY_WRITETHRU 1 > +void memcpy_writethru(void *dst, const void *src, size_t cnt); > +#endif This should be named memcpy_wt(), which is the well-known postfix for write-through. We already have ioremap_

Re: [PATCH 00/10] dm: zoned block device support

2017-04-26 Thread Damien Le Moal
Hello Mike, Any comments on this series ? Is it possible that you consider it for 4.12 ? Best regards. On 4/21/17 12:55, damien.lem...@wdc.com wrote: > From: Damien Le Moal > > This series introduces zoned block device support to the device mapper > infrastructure. Pathces are as follows: > >

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-26 Thread Ming Lei
On Wed, Apr 26, 2017 at 11:22:43AM -0700, Jens Axboe wrote: > On 04/26/2017 11:15 AM, Jens Axboe wrote: > > On 04/26/2017 03:48 AM, Ming Lei wrote: > >> Hi Christoph, > >> > >> On Thu, Apr 20, 2017 at 04:30:42PM +0800, Ming Lei wrote: > >>> Hi Christoph, > >>> > >>> On Wed, Apr 19, 2017 at 09:54:08

Re: small dm mpath cleanups

2017-04-26 Thread Mike Snitzer
On Wed, Apr 26 2017 at 2:41pm -0400, Bart Van Assche wrote: > On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > > this series has some prep patches for my work to have proper, type > > checked block errors codes. One fallout of that is that we need to > > get rid of how dm overloads

Re: bfq-mq performance comparison to cfq

2017-04-26 Thread Bart Van Assche
On Wed, 2017-04-26 at 10:18 +0200, Paolo Valente wrote: > I guess that both the above issues may not be dramatic. In contrast, > the following last issue seems harder to address: BFQ uses two > different privileging schemes, one suitable for interactive > applications, and one suitable for soft rea

[RFC PATCH] x86, uaccess, pmem: introduce copy_from_iter_writethru for dax + pmem

2017-04-26 Thread Dan Williams
The pmem driver has a need to transfer data with a persistent memory destination and be able to rely on the fact that the destination writes are not cached. It is sufficient for the writes to be flushed to a cpu-store-buffer (non-temporal / "movnt" in x86 terms), as we expect userspace to call fsyn

Re: [PATCH v6 00/10] blk-mq debugfs patches for kernel v4.12

2017-04-26 Thread Jens Axboe
On Wed, Apr 26 2017, Bart Van Assche wrote: > Hello Jens, > > Please consider the ten patches in this series for kernel v4.12. > These patches improve blk-mq debugfs support. Thanks Bart, added for 4.12. -- Jens Axboe

Re: [PATCH] ARM: Fix rd_size declaration

2017-04-26 Thread Bart Van Assche
On Mon, 2017-04-17 at 16:10 -0700, Bart Van Assche wrote: > The global variable 'rd_size' is declared as 'int' in source file > arch/arm/kernel/atags_parse.c and as 'unsigned long' in > drivers/block/brd.c. Fix this inconsistency. > [ ... ] Hello Russell, Have I sent this patch to the right maint

[PATCH v6 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Bart Van Assche
We currently call blk_mq_free_queue() from blk_cleanup_queue() before we unregister the debugfs attributes for that queue in blk_release_queue(). This leaves a window open during which accessing most of the mq debugfs attributes would cause a use-after-free. Additionally, the "state" attribute allo

[PATCH v6 06/10] blk-mq: Move the "state" debugfs attribute one level down

2017-04-26 Thread Bart Van Assche
Move the "state" attribute from the top level to the "mq" directory as requested by Omar. Signed-off-by: Bart Van Assche Reviewed-by: Omar Sandoval Reviewed-by: Hannes Reinecke --- block/blk-mq-debugfs.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/block/blk-mq-d

[PATCH v6 03/10] blk-mq-debugfs: Rename functions for registering and unregistering the mq directory

2017-04-26 Thread Bart Van Assche
Since the blk_mq_debugfs_*register_hctxs() functions register and unregister all attributes under the "mq" directory, rename these into blk_mq_debugfs_*register_mq(). Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Omar Sandoval --- block/blk-mq-debugfs.c | 8

[PATCH v6 10/10] scsi: Implement blk_mq_ops.show_rq()

2017-04-26 Thread Bart Van Assche
Show the SCSI CDB for pending SCSI commands in /sys/kernel/debug/block/*/mq/*/dispatch and */rq_list. An example of how SCSI commands are displayed by this code: 8801703245c0 {.op=READ, .cmd_flags=META PRIO, .rq_flags=DONTPREP IO_STAT STATS, .tag=14, .internal_tag=-1, .cmd=Read(10) 28 00 2a 8

[PATCH v6 07/10] blk-mq: Make blk_flags_show() callers append a newline character

2017-04-26 Thread Bart Van Assche
This patch does not change any functionality but makes it possible to produce a single line of output with multiple flag-to-name translations. Signed-off-by: Bart Van Assche Reviewed-by: Omar Sandoval Reviewed-by: Hannes Reinecke --- block/blk-mq-debugfs.c | 4 +++- 1 file changed, 3 insertion

[PATCH v6 02/10] blk-mq: Let blk_mq_debugfs_register() look up the queue name

2017-04-26 Thread Bart Van Assche
A later patch will move the call of blk_mq_debugfs_register() to a function to which the queue name is not passed as an argument. To avoid having to add a 'name' argument to multiple callers, let blk_mq_debugfs_register() look up the queue name. Signed-off-by: Bart Van Assche Reviewed-by: Omar Sa

[PATCH v6 04/10] blk-mq: Only unregister hctxs for which registration succeeded

2017-04-26 Thread Bart Van Assche
Hctx unregistration involves calling kobject_del(). kobject_del() must not be called if kobject_add() has not been called. Hence in the error path only unregister hctxs for which registration succeeded. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- block/blk-mq-sysfs

[PATCH v6 09/10] blk-mq: Add blk_mq_ops.show_rq()

2017-04-26 Thread Bart Van Assche
This new callback function will be used in the next patch to show more information about SCSI requests. Signed-off-by: Bart Van Assche Reviewed-by: Omar Sandoval Cc: Hannes Reinecke --- block/blk-mq-debugfs.c | 6 +- include/linux/blk-mq.h | 8 2 files changed, 13 insertions(+), 1

[PATCH v6 01/10] blk-mq: Register /queue/mq after having registered /queue

2017-04-26 Thread Bart Van Assche
A later patch in this series will modify blk_mq_debugfs_register() such that it uses q->kobj.parent to determine the name of a request queue. Hence make sure that that pointer is initialized before blk_mq_debugfs_register() is called. To avoid lock inversion, protect sysfs / debugfs registration wi

[PATCH v6 08/10] blk-mq: Show operation, cmd_flags and rq_flags names

2017-04-26 Thread Bart Van Assche
Show the operation name, .cmd_flags and .rq_flags as names instead of numbers. Signed-off-by: Bart Van Assche Reviewed-by: Omar Sandoval Reviewed-by: Hannes Reinecke --- block/blk-mq-debugfs.c | 72 +++--- 1 file changed, 69 insertions(+), 3 deletion

[PATCH v6 00/10] blk-mq debugfs patches for kernel v4.12

2017-04-26 Thread Bart Van Assche
Hello Jens, Please consider the ten patches in this series for kernel v4.12. These patches improve blk-mq debugfs support. Thanks, Bart. Changes compared to v5: - Updated patch 4/10 as proposed by Omar: fixed unregistration code and changed "goto out" at the end of __blk_mq_register_dev() int

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Bart Van Assche
On Tue, 2017-04-25 at 14:41 -0700, Jens Axboe wrote: > Looks fine to me. However, I think there's room for improvement here. > Why don't we just make it: > > if (!q->mq_ops) { > spin_lock_irq(lock); > __blk_drain_queue(q, true); > } else { > bl

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Omar Sandoval
On Wed, Apr 26, 2017 at 08:32:31PM +, Bart Van Assche wrote: > On Tue, 2017-04-25 at 14:30 -0700, Omar Sandoval wrote: > > Jens, could you ack that dropping the lock is okay? > > Hello Omar, > > If you have a look at the block layer history then you will see that the > current approach for sh

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Jens Axboe
On 04/26/2017 01:32 PM, Bart Van Assche wrote: > On Tue, 2017-04-25 at 14:30 -0700, Omar Sandoval wrote: >> Jens, could you ack that dropping the lock is okay? > > Hello Omar, > > If you have a look at the block layer history then you will see that the > current approach for shutting down block l

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Bart Van Assche
On Tue, 2017-04-25 at 14:30 -0700, Omar Sandoval wrote: > Jens, could you ack that dropping the lock is okay? Hello Omar, If you have a look at the block layer history then you will see that the current approach for shutting down block layer queues is an approach that I had introduced myself. See

Re: small dm mpath cleanups

2017-04-26 Thread Bart Van Assche
On Wed, 2017-04-26 at 09:40 +0200, Christoph Hellwig wrote: > this series has some prep patches for my work to have proper, type > checked block errors codes. One fallout of that is that we need to > get rid of how dm overloads a few return values with either internal > positive error codes or neg

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-26 Thread Jens Axboe
On 04/26/2017 11:15 AM, Jens Axboe wrote: > On 04/26/2017 03:48 AM, Ming Lei wrote: >> Hi Christoph, >> >> On Thu, Apr 20, 2017 at 04:30:42PM +0800, Ming Lei wrote: >>> Hi Christoph, >>> >>> On Wed, Apr 19, 2017 at 09:54:08PM -0700, Christoph Hellwig wrote: On Thu, Apr 20, 2017 at 09:03:47AM +

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-26 Thread Jens Axboe
On 04/26/2017 03:48 AM, Ming Lei wrote: > Hi Christoph, > > On Thu, Apr 20, 2017 at 04:30:42PM +0800, Ming Lei wrote: >> Hi Christoph, >> >> On Wed, Apr 19, 2017 at 09:54:08PM -0700, Christoph Hellwig wrote: >>> On Thu, Apr 20, 2017 at 09:03:47AM +0800, Ming Lei wrote: If we don't need to res

Re: [PATCH 3/3] ide-pm: always pass 0 error to ide_complete_rq in ide_do_devset

2017-04-26 Thread David Miller
From: Christoph Hellwig Date: Wed, 26 Apr 2017 09:34:22 +0200 > The caller only looks at the scsi_request result field anyway. > > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller

Re: [PATCH 2/3] ide-pm: always pass 0 error to __blk_end_request_all

2017-04-26 Thread David Miller
From: Christoph Hellwig Date: Wed, 26 Apr 2017 09:34:21 +0200 > ide_pm_execute_rq exectures a PM request synchronously, and in the failure > case where it calls __blk_end_request_all it never checks the error field > passed to the end_io callback, so don't bother setting it. > > Signed-off-by: C

Re: three little req->errors follow ups

2017-04-26 Thread Jens Axboe
On 04/26/2017 12:34 AM, Christoph Hellwig wrote: > While moving forward with the block error work I noticed three more > places that pass non-errno values to the end_request variants, and > never actually check those return values. This little series fixes > those up to always pass 0. Applied, th

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-26 Thread Ming Lei
Hi Christoph, On Thu, Apr 20, 2017 at 04:30:42PM +0800, Ming Lei wrote: > Hi Christoph, > > On Wed, Apr 19, 2017 at 09:54:08PM -0700, Christoph Hellwig wrote: > > On Thu, Apr 20, 2017 at 09:03:47AM +0800, Ming Lei wrote: > > > If we don't need to reserve tag for internal command, I am happy > > >

Re: [PATCH 3/3] ide-pm: always pass 0 error to ide_complete_rq in ide_do_devset

2017-04-26 Thread Bartlomiej Zolnierkiewicz
On Wednesday, April 26, 2017 09:34:22 AM Christoph Hellwig wrote: > The caller only looks at the scsi_request result field anyway. > > Signed-off-by: Christoph Hellwig Reviewed-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electro

Re: [PATCH 2/3] ide-pm: always pass 0 error to __blk_end_request_all

2017-04-26 Thread Bartlomiej Zolnierkiewicz
On Wednesday, April 26, 2017 09:34:21 AM Christoph Hellwig wrote: > ide_pm_execute_rq exectures a PM request synchronously, and in the failure > case where it calls __blk_end_request_all it never checks the error field > passed to the end_io callback, so don't bother setting it. > > Signed-off-by:

Re: bfq-mq performance comparison to cfq

2017-04-26 Thread Paolo Valente
> Il giorno 25 apr 2017, alle ore 11:40, Juri Lelli ha > scritto: > > Hi, > > sorry if I jump into this interesting conversation, but I felt some people > might have missed this and might be interested as well (even if from a > slightly different POW). Let me Cc them (Patrick, Morten, Peter, J

[PATCH 3/4] dm mpath: simplify multipath_clone_and_map a little bit

2017-04-26 Thread Christoph Hellwig
Remove the r variable and just expand the value at the two places where it is used. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 9e971be254f4..33ecda737376 1

[PATCH 4/4] dm: introduce a new DM_MAPIO_KILL return value

2017-04-26 Thread Christoph Hellwig
This untangles the DM_MAPIO_* values returned from ->clone_and_map_rq from the error codes used by the block layer. Signed-off-by: Christoph Hellwig --- drivers/md/dm-rq.c| 12 +--- drivers/md/dm-target.c| 2 +- include/linux/device-mapper.h | 1 + 3 files changed,

[PATCH 2/4] dm rq: change ->rq_end_io calling conventions

2017-04-26 Thread Christoph Hellwig
Instead of returning either a DM_ENDIO_* constant or an error code, add a new DM_ENDIO_DONE value that means keep errno as is. This allows us to easily keep the existing error code in case where we can't push back, and it also preparares for the new block level status codes with strict type checki

small dm mpath cleanups

2017-04-26 Thread Christoph Hellwig
Hi Mike, this series has some prep patches for my work to have proper, type checked block errors codes. One fallout of that is that we need to get rid of how dm overloads a few return values with either internal positive error codes or negative errno values. This patches does that, which happens

[PATCH 1/4] dm mpath: merge do_end_io into multipath_end_io

2017-04-26 Thread Christoph Hellwig
This simplifies the I/O completion path a bit. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 53 +-- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 2950b145443d..19

[PATCH 2/3] ide-pm: always pass 0 error to __blk_end_request_all

2017-04-26 Thread Christoph Hellwig
ide_pm_execute_rq exectures a PM request synchronously, and in the failure case where it calls __blk_end_request_all it never checks the error field passed to the end_io callback, so don't bother setting it. Signed-off-by: Christoph Hellwig --- drivers/ide/ide-pm.c | 2 +- 1 file changed, 1 inse

[PATCH 3/3] ide-pm: always pass 0 error to ide_complete_rq in ide_do_devset

2017-04-26 Thread Christoph Hellwig
The caller only looks at the scsi_request result field anyway. Signed-off-by: Christoph Hellwig --- drivers/ide/ide-devsets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c index b1223234037d..9b69c32ee560 100644 --- a/dr

[PATCH 1/3] scsi_transport_sas: always pass 0 error to blk_end_request_all

2017-04-26 Thread Christoph Hellwig
The SAS transport queues are only used by bsg, and bsg always looks at the scsi_request results and never add the error passed in the end_io callback. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_transport_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver

three little req->errors follow ups

2017-04-26 Thread Christoph Hellwig
While moving forward with the block error work I noticed three more places that pass non-errno values to the end_request variants, and never actually check those return values. This little series fixes those up to always pass 0.