Skip to content

Commit

Permalink
drm/nouveau/kms/nv04: use vzalloc for nv04_display
Browse files Browse the repository at this point in the history
The struct is giant, and triggers an order-7 allocation (512K). There is
no reason for this to be kmalloc-type memory, so switch to vmalloc. This
should help loading nouveau on low-memory and/or long-running systems.

Reported-by: Nathan E. Egge <[email protected]>
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: [email protected]
Signed-off-by: Ben Skeggs <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Signed-off-by: Karol Herbst <[email protected]>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10
  • Loading branch information
imirkin authored and karolherbst committed Nov 12, 2021
1 parent 5d96a01 commit bd6e07e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/dispnv04/disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ nv04_display_destroy(struct drm_device *dev)
nvif_notify_dtor(&disp->flip);

nouveau_display(dev)->priv = NULL;
kfree(disp);
vfree(disp);

nvif_object_unmap(&drm->client.device.object);
}
Expand All @@ -223,7 +223,7 @@ nv04_display_create(struct drm_device *dev)
struct nv04_display *disp;
int i, ret;

disp = kzalloc(sizeof(*disp), GFP_KERNEL);
disp = vzalloc(sizeof(*disp));
if (!disp)
return -ENOMEM;

Expand Down

0 comments on commit bd6e07e

Please sign in to comment.