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 <pauldrynoff@xxxxxxxxx> 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.

Ray
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux