From: John Garry <john.g.garry@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>,
Andreas Hindborg <a.hindborg@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Oliver Mangold <oliver.mangold@pm.me>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: set bi_vcnt when cloning bio
Date: Wed, 19 Feb 2025 14:19:01 +0000 [thread overview]
Message-ID: <2c23b85e-4ec7-4554-bac8-a76e3b75d776@oracle.com> (raw)
In-Reply-To: <6c3d81f0-aee5-4619-82c4-3ce72bdce317@acm.org>
On 18/02/2025 22:21, Bart Van Assche wrote:
> On 2/18/25 9:12 AM, John Garry wrote:
>> On 18/02/2025 11:40, Andreas Hindborg wrote:
>>> But I am genuinely curious if there is a reason for not setting
>>> `bi_vcnt` during a clone.
>>
>> I think that it came from commit 59d276fe0 (with the addition of
>> bio_clone_fast()), where we assume that the cloned bio is not having
>> the bio_vec touched and so does not need to know bi_vcnt (or
>> bi_max_vecs). And it is inefficient to needlessly set bi_vcnt then.
>
> Hmm ... I prefer paying the very small performance hit caused by copying
> bi_vcnt rather than having to deal with the inconsistency caused by not
> copying that data structure member.
From my experience, setting anything which is not strictly necessary in
the fastpath code is generally not wanted.
Thanks,
John
next prev parent reply other threads:[~2025-02-19 14:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-15 10:58 Andreas Hindborg
2025-02-18 10:40 ` John Garry
2025-02-18 11:40 ` Andreas Hindborg
2025-02-18 17:12 ` John Garry
2025-02-18 18:20 ` Andreas Hindborg
2025-02-18 22:21 ` Bart Van Assche
2025-02-19 14:19 ` John Garry [this message]
2025-02-20 6:11 ` 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=2c23b85e-4ec7-4554-bac8-a76e3b75d776@oracle.com \
--to=john.g.garry@oracle.com \
--cc=a.hindborg@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.mangold@pm.me \
/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
all inboxes | Powered by JetHome®