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 http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Video 4 Linux]
[Linux for the blind]