[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <abe8c209-d452-4fb5-90eb-f77b5ec1a2dc@acm.org>
Date: Thu, 30 May 2024 10:11:15 -0700
From: Bart Van Assche <bvanassche@....org>
To: Nitesh Shetty <nj.shetty@...sung.com>
Cc: Damien Le Moal <dlemoal@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Jonathan Corbet <corbet@....net>, Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...nel.org>, Mikulas Patocka <mpatocka@...hat.com>,
Keith Busch <kbusch@...nel.org>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, Chaitanya Kulkarni <kch@...dia.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
martin.petersen@...cle.com, david@...morbit.com, hare@...e.de,
damien.lemoal@...nsource.wdc.com, anuj20.g@...sung.com, joshi.k@...sung.com,
nitheshshetty@...il.com, gost.dev@...sung.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
dm-devel@...ts.linux.dev, linux-nvme@...ts.infradead.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v20 02/12] Add infrastructure for copy offload in block
and request layer.
On 5/30/24 00:16, Nitesh Shetty wrote:
> +static inline bool blk_copy_offload_attempt_combine(struct request_queue *q,
> + struct bio *bio)
> +{
> + struct blk_plug *plug = current->plug;
> + struct request *rq;
> +
> + if (!plug || rq_list_empty(plug->mq_list))
> + return false;
> +
> + rq_list_for_each(&plug->mq_list, rq) {
> + if (rq->q == q) {
> + if (!blk_copy_offload_combine(rq, bio))
> + return true;
> + break;
> + }
> +
> + /*
> + * Only keep iterating plug list for combines if we have multiple
> + * queues
> + */
> + if (!plug->multiple_queues)
> + break;
> + }
> + return false;
> +}
This new approach has the following two disadvantages:
* Without plug, REQ_OP_COPY_SRC and REQ_OP_COPY_DST are not combined. These two
operation types are the only operation types for which not using a plug causes
an I/O failure.
* A loop is required to combine the REQ_OP_COPY_SRC and REQ_OP_COPY_DST operations.
Please switch to the approach Hannes suggested, namely bio chaining. Chaining
REQ_OP_COPY_SRC and REQ_OP_COPY_DST bios before these are submitted eliminates the
two disadvantages mentioned above.
Thanks,
Bart.
Powered by blists - more mailing lists