Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3610433pxb; Mon, 24 Jan 2022 13:28:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqRBx8mLBMgHhpXkYxFmL5AIBWOemO3agllhykyypVf5Kdhqu/0Sepv7L2JmHXE6G3vIlK X-Received: by 2002:a17:90a:7044:: with SMTP id f62mr199979pjk.246.1643059724722; Mon, 24 Jan 2022 13:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059724; cv=none; d=google.com; s=arc-20160816; b=nRZYHjjLxW9Pwimnv8sQd7agKvfE3uFKZwtEzssKxsYBv+UflYEWWD9YVmRaG7yG/g 1s7v1lCigcAeWUNWHmuC/M8LXNWqF8eYMj6Vgz2HifPJROBl/1GLc3VEG4A2/CjZAVjD kK/hzPJoFkyQEIhv6iopqPxiXq0cDYESqVcz5DrRpv9M8sMy8FBTrGwgP1AyqLvYvDRq dIHU/sDrMGQLRfrHFDTvlUxydydDvg4HhLEm3+vlvaC7gDssziSst8g58If+4S6jU7Ij 9RDufGMl2Ago+AZcxlrgLEj6I178o8m3lSMGXDmRM+RsYWf4VF7HUCWtAARHpdfussMA DT+A== 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=ESO8xG5+dtAaO334pD0Fd4sRQmEEG1iIOV4den+D9ssDBIttbLcSos5mpmyjEftOAT 28ysTU0k4ioaZG0djF5+ByH4+XEwhvNP09VgGWEgvIhH6yvsXkA6+PGAiQLJHv7T9bVN Mtuv8R9rui59hc0WT8Tq5Q2v/ohQMIFQOiDOdiIvpNAVAbsenbTdtj+f1i56btl+vkk6 gDHW8Q4rY05RCVBK+Hx+FN/X+h3c/GZ48Kv8QmbQ0/eJQMJL57MlQkxqesIY1RiR9gef gy0AUXGEjeKUwq9ahw0hJQ+C9Q0crxYBD2tyHSre+LYODE13E6iJR8EeISyM8rvpM3sE GpCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fBI9oJzX; 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 u31si3868784pfg.208.2022.01.24.13.28.31; Mon, 24 Jan 2022 13:28:44 -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=fBI9oJzX; 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 S1354265AbiAXVGn (ORCPT + 99 others); Mon, 24 Jan 2022 16:06:43 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:40144 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351903AbiAXUoe (ORCPT ); Mon, 24 Jan 2022 15:44:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0CE0D60B0B; Mon, 24 Jan 2022 20:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3E7C340E5; Mon, 24 Jan 2022 20:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057072; bh=xI5hEJ3lhDIHA1QI9owRidjMV8Rm3Aur9/+X8usPUKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBI9oJzXdsIXDh561HNCaOpqcQ+uhLx++H4fuSwtnDdX8cXr0OR2/E7S+KMMaucAC NLl4DuesPRYkxbNwUUp8h8nGOtDfw93C0rE0DTAMPwbPV5DuBZmfVXn1IdB4dLhuTj +IHAtqkjAEnuRru4cNHi0RnN6uA1EoOx8FJZXya4= 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.15 693/846] drm/nouveau/kms/nv04: use vzalloc for nv04_display Date: Mon, 24 Jan 2022 19:43:30 +0100 Message-Id: <20220124184124.950008539@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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;