]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd: Closed hash table with low overhead (v2)
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 24 Aug 2017 23:22:32 +0000 (19:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 18:53:19 +0000 (14:53 -0400)
commit29febd58bc7f964b27979379c2ee2548c7a020c3
tree96be27e6b37d06394065da328377c6626e374c6c
parent0c5167857b7b8809715572b70666042b3fcdd293
drm/amd: Closed hash table with low overhead (v2)

This adds a statically sized closed hash table implementation with
low memory and CPU overhead. The API is inspired by kfifo.

Storing, retrieving and deleting data does not involve any dynamic
memory management, which makes it ideal for use in interrupt context.
Static memory usage per entry comprises a 32 or 64 bit hash key, two
bits for occupancy tracking and the value size stored in the table.
No list heads or pointers are needed. Therefore this data structure
should be quite cache-friendly, too.

It uses linear probing and lazy deletion. During lookups free space
is reclaimed and entries relocated to speed up future lookups.

v2: squash in do_div and _BITOPS_LONG_SHIFT fixes

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile
drivers/gpu/drm/amd/include/linux/chash.h [new file with mode: 0644]
drivers/gpu/drm/amd/lib/Kconfig [new file with mode: 0644]
drivers/gpu/drm/amd/lib/Makefile [new file with mode: 0644]
drivers/gpu/drm/amd/lib/chash.c [new file with mode: 0644]