From: Christoph Hellwig <hch@lst.de>
To: Coly Li <colyli@suse.de>
Cc: axboe@kernel.dk, linux-bcache@vger.kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexander Ullrich <ealex1979@gmail.com>,
Diego Ercolani <diego.ercolani@gmail.com>,
Jan Szubiak <jan.szubiak@linuxpolska.pl>,
Marco Rebhan <me@dblsaiko.net>,
Matthias Ferdinand <bcache@mfedv.net>,
Victor Westerhuis <victor@westerhu.is>,
Vojtech Pavlik <vojtech@suse.cz>,
Rolf Fokkens <rolf@rolffokkens.nl>,
Thorsten Knabe <linux@thorsten-knabe.de>,
stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Kent Overstreet <kent.overstreet@gmail.com>,
Nix <nix@esperi.org.uk>, Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH v5 2/2] bcache: avoid oversized read request in cache missing code path
Date: Mon, 7 Jun 2021 13:06:57 +0200 [thread overview]
Message-ID: <20210607110657.GB6729@lst.de> (raw)
In-Reply-To: <20210607103539.12823-3-colyli@suse.de>
On Mon, Jun 07, 2021 at 06:35:39PM +0800, Coly Li wrote:
> + /* Limitation for valid replace key size and cache_bio bvecs number */
> + size_limit = min_t(unsigned int, bio_max_segs(UINT_MAX) * PAGE_SECTORS,
> + (1 << KEY_SIZE_BITS) - 1);
bio_max_segs kaps the argument to BIO_MAX_VECS, so you might as well
directly write BIO_MAX_VECS. Can you explain the PAGE_SECTORS here a bit
more? Does this code path use discontiguous per-sector allocations?
Preferably in a comment.
> + s->insert_bio_sectors = min3(size_limit, sectors, bio_sectors(bio));
Also I don't really understand the units involved here.
s->insert_bio_sectors, sectors, and bio_sectors is in unit of 512 byte
sectors.
> - miss = bio_next_split(bio, sectors, GFP_NOIO, &s->d->bio_split);
> + miss = bio_next_split(bio, s->insert_bio_sectors, GFP_NOIO, &s->d->bio_split);
Overly long line.
next prev parent reply other threads:[~2021-06-07 11:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 10:35 [PATCH 0/2] bcache fixes for Linux v5.13-rc6 Coly Li
2021-06-07 10:35 ` [PATCH v5 1/2] bcache: remove bcache device self-defined readahead Coly Li
2021-06-07 11:00 ` Christoph Hellwig
2021-06-07 10:35 ` [PATCH v5 2/2] bcache: avoid oversized read request in cache missing code path Coly Li
2021-06-07 11:06 ` Christoph Hellwig [this message]
2021-06-07 11:55 ` Coly Li
2021-06-07 12:08 ` Christoph Hellwig
2021-06-07 12:31 ` Coly Li
-- strict thread matches above, loose matches on Subject: below --
2021-05-31 15:31 [PATCH v5 1/2] bcache: remove bcache device self-defined readahead Coly Li
2021-05-31 15:31 ` [PATCH v5 2/2] bcache: avoid oversized read request in cache missing code path Coly Li
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=20210607110657.GB6729@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bcache@mfedv.net \
--cc=colyli@suse.de \
--cc=diego.ercolani@gmail.com \
--cc=ealex1979@gmail.com \
--cc=jan.szubiak@linuxpolska.pl \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@thorsten-knabe.de \
--cc=me@dblsaiko.net \
--cc=nix@esperi.org.uk \
--cc=rolf@rolffokkens.nl \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=victor@westerhu.is \
--cc=vojtech@suse.cz \
/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.