Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1007040ybt; Fri, 19 Jun 2020 21:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVGgZhFkEzvzp0xSlkF/w/xj3k+xDVinuXAdl+eSRtNEmBtQADXBuDEtMsYGpomChHe8EV X-Received: by 2002:a17:906:480f:: with SMTP id w15mr6530393ejq.430.1592627045451; Fri, 19 Jun 2020 21:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592627045; cv=none; d=google.com; s=arc-20160816; b=bPTzKvI+nuoeOI+GeeGiTyooV6ZAlDsFdHSRjXXNCZrLj2fQHXmvMwGwOI3wJ8OAhG a2l6eDStu9+m/EBx1aceApT/u+WX2rk3ehZtN7i95vm+nvxGPMzw32n/ZeS2yNO2WpIH umBbharADK4AYvsWdFZ6GXM5ygh28tmMkpedOwDH4oB9HeeyW9OoWTVfgPqdgmQ5hWJb 6DrdazWMxqggSvbIU0eNyBtEnE8dMkEVQB0S0bB4kJXCyO/8Gv+wglipkDmcn+bob/7H 4BAjgDW76eMg1p2/ihW9fA3X6oC5aISzGq4vxiB3SSRITk1jkH2fRQzcrPahhuTXEr4p 4lEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Z8Lv9ap/5+MGtYWPoEO0+lkl3xRdUoM0YERSQDqAgkI=; b=am6aJcySr+77ULMj/0IiLPSujcZ3ejbxwBA6DeC3BVcGqh3MAcnZT7+XRaA83lDDTU P+avK0g9wWbur8Jvn3XzBN8kNCVZoUV5yNgK7gs5csXG0I3MVUvkNFP271ZhPLACSXSJ ongfv1SlRqEqy1RrM/iTs2iCjD3vR+qXh/PVcdDbtROUd3OOZmxagK8gKLn0HIxGe0pA s8qT32ZwhYVC8EfVxfr+vhnekZ0RztaYKInL/OSEJGxfz0a/NV06Y488c+n5l4C95mel x0YX8pFDV2wbZi5RWhhJJ75hSNWEBePgUSnod0z7r5aNotRo13F+CNTitVKKgkqHvgDX Ucnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ME17mnS3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si1101957ejy.723.2020.06.19.21.23.43; Fri, 19 Jun 2020 21:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ME17mnS3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732647AbgFSSNk (ORCPT + 99 others); Fri, 19 Jun 2020 14:13:40 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26036 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732562AbgFSSNi (ORCPT ); Fri, 19 Jun 2020 14:13:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592590416; 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=Z8Lv9ap/5+MGtYWPoEO0+lkl3xRdUoM0YERSQDqAgkI=; b=ME17mnS3p1wQU2TaGHG19c9tf2Rr2EfgUEpsp2uDhZlzWMKBBR/ZuRu6IbmN+ARFNO1lCA piz2VimXFkAK4ooU7tfhjfvtuklLDxBc7TOiWBkri9OHQ26ERNMCwR8qx1sBfU7AbYSUNc KrH2V/lA8vChElgUepiddvX1l722faA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-0m28QoAtN9SxtVrQMRv6IA-1; Fri, 19 Jun 2020 14:13:32 -0400 X-MC-Unique: 0m28QoAtN9SxtVrQMRv6IA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E8CF835B40; Fri, 19 Jun 2020 18:13:30 +0000 (UTC) Received: from redhat.com (ovpn-112-200.rdu2.redhat.com [10.10.112.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C9EA19723; Fri, 19 Jun 2020 18:13:28 +0000 (UTC) Date: Fri, 19 Jun 2020 14:13:26 -0400 From: Jerome Glisse To: Felix Kuehling Cc: Jason Gunthorpe , Thomas =?iso-8859-1?Q?Hellstr=F6m_=28Intel=29?= , DRI Development , linux-rdma@vger.kernel.org, Intel Graphics Development , Maarten Lankhorst , LKML , amd-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Thomas Hellstrom , Daniel Vetter , linux-media@vger.kernel.org, Christian =?iso-8859-1?Q?K=F6nig?= , Mika Kuoppala Subject: Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations Message-ID: <20200619181326.GB10009@redhat.com> References: <20200604081224.863494-1-daniel.vetter@ffwll.ch> <20200604081224.863494-5-daniel.vetter@ffwll.ch> <20200611083430.GD20149@phenom.ffwll.local> <20200611141515.GW6578@ziepe.ca> <4702e170-fd02-88fa-3da4-ea64252fff9a@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4702e170-fd02-88fa-3da4-ea64252fff9a@amd.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2020 at 07:35:35PM -0400, Felix Kuehling wrote: > Am 2020-06-11 um 10:15 a.m. schrieb Jason Gunthorpe: > > On Thu, Jun 11, 2020 at 10:34:30AM +0200, Daniel Vetter wrote: > >>> I still have my doubts about allowing fence waiting from within shrinkers. > >>> IMO ideally they should use a trywait approach, in order to allow memory > >>> allocation during command submission for drivers that > >>> publish fences before command submission. (Since early reservation object > >>> release requires that). > >> Yeah it is a bit annoying, e.g. for drm/scheduler I think we'll end up > >> with a mempool to make sure it can handle it's allocations. > >> > >>> But since drivers are already waiting from within shrinkers and I take your > >>> word for HMM requiring this, > >> Yeah the big trouble is HMM and mmu notifiers. That's the really awkward > >> one, the shrinker one is a lot less established. > > I really question if HW that needs something like DMA fence should > > even be using mmu notifiers - the best use is HW that can fence the > > DMA directly without having to get involved with some command stream > > processing. > > > > Or at the very least it should not be a generic DMA fence but a > > narrowed completion tied only into the same GPU driver's command > > completion processing which should be able to progress without > > blocking. > > > > The intent of notifiers was never to endlessly block while vast > > amounts of SW does work. > > > > Going around and switching everything in a GPU to GFP_ATOMIC seems > > like bad idea. > > > >> I've pinged a bunch of armsoc gpu driver people and ask them how much this > >> hurts, so that we have a clear answer. On x86 I don't think we have much > >> of a choice on this, with userptr in amd and i915 and hmm work in nouveau > >> (but nouveau I think doesn't use dma_fence in there). > > Soon nouveau will get company. We're working on a recoverable page fault > implementation for HMM in amdgpu where we'll need to update page tables > using the GPUs SDMA engine and wait for corresponding fences in MMU > notifiers. Note that HMM mandate, and i stressed that several time in the past, that all GPU page table update are asynchronous and do not have to wait on _anything_. I understand that you use DMA engine for GPU page table update but if you want to do so with HMM then you need a GPU page table update only DMA context where all GPU page table update goes through and where user space can not queue up job. It can be for HMM only but if you want to mix HMM with non HMM then everything need to be on that queue and other command queue will have to depends on it. Cheers, J?r?me