[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150125134038.GD19445@infradead.org>
Date: Sun, 25 Jan 2015 05:40:38 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Ming Lei <ming.lei@...onical.com>
Cc: linux-kernel@...r.kernel.org,
Dave Kleikamp <dave.kleikamp@...cle.com>,
Jens Axboe <axboe@...nel.dk>, Zach Brown <zab@...bo.net>,
Christoph Hellwig <hch@...radead.org>,
Maxim Patlasov <mpatlasov@...allels.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Benjamin LaHaise <bcrl@...ck.org>
Subject: Re: [PATCH v2 4/4] block: loop: support to submit I/O via kernel aio
based
> +{
> + unsigned int i = 0;
> + struct iov_iter iter;
> + struct bio_vec *bvec, bv;
> + size_t nr_segs = 0;
> + struct req_iterator r_iter;
> +
> + rq_for_each_segment(bv, cmd->rq, r_iter)
> + nr_segs++;
> +
> + if (nr_segs > LOOP_CMD_BVEC_CNT) {
> + cmd->alloc_bv = kmalloc(nr_segs * sizeof(*cmd->alloc_bv),
> + GFP_NOIO);
> + if (!cmd->alloc_bv)
> + return -ENOMEM;
> + bvec = cmd->alloc_bv;
> + } else {
> + bvec = cmd->bv;
> + cmd->alloc_bv = NULL;
> + }
> +
> + rq_for_each_segment(bv, cmd->rq, r_iter)
> + bvec[i++] = bv;
What prevents us from simplify using the bvecs in the request? Sure
we'd need to disable merging for this case, but it would avoid the
copy, and the potentival memory allocation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists