Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3517556rdb; Wed, 13 Sep 2023 14:46:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFujIzL4BbFjBCyICDW8WzGw6WnRWdNDzP2Sa8YcQrtH5X1V+hMd76tAfG+cHh4xI5VGLkI X-Received: by 2002:a05:6358:f484:b0:13f:e3eb:53a6 with SMTP id ku4-20020a056358f48400b0013fe3eb53a6mr2936115rwb.30.1694641609992; Wed, 13 Sep 2023 14:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694641609; cv=none; d=google.com; s=arc-20160816; b=hQf68z+aKF92HT5Z7ZKlpmr7XFf+e3ofn/rlie2chBQQWwHCaT5bdGbSDRpL7saB9z 0MLeAaabTaHconcRUBmMrtw9mvzkslUBQdecS8SiKOmbYb8F04mTVJNnA/zR7T+wewR6 4YgmirE7/aF/UjJEtn1rWAIhS6iK+IJ1fAK4gcLXVKfp1+lTLp8G1gWH9LaUl2P51/UI aSQolWm697Gj91jf3TuLaiSUmd0Ps2dHxqfkBaKxmxjEN90X4rIhW4quAfZaf8mRbSkz lbMOHAFpJgdrKPeX9WJLecifEULoQ0hs3jsztQnVjnvExmuv/mmNqNnWHV436pNDp6jb KdAA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=qRz9tPhMotdbCCNrMsna8quRbeFGkC6nsVVFqUDbq5E=; fh=tm4guOj2z7vOLt+F609UXFCXB+33+auHitvZWdG41Mo=; b=KIPQNP/zS4vkD65N457J6lRRfa/iO2McieB44qwv+24SKMJoim98HhdAB5K5b1KcwL NiIC0lkZzYHk4Zk2OI22r9zOpgQGbZBDGm0cvc7tbMb45R4Z8pztOsFd4YnHf2xbCBi8 0Lye2SyIZMBMERewP8b19/7tA8Lnnn764pRJiXBvpEAXw8s5D/HPKGos4WAiYp5Xr0jN H/Tpqjxfl9mV5dxWZouhKNt8qTIExZgPSEEjYVy0JRYmY82YegbmPbLaHKbDlmvNMVXZ ag44KYDIfcA/ublxMYtp+jo4gI/6DbXEjB1hd3EjCVz0ntyi9TzkqBxSs5AYCjj2fsAi p4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Kzf9uz3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f27-20020a63101b000000b00573fd72dcf8si11662pgl.550.2023.09.13.14.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Kzf9uz3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4C382801D49A; Wed, 13 Sep 2023 00:19:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238572AbjIMHT2 (ORCPT + 99 others); Wed, 13 Sep 2023 03:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238575AbjIMHT1 (ORCPT ); Wed, 13 Sep 2023 03:19:27 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D7621986 for ; Wed, 13 Sep 2023 00:19:23 -0700 (PDT) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id A478A66072BB; Wed, 13 Sep 2023 08:19:21 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694589562; bh=qRz9tPhMotdbCCNrMsna8quRbeFGkC6nsVVFqUDbq5E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Kzf9uz3R9ZeHfByQCDLX+j6OfkcOmaGBKFw8y+VeZTyNV819pX+DinMWSGl+wOIaL 9jOTZ637ZmNnITFEYNr2HukkhIXs8zsfd4jYhICL2260ACg9Wi20LQ44Nr9eWFlZu3 4JbeWHUPWFUaKM84K2A+GTGEf2G1aqzXhprOVqoGjzgT84xiLs4KZPYkCVp4Tr+4YS pBjOvrH7q61KvUrjRDa9sXgobr/IyAt8/e0W0mY7Eo7BwhpchRaLqXLJZ3ar3YxrSR 6z4NHprWHg56Wy7gP46fAhFdzf7BoxIsI4thnwGjr4FjY4TfUfTrcU+ntlNi/jvfNA P0dJv7jKQk6fA== Date: Wed, 13 Sep 2023 09:19:18 +0200 From: Boris Brezillon To: Dave Airlie Cc: Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Danilo Krummrich , daniel@ffwll.ch, matthew.brost@intel.com, sarah.walker@imgtec.com, donald.robson@imgtec.com, christian.koenig@amd.com, faith.ekstrand@collabora.com, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation Message-ID: <20230913091918.62c06a30@collabora.com> In-Reply-To: References: <20230909153125.30032-1-dakr@redhat.com> <20230909153125.30032-7-dakr@redhat.com> <20230913090311.5eeb026a@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 00:19:33 -0700 (PDT) On Wed, 13 Sep 2023 17:05:42 +1000 Dave Airlie wrote: > On Wed, 13 Sept 2023 at 17:03, Boris Brezillon > wrote: > > > > On Tue, 12 Sep 2023 18:20:32 +0200 > > Thomas Hellstr=C3=B6m wrote: > > =20 > > > > +/** > > > > + * get_next_vm_bo_from_list() - get the next vm_bo element > > > > + * @__gpuvm: The GPU VM > > > > + * @__list_name: The name of the list we're iterating on > > > > + * @__local_list: A pointer to the local list used to store alread= y iterated items > > > > + * @__prev_vm_bo: The previous element we got from drm_gpuvm_get_n= ext_cached_vm_bo() > > > > + * > > > > + * This helper is here to provide lockless list iteration. Lockles= s as in, the > > > > + * iterator releases the lock immediately after picking the first = element from > > > > + * the list, so list insertion deletion can happen concurrently. = =20 > > > > > > Are the list spinlocks needed for that async state update from within > > > the dma-fence critical section we've discussed previously? =20 > > > > Any driver calling _[un]link() from its drm_gpu_scheduler::run_job() > > hook will be in this situation (Panthor at the moment, PowerVR soon). I > > get that Xe and Nouveau don't need that because they update the VM > > state early (in the ioctl path), but I keep thinking this will hurt us > > if we don't think it through from the beginning, because once you've > > set this logic to depend only on resv locks, it will be pretty hard to > > get back to a solution which lets synchronous VM_BINDs take precedence > > on asynchronous request, and, with vkQueueBindSparse() passing external > > deps (plus the fact the VM_BIND queue might be pretty deep), it can > > take a long time to get your synchronous VM_BIND executed... =20 >=20 > btw what is the use case for this? do we have actual vulkan > applications we know will have problems here? I don't, but I think that's a concern Faith raised at some point (dates back from when I was reading threads describing how VM_BIND on i915 should work, and I was clearly discovering this whole VM_BIND thing at that time, so maybe I misunderstood). >=20 > it feels like a bit of premature optimisation, but maybe we have use case= s. Might be, but that's the sort of thing that would put us in a corner if we don't have a plan for when the needs arise. Besides, if we don't want to support that case because it's too complicated, I'd recommend dropping all the drm_gpuvm APIs that let people think this mode is valid/supported (map/remap/unmap hooks in drm_gpuvm_ops, drm_gpuvm_sm_[un]map helpers, etc). Keeping them around just adds to the confusion.