From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F3331E51FB; Mon, 8 Sep 2025 12:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757334040; cv=none; b=QaaRfigfdD/lSKpToGHoUf1zhsqgfIjBXnlrJG5RFse2qFb3RI/iL8nZBXWeu60xTRb8adaskx8d7xduhkt+J2mx5bZk4pgYSByUwufFFNcoRBBuJhamRCg/K1DFuEQo5O2837ugB/XvsXqzgRdVql5KevnvgdHzboE8Piztdd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757334040; c=relaxed/simple; bh=MQo3B3xE2J4C5YV7vElpRMlKdfQxIsL88C+y00Of4+8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qqaJ1Eo79QnxcBVPkkSYpC0ey2qi9qdbxVo9hqizjwgscxxN+lTJhKJOfsUiZ5TvmAhKvXHDNKIPoh1yJQG3kV7AzmXb2mLYtjkpRJSaRxuXrtqrqYAklLEo/Su89QEtrAQOK8qTCOt8PcavrWdBihBSoOrU7mIMEZZBjcmpu9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r/4XPl0G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r/4XPl0G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F356C4CEF1; Mon, 8 Sep 2025 12:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757334040; bh=MQo3B3xE2J4C5YV7vElpRMlKdfQxIsL88C+y00Of4+8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=r/4XPl0GYAWlfqhdbB985JBAGviphT2ad3keuexy0YcdL0QHKSGRFk+e0/0SxfvpN kkZjHjr2OlGe4afVhWrU3fYSOcoilCKTHSXwvTFzY4RybxPUpEdf/MbAy4/dj9zrd2 39Nq+y52Qd92QWCsAic348DIwvrUpy57UaaQFzGXvAggLPQO3yCc4vi+gZ2ryV6KhJ ZWj2V/z1P4jKD1dNZSGVUEGg8SHdic/VHMlxaLQIL/ddrLCWueHPx0fYta/VL4q85Y nnNa435SG5pXsx2UwsFF2ciyLprv0k1QFHcgAbimegJzU08iH8r9h6MIDaWbRilw5h BhmSwT7egKKaQ== Message-ID: <7aa3f464-a3d0-47a0-b044-d8db93f45918@kernel.org> Date: Mon, 8 Sep 2025 14:20:35 +0200 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] drm/gpuvm: add deferred vm_bo cleanup To: Boris Brezillon Cc: Alice Ryhl , Matthew Brost , =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Steven Price , Daniel Almeida , Liviu Dudau , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org References: <20250905-vmbo-defer-v1-0-7ae1a382b674@google.com> <20250905-vmbo-defer-v1-1-7ae1a382b674@google.com> <20250905152505.005a610d@fedora> <20250908091140.44856fde@fedora> <20250908122002.2c80dd3a@fedora> <20250908141156.3dbdea0b@fedora> From: Danilo Krummrich Content-Language: en-US In-Reply-To: <20250908141156.3dbdea0b@fedora> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/8/25 2:11 PM, Boris Brezillon wrote: > On Mon, 08 Sep 2025 13:11:32 +0200 > "Danilo Krummrich" wrote: >> I'm saying exactly what you say: "has to be a special unlink function" -> >> drm_gpuva_unlink_defer_put(). :) > > I don't see how calling drm_gpuva_unlink() instead of > drm_gpuva_unlink_defer_put() would leak the vm_bo though. Initially (i.e. a few mails back), it sounded to me as if you'd propose to drop the drm_gpuva's vm_bo reference only when it is freed. >> No, drivers can't iterate the evict/extobj lists directly; or at least this is >> not intended by GPUVM's API and if drivers do so, this is considered peeking >> into GPUVM internals, so drivers are on their own anyways. >> >> Iterators, such as for_each_vm_bo_in_list() are not exposed to drivers. > > Okay, that's a good thing. I thought Xe was doing some funky stuff with > the list... Maybe, I don't know. If they do so, the should send patches adding the corresponding iterators and provide a rationale why drivers need to access those lists directly and why we can't provide an API that handles the overall use-case, such as drm_gpuvm_prepare_objects(), etc.