[PATCH 07/23] nvme: use bvec_set_virt to initialize special_vec

2023-01-30 Thread Christoph Hellwig
Use the bvec_set_virt helper to initialize the special_vec. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 505e16f20e57fa..7ba1accc3c22a4 100644

[PATCH 06/23] nvmet: use bvec_set_page to initialize bvecs

2023-01-30 Thread Christoph Hellwig
Use the bvec_set_page helper to initialize bvecs. Signed-off-by: Christoph Hellwig --- drivers/nvme/target/io-cmd-file.c | 10 ++ drivers/nvme/target/tcp.c | 5 ++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers

[PATCH 03/23] block: add a bvec_set_virt helper

2023-01-30 Thread Christoph Hellwig
A small wrapper around bvec_set_page for callers that have a virtual address. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index f094512ce3bda9..7031d83af02267 100644

[PATCH 02/23] block: add a bvec_set_folio helper

2023-01-30 Thread Christoph Hellwig
A smaller wrapper around bvec_set_page that takes a folio instead. There are only two potential users for this in the tree, but the number will grow in the future. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH 01/23] block: factor out a bvec_set_page helper

2023-01-30 Thread Christoph Hellwig
Add a helper to initialize a bvec based of a page pointer. This will help removing various open code bvec initializations. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 7 +-- block/bio.c | 12 ++-- include/linux/bvec.h | 15 +++ 3 files

add bvec initialization helpers

2023-01-30 Thread Christoph Hellwig
Hi all, this series adds the helpers to initalize a bvec. These remove open coding of bvec internals and help with experimenting with other representations like a phys_addr_t instead of page + offset. Diffstat: block/bio-integrity.c |7 -- block/bio.c

Re: [RFC PATCH 01/19] mm: Introduce vm_account

2023-01-23 Thread Christoph Hellwig
> +/** > + * vm_account_init - Initialise a new struct vm_account. > + * @vm_account: pointer to uninitialised vm_account. > + * @task: task to charge against. > + * @user: user to charge against. Must be non-NULL for VM_ACCOUNT_USER. > + * @flags: flags to use when charging to vm_account. > + * >

Re: [PATCH] vdpa_sim: get rid of DMA ops

2022-12-22 Thread Christoph Hellwig
Looks good from the DMA subsysten POV: Acked-by: Christoph Hellwig Thanks for doing the work! ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v2 2/2] virtio-blk: support completion batching for the IRQ path

2022-12-21 Thread Christoph Hellwig
!blk_mq_add_to_batch(req, iob, vbr->status, virtblk_complete_batch)) > + found = virtblk_handle_req(vq, iob); > > if (found) You can drop the found variable here now: if (virtblk_handle_req(vq, iob)) blk_mq_start_stopped_hw_queues(vblk->disk-&

Re: [PATCH v2 1/2] virtio-blk: set req->state to MQ_RQ_COMPLETE after polling I/O is finished

2022-12-21 Thread Christoph Hellwig
perly sets req->state after polling I/O is finished. > > Fixes: 4e0400525691 ("virtio-blk: support polling I/O") > Signed-off-by: Suwan Kim Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization

Re: [PATCH 1/2] virtio-blk: set req->state to MQ_RQ_COMPLETE after polling I/O is finished

2022-12-11 Thread Christoph Hellwig
On Thu, Dec 08, 2022 at 09:48:23AM -0700, Jens Axboe wrote: > > The doc comment for blk_mq_set_request_complete() mentions this being > > used in ->queue_rq(), but that's not the case here. Does the doc comment > > need to be updated if we're using the function in a different way? > > Looks like

Re: [PATCH v3] virtio_blk: add VIRTIO_BLK_F_LIFETIME feature support

2022-12-07 Thread Christoph Hellwig
On Wed, Dec 07, 2022 at 05:21:48AM -0500, Michael S. Tsirkin wrote: > Christoph you acked the spec patch adding this to virtio blk: > > Still not a fan of the encoding, but at least it is properly documented > now: > > Acked-by: Christoph Hellwig > >

Re: [PATCH v3] virtio_blk: add VIRTIO_BLK_F_LIFETIME feature support

2022-12-07 Thread Christoph Hellwig
This just seems like a horrible interface. And virtio-blk should be a simple passthrough and not grow tons of side-band crap like this. If you want to pass through random misc information use virtio-scsi or nvme with shadow doorbell buffers. ___

Re: [PATCH v2 01/11] genirq/affinity:: Export irq_create_affinity_masks()

2022-12-06 Thread Christoph Hellwig
On Tue, Dec 06, 2022 at 04:40:37PM +0800, Yongji Xie wrote: > With the vDPA framework, some drivers (vduse, vdpa-sim) can create > software-defined virtio devices and attach them to the virtio bus. > This kind of virtio device is not a pci device or a platform device. > So it would be needed to

Re: [PATCH v2 01/11] genirq/affinity:: Export irq_create_affinity_masks()

2022-12-06 Thread Christoph Hellwig
On Mon, Dec 05, 2022 at 04:41:17PM +0800, Xie Yongji wrote: > Export irq_create_affinity_masks() so that some modules > can make use of it to implement interrupt affinity > spreading mechanism. I don't think driver should be building low-level affinity masks.

Re: [RFC PATCH 00/21] block: add and use init tagset helper

2022-10-10 Thread Christoph Hellwig
On Fri, Oct 07, 2022 at 11:26:13AM -0700, Luis Chamberlain wrote: > *If* there were commonalities at init and these could be broken up into > common groups, each having their own set of calls, then we simplify and > can abstract these. I say this without doing a complete review of the > removals,

Re: [PATCH v1] virtio_blk: should not use IRQD_AFFINITY_MANAGED in init_rq

2022-09-28 Thread Christoph Hellwig
On Tue, Sep 27, 2022 at 04:47:20PM -0400, Michael S. Tsirkin wrote: > > The log : > > "genirq: Flags mismatch irq 0. 0080 (virtio418) vs. 00015a00 (timer)" > > was print because of the irq 0 is used by timer exclusive,and when > > vp_find_vqs called vp_find_vqs_msix and return false twice,then

Re: [PATCH v1] virtio_blk: should not use IRQD_AFFINITY_MANAGED in init_rq

2022-09-26 Thread Christoph Hellwig
On Sat, Sep 24, 2022 at 11:48:54AM +0800, Angus Chen wrote: > The background is that we use dpu in cloud computing,the arch is x86,80 > cores.We will have a lots of virtio devices,like 512 or more. > When we probe about 200 virtio_blk devices,it will fail and > the stack is print as follows: I

Re: [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage

2022-09-23 Thread Christoph Hellwig
On Wed, Sep 21, 2022 at 07:48:50AM +1000, Daniil Lunev wrote: > > There is no such thing as WRITE UNAVAILABLE in NVMe. > Apologize, that is WRITE UNCORRECTABLE. Chapter 3.2.7 of > NVM Express NVM Command Set Specification 1.0b Write uncorrectable is a very different thing, and the equivalent of

Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION

2022-09-23 Thread Christoph Hellwig
On Tue, Sep 20, 2022 at 10:54:32PM -0700, Sarthak Kukreti wrote: > [ mmc0blkp1 | ext4(1) | sparse file | loop | dm-thinp | dm-thin | ext4(2) ] > > would be predicated on the guarantees of fallocate() per allocation > layer; if ext4(1) was replaced by a filesystem that did not support >

Re: [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage

2022-09-20 Thread Christoph Hellwig
On Tue, Sep 20, 2022 at 08:17:10PM +1000, Daniil Lunev wrote: > to WRITE ZERO command in NVMe, but to WRITE UNAVAILABLE in There is no such thing as WRITE UNAVAILABLE in NVMe. > NVME 2.0 spec, and to UNMAP ANCHORED in SCSI spec. The SCSI anchored LBA state is quite complicated, and in addition

Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION

2022-09-20 Thread Christoph Hellwig
On Thu, Sep 15, 2022 at 09:48:22AM -0700, Sarthak Kukreti wrote: > From: Sarthak Kukreti > > FALLOC_FL_PROVISION is a new fallocate() allocation mode that > sends a hint to (supported) thinly provisioned block devices to > allocate space for the given range of sectors via REQ_OP_PROVISION. So,

Re: [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage

2022-09-20 Thread Christoph Hellwig
On Fri, Sep 16, 2022 at 11:48:34AM -0700, Sarthak Kukreti wrote: > Yes. On ChromiumOS, we regularly deal with storage devices that don't > support WRITE_ZEROES or that need to have it disabled, via a quirk, > due to a bug in the vendor's implementation. So bloody punich the vendors for it.

Re: [PATCH] virtio-blk: Fix WARN_ON_ONCE in virtio_queue_rq()

2022-08-23 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-07 Thread Christoph Hellwig
On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > Why is "IOMMU support" called "VIRTIO_F_ACCESS_PLATFORM"? Because, as far as the virtio spec and virtio "guest" implementation is concerned it is not about IOMMU support at all. It is about treating virtio DMA as real DMA by the

Re: [PATCH] virtio: Force DMA restricted devices through DMA API

2022-07-19 Thread Christoph Hellwig
On Tue, Jul 19, 2022 at 04:11:50PM +, Keir Fraser wrote: > Well here are two possible approaches: > > 1. Revert e41b1355508d outright. I'm not even sure what it would mean > for reported pages to go through IOMMU. And VIRTIO_F_ACCESS_PLATFORM > is no longer IOMMU-specific anyway. > > 2.

Re: [PATCH] virtio: Force DMA restricted devices through DMA API

2022-07-19 Thread Christoph Hellwig
On Tue, Jul 19, 2022 at 03:46:08PM +, Keir Fraser wrote: > However, if the general idea at least is acceptable, would the > implementation be acceptable if I add an explicit API for this to the > DMA subsystem, and hide the detail there? I don't think so. The right thing to key off is

Re: [PATCH] virtio: Force DMA restricted devices through DMA API

2022-07-19 Thread Christoph Hellwig
On Tue, Jul 19, 2022 at 10:02:56AM +, Keir Fraser wrote: > +#include Drivers must never use this header. We have a few pre-existing abuses in the drm code, but they will go away. ___ Virtualization mailing list

Re: [PATCH v10 0/8] Use copy_process in vhost layer

2022-07-11 Thread Christoph Hellwig
On Mon, Jul 11, 2022 at 11:44:14PM -0500, Mike Christie wrote: > Eric and Christian, Ping? > > If you guys don't like these patches anymore what about something > simple like just exporting some helpers to update and check a task's > nproc limit. Something like this: I'm not Eric or Christian

Re: [PATCH RFC v1 4/7] swiotlb: to implement io_tlb_high_mem

2022-06-13 Thread Christoph Hellwig
On Fri, Jun 10, 2022 at 02:56:08PM -0700, Dongli Zhang wrote: > Since this patch file has 200+ lines, would you please help clarify what does > 'this' indicate? This indicates that any choice of a different swiotlb pools needs to be hidden inside of ѕwiotlb. The dma mapping API already provides

Re: [PATCH RFC v1 3/7] swiotlb-xen: support highmem for xen specific code

2022-06-08 Thread Christoph Hellwig
On Wed, Jun 08, 2022 at 05:55:49PM -0700, Dongli Zhang wrote: > @@ -109,19 +110,25 @@ int xen_swiotlb_fixup(void *buf, unsigned long nslabs, > bool high) > int rc; > unsigned int order = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT); > unsigned int i, dma_bits = order + PAGE_SHIFT;

Re: [PATCH RFC v1 7/7] swiotlb: fix the slot_addr() overflow

2022-06-08 Thread Christoph Hellwig
On Wed, Jun 08, 2022 at 05:55:53PM -0700, Dongli Zhang wrote: > +#define slot_addr(start, idx)((start) + \ > + (((unsigned long)idx) << IO_TLB_SHIFT)) Please just convert it to an inline function. ___ Virtualization

Re: [PATCH RFC v1 6/7] virtio: use io_tlb_high_mem if it is active

2022-06-08 Thread Christoph Hellwig
On Wed, Jun 08, 2022 at 05:55:52PM -0700, Dongli Zhang wrote: > /* Unique numbering for virtio devices. */ > @@ -241,6 +243,12 @@ static int virtio_dev_probe(struct device *_d) > u64 device_features; > u64 driver_features; > u64 driver_features_legacy; > + struct device

Re: [PATCH RFC v1 5/7] swiotlb: add interface to set dev->dma_io_tlb_mem

2022-06-08 Thread Christoph Hellwig
This should be handled under the hood without the driver even knowing. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH RFC v1 4/7] swiotlb: to implement io_tlb_high_mem

2022-06-08 Thread Christoph Hellwig
All this really needs to be hidden under the hood. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH RFC v1 1/7] swiotlb: introduce the highmem swiotlb buffer

2022-06-08 Thread Christoph Hellwig
On Wed, Jun 08, 2022 at 05:55:47PM -0700, Dongli Zhang wrote: > @@ -109,6 +109,7 @@ struct io_tlb_mem { > } *slots; > }; > extern struct io_tlb_mem io_tlb_default_mem; > +extern struct io_tlb_mem io_tlb_high_mem; Tis should not be exposed. > +extern bool swiotlb_high_active(void); And

Re: [PATCH 20/20] mm/folio-compat: Remove migration compatibility functions

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 19/20] fs: Remove aops->migratepage()

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 13/20] aio: Convert to migrate_folio

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 10/20] btrfs: Convert btrfs_migratepage to migrate_folio

2022-06-08 Thread Christoph Hellwig
On Mon, Jun 06, 2022 at 09:40:40PM +0100, Matthew Wilcox (Oracle) wrote: > Use filemap_migrate_folio() to do the bulk of the work, and then copy > the ordered flag across if needed. Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization m

Re: [PATCH 09/20] mm/migrate: Add filemap_migrate_folio()

2022-06-08 Thread Christoph Hellwig
lesystems > to use it. Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 08/20] mm/migrate: Convert migrate_page() to migrate_folio()

2022-06-08 Thread Christoph Hellwig
On Mon, Jun 06, 2022 at 09:40:38PM +0100, Matthew Wilcox (Oracle) wrote: > Convert all callers to pass a folio. Most have the folio > already available. Switch all users from aops->migratepage to > aops->migrate_folio. Also turn the documentation into kerneldoc. Reviewed-by: Ch

Re: [PATCH 07/20] nfs: Convert to migrate_folio

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 06/20] btrfs: Convert btree_migratepage to migrate_folio

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 05/20] mm/migrate: Convert expected_page_refs() to folio_expected_refs()

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 04/20] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio()

2022-06-08 Thread Christoph Hellwig
> them up. Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 03/20] mm/migrate: Convert writeout() to take a folio

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 02/20] mm/migrate: Convert fallback_migrate_page() to fallback_migrate_folio()

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 01/20] fs: Add aops->migrate_folio

2022-06-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v3 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-05-09 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v3 1/2] kernel: add platform_has() infrastructure

2022-05-09 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: fix and cleanup discard_alignment handling

2022-05-02 Thread Christoph Hellwig
ping? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH 11/11] xen-blkback: use bdev_discard_alignment

2022-04-17 Thread Christoph Hellwig
Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Also switch to use bdev_discard_granularity to get rid of the last direct queue reference in xen_blkbk_discard. Signed-off-by: Christoph Hellwig

[PATCH 10/11] rnbd-srv: use bdev_discard_alignment

2022-04-17 Thread Christoph Hellwig
Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-srv-dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block

[PATCH 09/11] nvme: remove a spurious clear of discard_alignment

2022-04-17 Thread Christoph Hellwig
The nvme driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b9b0fbde97c80..76a9ccd5d064a

[PATCH 08/11] loop: remove a spurious clear of discard_alignment

2022-04-17 Thread Christoph Hellwig
The loop driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 976cf987b3920..61b642b966a08 100644

[PATCH 07/11] dasd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
useless. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dasd_fba.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index 8bd5665db9198..60be7f7bf2d16 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block

[PATCH 01/11] ubd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by ubd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- arch/um/drivers/ubd_kern.c

[PATCH 06/11] raid5: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by raid5 is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/md/raid5.c | 1

[PATCH 04/11] virtio_blk: fix the discard_granularity and discard_alignment queue limits

2022-04-17 Thread Christoph Hellwig
23816b8eb8 ("virtio_blk: add discard and write zeroes support") Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6ccf15253dee1..d624cc8eddc3c

[PATCH 05/11] dm-zoned: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by dm-zoned is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/md/dm-zoned

[PATCH 03/11] null_blk: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by null_blk is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/block/null_blk

fix and cleanup discard_alignment handling

2022-04-17 Thread Christoph Hellwig
Hi all, the somewhat confusing name of the discard_alignment queue limit, that really is an offset for the discard granularity mislead a lot of driver authors to set it to an incorrect value. This series tries to fix up all these cases. Diffstat: arch/um/drivers/ubd_kern.c |1 -

[PATCH 02/11] nbd: don't set the discard_alignment queue limit

2022-04-17 Thread Christoph Hellwig
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by nbd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig --- drivers/block/nbd.c | 3

Re: [RFC PATCH 0/6] virtio: Solution to restrict memory access under Xen using xen-virtio DMA ops layer

2022-04-15 Thread Christoph Hellwig
I can only see three out of 6 patches on the linux-arm-kernel list, which makes reviewing this impossible. Also please Cc me directly on any series doing crazy things with dma ops. Thanks! ___ Virtualization mailing list

[PATCH 24/27] block: remove QUEUE_FLAG_DISCARD

2022-04-14 Thread Christoph Hellwig
allow for it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Jan Höppner [s390] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] --- arch/um/drivers/ubd_kern.c | 2 -- block/blk-core.c| 2

[PATCH 26/27] block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-14 Thread Christoph Hellwig
Secure erase is a very different operation from discard in that it is a data integrity operation vs hint. Fully split the limits and helper infrastructure to make the separation more clear. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd

[PATCH 27/27] direct-io: remove random prefetches

2022-04-14 Thread Christoph Hellwig
Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance criticil direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 32

[PATCH 25/27] block: add a bdev_discard_granularity helper

2022-04-14 Thread Christoph Hellwig
Abstract away implementation details from file systems by providing a block_device based helper to retrieve the discard granularity. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Ryusuke Konishi Acked-by: David Sterba [btrfs

[PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-14 Thread Christoph Hellwig
-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] --- drivers/block/drbd/drbd_nl.c| 8 +--- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/rnbd/rnbd-srv-dev.h | 3

[PATCH 22/27] block: refactor discard bio size limiting

2022-04-14 Thread Christoph Hellwig
Move all the logic to limit the discard bio size into a common helper so that it is better documented. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Coly Li --- block/blk-lib.c | 59 - block/blk.h | 14

[PATCH 20/27] block: use bdev_discard_alignment in part_discard_alignment_show

2022-04-14 Thread Christoph Hellwig
Use the bdev based alignment helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/partitions/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index

[PATCH 21/27] block: move {bdev, queue_limit}_discard_alignment out of line

2022-04-14 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Also fix the return value to be unsigned, just like the field in struct queue_limits. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-settings.c | 35 +++ include/linux/blkdev.h

[PATCH 19/27] block: remove queue_discard_alignment

2022-04-14 Thread Christoph Hellwig
Just use bdev_alignment_offset in disk_discard_alignment_show instead. That helpers is the same except for an always false branch that doesn't matter in this slow path. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/genhd.c | 2 +- include/linux/blkdev.h

[PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line

2022-04-14 Thread Christoph Hellwig
No need to inline these fairly larger helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-settings.c | 23 +++ include/linux/blkdev.h | 21 + 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/block/blk

[PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show

2022-04-14 Thread Christoph Hellwig
This does the same as the open coded variant except for an extra branch, and allows to remove queue_alignment_offset entirely. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/genhd.c | 2 +- include/linux/blkdev.h | 8 2 files changed, 1 insertion

[PATCH 16/27] block: use bdev_alignment_offset in part_alignment_offset_show

2022-04-14 Thread Christoph Hellwig
Replace the open coded offset calculation with the proper helper. This is an ABI change in that the -1 for a misaligned partition is properly propagated, which can be considered a bug fix and matches what is done on the whole device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K

[PATCH 15/27] block: add a bdev_max_zone_append_sectors helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the max supported sectors for zone append based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Acked-by: Damien Le Moal Reviewed-by: Martin K. Petersen Reviewed-by: Johannes Thumshirn

[PATCH 14/27] block: add a bdev_stable_writes helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the stable writes flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/md/dm-table.c | 4 +--- fs/super.c | 2 +- include/linux

[PATCH 13/27] block: add a bdev_fua helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the FUA flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/block/rnbd/rnbd-srv.c | 3 +-- drivers/target/target_core_iblock.c | 3 +-- fs

[PATCH 12/27] block: add a bdev_write_cache helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the write cache flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] --- drivers/block/rnbd/rnbd-srv.c | 2 +- drivers

[PATCH 11/27] block: add a bdev_nonrot helper

2022-04-14 Thread Christoph Hellwig
Add a helper to check the nonrot flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] --- block/ioctl.c | 2 +- drivers/block

[PATCH 10/27] mm: use bdev_is_zoned in claim_swapfile

2022-04-14 Thread Christoph Hellwig
Use the bdev based helper instead of poking into the queue. Signed-off-by: Christoph Hellwig --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 63c61f8b26118..4c7537162af5e 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c

[PATCH 09/27] ntfs3: use bdev_logical_block_size instead of open coding it

2022-04-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/ntfs3/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 278dcf5024102..cd30e81abbce0 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -920,7 +920,7

[PATCH 08/27] btrfs: use bdev_max_active_zones instead of open coding it

2022-04-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Acked-by: David Sterba --- fs/btrfs/zoned.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 1b1b310c3c510..f72cad7391a11 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs

[PATCH 07/27] drbd: cleanup decide_on_discard_support

2022-04-14 Thread Christoph Hellwig
Sanitize the calling conventions and use a goto label to cleanup the code flow. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_nl.c | 68 +++- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/drivers

[PATCH 06/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset

2022-04-14 Thread Christoph Hellwig
The bdev version does the right thing for partitions, so use that. Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support") Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes

2022-04-14 Thread Christoph Hellwig
Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd

[PATCH 04/27] drbd: remove assign_p_sizes_qlim

2022-04-14 Thread Christoph Hellwig
Fold each branch into its only caller. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 47 +++--- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd

[PATCH 03/27] target: fix discard alignment on partitions

2022-04-14 Thread Christoph Hellwig
Use the proper bdev_discard_alignment helper that accounts for partition offsets. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/target/target_core_device.c | 4 ++-- 1 file

[PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue

2022-04-14 Thread Christoph Hellwig
The SCSI target drivers is a consumer of the block layer and shoul d generally work on struct block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/target/target_core_device.c | 5 +++-- drivers/target/target_core_file.c| 7 --- drivers/target

[PATCH 01/27] target: remove an incorrect unmap zeroes data deduction

2022-04-14 Thread Christoph Hellwig
block: Convert WRITE_SAME to blkdev_issue_zeroout") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- drivers/target/target_core_device.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 44b

use block_device based APIs in block layer consumers v3

2022-04-14 Thread Christoph Hellwig
Hi Jens, this series cleanups up the block layer API so that APIs consumed by file systems are (almost) only struct block_devic based, so that file systems don't have to poke into block layer internals like the request_queue. I also found a bunch of existing bugs related to partition offsets and

Re: [PATCH 26/27] block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-10 Thread Christoph Hellwig
On Sat, Apr 09, 2022 at 10:32:52PM +0800, Coly Li wrote: >> Acked-by: Coly Li [drbd] > > Hi Christoph, > > My ACK is for bcache, not drbd here. Fixed. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 24/27] block: remove QUEUE_FLAG_DISCARD

2022-04-10 Thread Christoph Hellwig
On Sat, Apr 09, 2022 at 10:15:33AM +0200, Christoph Böhmwalder wrote: > On 09.04.22 06:50, Christoph Hellwig wrote: >> Just use a non-zero max_discard_sectors as an indicator for discard >> support, similar to what is done for write zeroes. >> >> The only places wh

[PATCH 26/27] block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD

2022-04-08 Thread Christoph Hellwig
Secure erase is a very different operation from discard in that it is a data integrity operation vs hint. Fully split the limits and helper infrastructure to make the separation more clear. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd

[PATCH 27/27] direct-io: remove random prefetches

2022-04-08 Thread Christoph Hellwig
Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance criticil direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 32

[PATCH 25/27] block: add a bdev_discard_granularity helper

2022-04-08 Thread Christoph Hellwig
Abstract away implementation details from file systems by providing a block_device based helper to retrieve the discard granularity. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [btrfs] Acked-by: Ryusuke Konishi Acked-by: David Sterba [btrfs

[PATCH 24/27] block: remove QUEUE_FLAG_DISCARD

2022-04-08 Thread Christoph Hellwig
allow for it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [btrfs] Acked-by: Coly Li [bcache] --- arch/um/drivers/ubd_kern.c | 2 -- block/blk-core.c| 2 +- block/blk-lib.c | 2 +- block/blk-mq

[PATCH 23/27] block: add a bdev_max_discard_sectors helper

2022-04-08 Thread Christoph Hellwig
-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] --- drivers/block/drbd/drbd_nl.c| 8 +--- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/rnbd/rnbd-srv-dev.h | 3

<    1   2   3   4   5   6   7   8   9   10   >