Re: [PATCH]: block_read_full_page: micro optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 6/24/06, Paul Drynoff <[email protected]> wrote:
I wonder, may be with such change kernel become little faster?
-                               memset(kaddr + i * blocksize, 0, blocksize);
+                               memset(kaddr + (i << inode->i_blkbits), 0, blocksize);
It's likely slower with this change, as you now require the CPU to
load inode->i_blkbits which, chances are, isn't hanging around handily
in a register like blocksize obviously is. So, you've increased
register pressure and added more fetches from memory instead of just
doing a simple (and cheap) multiplication. Not good.

Check the generated code for both cases. Smaller is usually better.
Benchmarking would be best, however, code changes that cause cache
misses or register pressure can be hard to measure well.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux