diff options
author | Eric Biggers <[email protected]> | 2017-07-10 15:47:29 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2017-07-10 16:32:30 -0700 |
commit | 241f01fbeda2521f802eeef4de0261387e6e9c1d (patch) | |
tree | 1ea0ec512f4f55fe1ade4c030d6b255f85c0e41a /tools/perf/scripts/python | |
parent | 3457f4147675108aa83f9f33c136f06bb9f8518f (diff) |
fs/buffer.c: make bh_lru_install() more efficient
To install a buffer_head into the cpu's LRU queue, bh_lru_install()
would construct a new copy of the queue and then memcpy it over the real
queue. But it's easily possible to do the update in-place, which is
faster and simpler. Some work can also be skipped if the buffer_head
was already in the queue.
As a microbenchmark I timed how long it takes to run sb_getblk()
10,000,000 times alternating between BH_LRU_SIZE + 1 blocks.
Effectively, this benchmarks looking up buffer_heads that are in the
page cache but not in the LRU:
Before this patch: 1.758s
After this patch: 1.653s
This patch also removes about 350 bytes of compiled code (on x86_64),
partly due to removal of the memcpy() which was being inlined+unrolled.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions