1
0
Fork 0
alistair23-linux/include
Chris Wilson 077675c1e8 drm: Convert prime dma-buf <-> handle to rbtree
Currently we use a linear walk to lookup a handle and return a dma-buf,
and vice versa. A long overdue TODO task is to convert that to a
hashtable. Since the initial implementation of dma-buf/prime, we now
have resizeable hashtables we can use (and now a future task is to RCU
enable the lookup!). However, this patch opts to use an rbtree instead
to provide O(lgN) lookups (and insertion, deletion). rbtrees were chosen
over using the RCU backed resizable hashtable to firstly avoid the
reallocations (rbtrees can be embedded entirely within the parent
struct) and to favour simpler code with predictable worst case
behaviour. In simple testing, the difference between using the constant
lookup and insertion of the rhashtable and the rbtree was less than 10%
of the wall time (igt/benchmarks/prime_lookup) - both are dramatic
improvements over the existing linear lists.

v2: Favour rbtree over rhashtable

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94631
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160926204414.23222-1-chris@chris-wilson.co.uk
2016-10-04 08:23:07 +02:00
..
acpi treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
asm-generic Merge branch 'uaccess-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-09-14 09:35:05 -07:00
clocksource
crypto A number of improvements for the /dev/random driver; the most 2016-07-27 15:11:55 -07:00
drm drm: Convert prime dma-buf <-> handle to rbtree 2016-10-04 08:23:07 +02:00
dt-bindings Merge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next 2016-09-13 10:28:17 +10:00
keys
kvm KVM/ARM Changes for v4.8 - Take 2 2016-08-04 13:59:56 +02:00
linux Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
math-emu
media [media] cec: rename cec_devnode fhs_lock to just lock 2016-08-22 13:09:06 -03:00
memory
misc
net Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec 2016-09-22 02:56:23 -04:00
pcmcia
ras tracing, RAS: Cleanup on __get_str() usage 2016-07-15 15:51:16 -04:00
rdma IB/core: Use memdup_user() rather than duplicating its implementation 2016-08-23 12:40:13 -04:00
rxrpc
scsi Merge remote-tracking branch 'mkp-scsi/4.8/scsi-fixes' into fixes 2016-08-19 07:41:12 -07:00
soc ARM: SoC driver updates for v4.8 2016-08-01 18:36:01 -04:00
sound Merge tag 'drm-for-v4.8' of git://people.freedesktop.org/~airlied/linux 2016-08-01 21:44:08 -04:00
target target: Fix ordered task CHECK_CONDITION early exception handling 2016-07-20 00:58:40 -07:00
trace Luiz Capitulino noticed that the tick_stop tracepoint wasn't being parsed 2016-08-09 10:34:09 -07:00
uapi Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
video gpu: ipu-v3: Add queued image conversion support 2016-09-19 08:30:27 +02:00
xen xen: change the type of xen_vcpu_id to uint32_t 2016-08-24 18:17:27 +01:00
Kbuild