Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3171445rdb; Wed, 13 Sep 2023 04:32:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUe51qSDXyisvJhWElXY9amHCelv+weMLWE0uQINg3UUXwlKbcrJGqROamC0z5X3xrUOsQ X-Received: by 2002:a17:90b:3691:b0:268:1745:b61 with SMTP id mj17-20020a17090b369100b0026817450b61mr1817612pjb.34.1694604767072; Wed, 13 Sep 2023 04:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694604767; cv=none; d=google.com; s=arc-20160816; b=POt0A70df+QWUzuhRXNCXvCJ8heUl3ZnHI7hSQgpYFylWzXrHikb9GjQstznOj9T2r 6wDuXmUoVHrO6fCsoN3EEfF/UhNb7tNlI0Yj2Tw+hwqv63qJCp4ul1Mc4WcZ1sO1YXwz iNV57fUYKkPRrv0F7smPIv2lSFL3LnMdHqmv7u9RsZIAGQF70Q5O20xAPQEIpgjC+R8u fB1bfod4+U7l4GyjHbl7pSg0ijs/QP9fVGQDYCfDogjTvfcbTW1wdc4EcKr2BF//UtOu 738TW5+dBPw/o2oghr0waBkXt/ZzU1i7xuEWE+c+KLhj9j7bdThMdws08upMV5WNPJ+o q//w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ARucV4SPV6o29NZnTlh9kC1XvI7Cu6efHFTCveAgcl0=; fh=rjizPntEzmZaS1yCj9uOse1oDzqdoVNZUsybn0xVM60=; b=jJ1Ic7i/wSNCVynutB4wb7FTzjh7ujrY1LryRRrHUMlgnex+zCKU1zUX+fKkBeWOjU pQifJJpcp69rH9OOow8Vrum495H8+ajyRKptty26Yi6qKxIEeDz4OAPbGsmJNpe9Ag/1 kD7EIQojhPM/nDkMR4sOxssI9+2bAVkKl0GeoitnJ+bAIcr8QMQ6v1ybMJsVwa7FwrYS BVTHN9G2IBVJfjzroYlgOg5hkbdmTWw8LAg98oPY9C6IIlfi8X/N9w3XQAM0GR1nfbmq JLVn54mSgAUJ1Xxge/rjntCodXuLayHUULUPExbPzOJ9iVdL5ZjZ0tXhSl9e0BqyEiU1 mhow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NUbMkY9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bk12-20020a17090b080c00b0027000086c93si1349416pjb.102.2023.09.13.04.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NUbMkY9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5F9F78263E8A; Wed, 13 Sep 2023 00:06:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238417AbjIMHGB (ORCPT + 99 others); Wed, 13 Sep 2023 03:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238362AbjIMHGA (ORCPT ); Wed, 13 Sep 2023 03:06:00 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EADB61738 for ; Wed, 13 Sep 2023 00:05:55 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-99c93638322so133034966b.1 for ; Wed, 13 Sep 2023 00:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694588754; x=1695193554; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ARucV4SPV6o29NZnTlh9kC1XvI7Cu6efHFTCveAgcl0=; b=NUbMkY9togY3+BvTooXA+5xbDdE1THV4l0FnLyfjVR7CCbUR0E5Urqff75nzD5fko+ qxnDsAozS9g8JNqO5r5YoC2YQGCJ8qtdhvr7nd0hS+/c2j3A3Tqa12w8pwdKcJAqtqG0 6Lwf3sRRf4wvTnT67/JBlCokT2XNHATZNdthiU5e4QvZ1JfwXHOsqM9GOw1e7m2XHWn+ gB6vigffTRphZ6k2zaXFhsUrLzRdkbVdxg7enX8aUXfHn1YbY1S9dR7/NuzbREu85aEA BdkNc8q/CAD5lrFUyPb3MN1UhKT3klB7WoPPbnsZKocoMoP3Td7lK8MlP0TJAZ67bkxO lrBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694588754; x=1695193554; h=content-transfer-encoding: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=ARucV4SPV6o29NZnTlh9kC1XvI7Cu6efHFTCveAgcl0=; b=Iw5gorsmxDypEk2o8zsQOv1ZctoxNBUkWwCmnpb/0NypYCRF9VYczh3vPY07WoHjAf nYzhcZ0vKs5SKczi5qeJFBQtR0du54EIworPzdlkqr/XeERBOW6XMgrUI+S0+jBAeML+ TkdEZfs9NtGUNvlfNjZKDwW/YWO068tg5Hu8ZyBQIJ0tbzpPmoGDkiNzDDBI9wyFiYVY ZAX4/D0BK1ItfL4Igz3Ljy7PkViLIdya380kcsAOeXyaK03kpPkRote667y5Mql26Ai0 ZhZdijsvBziiE7aVpyQsoz7oS4B2HXBOlgooGTLOxalf4+RJy0pnZPn67cANU3uefy8L vT2A== X-Gm-Message-State: AOJu0YxNs6Uta6fEe9LoOzFOqhayaoZ25EQ7Pq54XGvJOEtJ/CZHYFUQ tnQUrTBPuUWaQH3RwgVhGw5boincAjcjeQ5ieeI= X-Received: by 2002:a17:907:75d7:b0:9a5:a543:2744 with SMTP id jl23-20020a17090775d700b009a5a5432744mr2313726ejc.33.1694588754097; Wed, 13 Sep 2023 00:05:54 -0700 (PDT) MIME-Version: 1.0 References: <20230909153125.30032-1-dakr@redhat.com> <20230909153125.30032-7-dakr@redhat.com> <20230913090311.5eeb026a@collabora.com> In-Reply-To: <20230913090311.5eeb026a@collabora.com> From: Dave Airlie Date: Wed, 13 Sep 2023 17:05:42 +1000 Message-ID: Subject: Re: [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation To: Boris Brezillon Cc: =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , 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 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 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 00:06:03 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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: > > > > +/** > > > + * 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 already = iterated items > > > + * @__prev_vm_bo: The previous element we got from drm_gpuvm_get_nex= t_cached_vm_bo() > > > + * > > > + * This helper is here to provide lockless list iteration. Lockless = as in, the > > > + * iterator releases the lock immediately after picking the first el= ement from > > > + * the list, so list insertion deletion can happen concurrently. > > > > Are the list spinlocks needed for that async state update from within > > the dma-fence critical section we've discussed previously? > > 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... btw what is the use case for this? do we have actual vulkan applications we know will have problems here? it feels like a bit of premature optimisation, but maybe we have use cases. Dave.