From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81029C54FB9 for ; Thu, 16 Nov 2023 14:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345455AbjKPOCq (ORCPT ); Thu, 16 Nov 2023 09:02:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345351AbjKPOCa (ORCPT ); Thu, 16 Nov 2023 09:02:30 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85DC9173D for ; Thu, 16 Nov 2023 06:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700143341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ify9Vvsur2tjiWibc1WjaPX2nLUPCNROFWZ7Gxf23VI=; b=FqlTQ1Es8lIKB67XWyEprqmI2WWWCr3bE9otNmM86tJ4ZXmupNgZMW0xOjGCu3qSEvDSrW uVEls0mRbM7TWwAG/lvLBTXviErjXWSqwHwmDmD4igel19q0ei/1KRYtYydwhbw1so1b2G xPkBR+ZaomW7+4tO2p297spLM9+rq5Q= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-nUkNOWNNPeevjpj_PlkB9Q-1; Thu, 16 Nov 2023 09:02:20 -0500 X-MC-Unique: nUkNOWNNPeevjpj_PlkB9Q-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-9e28d82339aso60423666b.2 for ; Thu, 16 Nov 2023 06:02:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700143339; x=1700748139; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ify9Vvsur2tjiWibc1WjaPX2nLUPCNROFWZ7Gxf23VI=; b=LSflO/0FGYqXlE+gV1z2eCQ1S3mf8SxdYXU4sLNvPqswiVSdOhI0sW+bg5Oyys66zk Ofu8TfjdjuFV+/vW7x3eMpquFppz288CEgckGGcrAVgenaX5g8yIx8N76Wp4KYEECbE9 Yke+GemyCl6HCsLHc9Q1oC4+cr71TK/XwLeHNb3P15kIDlgU1idRyBfbjVTGuEaDFyh7 +A3JtSmvoNs93l1pyhtEw24qTD+VdtNrDoBCwKhsPXWHGaLiJLiqud58wRL59Mqz/PFz tI1gf9ztEwKuyIpn3VRvznIpdFLot/GuDJWKuR7IbvnjJIOxN6IQ4cQYK/fnM11SN1iw Pdtg== X-Gm-Message-State: AOJu0YzdzSZpC3rWpQXrQUxNWnLv+8h4XI7FEx1mbjv4oPdkU/1WN43p a9wQ9UcS1Eq78znS4FtBoPWOg+WMqP4nSaLZLeRyvI4Nqc8RLvd6gVaGeBNycb94XRiIbaGEE1Y MNnswXIeEYRdT/mH4qredtxRC X-Received: by 2002:a17:906:e20c:b0:9e0:4910:1665 with SMTP id gf12-20020a170906e20c00b009e049101665mr10183262ejb.29.1700143339109; Thu, 16 Nov 2023 06:02:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4pGsJb2OCA8cUb6M3QJESft2ul7MzFcR4nU6hjfBuLpwW0QUNLAHidXjV+1Rf6jlYCJQBRQ== X-Received: by 2002:a17:906:e20c:b0:9e0:4910:1665 with SMTP id gf12-20020a170906e20c00b009e049101665mr10183242ejb.29.1700143338774; Thu, 16 Nov 2023 06:02:18 -0800 (PST) Received: from ?IPV6:2a02:810d:4b3f:de9c:abf:b8ff:feee:998b? ([2a02:810d:4b3f:de9c:abf:b8ff:feee:998b]) by smtp.gmail.com with ESMTPSA id mb8-20020a170906eb0800b009bf7a4d591csm8606474ejb.11.2023.11.16.06.02.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 06:02:18 -0800 (PST) Message-ID: Date: Thu, 16 Nov 2023 15:02:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] Documentation/gpu: VM_BIND locking document Content-Language: en-US To: =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , Boris Brezillon Cc: intel-xe@lists.freedesktop.org, Rodrigo Vivi , Matthew Brost , Joonas Lahtinen , Oak Zeng , Daniel Vetter , Maarten Lankhorst , Francois Dugast , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20231115124937.6740-1-thomas.hellstrom@linux.intel.com> <20231116104851.114bdb08@collabora.com> <0850281b667c4b88163dab60737dbc945ad742fd.camel@linux.intel.com> From: Danilo Krummrich Organization: RedHat In-Reply-To: <0850281b667c4b88163dab60737dbc945ad742fd.camel@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/16/23 12:48, Thomas Hellström wrote: >>> +Locks used and locking orders >>> +============================= >>> + >>> +One of the benefits of VM_BIND is that local GEM objects share the >>> gpu_vm's >>> +dma_resv object and hence the dma_resv lock. So even with a huge >>> +number of local GEM objects, only one lock is needed to make the >>> exec >>> +sequence atomic. >>> + >>> +The following locks and locking orders are used: >>> + >>> +* The ``gpu_vm->lock`` (optionally an rwsem). Protects how the >>> gpu_vm is >>> +  partitioned into gpu_vmas. It can also protect the gpu_vm's list >>> of >>> +  userptr gpu_vmas. With a CPU mm analogy this would correspond to >>> the >>> +  mmap_lock. >> >> I don't see any drm_gpuvm::lock field in Danilo's latest patchset, >> so, >> unless I missed one version, and this lock is actually provided by >> drm_gpuvm, I would mention this is a driver-specific lock. This >> comment >> applies to all the locks you describe here actually (mention which >> ones >> are provided by drm_gpuvm, and which ones are driver-specific). > > These will be needed also by gpuvm when implementing userptr vmas, so I > can mention that drm_gpuvm is currently lacking a userptr > implementation, so "the locks described below are to be considered > driver-specific for now" Since Xe already implements userptr support, are you guys maybe interested in extending drm_gpuvm accordingly? :-)