Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972119pxb; Tue, 25 Jan 2022 00:19:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUOF3AF7xswAbOl6/ysKUVYN4kZkJYcKPd5HF4UJGS0qn8NY8nHElK4560GYn7lxP6Fb+4 X-Received: by 2002:a05:6a00:987:b0:4ca:f115:ced3 with SMTP id u7-20020a056a00098700b004caf115ced3mr579000pfg.83.1643098782354; Tue, 25 Jan 2022 00:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098782; cv=none; d=google.com; s=arc-20160816; b=ZQXRN4gAlinRCzWjcXj4dlhwgqCEZZWrc34pYUkKPpUyprpEfPUeBqGNjrTREiQb9O DrRVW0/JRDfoCbLuN/t6GlzlCAqeba0oGRuB4TsH6z4Vw72nJTQGm9hVMsDqvd2juzxW v/1Z0AdZOYMjLwb/VMV/rBhdAWHwZ2btSNMe0FDVJ1yVXOGyB8wqseQ//08ANk/r2SLw GWl3RYboM1vboQSY9OX1q/kP1TKY2q9k5LlC4oeEitBtXL7s/CehQHKLLlV70Crs+2cP FKnBdM27RvHzKGH/P52tc8q1d8lLRdJRZJ8dJF3/yBuAog/+blFmqnE1iik26dLBMuIP Yedw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aSutpYJEeTMaLhof7rgnxsZ6ACqsIC7jpS6w0fc5uVc=; b=pJBIm5eT9GSfVR6GtEQQlgUQ06PnBLXKg07Jhph03GvAA74ZEN3lVoPB+55pKpzd5X WN1H/mNayAv7Lu9j5d4pABVOzcxuL6WBJflucpH1qNOY4nwJZQGTubYz+WKqacLfyBRC 3yA0b3LSWW3s5n/7WmVz9/X46y/qT2iawVo/v998l70KKx5U36XSTaYsKvxOgrSfJ+Yi 6FPY6ivomXMmgz7Lg9RkbvlOy9sdH9vPRkEt0qLPy/5nFpt11rMN+cX9SQ4kgenrSAc7 CPdfw7N1KQCDsQ8SQ5gJQVO+vJ6bLYKtXWUJ+bFZ+grcuhqTSSrV/ZExqUC5SkT1H7Xy 47AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c9gSHT6R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si14795920pll.463.2022.01.25.00.19.30; Tue, 25 Jan 2022 00:19:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c9gSHT6R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3411282AbiAYAc4 (ORCPT + 99 others); Mon, 24 Jan 2022 19:32:56 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:48032 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455782AbiAXVgQ (ORCPT ); Mon, 24 Jan 2022 16:36:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 46D50B81233; Mon, 24 Jan 2022 21:36:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63AD5C340E4; Mon, 24 Jan 2022 21:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060173; bh=xI5hEJ3lhDIHA1QI9owRidjMV8Rm3Aur9/+X8usPUKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9gSHT6RFJqkagUTkO5V6rLHtk5AikfZPhghrWzP6PU/+q6zkiUpvw3Fl2YtFy2fK Wi4BI50lf3tvgM3C53BkJeWkTdnv4+mJSbxgeA0m7+FGbbPzwZgOfcIhF/uyr/mA8S Ly0FJeTmEDCFW+vz7lnjwSSWJHDnEMvpwg1sg+3U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Nathan E. Egge" , Ilia Mirkin , Ben Skeggs , Karol Herbst Subject: [PATCH 5.16 0862/1039] drm/nouveau/kms/nv04: use vzalloc for nv04_display Date: Mon, 24 Jan 2022 19:44:11 +0100 Message-Id: <20220124184154.268640046@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilia Mirkin 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 Signed-off-by: Ilia Mirkin Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 Signed-off-by: Greg Kroah-Hartman --- 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;