Thread (5 messages) 5 messages, 4 authors, 2023-02-22

Re: [PATCH] block: shift with PAGE_SHIFT instead of dividing with PAGE_SIZE

From: Jens Axboe <axboe@kernel.dk>
Date: 2023-02-22 16:49:42

On 2/22/23 9:25 AM, Pankaj Raghav wrote:
On 2023-02-22 20:57, Bart Van Assche wrote:
quoted
On 2/22/23 06:34, Pankaj Raghav wrote:
quoted
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help