Eric Biggers 241f01fbed 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/20161229193445.1913-1-ebiggers3@gmail.com
Signed-off-by: Eric Biggers <ebiggers@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-10 16:32:30 -07:00
..
2017-05-05 15:24:52 -04:00
2017-07-09 14:40:12 -07:00
2017-05-12 15:57:15 -07:00
2017-06-14 19:37:23 +02:00
2017-07-06 16:24:35 -07:00
2017-07-07 20:09:10 -04:00
2017-07-03 09:55:26 -07:00
2017-07-05 17:09:27 -07:00
2017-06-27 17:02:36 -07:00
2017-07-10 10:51:53 -07:00
2017-04-17 12:52:27 -04:00
2017-07-07 19:38:17 -07:00
2017-07-07 13:48:18 -07:00
2017-07-10 10:51:53 -07:00
2016-12-14 23:48:11 -05:00
2017-06-22 11:44:55 -04:00
2017-05-08 17:15:12 -07:00
2017-06-09 16:28:01 -04:00
2017-07-05 18:44:23 -04:00