Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1163185lqa; Sun, 28 Apr 2024 23:03:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRIKRNvmAkBLqOx4sAiZQcwlFD1Dai2s3WEGyz0RWymDo5AAtS7Dnz7wyn0RcL/I2eAP0I7fRwlpR2JmB84TuwbpAVUGuqh9TjO58DQA== X-Google-Smtp-Source: AGHT+IGFoMzeXYnk4tdrMoCGg9a+U2K+qJaGP9kJrB8jSo20AffeTt4+WnzttUvYcf0V+c7+DGKJ X-Received: by 2002:a05:6a00:17a2:b0:6ed:825b:30c0 with SMTP id s34-20020a056a0017a200b006ed825b30c0mr9133664pfg.15.1714370605946; Sun, 28 Apr 2024 23:03:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714370605; cv=pass; d=google.com; s=arc-20160816; b=sCbNjKe9KyBdexNR/Jc9q3W3wARh4nE4VENT4dYKk5/nwGuZ/7hq/0waANYPO6zmdr FIDKw8oOWh+SwZiH1dFxcVVKK2m5+np8n/yRxW98Q2KWwPSNef/7Ut8Db/59QnMoqGGl Wi8XkoE9v1fKC1xFMkwTHNxzkJmdsKquiqsjJgHMNeriOVeFhlY+2OME15p9gFbckyPE srlvZPar7ltz/5rjpQDRmsz7yWOUwTYT4EYMyeKN6w2C1Ktey0bzNW7fxoD+52xgpOLD FSP4yf8rrJimLl1e5DK2kioxKg+vZWbQFIOCGGybXtgLmB7hnPOVXDvYjBsOKM4Ls73v WTdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=kiriSi9cv3OVBgriCchZMDK+rQMOClWkLptGCJ8G+44=; fh=mMjjy4l2d0FGC4UICRo+LqR10JvIeBaeLW2a1E7c+p8=; b=L8g+zdkLWtPwU10XcsZ5+hZvY0J7qbKigUr4QFnFVrJf0PjxR7+gIVQGY6tQaODrGz +q2d3KJZ/SVPGATnOkZlEPjPF4Nmh2wyUUuu82/O0Auap2mhDaxMkoKsxEfdPlj9NKkr vTYx70/t2NlY1Jitk7XokwI7QqTF1LbJ+sKTYcumAJVxCqWcCRL6THflW8mx3rJ2SGF2 KmWKmSORnXjPdHF7CHHRHm2FPU07gMGrZxaJOrEyP3lvcK9pZELGSSanSeqe3Ih7ShkG V+Bu8ogOVOnSh+Ga5pdRkeCE8lZLntKchBVdzCL1dg0pVBwa9peysBp3FXTqTRdM33lE rX1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WeLqWciu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s3-20020a62e703000000b006ed26c096b0si19263456pfh.141.2024.04.28.23.03.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 23:03:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WeLqWciu; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161766-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9805A281C5A for ; Mon, 29 Apr 2024 06:03:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 582ADF516; Mon, 29 Apr 2024 06:03:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WeLqWciu" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02B21DF5C for ; Mon, 29 Apr 2024 06:03:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714370599; cv=none; b=o51IPxkLbg03vGOn+lu2IM3Foalu8w0SOl6RqG2TBKOt8C1qaL6mjFeLOrGxb1PB1ktmPMUPyYaoG4vTvSGBrjlcVqf6vjKSANumt5VFjjqLO8MtYiACPCfDxjZjKPX3sfSAc+8N5bLKCkNSLL0sc9ZAykp3MriQ6OCKRWoPY9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714370599; c=relaxed/simple; bh=2DofV/GMsnnUHL4mzuDfPae85RQ6/uyefceuooWK8as=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GLJNMZG1/Qx7GVHEDI8zm3gBr9jFrqDJXLr/u3vmlkUb3M7dkwYmliw7x4bKLgakKqwf2OPTM6TlO4RPBgdf34gNsf8Ba5Qc7/o/MD3GPQ6Q+IAeQQxjdSPtAJRS17BEbOq4wIL5I+XeHjfJ0y+/eFDLrYzEhohnoBNabcDjwpU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WeLqWciu; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a5872b74c44so438415966b.3 for ; Sun, 28 Apr 2024 23:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714370596; x=1714975396; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kiriSi9cv3OVBgriCchZMDK+rQMOClWkLptGCJ8G+44=; b=WeLqWciuUqKsxzcxbyI4hiE4i/vWez9+EqdmwYu+2nyxzQYwObSSM8SzCxl6R5ZsT7 pRo/QXgHFJYFfszJIo9seHOkAG/MXx88GnPhiVkJ5f/D1sy+qeNJxBuqncFXkWCneYGW MSMVCsI+SpucoGQuWeQYpJXGH7U3dKCYOsb2pYDgZcy/rHozBRou8bXE218TUBwhR6eb Wm4NedoNKs0dhcHs8RcsjNE1Xjx+SJHeu7TVVV6srEsRygUQqc1hHpAgPp7Csl4Ea/fR a4kxqthP93rJzGuVcVKNNpiTwG5zZMe4oruoQWI9Wx2MfooudyrBgSkqV4M3ZP22D3BF dREw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714370596; x=1714975396; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kiriSi9cv3OVBgriCchZMDK+rQMOClWkLptGCJ8G+44=; b=oR9q64JR8NnvV4OapH8hQFOOCcyYvw9SjpIRhsW+Efy5Rmv2kuOun5cJB7JikeUwjo S8kMJT6JsQ/pa1YDMC4VR9/Y+24+RVYyT50NKxHnmJEaCeIwCsOpvv3RIFgGRqAUif2u NCR0uwU58LYb+om9XUmQcBYdCOwUJjfe3RN4uVgu0EygXw0uGiryoc8RfmU4kv/WYKFP 5Q9gjSVWmsRkTvgZW0aQXmyZw5UrzhXvheYqt2t1lvX5oF6DBsRJxD0Teh7QiQGU2D0N CLXuafcj6gEZMS7VFK515BGRSrmwNG+EAJKPUChVLDnBs9s3HbP6FYGrFg40/JBtlpsQ nvuQ== X-Forwarded-Encrypted: i=1; AJvYcCX+RoDg32fmXstq7GOsUmFoPk4PQifWHGKxnUBa8h15tQcTpSsraVG0gttQDSVbEuOwa01zit+/H4SJWDL20/XHMu5a1iyuGo5zbwtm X-Gm-Message-State: AOJu0YxXGJ+nnvwJij96WZ7q8Q7tCXHGV46S2T4AYjZb6WkzjsvbVYqf ajPt4riMYLl6JAAV/uyuYNZuYpW+3hdsa7HOpZO46ZfyzQuGZ5HirnFekGp3hAYmlh6LiuCkXBH n3cXibckfc47TUpcmkutA/hy/w6U= X-Received: by 2002:a17:906:a8b:b0:a58:ff45:415f with SMTP id y11-20020a1709060a8b00b00a58ff45415fmr1464926ejf.44.1714370596063; Sun, 28 Apr 2024 23:03:16 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240426154138.64643-1-lyude@redhat.com> <20240426154138.64643-2-lyude@redhat.com> In-Reply-To: <20240426154138.64643-2-lyude@redhat.com> From: Dave Airlie Date: Mon, 29 Apr 2024 16:03:03 +1000 Message-ID: Subject: Re: [PATCH 2/2] drm/nouveau/gsp: Use the sg allocator for level 2 of radix3 To: Lyude Paul Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Karol Herbst , Danilo Krummrich , Daniel Vetter , Dave Airlie , Ben Skeggs , Timur Tabi , Dan Carpenter , open list Content-Type: text/plain; charset="UTF-8" > Currently, this can result in runtime PM issues on systems where memory > Luckily, we don't actually need to allocate coherent memory for the page > table thanks to being able to pass the GPU a radix3 page table for > suspend/resume data. So, let's rewrite nvkm_gsp_radix3_sg() to use the sg > allocator for level 2. We continue using coherent allocations for lvl0 and > 1, since they only take a single page. > > Signed-off-by: Lyude Paul > Cc: stable@vger.kernel.org > --- > .../gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 4 +- > .../gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 71 ++++++++++++------- > 2 files changed, 47 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > index 6f5d376d8fcc1..a11d16a16c3b2 100644 > --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h > @@ -15,7 +15,9 @@ struct nvkm_gsp_mem { > }; > > struct nvkm_gsp_radix3 { > - struct nvkm_gsp_mem mem[3]; > + struct nvkm_gsp_mem lvl0; > + struct nvkm_gsp_mem lvl1; > + struct sg_table lvl2; This looks great, could we go a step further and combine lvl0 and lvl1 into a 2 page allocation, I thought we could combine lvl0/lvl1 into a 2 page alloc, but that actually might be a bad idea under memory pressure. Dave.