Re: Fixup direct bi_rw modifiers

2016-08-01 Thread Christoph Hellwig
On Sat, Jul 30, 2016 at 04:45:48PM -0500, Shaun Tancheff wrote: > bi_rw should be using bio_set_op_attrs to set bi_rw. Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> Jens, what do you think about renaming bi_rw? There aren't too many users left, and any old code that w

Re: [PATCH v2] block: make sure big bio is splitted into at most 256 bvecs

2016-08-11 Thread Christoph Hellwig
Please just fix bcache to not submit bios larger than BIO_MAX_PAGES for now, until we can support such callers in general and enable common used code to do so. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] block: Fix secure erase

2016-08-15 Thread Christoph Hellwig
req_op(pos) == REQ_OP_SECURE_ERASE)) > break; This really should be a: if (req_op(rq) != req_op(pos)) I'l lleave it up to Jens if he wants that in this patch or not, otherwise I'll send an incremental patch. Otherwise this looks fine: Reviewed-by: Christoph Hellwig <h...@lst.de&

Re: [PATCH] block: Fix secure erase

2016-08-15 Thread Christoph Hellwig
On Mon, Aug 15, 2016 at 11:43:12AM -0500, Shaun Tancheff wrote: > Hmm ... Since REQ_SECURE implied REQ_DISCARD doesn't this > mean that we should include REQ_OP_SECURE_ERASE checking > wherever REQ_OP_DISCARD is being checked now in drivers/scsi/sd.c ? > > (It's only in 3 spots so it's a quickie

Re: [PATCH v3] block: make sure big bio is splitted into at most 256 bvecs

2016-08-15 Thread Christoph Hellwig
On Mon, Aug 15, 2016 at 11:11:22PM +0800, Ming Lei wrote: > After arbitrary bio size is supported, the incoming bio may > be very big. We have to split the bio into small bios so that > each holds at most BIO_MAX_PAGES bvecs for safety reason, such > as bio_clone(). I still think working around a

Re: [PATCH] block: Fix secure erase

2016-08-16 Thread Christoph Hellwig
On Tue, Aug 16, 2016 at 10:20:25AM +0300, Adrian Hunter wrote: > On 15/08/16 21:14, Christoph Hellwig wrote: > > On Mon, Aug 15, 2016 at 11:43:12AM -0500, Shaun Tancheff wrote: > >> Hmm ... Since REQ_SECURE implied REQ_DISCARD doesn't this > >> mean that we should

Re: [PATCH v3] scsi, block: fix duplicate bdi name registration crashes

2017-02-02 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 03:54:36PM +0800, Jason Wang wrote: >> +list_for_each_entry(vq, _dev->vdev.vqs, list) { >> +if (vq->callback && vring_interrupt(irq, vq) == IRQ_HANDLED) > > The check of vq->callback seems redundant, we will check it soon in > vring_interrupt(). Good point

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 03:54:54PM +0800, Jason Wang wrote: > On 2017年01月27日 16:16, Christoph Hellwig wrote: >> +snprintf(vp_dev->msix_names[i + 1], >> + sizeof(*vp_dev->msix_names), "%s-%s", >>

Re: [PATCH 2/2] nvme: allocate nvme_queue in correct node

2017-02-01 Thread Christoph Hellwig
> + mask = pci_irq_get_affinity(to_pci_dev(dev->dev), i); > + if (mask) { > + node = cpu_to_node(cpumask_first(mask)); > + node = local_memory_node(node); > + } Can you move this to a PCI-layer helper, e.g. something

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Christoph Hellwig
Looks fine: Reviewed-by: Christoph Hellwig <h...@lst.de> But can you also add another patch to kill off blk_get_backing_dev_info? The direct dereference is short and cleaner. Additionally the bt_bdi field in XFS could go away, too. -- To unsubscribe from this list: send the line "

Re: [RFC PATCH 10/17] block: introduce bdev_dax_direct_access()

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 10:16:29AM -0800, Dan Williams wrote: > Ok, now that dax_map_atomic() is gone, it's much easier to remove > struct blk_dax_ctl. > > We can also move the partition alignment checks to be a one-time check > at bdev_dax_capable() time and kill bdev_dax_direct_access() in

Re: [RFC PATCH 13/17] fs: update mount_bdev() to lookup dax infrastructure

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 10:29:12AM -0800, Dan Williams wrote: > On Mon, Jan 30, 2017 at 4:26 AM, Christoph Hellwig <h...@lst.de> wrote: > > On Sat, Jan 28, 2017 at 12:37:14AM -0800, Dan Williams wrote: > >> This is in preparation for removing the ->

Re: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 12:57:05PM -0800, Dan Williams wrote: > > struct kref { > atomic_t refcount; > }; > > ...so what do we gain by open coding kref_get() and kref_put()? A much less ugly calling convention. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in

Re: [PATCH 3/4] block: Dynamically allocate and refcount backing_dev_info

2017-02-01 Thread Christoph Hellwig
On Tue, Jan 31, 2017 at 01:54:28PM +0100, Jan Kara wrote: > Instead of storing backing_dev_info inside struct request_queue, > allocate it dynamically, reference count it, and free it when the last > reference is dropped. Currently only request_queue holds the reference > but in the following

Re: [PATCH 2/4] block: Use pointer to backing_dev_info from request_queue

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [RFC PATCH 10/17] block: introduce bdev_dax_direct_access()

2017-02-01 Thread Christoph Hellwig
On Wed, Feb 01, 2017 at 01:21:40AM -0800, Dan Williams wrote: > > In/Out parameters are always a bit problematic in terms of API clarity. > > And updating a device-relative address with an absolute physical one > > sounds like an odd API for sure. > > Yes, it does, and I thought better of it

Re: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 01:53:36PM -0800, Dan Williams wrote: > On Mon, Jan 30, 2017 at 4:24 AM, Christoph Hellwig <h...@lst.de> wrote: > > Hi Dan, > > > > this looks mostly fine to me. A few code comments below, but except > > for this there is another issu

Re: [PATCH 1/2] blk-mq: allocate blk_mq_tags and requests in correct node

2017-02-01 Thread Christoph Hellwig
Hi Shaohua, the code your patching has changed a lot in Jens' tree, so I think you'll have to respin it. But the idea looks fine. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 1/4] block: Unhash block device inodes on gendisk destruction

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 09/10] ide: don't abuse cmd_type

2017-01-31 Thread Christoph Hellwig
code.. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/ide/ide-atapi.c| 18 ++- drivers/ide/ide-cd.c | 25 - drivers/ide/ide-cd_ioctl.c | 1 + drivers/ide/ide-devsets.c | 1 + drivers/ide/ide-disk.c | 6 +++-- drivers/ide/id

[PATCH 10/10] block: fold cmd_type into the REQ_OP_ space

2017-01-31 Thread Christoph Hellwig
this patch adds new REQ_OP_* for SCSI passthrough and driver private requests, althought it has to add two for each so that we can communicate the data in/out nature of the request. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/bio.c| 10 - block/blk-

[PATCH 02/10] ѕd: remove pointless REQ_TYPE_FS check

2017-01-31 Thread Christoph Hellwig
->done can only be called for fs requests, so no need to check again here. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c779986..bd2fb4d 100644 --- a/drivers/scsi/s

remove the cmd_type field from struct request

2017-01-31 Thread Christoph Hellwig
Hi Jens, this series gets rid of the cmd_type field in struct request and instead folds it into the REQ_OP* space. This reduces the size of struct request, and leads to a single op namespace that drivers can easily switch on. Except for the legacy ide driver which has a mess of different

[PATCH 08/10] block: introduce blk_rq_is_passthrough

2017-01-31 Thread Christoph Hellwig
This can be used to check for fs vs non-fs requests and basically removes all knowledge of BLOCK_PC specific from the block layer, as well as preparing for removing the cmd_type field in struct request. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c

[PATCH 01/10] scm_blk: remove unneeded REQ_TYPE_FS check

2017-01-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/s390/block/scm_blk.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index 9f16ea6..152de68 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm

[PATCH 06/10] nbd: remove REQ_TYPE_DRV_PRIV leftovers

2017-01-31 Thread Christoph Hellwig
Disconnects don't use block layer requests these days, so all handling of private requests is dead code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/nbd.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block

[PATCH 04/10] ms_block: remove pointless prep_fn

2017-01-31 Thread Christoph Hellwig
This driver will never see non-fs requests, and doesn't do anything else in the prep_fn. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/memstick/core/ms_block.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstic

[PATCH 07/10] nbd: move request validity checking into nbd_send_cmd

2017-01-31 Thread Christoph Hellwig
This is where we do the rest of the request handling, which will become much simpler soon, too. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/nbd.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/block/nbd.c b/drivers

[PATCH 05/10] mspro_block: remove pointless prep_fn

2017-01-31 Thread Christoph Hellwig
This driver will never see non-fs requests, and doesn't do anything else in the prep_fn. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/memstick/core/mspro_block.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/memstick/core/mspro_block.c b/d

[PATCH 03/10] mmc: remove pointless request type check in mmc_prep_request

2017-01-31 Thread Christoph Hellwig
The block layer won't send requests the driver isn't asking for, so remove this check. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/mmc/core/queue.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index a

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Christoph Hellwig
On Wed, Feb 01, 2017 at 01:28:14PM +0100, Jan Kara wrote: > OK, I'll do that. Another cleanup I was considering is to remove all other > embedded occurences of backing_dev_info and make the structure only > dynamically allocated. It would unify the handling of backing_dev_info and > allow us to

Re: [PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

2017-02-07 Thread Christoph Hellwig
On Tue, Feb 07, 2017 at 03:17:02PM +0800, Jason Wang wrote: > The check is still there. Meh, I could swear I fixed it up. Here is an updated version: --- >From bf5e3b7fd272aea32388570503f00d0ab592fc2a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig <h...@lst.de> Date: Wed, 25 Jan 2

[PATCH 2/4] block: enumify ELEVATOR_*_MERGE

2017-02-07 Thread Christoph Hellwig
Switch these constants to an enum, and make let the compiler ensure that all callers of blk_try_merge and elv_merge handle all potential values. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 76 +--- block/blk-m

[PATCH 1/4] block: move req_set_nomerge to blk.h

2017-02-07 Thread Christoph Hellwig
This makes it available outside of blk-merge.c, and inlining such a trivial helper seems pretty useful to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-merge.c | 7 --- block/blk.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff

support for multi-range discard requests

2017-02-07 Thread Christoph Hellwig
Hi all, this series adds support for merging discontiguous discard bios into a single request if the driver supports it. This reduces the number of discards sent to the device by about a factor of 5-6 for typical workloads on NVMe, and for slower devices that use I/O scheduling the number will

[PATCH 3/4] block: optionally merge discontiguous discard bios into a single request

2017-02-07 Thread Christoph Hellwig
are the only user for now. Note that for now we don't support limiting the size of each discard range, but if needed that can be added later. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 27 +++ block/blk-merge.c| 5 - block/bl

[PATCH 3/4] block: optionally merge discontiguous discard bios into a single request

2017-02-08 Thread Christoph Hellwig
are the only user for now. Note that for now we don't support limiting the size of each discard range, but if needed that can be added later. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 27 +++ block/blk-merge.c| 5 - block/bl

[PATCH 2/4] block: enumify ELEVATOR_*_MERGE

2017-02-08 Thread Christoph Hellwig
Switch these constants to an enum, and make let the compiler ensure that all callers of blk_try_merge and elv_merge handle all potential values. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 76 +--- block/blk-m

Re: [PATCH 4/4] md: fast clone bio in bio_clone_mddev()

2017-02-06 Thread Christoph Hellwig
On Mon, Feb 06, 2017 at 06:43:32PM +0800, Ming Lei wrote: > In theory, ->bio_set still might be NULL in case of failed memory allocation, > please see md_run(). And that's something that should be fixed. Silently not having mempool is very bad behavior.

[PATCH 5/9] virtio: allow drivers to request IRQ affinity when creating VQs

2017-02-05 Thread Christoph Hellwig
to allocate the irq descritors node-local and avoid interconnect traffic. Last but not least this will allow blk-mq queues are created based on the interrupt affinity for storage drivers. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jason Wang <jasow...@redhat.com> --- d

automatic IRQ affinity for virtio V3

2017-02-05 Thread Christoph Hellwig
Hi Michael, hi Jason, This patches applies a few cleanups to the virtio PCI interrupt handling code, and then converts the virtio PCI code to use the automatic MSI-X vectors spreading, as well as using the information in virtio-blk and virtio-scsi to automatically align the blk-mq queues to the

Re: [PATCH 1/6] genirq: allow assigning affinity to present but not online CPUs

2017-02-05 Thread Christoph Hellwig
Hi Joe, On Fri, Feb 03, 2017 at 08:58:09PM -0500, Joe Korty wrote: > IIRC, some years ago I ran across a customer system where > the #cpus_present was twice as big as #cpus_possible. > > Hyperthreading was turned off in the BIOS so it was not > entirely out of line for the extra cpus to be

[PATCH] block: don't try Write Same from __blkdev_issue_zeroout

2017-02-05 Thread Christoph Hellwig
__blkdev_issue_zeroout as a non-invasive workaround. Signed-off-by: Christoph Hellwig <h...@lst.de> Reported-by: Junichi Nomura <j-nom...@ce.jp.nec.com> Fixes: e73c23ff ("block: add async variant of blkdev_issue_zeroout") --- block/blk-lib.c | 9 - 1 file changed, 4 insertions(+)

[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info

2017-02-05 Thread Christoph Hellwig
semantics - we can use a simple array to look up the MSI-X vec if needed. - That simple array now also duoble serves to replace the per_vq_vectors flag Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/virtio/virtio_pci_common.c | 117 +++-- d

[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-05 Thread Christoph Hellwig
handlers there, and only treat vector 0 special. Additionally clean up the VQ allocation code to properly unwind on error instead of having a single global cleanup label, which is error prone, and in this case also leads to more code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/

[PATCH 6/9] virtio: provide a method to get the IRQ affinity mask for a virtqueue

2017-02-05 Thread Christoph Hellwig
This basically passed up the pci_irq_get_affinity information through virtio through an optional get_vq_affinity method. It is only implemented by the PCI backend for now, and only when we use per-virtqueue IRQs. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jason Wang

[PATCH 7/9] blk-mq: provide a default queue mapping for virtio device

2017-02-05 Thread Christoph Hellwig
Similar to the PCI version, just calling into virtio instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/Kconfig | 5 block/Makefile| 1 + block/blk-mq-virtio.c | 54 +++ include/linux/

[PATCH 3/9] virtio_pci: don't duplicate the msix_enable flag in struct pci_dev

2017-02-05 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jason Wang <jasow...@redhat.com> --- drivers/virtio/virtio_pci_common.c | 5 ++--- drivers/virtio/virtio_pci_common.h | 2 -- drivers/virtio/virtio_pci_legacy.c | 2 +- drivers/virtio/virtio_pci_modern.c | 2 +- includ

[PATCH 4/9] virtio_pci: simplify MSI-X setup

2017-02-05 Thread Christoph Hellwig
Try to grab the MSI-X vectors early and fall back to the shared one before doing lots of allocations. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jason Wang <jasow...@redhat.com> --- drivers/virtio/virtio_pci_common.c | 35 ++- 1 file

[PATCH 8/9] virtio_blk: use virtio IRQ affinity

2017-02-05 Thread Christoph Hellwig
Use automatic IRQ affinity assignment in the virtio layer if available, and build the blk-mq queues based on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/block/virtio_blk.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH 9/9] virtio_scsi: use virtio IRQ affinity

2017-02-05 Thread Christoph Hellwig
Use automatic IRQ affinity assignment in the virtio layer if available, and build the blk-mq queues based on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/virtio_scsi.c | 126 + include/linux/cpuhotplug.h | 1 - 2 files c

Re: [PATCH 1/6] genirq: allow assigning affinity to present but not online CPUs

2017-02-06 Thread Christoph Hellwig
On Mon, Feb 06, 2017 at 12:03:05PM -0500, Keith Busch wrote: > Can we use the online CPUs and create a new hot-cpu notifier to the nvme > driver to free/reallocate as needed? We were doing that before blk-mq. Now > blk-mq can change the number hardware contexts on a live queue, so we > can

Re: [PATCH 4/4] nvme: support ranged discard requests

2017-02-07 Thread Christoph Hellwig
On Tue, Feb 07, 2017 at 01:34:54PM -0500, Keith Busch wrote: > On Tue, Feb 07, 2017 at 05:46:58PM +0100, Christoph Hellwig wrote: > > @@ -1233,6 +1243,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl > > *ctrl, > > if (ctrl->vwc & NVME_CTRL_VWC_PRESENT

[PATCH 4/4] nvme: support ranged discard requests

2017-02-08 Thread Christoph Hellwig
NVMe supports up to 256 ranges per DSM command, so wire up support for ranged discards up to that limit. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 30 +++--- include/linux/nvme.h | 2 ++ 2 files changed, 25 insertions

Re: [PATCH 3/4] block: optionally merge discontiguous discard bios into a single request

2017-02-08 Thread Christoph Hellwig
On Wed, Feb 08, 2017 at 06:54:24PM +0800, Ming Lei wrote: > > + struct bio *bio) > > +{ > > + unsigned short segments = blk_rq_nr_discard_segments(req); > > + > > + if (segments >= queue_max_discard_segments(q)) > > + goto no_merge; > > + if

support for multi-range discard requests V3

2017-02-08 Thread Christoph Hellwig
Hi all, this series adds support for merging discontiguous discard bios into a single request if the driver supports it. This reduces the number of discards sent to the device by about a factor of 5-6 for typical workloads on NVMe, and for slower devices that use I/O scheduling the number will

[PATCH 1/4] block: move req_set_nomerge to blk.h

2017-02-08 Thread Christoph Hellwig
This makes it available outside of blk-merge.c, and inlining such a trivial helper seems pretty useful to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-merge.c | 7 --- block/blk.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff

support for multi-range discard requests V2

2017-02-08 Thread Christoph Hellwig
Hi all, this series adds support for merging discontiguous discard bios into a single request if the driver supports it. This reduces the number of discards sent to the device by about a factor of 5-6 for typical workloads on NVMe, and for slower devices that use I/O scheduling the number will

[PATCH 3/4] block: optionally merge discontiguous discard bios into a single request

2017-02-08 Thread Christoph Hellwig
are the only user for now. Note that for now we don't support limiting the size of each discard range, but if needed that can be added later. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 27 +++ block/blk-merge.c| 5 - block/bl

[PATCH 1/4] block: move req_set_nomerge to blk.h

2017-02-08 Thread Christoph Hellwig
This makes it available outside of blk-merge.c, and inlining such a trivial helper seems pretty useful to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-merge.c | 7 --- block/blk.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff

[PATCH 2/4] block: enumify ELEVATOR_*_MERGE

2017-02-08 Thread Christoph Hellwig
Switch these constants to an enum, and make let the compiler ensure that all callers of blk_try_merge and elv_merge handle all potential values. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 76 +--- block/blk-m

[PATCH 4/4] nvme: support ranged discard requests

2017-02-08 Thread Christoph Hellwig
NVMe supports up to 255 ranges per DSM command, so wire up support for ranged discards up to that limit. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 28 +--- include/linux/nvme.h | 2 ++ 2 files changed, 23 insertions(+), 7 del

Re: [PATCH 4/4] nvme: support ranged discard requests

2017-02-08 Thread Christoph Hellwig
On Wed, Feb 08, 2017 at 01:32:22PM +, Andrey Kuzmin wrote: > On Wed, Feb 8, 2017, 16:14 Christoph Hellwig <h...@lst.de> wrote: > > > NVMe supports up to 255 ranges per DSM command, > > > 256 per spec, with number of ranges being zero-based. You're right. I'll do

[PATCH v4] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-04 Thread Christoph Hellwig
it in for DM, and the exception is not very useful anyway. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Mike Snitzer <snit...@redhat.com> --- drivers/md/dm.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

Re: [REGRESSION v4.10-rc1] blkdev_issue_zeroout() returns -EREMOTEIO on the first call for SCSI device that doesn't support WRITE SAME

2017-02-04 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 08:17:10PM -0700, Jens Axboe wrote: > We're at (almost) -rc7 time, we have to do more than hand wave about > this. What's the plan for 4.10 final? I'll send your a fix to revert the async write same changes for now, as suggested in the last mail from me.

Re: [PATCH 2/4] md: introduce bio_clone_slow_mddev_partial()

2017-02-06 Thread Christoph Hellwig
> +struct bio *bio_clone_slow_mddev_partial(struct bio *bio, gfp_t gfp_mask, > + struct mddev *mddev, int offset, > + int size) > +{ > + struct bio_set *bs; > + > + if (!mddev || !mddev->bio_set) > + bs =

Re: [PATCH 4/4] md: fast clone bio in bio_clone_mddev()

2017-02-06 Thread Christoph Hellwig
On Sun, Feb 05, 2017 at 02:22:13PM +0800, Ming Lei wrote: > Firstly bio_clone_mddev() is used in raid normal I/O and isn't > in resync I/O path. > > Secondly all the direct access to bvec table in raid happens on > resync I/O except for write behind of raid1, in which we still > use bio_clone()

[PATCH] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-03 Thread Christoph Hellwig
to drag it in for DM, and the exception is not very useful anyway. Signed-off-by: Christoph Hellwig <h...@lst.de> Note: this should go into the block tree, as that's where scsi_verify_blk_ioctl becomes optional. --- drivers/md/dm.c | 13 - 1 file changed, 8 insertions(+), 5 del

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 05:47:41PM +0800, Jason Wang wrote: >> No, we need to allocate the array larger in that case as want proper >> names for the interrupts. > > Consider the case of !per_vq_vectors, the size of msix_names is 2, but > snprintf can do out of bound accessing here. (We name the

Re: [PATCH] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 11:10:10AM +0100, Johannes Thumshirn wrote: > On 02/03/2017 11:06 AM, Christoph Hellwig wrote: >> .. at least for unprivilegued users. Before we called into the SCSI >> ioctl code to allow excemptions for a few SCSI passthrough ioctls, >> but

[PATCH 2/6] genirq/affinity: assign vectors to all present CPUs

2017-02-03 Thread Christoph Hellwig
-by: Christoph Hellwig <h...@lst.de> --- kernel/irq/affinity.c | 43 --- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 4544b115f5eb..6cd20a569359 100644 --- a/kernel/irq/affinity.c

[PATCH 1/6] genirq: allow assigning affinity to present but not online CPUs

2017-02-03 Thread Christoph Hellwig
This will allow us to spread MSI/MSI-X affinity over all present CPUs and thus better deal with systems where cpus are take on and offline all the time. Signed-off-by: Christoph Hellwig <h...@lst.de> --- kernel/irq/manage.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH 5/6] blk-mq: create hctx for each present CPU

2017-02-03 Thread Christoph Hellwig
Currently we only create hctx for online CPUs, which can lead to a lot of churn due to frequent soft offline / online operations. Instead allocate one for each present CPU to avoid this and dramatically simplify the code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-mq-s

[PATCH 3/6] genirq/affinity: update CPU affinity for CPU hotplug events

2017-02-03 Thread Christoph Hellwig
Remove a CPU from the affinity mask when it goes offline and add it back when it returns. In case the vetor was assigned only to the CPU going offline it will be shutdown and re-started when the CPU reappears. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/irq.c

[PATCH 6/6] nvme: allocate queues for all possible CPUs

2017-02-03 Thread Christoph Hellwig
Unlike most drіvers that simply pass the maximum possible vectors to pci_alloc_irq_vectors NVMe needs to configure the device before allocting the vectors, so it needs a manual update for the new scheme of using all present CPUs. Signed-off-by: Christoph Hellwig <h...@lst.de> --- driver

spread MSI(-X) vectors to all possible CPUs

2017-02-03 Thread Christoph Hellwig
Hi all, this series changes our automatic MSI-X vector assignment so that it takes all present CPUs into account instead of all online ones. This allows to better deal with cpu hotplug events, which could happen frequently due to power management for example. -- To unsubscribe from this list:

[PATCH 4/6] blk-mq: include all present CPUs in the default queue mapping

2017-02-03 Thread Christoph Hellwig
This way we get a nice distribution independent of the current cpu online / offline state. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-mq-cpumap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c

Re: [REGRESSION v4.10-rc1] blkdev_issue_zeroout() returns -EREMOTEIO on the first call for SCSI device that doesn't support WRITE SAME

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 08:21:31AM -0700, Jens Axboe wrote: > > Error 121 (EREMOTEIO) was returned from blkdev_issue_zeroout(). > > That came from sd driver because WRITE SAME was sent to the device > > which didn't support it. > > > > The problem was introduced by commit e73c23ff736e ("block:

[PATCH v2] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-03 Thread Christoph Hellwig
it in for DM, and the exception is not very useful anyway. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Mike Snitzer <snit...@redhat.com> --- drivers/md/dm.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

[PATCH v3] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-03 Thread Christoph Hellwig
it in for DM, and the exception is not very useful anyway. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Mike Snitzer <snit...@redhat.com> --- drivers/md/dm.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

Re: [PATCH v3] dm: don't allow ioctls to targets that don't map to whole devices

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 11:39:22AM -0500, Mike Snitzer wrote: > I assume you meant for v3 to remove the newline? ;) I did. And I swear I did edit the file, but I guess the ammend didn't work. I guess it's time for the weekend.. I'll resend after I got some rest.

Re: [PATCH] block: Update comments that refer to __bio_map_user() and bio_map_user()

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2 1/3] blk-mq: allocate blk_mq_tags and requests in correct node

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2 2/3] PCI: add an API to get node from vector

2017-02-01 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2 3/3] nvme: allocate nvme_queue in correct node

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig <h...@lst.de> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: split scsi passthrough fields out of struct request

2017-01-23 Thread Christoph Hellwig
On Mon, Jan 23, 2017 at 08:39:44AM -0700, Jens Axboe wrote: > I'd like to get this in sooner rather than later, so I'll spend some > time reviewing and testing it start this week. I'm assuming you are > targeting 4.11 with this change, right? Yes. -- To unsubscribe from this list: send the line

[PATCH 08/16] scsi_dh_hp_sw: switch to scsi_execute_req_flags()

2017-01-23 Thread Christoph Hellwig
Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 222 1 file changed, 65 insertions(+), 157 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw

[PATCH 16/16] block: don't assign cmd_flags in __blk_rq_prep_clone

2017-01-23 Thread Christoph Hellwig
These days we have the proper flags set since request allocation time. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index fe5cc98..93a9e0b 100644 --- a/block/blk-core.c +++ b/blo

[PATCH 12/16] scsi: remove __scsi_alloc_queue

2017-01-23 Thread Christoph Hellwig
Instead do an internal export of __scsi_init_queue for the transport classes that export BSG nodes. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/scsi_lib.c | 19 --- drivers/scsi/scsi_transport_fc.c| 6 -- driver

[PATCH 07/16] scsi_dh_emc: switch to scsi_execute_req_flags()

2017-01-23 Thread Christoph Hellwig
d even if the device is quiesced. Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_emc.c | 247 +++--- 1 file changed, 56 insertions(+), 191 deletions(-) diff --git a/drivers/s

[PATCH 05/16] dm: always defer request allocation to the owner of the request_queue

2017-01-23 Thread Christoph Hellwig
in the block layer greatly simplifies the dm-rq and mpath code, and should also make arbitrary combinations of SQ and MQ devices with SQ or MQ device mapper tables easily possible as a further step. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/md/dm-core.h | 1 - drivers

[PATCH 09/16] scsi: remove gfp_flags member in scsi_host_cmd_pool

2017-01-23 Thread Christoph Hellwig
-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/scsi.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 75455d4..0f93892 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -105,7 +105,6 @@

[PATCH 04/16] dm: remove incomple BLOCK_PC support

2017-01-23 Thread Christoph Hellwig
DM tries to copy a few fields around for BLOCK_PC requests, but given that no dm-target ever wires up scsi_cmd_ioctl BLOCK_PC can't actually be sent to dm. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/md/dm-rq.c | 16 1 file changed, 16 deletions(-) diff

[PATCH 06/16] scsi_dh_rdac: switch to scsi_execute_req_flags()

2017-01-23 Thread Christoph Hellwig
d even if the device is quiesced. Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/device_handler/scsi_dh_rdac.c | 174 + 1 file changed, 51 insertions(+), 123 deletions(-) diff --git a/drivers/s

split scsi passthrough fields out of struct request

2017-01-23 Thread Christoph Hellwig
Hi all, this series splits the support for SCSI passthrough commands from the main struct request used all over the block layer into a separate scsi_request structure that drivers that want to support SCSI passthough need to embedded as the first thing into their request-private data, similar to

[PATCH 02/16] block: simplify blk_init_allocated_queue

2017-01-23 Thread Christoph Hellwig
, given that the request structure is zeroed on allocation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 38 +++--- drivers/md/dm-rq.c | 3 ++- include/linux/blkdev.h | 3 +-- 3 files changed, 18 insertions(+), 26 deletions(-)

[PATCH 01/16] block: fix elevator init check

2017-01-23 Thread Christoph Hellwig
for a flush. Fix this by allowing to pass any block op and flags, and by checking for the flush flags in __get_request. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/blo

[PATCH 13/16] scsi: allocate scsi_cmnd structures as part of struct request

2017-01-23 Thread Christoph Hellwig
Rely on the new block layer functionality to allocate additional driver specific data behind struct request instead of implementing it in SCSI itѕelf. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/hosts.c | 20 +-- drivers/scsi/scsi.c

[PATCH 11/16] scsi: remove scsi_cmd_dma_pool

2017-01-23 Thread Christoph Hellwig
There is no need for GFP_DMA allocations of the scsi_cmnd structures themselves, all that might be DMAed to or from is the actual payload, or the sense buffers. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/scsi.c | 15 +-- 1 file changed, 1 insertion(

  1   2   3   4   5   6   7   8   9   10   >