msm: kgsl: Store process mem entries in a rbtree
The list of memory objects attached to a process gets searched quite
a lot during normal operation of the driver. For processes with a
lot of memory allocations, the linear search through the list is O(N)
and uses a lot more CPU during critical loops than it should. Change
the mem entry list to a rbtree for faster search speeds.
Change-Id: Ic0dedbad1b25d9d77f56f93696b2fe933fbad333
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl.h b/drivers/gpu/msm/kgsl.h
index 20ed808..3dafbb9 100644
--- a/drivers/gpu/msm/kgsl.h
+++ b/drivers/gpu/msm/kgsl.h
@@ -132,7 +132,7 @@
int memtype;
int flags;
void *priv_data;
- struct list_head list;
+ struct rb_node node;
uint32_t free_timestamp;
/* back pointer to private structure under whose context this
* allocation is made */