Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-04 Thread Jens Axboe
On 2/4/22 5:09 AM, Mikulas Patocka wrote: > > > On Thu, 3 Feb 2022, Bart Van Assche wrote: > >> On 2/3/22 10:50, Mikulas Patocka wrote: >>> On Tue, 1 Feb 2022, Bart Van Assche wrote: On 2/1/22 10:32, Mikulas Patocka wrote: >/** > + * blk_queue_max_copy_sectors - set maximum

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-04 Thread Mikulas Patocka
On Thu, 3 Feb 2022, Bart Van Assche wrote: > On 2/3/22 10:50, Mikulas Patocka wrote: > > On Tue, 1 Feb 2022, Bart Van Assche wrote: > > > On 2/1/22 10:32, Mikulas Patocka wrote: > > > >/** > > > > + * blk_queue_max_copy_sectors - set maximum copy offload sectors for > > > > the > > > >

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-04 Thread Keith Busch
On Thu, Feb 03, 2022 at 01:50:06PM -0500, Mikulas Patocka wrote: > On Tue, 1 Feb 2022, Bart Van Assche wrote: > > Only supporting copying between contiguous LBA ranges seems restrictive to > > me. > > I expect garbage collection by filesystems for UFS devices to perform better > > if multiple LBA

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-03 Thread Bart Van Assche
On 2/3/22 10:50, Mikulas Patocka wrote: On Tue, 1 Feb 2022, Bart Van Assche wrote: On 2/1/22 10:32, Mikulas Patocka wrote: /** + * blk_queue_max_copy_sectors - set maximum copy offload sectors for the queue + * @q: the request queue for the device + * @size: the maximum copy offload

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-03 Thread Mikulas Patocka
On Tue, 1 Feb 2022, Bart Van Assche wrote: > On 2/1/22 10:32, Mikulas Patocka wrote: > > /** > > + * blk_queue_max_copy_sectors - set maximum copy offload sectors for the > > queue > > + * @q: the request queue for the device > > + * @size: the maximum copy offload sectors > > + */ > >

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-02 Thread Keith Busch
On Tue, Feb 01, 2022 at 01:32:29PM -0500, Mikulas Patocka wrote: > +int blkdev_issue_copy(struct block_device *bdev1, sector_t sector1, > + struct block_device *bdev2, sector_t sector2, > + sector_t nr_sects, sector_t *copied, gfp_t gfp_mask) > +{ > + struct

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-02 Thread Mikulas Patocka
On Wed, 2 Feb 2022, Keith Busch wrote: > On Tue, Feb 01, 2022 at 01:32:29PM -0500, Mikulas Patocka wrote: > > +int blkdev_issue_copy(struct block_device *bdev1, sector_t sector1, > > + struct block_device *bdev2, sector_t sector2, > > + sector_t nr_sects,

Re: [dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-01 Thread Bart Van Assche
On 2/1/22 10:32, Mikulas Patocka wrote: /** + * blk_queue_max_copy_sectors - set maximum copy offload sectors for the queue + * @q: the request queue for the device + * @size: the maximum copy offload sectors + */ +void blk_queue_max_copy_sectors(struct request_queue *q, unsigned int size)

[dm-devel] [RFC PATCH 1/3] block: add copy offload support

2022-02-01 Thread Mikulas Patocka
Add generic copy offload support to the block layer. We add two new bio types: REQ_OP_COPY_READ_TOKEN and REQ_OP_COPY_WRITE_TOKEN. Their bio vector has one entry - a page containing the token. When we need to copy data, we send REQ_OP_COPY_READ_TOKEN to the source device and then we send