From: Richard Weinberger <richard@nod.at>
To: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@infradead.org>
Cc: dedekind1@gmail.com, dwmw2@infradead.org,
computersforpeace@gmail.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, tom.leiming@gmail.com
Subject: Re: [PATCH 2/2 v2] UBI: Block: Add blk-mq support
Date: Wed, 14 Jan 2015 00:17:16 +0100 [thread overview]
Message-ID: <54B5A77C.9040405@nod.at> (raw)
In-Reply-To: <54B5A213.1090502@fb.com>
Am 13.01.2015 um 23:54 schrieb Jens Axboe:
>>> blk_rq_map_sg returns the number of entries actually mapped, which
>>> might be smaller than the number passed in due to merging.
>>
>> Yep, but the ubi_sql has a fixed number of scatterlist entries, UBI_MAX_SG_COUNT.
>> And I limit it also to that using: blk_queue_max_segments(dev->rq, UBI_MAX_SG_COUNT);
>>
>> Is there another reason why I should use the return value of blk_rq_map_sg()?
>> Please also note that the UBI block driver is read-only.
>
> It can return less than what you asked for, if segments are coalesced.
> Read/write, doesn't matter. You should always use the returned value as
> the indication of how many segments to access in pdu->usgl.sg for data
> transfer.
Sorry, I don't fully understand.
Currently the driver does:
to_read = blk_rq_bytes(req);
Then it fills pdu->usgl.sg up to to_read bytes
and calls blk_mq_end_request().
If I understand you correctly it can happen that blk_rq_bytes() returns
more bytes than blk_rq_map_sg() allocated, right?
Thanks,
//richard
next prev parent reply other threads:[~2015-01-13 23:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-10 21:52 [PATCH 1/2 v2] UBI: Add initial support for scatter gather Richard Weinberger
2015-01-10 21:52 ` [PATCH 2/2 v2] UBI: Block: Add blk-mq support Richard Weinberger
2015-01-13 16:25 ` Christoph Hellwig
2015-01-13 22:51 ` Richard Weinberger
2015-01-13 22:54 ` Jens Axboe
2015-01-13 23:17 ` Richard Weinberger [this message]
2015-01-13 23:30 ` Jens Axboe
2015-01-13 23:36 ` Richard Weinberger
2015-01-14 0:23 ` Jens Axboe
2015-01-14 8:39 ` Richard Weinberger
2015-01-26 23:55 ` Richard Weinberger
2015-01-27 4:03 ` Jens Axboe
2015-01-27 23:37 ` Ezequiel Garcia
2015-01-26 23:53 ` [PATCH 1/2 v2] UBI: Add initial support for scatter gather Richard Weinberger
2015-01-27 23:36 ` Ezequiel Garcia
2015-01-27 23:46 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B5A77C.9040405@nod.at \
--to=richard@nod.at \
--cc=axboe@fb.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=tom.leiming@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox