All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Christoph Hellwig <hch@infradead.org>
Cc: dedekind1@gmail.com, tom.leiming@gmail.com,
	linux-kernel@vger.kernel.org, axboe@fb.com,
	linux-mtd@lists.infradead.org, computersforpeace@gmail.com,
	dwmw2@infradead.org
Subject: Re: [PATCH 2/2 v2] UBI: Block: Add blk-mq support
Date: Tue, 13 Jan 2015 23:51:52 +0100	[thread overview]
Message-ID: <54B5A188.2000001@nod.at> (raw)
In-Reply-To: <20150113162553.GA24351@infradead.org>

Am 13.01.2015 um 17:25 schrieb Christoph Hellwig:
>> +	struct ubi_sgl usgl;
> 
> Btw, what's in struct ubi_sgl?  Can't find that in my tree.

"[PATCH 1/2] UBI: Add initial support for scatter gather" adds it.

/**
 * struct ubi_sgl - UBI scatter gather list data structure.
 * @list_pos: current position in @sg[]
 * @page_pos: current position in @sg[@list_pos]
 * @sg: the scatter gather list itself
 *
 * ubi_sgl is a wrapper around a scatter list which keeps track of the
 * current position in the list and the current list item such that
 * it can be used across multiple ubi_leb_read_sg() calls.
 */
struct ubi_sgl {
        int list_pos;
        int page_pos;
        struct scatterlist sg[UBI_MAX_SG_COUNT];
};

>> +static void ubiblock_do_work(struct work_struct *work)
>> +{
>> +	int ret;
>> +	struct ubiblock_pdu *pdu = container_of(work, struct ubiblock_pdu, work);
>> +	struct request *req = blk_mq_rq_from_pdu(pdu);
>> +
>> +	blk_mq_start_request(req);
>> +	blk_rq_map_sg(req->q, req, pdu->usgl.sg);
> 
> 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.

Thanks,
//richard

WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: 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, axboe@fb.com,
	tom.leiming@gmail.com
Subject: Re: [PATCH 2/2 v2] UBI: Block: Add blk-mq support
Date: Tue, 13 Jan 2015 23:51:52 +0100	[thread overview]
Message-ID: <54B5A188.2000001@nod.at> (raw)
In-Reply-To: <20150113162553.GA24351@infradead.org>

Am 13.01.2015 um 17:25 schrieb Christoph Hellwig:
>> +	struct ubi_sgl usgl;
> 
> Btw, what's in struct ubi_sgl?  Can't find that in my tree.

"[PATCH 1/2] UBI: Add initial support for scatter gather" adds it.

/**
 * struct ubi_sgl - UBI scatter gather list data structure.
 * @list_pos: current position in @sg[]
 * @page_pos: current position in @sg[@list_pos]
 * @sg: the scatter gather list itself
 *
 * ubi_sgl is a wrapper around a scatter list which keeps track of the
 * current position in the list and the current list item such that
 * it can be used across multiple ubi_leb_read_sg() calls.
 */
struct ubi_sgl {
        int list_pos;
        int page_pos;
        struct scatterlist sg[UBI_MAX_SG_COUNT];
};

>> +static void ubiblock_do_work(struct work_struct *work)
>> +{
>> +	int ret;
>> +	struct ubiblock_pdu *pdu = container_of(work, struct ubiblock_pdu, work);
>> +	struct request *req = blk_mq_rq_from_pdu(pdu);
>> +
>> +	blk_mq_start_request(req);
>> +	blk_rq_map_sg(req->q, req, pdu->usgl.sg);
> 
> 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.

Thanks,
//richard

  reply	other threads:[~2015-01-13 22:52 UTC|newest]

Thread overview: 32+ 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 ` Richard Weinberger
2015-01-10 21:52 ` [PATCH 2/2 v2] UBI: Block: Add blk-mq support Richard Weinberger
2015-01-10 21:52   ` Richard Weinberger
2015-01-13 16:25   ` Christoph Hellwig
2015-01-13 16:25     ` Christoph Hellwig
2015-01-13 22:51     ` Richard Weinberger [this message]
2015-01-13 22:51       ` Richard Weinberger
2015-01-13 22:54       ` Jens Axboe
2015-01-13 22:54         ` Jens Axboe
2015-01-13 23:17         ` Richard Weinberger
2015-01-13 23:17           ` Richard Weinberger
2015-01-13 23:30           ` Jens Axboe
2015-01-13 23:30             ` Jens Axboe
2015-01-13 23:36             ` Richard Weinberger
2015-01-13 23:36               ` Richard Weinberger
2015-01-14  0:23               ` Jens Axboe
2015-01-14  0:23                 ` Jens Axboe
2015-01-14  8:39                 ` Richard Weinberger
2015-01-14  8:39                   ` Richard Weinberger
2015-01-26 23:55                   ` Richard Weinberger
2015-01-26 23:55                     ` Richard Weinberger
2015-01-27  4:03                     ` Jens Axboe
2015-01-27  4:03                       ` Jens Axboe
2015-01-27 23:37   ` Ezequiel Garcia
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-26 23:53   ` Richard Weinberger
2015-01-27 23:36 ` Ezequiel Garcia
2015-01-27 23:36   ` Ezequiel Garcia
2015-01-27 23:46   ` Richard Weinberger
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=54B5A188.2000001@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.