提交 fa07fcff 编写于 作者: I Ilia Mirkin 提交者: Zheng Zengkai

drm/nouveau/kms/nv04: use vzalloc for nv04_display

stable inclusion
from stable-v5.10.94
commit 8cbbf4a6f1acdf0f392694ebc719b584a40400f6
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8cbbf4a6f1acdf0f392694ebc719b584a40400f6

--------------------------------

commit bd6e07e7 upstream.

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: NNathan E. Egge <unlord@xiph.org>
Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
Reviewed-by: NKarol Herbst <kherbst@redhat.com>
Signed-off-by: NKarol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 cfcab790
...@@ -205,7 +205,7 @@ nv04_display_destroy(struct drm_device *dev) ...@@ -205,7 +205,7 @@ nv04_display_destroy(struct drm_device *dev)
nvif_notify_dtor(&disp->flip); nvif_notify_dtor(&disp->flip);
nouveau_display(dev)->priv = NULL; nouveau_display(dev)->priv = NULL;
kfree(disp); vfree(disp);
nvif_object_unmap(&drm->client.device.object); nvif_object_unmap(&drm->client.device.object);
} }
...@@ -223,7 +223,7 @@ nv04_display_create(struct drm_device *dev) ...@@ -223,7 +223,7 @@ nv04_display_create(struct drm_device *dev)
struct nv04_display *disp; struct nv04_display *disp;
int i, ret; int i, ret;
disp = kzalloc(sizeof(*disp), GFP_KERNEL); disp = vzalloc(sizeof(*disp));
if (!disp) if (!disp)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册