[Intel-gfx] [PATCH 0/4] Userptr bo slab use optimization
Tvrtko Ursulin
tursulin at ursulin.net
Thu Jul 27 09:05:00 UTC 2017
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Yet another attempt to get this series reviewed and merged...
I've heard Vulkan might be creating a lot of userptr objects so might be
interesting to check what benefit it brings to those use cases.
As an introduction, this allows i915 to create fewer sg table entries for the bo
backing store representation. As such it primarily saves kernel slab memory.
When we added this optimisation to normal i915 bos, the savings were as far as
I remember around 1-2MiB of slab after booting to KDE desktop, and 2-4Mib on
neverball (game) main screen (or maybe it was while playing).
So thinking is, if Vulkan is indeed using a lot of userptr bos, it should
translate to similar savings there. It is not much but the motto is that every
little helps.
On the low level the saving will be up to around 32 bytes for each 4k of an
userptr bo (1GiB of userptr bos = up to ~8MiB of slab saving), with the actual
number depending on the backing store fragmentation.
Tvrtko Ursulin (4):
lib/scatterlist: Fix offset type in sg_alloc_table_from_pages
lib/scatterlist: Avoid potential scatterlist entry overflow
lib/scatterlist: Introduce and export __sg_alloc_table_from_pages
drm/i915: Use __sg_alloc_table_from_pages for userptr allocations
drivers/gpu/drm/i915/i915_drv.h | 15 +++++
drivers/gpu/drm/i915/i915_gem.c | 6 +-
drivers/gpu/drm/i915/i915_gem_userptr.c | 79 +++++++++--------------
drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 +-
drivers/rapidio/devices/rio_mport_cdev.c | 4 +-
include/linux/scatterlist.h | 17 +++--
lib/scatterlist.c | 87 +++++++++++++++++++-------
7 files changed, 126 insertions(+), 86 deletions(-)
--
2.9.4
More information about the Intel-gfx
mailing list