OSDN Git Service

dma-buf: Expand reservation_list to fill allocation
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 12 Jul 2019 08:03:13 +0000 (09:03 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jul 2019 11:08:05 +0000 (12:08 +0100)
commit94eb1e10a34d3c7fc42208faaa4954fe482ac091
tree32dae2f49424d4c6fbcd9bb9111edf9ec9a5e4f0
parent913cafbb250f146654ea979186d8615e0c54d6a7
dma-buf: Expand reservation_list to fill allocation

Since kmalloc() will round up the allocation to the next slab size or
page, it will normally return a pointer to a memory block bigger than we
asked for. We can query for the actual size of the allocated block using
ksize() and expand our variable size reservation_list to take advantage
of that extra space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190712080314.21018-1-chris@chris-wilson.co.uk
drivers/dma-buf/reservation.c