mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
BACKPORT: drm/virtio: use kvmalloc for large allocations
We observed that some of virtio_gpu_object_shmem_init() allocations can be rather costly - order 6 - which can be difficult to fulfill under memory pressure conditions. Switch to kvmalloc_array() in virtio_gpu_object_shmem_init() and let the kernel vmalloc the entries array. Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> (cherry picked from commit ea86f3defd55f141a44146e66cbf8ffb683d60da) Bug: 171450517 Test: run clash of clans game on Kled device Change-Id: I1b585177c7ebfbd95a494fc4e65150cd522517cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2519343 Reviewed-by: Suleiman Souhlal <suleiman@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: David Stevens <stevensd@chromium.org> Commit-Queue: Sergey Senozhatsky <senozhatsky@chromium.org> Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Alistair Delva <adelva@google.com>
This commit is contained in:
parent
a2e73af4e5
commit
d7505557bd
@ -1046,8 +1046,9 @@ int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev,
|
||||
}
|
||||
|
||||
/* gets freed when the ring has consumed it */
|
||||
ents = kmalloc_array(nents, sizeof(struct virtio_gpu_mem_entry),
|
||||
GFP_KERNEL);
|
||||
ents = kvmalloc_array(nents,
|
||||
sizeof(struct virtio_gpu_mem_entry),
|
||||
GFP_KERNEL);
|
||||
if (!ents) {
|
||||
DRM_ERROR("failed to allocate ent list\n");
|
||||
return -ENOMEM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user