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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B158DC433E0 for ; Tue, 23 Jun 2020 07:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 831F420774 for ; Tue, 23 Jun 2020 07:49:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ZqLlsVf8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 831F420774 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F0B86E961; Tue, 23 Jun 2020 07:48:59 +0000 (UTC) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D3EA6E935 for ; Tue, 23 Jun 2020 00:05:27 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id e12so3237239qtr.9 for ; Mon, 22 Jun 2020 17:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZARmJJ7xCkdZZ2t8wNh4/tQvVIlLfUoBxGbPVnLj1no=; b=ZqLlsVf823WvkS6Pxei8NiC2W2IIsAJoQA2urO7e9M3j3n78WU8zuiQnBC/Hh13LQ7 W82cIEkI8yK1kig27JBpN1A+kBTvdyfep2zqFSsRZ3bneYMoHddrECdeOHAhBx3jAggE 8oQvGlZO4VuJSft8Izl2Bf/u/NJdZDmJmyKoVRcHZq2TKwggLrrOlhDeM/ysxoX7/Me3 dqRCX3t0aoqiPb12yGgusjNMnEL8ewMvbu4zIi2lDYR1tedgzPmqU85hNdNt9mW7kpmp xuKIYdmxHb1ZwHUACc5P3GQ4w7GIm5gpp47skdgCpNYwfEX9eupQQgKd/elWzUh05kv2 mhag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZARmJJ7xCkdZZ2t8wNh4/tQvVIlLfUoBxGbPVnLj1no=; b=nTtu1+yTW5J5qd5ipxGxBnIdyjVDjifQXDFed55MYbhPJN0PLy0EJTqRR3P2zbLFCZ 2Lq2O5vFXxgixh9jEP5CkSDu4+U/Pqx/3ST1DTMLXtwM2FKvBR/RHhZXmfuxtfHeZCbg cRBbQEEvvrEXQmAbGlfx4qtdQkiUrgAbQr4r+oqI3Et080JxdEYZNQhS9IBy70AnxiGP i7u8w+Yj1MEJtJNAGAkg+aOp0XHYkxmreqNibb7slAP5jDkNajYiZVpxcEiokm6mtEV7 92IKL+R+UTirqRbmE7LDSOmoYZu89yFz6EwlWc1qqM0GhuTwsi93QqBlNi6FONefWVQY sHBQ== X-Gm-Message-State: AOAM530+ibkPPgtZXFnld8yPhHIf7Yt2IcMP+cKWCZd6FMvZquXg9YRz bldqxOvapi+vXKzMk/tCywB46W9es9OEPw== X-Google-Smtp-Source: ABdhPJybLGEC9Vkbo3afR1e0rkiE4Uqi81y09rG7Z316acKAzGcUboScxSHByPFqPGL4yR3GT9b3Ew== X-Received: by 2002:ac8:279a:: with SMTP id w26mr18731669qtw.309.1592870726664; Mon, 22 Jun 2020 17:05:26 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id n143sm1204192qkn.94.2020.06.22.17.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 17:05:26 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.93) (envelope-from ) id 1jnWRJ-00CHPu-Cd; Mon, 22 Jun 2020 21:05:25 -0300 Date: Mon, 22 Jun 2020 21:05:25 -0300 From: Jason Gunthorpe To: Jerome Glisse Subject: Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations Message-ID: <20200623000525.GX6578@ziepe.ca> References: <20200618172338.GM6578@ziepe.ca> <20200619113934.GN6578@ziepe.ca> <20200619151551.GP6578@ziepe.ca> <20200619172308.GQ6578@ziepe.ca> <20200619180935.GA10009@redhat.com> <20200619181849.GR6578@ziepe.ca> <20200619201011.GB13117@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200619201011.GB13117@redhat.com> X-Mailman-Approved-At: Tue, 23 Jun 2020 07:48:47 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rdma , Thomas =?utf-8?B?SGVsbHN0csO2bSAoSW50ZWwp?= , LKML , DRI Development , Christian =?utf-8?B?S8O2bmln?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Thomas Hellstrom , amd-gfx list , Daniel Vetter , Mika Kuoppala , Intel Graphics Development , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Jun 19, 2020 at 04:10:11PM -0400, Jerome Glisse wrote: > Maybe we can audit how user ptr buffer are use today and see if > we can define a usage pattern that would allow to cut corner in > kernel. For instance we could use mmu notifier just to block CPU > pte update while we do GUP and thus never wait on dma fence. The DMA fence is the main problem, if you can think of a way to avoid it then it would be great! > Then GPU driver just keep the GUP pin around until they are done > with the page. They can also use the mmu notifier to keep a flag > so that the driver know if it needs to redo a GUP ie: > > The notifier path: > GPU_mmu_notifier_start_callback(range) > gpu_lock_cpu_pagetable(range) > for_each_bo_in(bo, range) { > bo->need_gup = true; > } > gpu_unlock_cpu_pagetable(range) So some kind of invalidation tracking? But this doesn't solve COW and Fork problem? > > It is kind of unrelated to HMM, it just shouldn't be using mmu > > notifiers to replace page pinning.. > > Well my POV is that if you abide by rules HMM defined then you do > not need to pin pages. The rule is asynchronous device page table > update. I think one of the hmm rules is to not block notifiers for a long time, which these scheme seem to violate already. Pinning for a long time is less bad than blocing notifiers for a long time, IMHO Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel