LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Richard Weinberger <richard@nod.at>,
	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: Tue, 13 Jan 2015 17:23:00 -0700	[thread overview]
Message-ID: <54B5B6E4.4020400@fb.com> (raw)
In-Reply-To: <54B5AC10.6070102@nod.at>

On 01/13/2015 04:36 PM, Richard Weinberger wrote:
> 
> 
> Am 14.01.2015 um 00:30 schrieb Jens Axboe:
>>> If I understand you correctly it can happen that blk_rq_bytes() returns
>>> more bytes than blk_rq_map_sg() allocated, right?
>>
>> No, the number of bytes will be the same, no magic is involved :-)
> 
> Good to know. :)
> 
>> But lets say the initial request has 4 bios, with each 2 pages, for a
>> total of 8 segments. Lets further assume that the pages in each bio are
>> contiguous, so that blk_rq_map_sg() will map this to 4 sg elements, each
>> 2xpages long.
>>
>> Now, this may already be handled just fine, and you don't need to
>> update/store the actual sg count. I just looked at the source, and I'm
>> assuming it'll do the right thing (ubi_read_sg() will bump the active sg
>> element, when that size has been consumed), but I don't have
>> ubi_read_sg() in my tree to verify.
> 
> Currently the sg count is hard coded to UBI_MAX_SG_COUNT.

The max count doesn't matter, that just provides you a guarantee that
you'll never receive a request that maps to more than that. The point
I'm trying to make is that if you receive 8 segments and it maps to 4,
then you better not look at segments 5..8 after it being mapped.
Whatever the max is, doesn't matter in this conversation.

> I'm sorry, I forgot to CC you and hch to this patch:

Which is as I suspected, you'll do each segment to the length specified,
hence you don't need to track the returned count from blk_rq_map_sg().

-- 
Jens Axboe


  reply	other threads:[~2015-01-14  0:23 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
2015-01-13 23:30           ` Jens Axboe
2015-01-13 23:36             ` Richard Weinberger
2015-01-14  0:23               ` Jens Axboe [this message]
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=54B5B6E4.4020400@fb.com \
    --to=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=richard@nod.at \
    --cc=tom.leiming@gmail.com \
    --subject='Re: [PATCH 2/2 v2] UBI: Block: Add blk-mq support' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).