[PATCH 5/9] bio-integrity: fold bio_integrity_enabled to bio_integrity_prep

2017-04-04 Thread Dmitry Monakhov
Currently all integrity prep hooks are open-coded, and if prepare fails we ignore it's code and fail bio with EIO. Let's return real error to upper layer, so later caller may react accordingly. In fact no one want to use bio_integrity_prep() w/o bio_integrity_enabled, so it is reasonable to fold

[PATCH 6/9] T10: Move opencoded contants to common header

2017-04-04 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov --- block/t10-pi.c | 9 +++-- drivers/scsi/lpfc/lpfc_scsi.c| 5 +++-- drivers/scsi/qla2xxx/qla_isr.c | 8 drivers/target/target_core_sbc.c | 2 +- include/linux/t10-pi.h | 2 ++ 5 files changed,

[PATCH 8/9] bio: add bvec_iter rewind API

2017-04-04 Thread Dmitry Monakhov
Some ->bi_end_io handlers (for example: pi_verify or decrypt handlers) need to know original data vector, but after bio traverse io-stack it may be advanced, splited and relocated many times so it is hard to guess original iterator. Let's add 'bi_done' conter which accounts number of bytes

Re: [PATCH] Block SQ/MQ Request Priority

2017-04-04 Thread Jens Axboe
On 04/04/2017 09:25 AM, adam.manzana...@wdc.com wrote: > From: Adam Manzanares > > In 4.10 I introduced a patch that associates the ioc priority with > each request in the block layer. This work was done in the single queue > block layer code. This patch unifies ioc

[PATCH 0/9] block: T10/DIF Fixes and cleanups v3

2017-04-04 Thread Dmitry Monakhov
This patch set fix various problems spotted during T10/DIF integrity machinery testing. TOC: ## Fix various bugs in T10/DIF/DIX infrastructure 0001-bio-integrity-Do-not-allocate-integrity-context-for 0002-bio-integrity-bio_trim-should-truncate-integrity-vec

[PATCH 9/9] bio-integrity: Restore original iterator on verify stage

2017-04-04 Thread Dmitry Monakhov
Currently ->verify_fn not woks at all because at the moment it is called bio->bi_iter.bi_size == 0, so we do not iterate integrity bvecs at all. In order to perform verification we need to know original data vector, with new bvec rewind API this is trivial. testcase:

[PATCH 1/9] bio-integrity: Do not allocate integrity context for bio w/o data

2017-04-04 Thread Dmitry Monakhov
If bio has no data, such as ones from blkdev_issue_flush(), then we have nothing to protect. This patch prevent bugon like follows: kfree_debugcheck: out of range ptr ac1fa1d106742a5ah kernel BUG at mm/slab.c:2773! invalid opcode: [#1] SMP Modules linked in: bcache CPU: 0 PID: 4428 Comm:

[PATCH 7/9] Guard bvec iteration logic v3

2017-04-04 Thread Dmitry Monakhov
Currently if some one try to advance bvec beyond it's size we simply dump WARN_ONCE and continue to iterate beyond bvec array boundaries. This simply means that we endup dereferencing/corrupting random memory region. Sane reaction would be to propagate error back to calling context But

[PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-04 Thread Dmitry Monakhov
Reviewed-by: Christoph Hellwig Signed-off-by: Dmitry Monakhov --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index e75878f..fa84323 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1907,6 +1907,10 @@ void

[PATCH 3/9] bio-integrity: bio_integrity_advance must update integrity seed

2017-04-04 Thread Dmitry Monakhov
SCSI drivers do care about bip_seed so we must update it accordingly. Signed-off-by: Dmitry Monakhov --- block/bio-integrity.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index b5009a8..82a6ffb 100644 ---

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Michael Wang wrote: > On 04/04/2017 11:37 AM, NeilBrown wrote: >> On Tue, Apr 04 2017, Michael Wang wrote: > [snip] If sync_request_write() is using a bio that has already been used, it should call bio_reset() and fill in the details again. However I don't

Re: [PATCH 6/8] nowait aio: ext4

2017-04-04 Thread Goldwyn Rodrigues
On 04/04/2017 03:41 AM, Christoph Hellwig wrote: > On Tue, Apr 04, 2017 at 09:58:53AM +0200, Jan Kara wrote: >> FS_NOWAIT looks a bit too generic given these are filesystem feature flags. >> Can we call it FS_NOWAIT_IO? > > It's way to generic as it's a feature of the particular file_operations

Re: [PATCH] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Ming Lei wrote: > On Mon, Apr 3, 2017 at 9:18 AM, NeilBrown wrote: >> >> When a filesystem is mounted from a loop device, writes are >> throttled by balance_dirty_pages() twice: once when writing >> to the filesystem and once when the loop_handle_cmd() writes

[PATCH v2] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread NeilBrown
When a filesystem is mounted from a loop device, writes are throttled by balance_dirty_pages() twice: once when writing to the filesystem and once when the loop_handle_cmd() writes to the backing file. This double-throttling can trigger positive feedback loops that create significant delays.

Re: [PATCH] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Christoph Hellwig wrote: > Looks fine, > > Reviewed-by: Christoph Hellwig > > But if you actually care about performance in any way I'd suggest > to use the loop device in direct I/O mode.. The losetup on my test VM is too old to support that :-( I guess it

Re: [PATCH 2/7] bio-integrity: save original iterator for verify stage

2017-04-04 Thread Dmitry Monakhov
Christoph Hellwig writes: > This is a pretty big increase in the bio_integrity_payload size, > but I guess we can't get around it.. Yes, everybody hate this solution, me too, but I've stated with other approach and it is appeaded to be very ugly. My idea was that we have

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 12:23 PM, Michael Wang wrote: [snip] >> add something like >> if (wbio->bi_next) >> printk("bi_next!= NULL i=%d read_disk=%d bi_end_io=%pf\n", >> i, r1_bio->read_disk, wbio->bi_end_io); >> >> that might help narrow down what is happening. > > Just triggered again in

[PATCH] cfq: Disable writeback throttling by default

2017-04-04 Thread Jan Kara
Writeback throttling does not play well with CFQ since that also tries to throttle async writes. As a result async writeback can get starved in presence of readers. As an example take a benchmark simulating postgreSQL database running over a standard rotating SATA drive. There are 16 processes

Re: [PATCH 0/9] convert genericirq.tmpl and kernel-api.tmpl to DocBook

2017-04-04 Thread Mauro Carvalho Chehab
Em Sun, 2 Apr 2017 14:34:18 -0600 Jonathan Corbet escreveu: > On Thu, 30 Mar 2017 17:11:27 -0300 > Mauro Carvalho Chehab wrote: > > > This series converts just two documents, adding them to the > > core-api.rst book. It addresses the errors/warnings

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 02:24 PM, Michael Wang wrote: > On 04/04/2017 12:23 PM, Michael Wang wrote: > [snip] >>> add something like >>> if (wbio->bi_next) >>> printk("bi_next!= NULL i=%d read_disk=%d bi_end_io=%pf\n", >>> i, r1_bio->read_disk, wbio->bi_end_io); >>> >>> that might help

Re: [PATCH rfc 5/6] block: Add rdma affinity based queue mapping helper

2017-04-04 Thread Christoph Hellwig
On Tue, Apr 04, 2017 at 10:46:54AM +0300, Max Gurtovoy wrote: >> +if (set->nr_hw_queues > dev->num_comp_vectors) >> +goto fallback; >> + >> +for (queue = 0; queue < set->nr_hw_queues; queue++) { >> +mask = ib_get_vector_affinity(dev, first_vec + queue); >> +

Re: [PATCH] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread Ming Lei
On Mon, Apr 3, 2017 at 9:18 AM, NeilBrown wrote: > > When a filesystem is mounted from a loop device, writes are > throttled by balance_dirty_pages() twice: once when writing > to the filesystem and once when the loop_handle_cmd() writes > to the backing file. This

Re: [PATCH 7/7] Guard bvec iteration logic v2

2017-04-04 Thread Ming Lei
On Mon, Apr 3, 2017 at 3:23 PM, Dmitry Monakhov wrote: > Currently if some one try to advance bvec beyond it's size we simply > dump WARN_ONCE and continue to iterate beyond bvec array boundaries. > This simply means that we endup dereferencing/corrupting random memory >

Re: [PATCH 7/7] Guard bvec iteration logic v2

2017-04-04 Thread Dmitry Monakhov
Ming Lei writes: > On Mon, Apr 3, 2017 at 3:23 PM, Dmitry Monakhov wrote: >> Currently if some one try to advance bvec beyond it's size we simply >> dump WARN_ONCE and continue to iterate beyond bvec array boundaries. >> This simply means that we

[PATCH] Block SQ/MQ Request Priority

2017-04-04 Thread adam.manzanares
From: Adam Manzanares In 4.10 I introduced a patch that associates the ioc priority with each request in the block layer. This work was done in the single queue block layer code. This patch unifies ioc priority to request mapping across the single/multi queue block

Re: [PATCH V2 04/16] block, bfq: modify the peak-rate estimator

2017-04-04 Thread Bart Van Assche
On Tue, 2017-04-04 at 12:42 +0200, Paolo Valente wrote: > > Il giorno 31 mar 2017, alle ore 17:31, Bart Van Assche > > ha scritto: > > > > On Fri, 2017-03-31 at 14:47 +0200, Paolo Valente wrote: > > > + delta_ktime = ktime_get(); > > > +

Re: [PATCH] Block SQ/MQ Request Priority

2017-04-04 Thread Bart Van Assche
On Tue, 2017-04-04 at 08:25 -0700, adam.manzana...@wdc.com wrote: > Reviewed-by: Bart Van Assche

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Omar Sandoval
On Tue, Apr 04, 2017 at 02:07:43PM +0200, Hannes Reinecke wrote: > Hi all, > > as discussed recently most existing HBAs have a host-wide tagset which > does not map easily onto the per-queue tagset model of block mq. > This patchset implements a flag BLK_MQ_F_GLOBAL_TAGS for block-mq, which >

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Bart Van Assche
On Tue, 2017-04-04 at 08:32 -0700, Omar Sandoval wrote: > blk-mq already supports a shared tagset, and scsi-mq already uses that. > When we initialize a request queue, we add it to a tagset with > blk_mq_add_queue_set(), where we automatically mark the tagset as shared > if there is more than one

Re: [PATCH v2 2/5] blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list

2017-04-04 Thread Bart Van Assche
On 04/03/2017 11:40 PM, Christoph Hellwig wrote: > On Mon, Apr 03, 2017 at 04:22:25PM -0700, Bart Van Assche wrote: >> A later patch in this series will namely use RCU to iterate over >> this list. > > It also adds a couple lockdep_assert_held calls, which might be worth > mentioning. > >

Re: [PATCH 7/7] Guard bvec iteration logic v2

2017-04-04 Thread Ming Lei
On Tue, Apr 4, 2017 at 11:19 PM, Dmitry Monakhov wrote: > Ming Lei writes: > >> On Mon, Apr 3, 2017 at 3:23 PM, Dmitry Monakhov wrote: >>> Currently if some one try to advance bvec beyond it's size we simply >>> dump WARN_ONCE

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Ming Lei
On Tue, Apr 4, 2017 at 8:07 PM, Hannes Reinecke wrote: > Hi all, > > as discussed recently most existing HBAs have a host-wide tagset which > does not map easily onto the per-queue tagset model of block mq. > This patchset implements a flag BLK_MQ_F_GLOBAL_TAGS for block-mq, which >

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Bart Van Assche
On 04/04/2017 09:00 AM, Ming Lei wrote: > Just be curious, why is multi hard queue used for this case? Are there > some real cases in SCSI? Hello Ming, Yes, there is a real need for this. Background information is available in the following e-mail thread: Arun Easi, "scsi-mq - tag# and

[PATCH v2 1/5] sbitmap: add sbitmap_get_shallow() operation

2017-04-04 Thread Omar Sandoval
From: Omar Sandoval This operation supports the use case of limiting the number of bits that can be allocated for a given operation. Rather than setting aside some bits at the end of the bitmap, we can set aside bits in each word of the bitmap. This means we can keep the

[PATCH v2 4/5] blk-mq: export blk_mq_finish_request()

2017-04-04 Thread Omar Sandoval
From: Omar Sandoval This is required for schedulers that define their own put_request(). Signed-off-by: Omar Sandoval --- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 3dbfed6d0e5b..e75fa7a1a653 100644

[PATCH v2 0/5] blk-mq: Kyber multiqueue I/O scheduler

2017-04-04 Thread Omar Sandoval
From: Omar Sandoval This is v2 of Kyber, an I/O scheduler for multiqueue devices combining several techniques: the scalable bitmap library, the new blk-stats API, and queue depth throttling similar to blk-wbt. v1 was here [1]. v2 adds a tunable target synchronous write latency.

[PATCH v2 3/5] blk-mq-sched: make completed_request() callback more useful

2017-04-04 Thread Omar Sandoval
From: Omar Sandoval Currently, this callback is called right after put_request() and has no distinguishable purpose. Instead, let's call it before put_request() as soon as I/O has completed on the request, before we account it in blk-stat. With this, Kyber can enable stats when

[PATCH v2 5/5] blk-mq: introduce Kyber multiqueue I/O scheduler

2017-04-04 Thread Omar Sandoval
From: Omar Sandoval The Kyber I/O scheduler is an I/O scheduler for fast devices designed to scale to multiple queues. Users configure only two knobs, the target read and synchronous write latencies, and the scheduler tunes itself to achieve that latency goal. The implementation

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Hannes Reinecke
On 04/04/2017 05:32 PM, Omar Sandoval wrote: On Tue, Apr 04, 2017 at 02:07:43PM +0200, Hannes Reinecke wrote: Hi all, as discussed recently most existing HBAs have a host-wide tagset which does not map easily onto the per-queue tagset model of block mq. This patchset implements a flag

Re: [RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Hannes Reinecke
On 04/04/2017 05:59 PM, Ming Lei wrote: On Tue, Apr 4, 2017 at 8:07 PM, Hannes Reinecke wrote: Hi all, as discussed recently most existing HBAs have a host-wide tagset which does not map easily onto the per-queue tagset model of block mq. This patchset implements a flag

Re: [PATCH 0/5] blk-mq: scheduler and hw queue initialization fixes/enhancements

2017-04-04 Thread Josef Bacik
> On Apr 3, 2017, at 5:42 PM, Omar Sandoval wrote: > > From: Omar Sandoval > > Hi, Jens, > > This series has some fixes and enhancements for blk-mq: > > - Patch 1 is a cleanup in preparation for the rest of the series > - Patch 2 is a fix necessary for

Re: [PATCH 0/10 v5] block: Fix block device shutdown related races

2017-04-04 Thread Thiago Jung Bauermann
Hello, Am Donnerstag, 23. März 2017, 01:36:52 BRT schrieb Jan Kara: > this is a series with the remaining patches (on top of 4.11-rc2) to fix > several different races and issues I've found when testing device shutdown > and reuse. The first patch fixes possible (theoretical) problems when >

Re: [PATCH 5/8] nowait aio: return on congested block device

2017-04-04 Thread Christoph Hellwig
Please make this a REQ_* flag so that it can be passed in the bio, the request and as an argument to the get_request functions instead of testing for a bio.

Re: [PATCH 1/7] bio-integrity: Do not allocate integrity context for bio w/o data

2017-04-04 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] blk-mq: Remove blk_mq_queue_data.list

2017-04-04 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 5/7] bio-integrity: add bio_integrity_setup helper

2017-04-04 Thread Christoph Hellwig
On Mon, Apr 03, 2017 at 11:23:30AM +0400, Dmitry Monakhov wrote: > Currently all integrity prep hooks are open-coded, and if prepare fails > we ignore it's code and fail bio with EIO. Let's return real error to > upper layer, so later caller may react accordingly. For example retry in > case of

Re: [PATCH rfc 6/6] nvme-rdma: use intelligent affinity based queue mappings

2017-04-04 Thread Christoph Hellwig
On Sun, Apr 02, 2017 at 04:41:32PM +0300, Sagi Grimberg wrote: > Use the geneic block layer affinity mapping helper. Also, generic > nr_io_queues = min(opts->nr_io_queues, num_online_cpus()); > + nr_io_queues = min_t(unsigned int, nr_io_queues, > +

Re: [PATCH rfc 5/6] block: Add rdma affinity based queue mapping helper

2017-04-04 Thread Christoph Hellwig
On Sun, Apr 02, 2017 at 04:41:31PM +0300, Sagi Grimberg wrote: > Like pci and virtio, we add a rdma helper for affinity > spreading. This achieves optimal mq affinity assignments > according to the underlying rdma device affinity maps. > > Signed-off-by: Sagi Grimberg > --- >

Re: [PATCH v2 3/5] blk-mq: Introduce blk_mq_ops.restart_hctx

2017-04-04 Thread Christoph Hellwig
On Mon, Apr 03, 2017 at 04:22:26PM -0700, Bart Van Assche wrote: > If a tag set is shared among multiple hardware queues, leave > it to the block driver to rerun hardware queues. Hence remove > QUEUE_FLAG_RESTART and introduce blk_mq_ops.restart_hctx. > Remove blk_mq_sched_mark_restart_queue()

Re: [PATCH v2 4/5] scsi: Add scsi_restart_hctx()

2017-04-04 Thread Christoph Hellwig
> +static void scsi_restart_hctx(struct request_queue *q, > + struct blk_mq_hw_ctx *hctx) > +{ > + struct blk_mq_tags *tags = hctx->tags; > + struct blk_mq_tag_set *set = q->tag_set; > + int i; > + > + rcu_read_lock(); > + list_for_each_entry_rcu(q,

Re: [PATCH 7/8] nowait aio: xfs

2017-04-04 Thread Christoph Hellwig
> + if (unaligned_io) { > + /* If we are going to wait for other DIO to finish, bail */ > + if ((iocb->ki_flags & IOCB_NOWAIT) && > + atomic_read(>i_dio_count)) > + return -EAGAIN; > inode_dio_wait(inode); This checks

Re: [PATCH rfc 0/6] Automatic affinity settings for nvme over rdma

2017-04-04 Thread Max Gurtovoy
Any feedback is welcome. Hi Sagi, the patchset looks good and of course we can add support for more drivers in the future. have you run some performance testing with the nvmf initiator ? Sagi Grimberg (6): mlx5: convert to generic pci_alloc_irq_vectors mlx5: move affinity hints

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
Hi, Neil On 04/03/2017 11:25 PM, NeilBrown wrote: > On Mon, Apr 03 2017, Michael Wang wrote: > >> blk_attempt_plug_merge() try to merge bio into request and chain them >> by 'bi_next', while after the bio is done inside request, we forgot to >> reset the 'bi_next'. >> >> This lead into BUG while

Re: [PATCH v3] blk-mq: remap queues when adding/removing hardware queues

2017-04-04 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH rfc 4/6] mlx5: support ->get_vector_affinity

2017-04-04 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH rfc 2/6] mlx5: move affinity hints assignments to generic code

2017-04-04 Thread Christoph Hellwig
> @@ -1375,7 +1375,8 @@ static void mlx5e_close_cq(struct mlx5e_cq *cq) > > static int mlx5e_get_cpu(struct mlx5e_priv *priv, int ix) > { > - return cpumask_first(priv->mdev->priv.irq_info[ix].mask); > + return cpumask_first(pci_irq_get_affinity(priv->mdev->pdev, > +

Re: [PATCH v2 1/5] blk-mq: Export blk_mq_sched_restart_hctx()

2017-04-04 Thread Christoph Hellwig
> +void blk_mq_sched_restart_hctx(struct blk_mq_hw_ctx *hctx) > { > + clear_bit(BLK_MQ_S_SCHED_RESTART, >state); > + if (blk_mq_hctx_has_pending(hctx)) > + blk_mq_run_hw_queue(hctx, true); > } > +EXPORT_SYMBOL(blk_mq_sched_restart_hctx); _GPL export like the other _hctx

Re: [PATCH 1/8] nowait aio: Introduce IOCB_RW_FLAG_NOWAIT

2017-04-04 Thread Christoph Hellwig
On Mon, Apr 03, 2017 at 01:53:00PM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > This flag informs kernel to bail out if an AIO request will block > for reasons such as file allocations, or a writeback triggered, > or would block while allocating requests while

Re: [PATCH 3/7] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-04 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 2/7] bio-integrity: save original iterator for verify stage

2017-04-04 Thread Christoph Hellwig
This is a pretty big increase in the bio_integrity_payload size, but I guess we can't get around it.. Reviewed-by: Christoph Hellwig

Re: [PATCH] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig But if you actually care about performance in any way I'd suggest to use the loop device in direct I/O mode..

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Michael Wang wrote: > Hi, Neil > > On 04/03/2017 11:25 PM, NeilBrown wrote: >> On Mon, Apr 03 2017, Michael Wang wrote: >> >>> blk_attempt_plug_merge() try to merge bio into request and chain them >>> by 'bi_next', while after the bio is done inside request, we forgot to >>>

Re: [PATCH rfc 1/6] mlx5: convert to generic pci_alloc_irq_vectors

2017-04-04 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH 1/2] scsi: convert unrecovered read error to -EILSEQ

2017-04-04 Thread Christoph Hellwig
I'm planning to introduce new block-layer specific status code ASAP, so I'd prefer not to add new errno special cases. I'll port your patches to the new code and will send them out with my series in a few days, though.

Re: [PATCH 4/7] bio-integrity: fix interface for bio_integrity_trim

2017-04-04 Thread Christoph Hellwig
On Mon, Apr 03, 2017 at 11:23:29AM +0400, Dmitry Monakhov wrote: > bio_integrity_trim inherent it's interface from bio_trim and accept > offset and size, but this API is error prone because data offset > must always be insync with bio's data offset. That is why we have > integrity update hook in

Re: [PATCH 6/8] nowait aio: ext4

2017-04-04 Thread Christoph Hellwig
On Tue, Apr 04, 2017 at 09:58:53AM +0200, Jan Kara wrote: > FS_NOWAIT looks a bit too generic given these are filesystem feature flags. > Can we call it FS_NOWAIT_IO? It's way to generic as it's a feature of the particular file_operations instance. But once we switch to using RWF_* we can just

Re: [PATCH 6/7] T10: Move opencoded contants to common header

2017-04-04 Thread Christoph Hellwig
> - if ((src->ref_tag == 0x) || > - (src->app_tag == 0x)) { > + if ((src->ref_tag == T10_REF_ESCAPE) || > + (src->app_tag == T10_APP_ESCAPE)) { Please remove the

Re: [PATCH rfc 5/6] block: Add rdma affinity based queue mapping helper

2017-04-04 Thread Max Gurtovoy
diff --git a/block/blk-mq-rdma.c b/block/blk-mq-rdma.c new file mode 100644 index ..d402f7c93528 --- /dev/null +++ b/block/blk-mq-rdma.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 Sagi Grimberg. + * + * This program is free software; you can redistribute it and/or modify it + *

Re: [PATCH 6/8] nowait aio: ext4

2017-04-04 Thread Jan Kara
On Mon 03-04-17 13:53:05, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > Return EAGAIN if any of the following checks fail for direct I/O: > + i_rwsem is lockable > + Writing beyond end of file (will trigger allocation) > + Blocks are not allocated at the write

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 11:37 AM, NeilBrown wrote: > On Tue, Apr 04 2017, Michael Wang wrote: [snip] >>> >>> If sync_request_write() is using a bio that has already been used, it >>> should call bio_reset() and fill in the details again. >>> However I don't see how that would happen. >>> Can you give

Re: [PATCH V2 04/16] block, bfq: modify the peak-rate estimator

2017-04-04 Thread Paolo Valente
> Il giorno 31 mar 2017, alle ore 17:31, Bart Van Assche > ha scritto: > > On Fri, 2017-03-31 at 14:47 +0200, Paolo Valente wrote: >> -static bool bfq_update_peak_rate(struct bfq_data *bfqd, struct bfq_queue >> *bfqq, >> -bool

[RFC PATCH 0/2] block,scsi: support host-wide tagset

2017-04-04 Thread Hannes Reinecke
Hi all, as discussed recently most existing HBAs have a host-wide tagset which does not map easily onto the per-queue tagset model of block mq. This patchset implements a flag BLK_MQ_F_GLOBAL_TAGS for block-mq, which enables the use of a shared tagset for all hardware queues. The second patch

[PATCH 2/2] scsi: Add template flag 'host_tagset'

2017-04-04 Thread Hannes Reinecke
Add a host template flag 'host_tagset' to enable the use of a global tagmap for block-mq. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 5 + 2 files changed, 7 insertions(+) diff --git a/drivers/scsi/scsi_lib.c

[PATCH 1/2] block: Implement global tagset

2017-04-04 Thread Hannes Reinecke
Most legacy HBAs have a tagset per HBA, not per queue. To map these devices onto block-mq this patch implements a new tagset flag BLK_MQ_F_GLOBAL_TAGS, which will cause the tag allocator to use just one tagset for all hardware queues. Signed-off-by: Hannes Reinecke ---

Re: [PATCH] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread Michal Hocko
On Mon 03-04-17 11:18:51, NeilBrown wrote: > > When a filesystem is mounted from a loop device, writes are > throttled by balance_dirty_pages() twice: once when writing > to the filesystem and once when the loop_handle_cmd() writes > to the backing file. This double-throttling can trigger >

Re: [PATCH v2] loop: Add PF_LESS_THROTTLE to block/loop device thread.

2017-04-04 Thread Ming Lei
On Wed, Apr 5, 2017 at 12:33 PM, NeilBrown wrote: > > When a filesystem is mounted from a loop device, writes are > throttled by balance_dirty_pages() twice: once when writing > to the filesystem and once when the loop_handle_cmd() writes > to the backing file. This