From: Jens Axboe <axboe@kernel.dk>
To: Pankaj Raghav <p.raghav@samsung.com>,
Bart Van Assche <bvanassche@acm.org>
Cc: hch@lst.de, gost.dev@samsung.com, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: shift with PAGE_SHIFT instead of dividing with PAGE_SIZE
Date: Wed, 22 Feb 2023 09:49:35 -0700 [thread overview]
Message-ID: <f8aa172e-3c21-320e-36ef-7e48fc52ab29@kernel.dk> (raw)
In-Reply-To: <299c512b-06d6-cd79-9193-936bcabd2d69@samsung.com>
On 2/22/23 9:25 AM, Pankaj Raghav wrote:
>
> On 2023-02-22 20:57, Bart Van Assche wrote:
>> On 2/22/23 06:34, Pankaj Raghav wrote:
>>> No functional change. Division will be costly, especially in the hot
>>> path (page_is_mergeable() and bio_copy_user_iov())
>>
>> Although the change looks fine to me, is there any compiler for which this
>> patch makes a difference? I would expect that a compiler performs this
>> optimization even without this patch.
>>
>
> I didn't notice any for x86_64. But I was thinking this also as a way to
> maintain consistency across block code where we do a shift with PAGE_SHIFT
> instead of dividing with PAGE_SIZE.
It won't make a difference on any architecture, it'd be a pretty
awful compiler that didn't turn a division by a constant power-of-2
into a shift.
--
Jens Axboe
next prev parent reply other threads:[~2023-02-22 16:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230222143450eucas1p1a63ff021e0aba16184197ac386c5a3c5@eucas1p1.samsung.com>
2023-02-22 14:34 ` [PATCH] block: shift with PAGE_SHIFT instead of dividing with PAGE_SIZE Pankaj Raghav
2023-02-22 15:27 ` Bart Van Assche
2023-02-22 16:25 ` Pankaj Raghav
2023-02-22 16:49 ` Jens Axboe [this message]
2023-02-22 22:10 ` Chaitanya Kulkarni
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=f8aa172e-3c21-320e-36ef-7e48fc52ab29@kernel.dk \
--to=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=p.raghav@samsung.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