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 0A60332ED51; Fri, 19 Dec 2025 12:25:15 +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=1766147116; cv=none; b=l/aL5O5Ph/bzbhi+e228UvrYLUsFcWEELvZPkr8OMhB67TXMJScgbJgJPWV+o6mhHy1XuOK7pNh4ixH2XTwliVFQNBVaS8t721R8g22BL3tCyUqN+WKeMlOPDKLeKwfsFRM2ha3dbph7bwCw1C0inWL41ZhGTaqn8unSfduzNvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766147116; c=relaxed/simple; bh=IKABffyNvPjVM+RzIL5ZAgHEXRXD7t+eDtpJ1JycBW0=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=OZVBLsaa3DbuXAy/g1S+4GT+AMsKWcIqgEz8wjzVdIO0Qgimc6vYN0WNC0ouvVi5oNN/s8nsXd4RqDLgYu+ir/Q+wvI25ej5NRd1nJc3p1O6SjtsvNW1c9tAjlcgMd1Q2R76fmVyFHQ/+tLcmvCCBD9KSPJp5zFhalHFHmp8ZUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kDXoTy4J; 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="kDXoTy4J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DEE8C4CEF1; Fri, 19 Dec 2025 12:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766147115; bh=IKABffyNvPjVM+RzIL5ZAgHEXRXD7t+eDtpJ1JycBW0=; h=Date:To:From:Subject:Cc:References:In-Reply-To:From; b=kDXoTy4JgoCQtYGg5/UHAbHNxZs3nuql9kLRBlRL08h4OgY6WohVAyq+6n5wjjjN4 ZZ7BAsk+IxUf1OAJjfMLqsezJMiZTEDLMokOj+3p+oBqXBpbXSgX/PHtilfEzw0blp hI2uxR66pgVguorKq8YwmkyNG+YJG6ntsL7+PVOPC7iiav7mLXlrZCEYPzpNzwglj3 LtPOVO5vSqBa06DClUFoH9b/rDV+mK9q3/3hxSbYNNEaKu+VQftOBZpinqYnnaPBwT 5O4vVWnTHYIEwcwdw47DpyJQ2jk04fUUqn/U+WPbVnna0WAAaaMD7NYx91omtEqNg+ CM2oilI8Y6E0g== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 19 Dec 2025 13:25:05 +0100 Message-Id: To: "Alice Ryhl" From: "Danilo Krummrich" Subject: Re: [PATCH 2/4] drm/gpuvm: drm_gpuvm_bo_obtain() requires lock and staged mode Cc: "Daniel Almeida" , "Matthew Brost" , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Boris Brezillon" , "Steven Price" , "Liviu Dudau" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Frank Binns" , "Matt Coster" , "Rob Clark" , "Dmitry Baryshkov" , "Abhinav Kumar" , "Jessica Zhang" , "Sean Paul" , "Marijn Suijten" , "Lyude Paul" , "Lucas De Marchi" , "Rodrigo Vivi" , "Sumit Semwal" , =?utf-8?q?Christian_K=C3=B6nig?= , , , , , , , , , References: <20251128-gpuvm-rust-v1-0-ebf66bf234e0@google.com> <20251128-gpuvm-rust-v1-2-ebf66bf234e0@google.com> In-Reply-To: <20251128-gpuvm-rust-v1-2-ebf66bf234e0@google.com> On Fri Nov 28, 2025 at 3:14 PM CET, Alice Ryhl wrote: > In the previous commit we updated drm_gpuvm_bo_obtain_prealloc() to take > locks internally, which means that it's only usable in immediate mode. > In this commit, we notice that drm_gpuvm_bo_obtain() requires you to use > staged mode. This means that we now have one variant of obtain for each > mode you might use gpuvm in. > > To reflect this information, we add a warning about using it in > immediate mode, and to make the distinction clearer we rename the method > with a _locked() suffix so that it's clear that it requires the caller > to take the locks. > > Signed-off-by: Alice Ryhl Ultimately, the two different approaches of obtaining a VM_BO have always b= een desinged for the two different modes of operation -- great to see this refi= ned! Given that, I think it would be great to update the "Locking" section of th= e GPUVM's documentation and expand it with a new section "Modes of Operation"= . Mind sending a follow-up patch / series for this?