From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Christoph Hellwig <hch@infradead.org>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-raid@vger.kernel.org
Subject: Re: [PATCH V2] raid1: ensure write behind bio has less than BIO_MAX_VECS sectors
Date: Fri, 20 Aug 2021 16:19:22 +0800 [thread overview]
Message-ID: <207ca922-4223-632b-ed68-4e78e40ac3dc@linux.dev> (raw)
In-Reply-To: <YR4ckyTCiOXCRnue@infradead.org>
On 8/19/21 4:55 PM, Christoph Hellwig wrote:
> On Wed, Aug 18, 2021 at 03:37:38PM +0800, Guoqing Jiang wrote:
>> for (i = 0; i < disks; i++) {
>> struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
>> +
>> + if (test_bit(WriteMostly, &mirror->rdev->flags))
>> + write_behind = true;
> How does this condition relate to the ones used for actually calling
> alloc_behind_master_bio? It looks related, but as someone not familiar
> with the code I can't really verify if this is correct, so a comment
> explaining it might be useful.
How about this?
+ /*
+ * The write-behind io is only attempted on drives marked as
+ * write-mostly, which means we will allocate write behind
+ * bio later.
+ */
if (test_bit(WriteMostly, &mirror->rdev->flags))
write_behind = true;
>> + /*
>> + * When using a bitmap, we may call alloc_behind_master_bio below.
>> + * alloc_behind_master_bio allocates a copy of the data payload a page
>> + * at a time and thus needs a new bio that can fit the whole payload
>> + * this bio in page sized chunks.
>> + */
>> + if (write_behind && bitmap)
>> + max_sectors = min_t(int, max_sectors, BIO_MAX_VECS * PAGE_SECTORS);
> Overly long line here.
I can change it given you still prefer the limitation is 80 characters.
Thanks,
Guoqing
next prev parent reply other threads:[~2021-08-20 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 7:37 [PATCH V2] raid1: ensure write behind bio has less than BIO_MAX_VECS sectors Guoqing Jiang
2021-08-18 7:57 ` Guoqing Jiang
2021-08-18 11:03 ` kernel test robot
2021-08-18 12:02 ` kernel test robot
2021-08-19 8:55 ` Christoph Hellwig
2021-08-20 8:19 ` Guoqing Jiang [this message]
2021-08-23 6:50 ` Christoph Hellwig
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=207ca922-4223-632b-ed68-4e78e40ac3dc@linux.dev \
--to=guoqing.jiang@linux.dev \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).