Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3296770rdb; Thu, 16 Nov 2023 06:03:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFewv0eucwtGpi1K3YhMKfaRM5vXjd4ezmGXoCcmi9XD++5cX8uMvV+zVaqN+dnOOg+61tB X-Received: by 2002:a05:6871:460c:b0:1f4:b0cb:f276 with SMTP id nf12-20020a056871460c00b001f4b0cbf276mr16809172oab.20.1700143437804; Thu, 16 Nov 2023 06:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700143437; cv=none; d=google.com; s=arc-20160816; b=slPijTwDVorteuIJOK85nRYoEm+uP6plCnHPZxRTVFyXYjPsjjE8ERvFp9e957ONS2 SmVrq0AC1AFH04HhZiFjrdOyKHDacU2dHUm8uemDR3WClv74IYuTIOJBxEfPQqgZsJ8V fIaN6YtXDzggN76EovIm0ml6LqngkyNkgpS17R2CSS0/CGBuGfomuAK/YQ+c8SF5WKKO CWs959nyPOGT6U31PPu2jj4CJGwZ5/D47OY2To296dAJcWRxN7vx9pDEqK3/1YM99jk5 queO38GycBv3T2gC8krt2HKq9/mKDOAso0tUW3h136XbQ5iPj/FJp6WojEQ6qAshNKXt 69ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=ify9Vvsur2tjiWibc1WjaPX2nLUPCNROFWZ7Gxf23VI=; fh=iz8/ui5Cd7vfAQjkuduRxnYAHeAbvUXq1iL+xF81COY=; b=J/pspEtj9F0Di4tlTxkKrh6F+bt9IcyRz58bD5tQyv2ejdjR7s+juq8YVMBTkYyijw T068i3m/zkV1SYGf+df2Mo+WiEx9eHiXIOOKyk5EkirLez0G248PbspLfooMSu7WQLqM LG3u04nwuppfixJFfSOZSev07qptt0obNWZKzXAQx+RFQErNZUx/zL/L6RjGHZY9l7HT FVof2hCQb7wTnPirV3tUa9MM+HYKfIJHMuEDm2pXzGmqpNk/mRNaspgF5kzM+C1sXGVP BS96sNV+YO0doWWYjQ1z2TdVEgZIhqvWh3oa+g2lrPoOp8H5/GdBIKXEcYiDGn04nX4u cGsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FqlTQ1Es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q18-20020a056870731200b001e9d0824898si4353243oal.222.2023.11.16.06.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:03:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FqlTQ1Es; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4F82280ECB3F; Thu, 16 Nov 2023 06:03:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345451AbjKPOCo (ORCPT + 99 others); Thu, 16 Nov 2023 09:02:44 -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-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 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:03:38 -0800 (PST) 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? :-)