From: Mike Snitzer <snitzer@redhat.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Jens Axboe <axboe@fb.com>,
linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
linux-block@vger.kernel.org, "maintainer:DEVICE-MAPPER LVM,
Shaohua Li <shli@kernel.org>,
linux-raid@vger.kernel.org open list:SOFTWARE RAID Multiple
DisksSUPPORT" <dm-devel@redhat.com>,
Alasdair Kergon <agk@redhat.com>
Subject: Re: [PATCH v1 12/54] dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE
Date: Tue, 3 Jan 2017 11:43:13 -0500 [thread overview]
Message-ID: <20170103164312.GA20421@redhat.com> (raw)
In-Reply-To: <1482854250-13481-13-git-send-email-tom.leiming@gmail.com>
On Tue, Dec 27 2016 at 10:56am -0500,
Ming Lei <tom.leiming@gmail.com> wrote:
> For BIO based DM, some targets aren't ready for dealing with
> bigger incoming bio than 1Mbyte, such as crypt target.
>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> drivers/md/dm.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 3086da5664f3..6139bf7623f7 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -899,7 +899,16 @@ int dm_set_target_max_io_len(struct dm_target *ti, sector_t len)
> return -EINVAL;
> }
>
> - ti->max_io_len = (uint32_t) len;
> + /*
> + * BIO based queue uses its own splitting. When multipage bvecs
> + * is switched on, size of the incoming bio may be too big to
> + * be handled in some targets, such as crypt.
> + *
> + * When these targets are ready for the big bio, we can remove
> + * the limit.
> + */
> + ti->max_io_len = min_t(uint32_t, len,
> + (BIO_MAX_PAGES * PAGE_SIZE));
>
> return 0;
> }
> --
> 2.7.4
dm_set_target_max_io_len() is already meant to be called by the .ctr
hook for each DM target. So why not just have the dm-crypt target (and
other targets if needed) pass your reduced $len?
That way only targets that need to be fixed (e.g. dm-crypt) impose this
limit.
next prev parent reply other threads:[~2017-01-03 16:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-27 15:55 [PATCH v1 00/54] block: support multipage bvec Ming Lei
2016-12-27 15:56 ` [PATCH v1 12/54] dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE Ming Lei
2017-01-03 16:43 ` Mike Snitzer [this message]
2017-01-06 3:30 ` Ming Lei
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=20170103164312.GA20421@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=axboe@fb.com \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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