* [Nouveau] [PATCH] drm/nouveau/kms/nv04: use vzalloc for nv04_display
@ 2021-03-07 17:48 ` Ilia Mirkin
0 siblings, 0 replies; 4+ messages in thread
From: Ilia Mirkin @ 2021-03-07 17:48 UTC (permalink / raw)
To: bskeggs; +Cc: Nathan E . Egge, nouveau, dri-devel
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 <unlord@xiph.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
index 7739f46470d3..99fee4d8cd31 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
@@ -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);
}
@@ -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;
--
2.26.2
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/nouveau/kms/nv04: use vzalloc for nv04_display
@ 2021-03-07 17:48 ` Ilia Mirkin
0 siblings, 0 replies; 4+ messages in thread
From: Ilia Mirkin @ 2021-03-07 17:48 UTC (permalink / raw)
To: bskeggs; +Cc: Nathan E . Egge, nouveau, dri-devel
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 <unlord@xiph.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
index 7739f46470d3..99fee4d8cd31 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
@@ -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);
}
@@ -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;
--
2.26.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau/kms/nv04: use vzalloc for nv04_display
2021-03-07 17:48 ` Ilia Mirkin
@ 2021-03-24 23:33 ` Ben Skeggs
-1 siblings, 0 replies; 4+ messages in thread
From: Ben Skeggs @ 2021-03-24 23:33 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: ML nouveau, ML dri-devel, Ben Skeggs, Nathan E . Egge
On Mon, 8 Mar 2021 at 03:49, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>
> 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 <unlord@xiph.org>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> Cc: stable@vger.kernel.org
Thanks!
> ---
> drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> index 7739f46470d3..99fee4d8cd31 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> @@ -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);
> }
> @@ -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;
>
> --
> 2.26.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau/kms/nv04: use vzalloc for nv04_display
@ 2021-03-24 23:33 ` Ben Skeggs
0 siblings, 0 replies; 4+ messages in thread
From: Ben Skeggs @ 2021-03-24 23:33 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: ML nouveau, ML dri-devel, Ben Skeggs, Nathan E . Egge
On Mon, 8 Mar 2021 at 03:49, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>
> 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 <unlord@xiph.org>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> Cc: stable@vger.kernel.org
Thanks!
> ---
> drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> index 7739f46470d3..99fee4d8cd31 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> @@ -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);
> }
> @@ -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;
>
> --
> 2.26.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-24 23:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 17:48 [Nouveau] [PATCH] drm/nouveau/kms/nv04: use vzalloc for nv04_display Ilia Mirkin
2021-03-07 17:48 ` Ilia Mirkin
2021-03-24 23:33 ` [Nouveau] " Ben Skeggs
2021-03-24 23:33 ` Ben Skeggs
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.