lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0862/1039] drm/nouveau/kms/nv04: use vzalloc for nv04_display
    Date
    From: Ilia Mirkin <imirkin@alum.mit.edu>

    commit bd6e07e72f37f34535bec7eebc807e5fcfe37b43 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: Nathan E. Egge <unlord@xiph.org>
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    Reviewed-by: Karol Herbst <kherbst@redhat.com>
    Signed-off-by: Karol Herbst <kherbst@redhat.com>
    Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- 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 *
    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 *d
    struct nv04_display *disp;
    int i, ret;

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


    \
     
     \ /
      Last update: 2022-01-25 04:10    [W:2.494 / U:0.920 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site