OSDN Git Service

intel: Leak the userptr test bo
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 17 Apr 2015 10:57:28 +0000 (11:57 +0100)
committerDamien Lespiau <damien.lespiau@intel.com>
Wed, 29 Apr 2015 14:22:58 +0000 (15:22 +0100)
commit30921483c70c6939f017476eac13da6aa26b3b3c
treed47584ab03c676eea33aab35af34db095e36e373
parent9915e68b3b4d69101f3cb6609e796fb8f63320e2
intel: Leak the userptr test bo

In order to use userptr, the kernel tracks the owner's mm with a
mmu_notifier. Setting that is very expensive - it involves taking all
mm_locks and a stop_machine(). This tracking lives only for as long as
the client is using userptr objects - so if the client allocates then
frees a userptr in a loop, we will be executing that heavyweight setup
everytime. To ammoritize this cost, just leak the test bo and the single
backing page we use for detecting userptr.

v2: Free the object and memory when bufmgr is destroyed.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
intel/intel_bufmgr_gem.c