linux-brain/include
Michel Lespinasse 9f973cb380 lib/rbtree: avoid generating code twice for the cached versions
As was already noted in rbtree.h, the logic to cache rb_first (or
rb_last) can easily be implemented externally to the core rbtree api.

Change the implementation to do just that.  Previously the update of
rb_leftmost was wired deeper into the implmentation, but there were some
disadvantages to that - mostly, lib/rbtree.c had separate instantiations
for rb_insert_color() vs rb_insert_color_cached(), as well as rb_erase()
vs rb_erase_cached(), which were doing exactly the same thing save for
the rb_leftmost update at the start of either function.

   text	   data	    bss	    dec	    hex	filename
   5405	    120	      0	   5525	   1595	lib/rbtree.o-vanilla
   3827	     96	      0	   3923	    f53	lib/rbtree.o-patch

[dave@stgolabs.net: changelog addition]
  Link: http://lkml.kernel.org/r/20190628171416.by5gdizl3rcxk5h5@linux-r8p5
[akpm@linux-foundation.org: coding-style fixes]
Link: http://lkml.kernel.org/r/20190628045008.39926-1-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-16 19:23:22 -07:00
..
acpi It's been a relatively busy cycle for docs: 2019-07-09 12:34:26 -07:00
asm-generic asm-generic: fix a compilation warning 2019-07-16 19:23:22 -07:00
clocksource clocksource/drivers: Continue making Hyper-V clocksource ISA agnostic 2019-07-03 11:00:59 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
drm drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
dt-bindings Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-07-11 10:55:49 -07:00
keys request_key improvements 2019-07-08 19:19:37 -07:00
kvm KVM: arm/arm64: Support chained PMU counters 2019-07-05 13:56:22 +01:00
linux lib/rbtree: avoid generating code twice for the cached versions 2019-07-16 19:23:22 -07:00
math-emu
media media updates for v5.3-rc1 2019-07-09 09:47:22 -07:00
memory
misc powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
net net: sched: Fix NULL-pointer dereference in tc_indr_block_ing_cmd() 2019-07-12 15:21:53 -07:00
pcmcia It's been a relatively busy cycle for docs: 2019-07-09 12:34:26 -07:00
ras
rdma RDMA/core: Make rdma_counter.h compile stand alone 2019-07-09 09:44:47 -03:00
scsi SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
soc
sound ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
target
trace f2fs-for-5.3-rc1 2019-07-12 17:28:24 -07:00
uapi mm: fix the MAP_UNINITIALIZED flag 2019-07-16 19:23:21 -07:00
vdso vdso: Remove superfluous #ifdef __KERNEL__ in vdso/datapage.h 2019-06-26 07:28:09 +02:00
video drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
xen
Kbuild kbuild: compile-test kernel headers to ensure they are self-contained 2019-07-09 21:44:37 +09:00