]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/virtio: use kvmalloc for large allocations
authorSergey Senozhatsky <senozhatsky@chromium.org>
Thu, 5 Nov 2020 01:47:44 +0000 (10:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 10:27:41 +0000 (11:27 +0100)
commit676c8e5a1bf448b4c11cb1e57ddfe2c70253f1d7
tree605fd3c43c8e0f200d76319955ce59e7541d22d9
parent37932e2690bf2f78452f69e348fd9f0f388844bc
drm/virtio: use kvmalloc for large allocations

commit ea86f3defd55f141a44146e66cbf8ffb683d60da upstream.

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>
Link: http://patchwork.freedesktop.org/patch/msgid/20201105014744.1662226-1-senozhatsky@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Doug Horn <doughorn@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/virtio/virtgpu_vq.c