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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C40D5C433ED for ; Wed, 19 May 2021 12:21:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3CA96139A for ; Wed, 19 May 2021 12:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350141AbhESMWe (ORCPT ); Wed, 19 May 2021 08:22:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26407 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349646AbhESMWb (ORCPT ); Wed, 19 May 2021 08:22:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426871; 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: in-reply-to:in-reply-to:references:references; bh=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=ZefcU8PzDyCvDFwxwj6QzsO4ystN8p7Rbz1oSSuV7uas2fzqrp6WVZfgPW6Ir854umfZhy paqU0opFyPlOAVELm69pkVbh9sT8IY092TTvnukKVUIBQ442mscH2qYAOZCeLTg7inZ3L/ c85b4iFwLo7kN8EVMmBRrZVafAv+InU= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-161-dEsSE0M2PcCocaGQmCGQBg-1; Wed, 19 May 2021 08:21:10 -0400 X-MC-Unique: dEsSE0M2PcCocaGQmCGQBg-1 Received: by mail-qk1-f197.google.com with SMTP id z12-20020a05620a08ccb02902ea1e4a963dso9646149qkz.13 for ; Wed, 19 May 2021 05:21:10 -0700 (PDT) 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=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=TjoYEUtxxlIlxd8idgytLVwRKAw6RP1UFZa0k9tEj4gPNVvIhB6KXg7RW2Q5jwrIP6 tDE1Z/nUB5z/g4eWWu2S0ykYS4mu+oG971q5qxbz5yBASceRb/ZGCKJBftJiU864xP9B 8uNdHQm+AuO4GuQnnTBUdY5W/k5OIa2sesOQyTBOP169pruZ8G/Q/XUz/2Rf8+RtkQiB dPGfb7zqwfQfJ11k9UWIyMt9qhv/+/qip8gB/TimtBspgpJqgQ+v7JyO2DxNXzyr6L1q l9/yN965tzr86woC6OXhKJ+s5bCizD0z/KxqG9taWJxBpJGZ9fWMiWhldU6DwpaA+TRs LLuQ== X-Gm-Message-State: AOAM532FCsqvdLdnYCA9YgBRWKZtyBBjCjT6x0h22pC0NIFxvHsRmYxR GDGxFegy2Vt6tdAEMP/RW6TTqUTFkKpWZUH6I6T0/ztXI/HJKC7XcAwYPXBBfh/Uzzkq5vTH5sr ntHWi9dR9GF/sKMKn0V+K X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432101qks.425.1621426869766; Wed, 19 May 2021 05:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym25A+8CZrSnha27nfGC/bkh618yND6m6b6Lo8EgcNF6Oma7UyN8ZK+yut+/9S1ILrFjJgwA== X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432081qks.425.1621426869529; Wed, 19 May 2021 05:21:09 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id o10sm15018668qki.72.2021.05.19.05.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:21:09 -0700 (PDT) Date: Wed, 19 May 2021 08:21:08 -0400 From: Peter Xu To: Alistair Popple Cc: linux-mm@kvack.org, nouveau@lists.freedesktop.org, bskeggs@redhat.com, akpm@linux-foundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, jhubbard@nvidia.com, rcampbell@nvidia.com, jglisse@redhat.com, jgg@nvidia.com, hch@infradead.org, daniel@ffwll.ch, willy@infradead.org, bsingharora@gmail.com, Christoph Hellwig Subject: Re: [PATCH v8 5/8] mm: Device exclusive memory access Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <2217153.lfGrokb94b@nvdebian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2217153.lfGrokb94b@nvdebian> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, May 19, 2021 at 09:35:10PM +1000, Alistair Popple wrote: > I think the approach you are describing is similar to what > migrate_vma_collect()/migrate_vma_unamp() does now and I think it could be > made to work. I ended up going with the GUP+unmap approach in part because > Christoph suggested it but primarily because it required less code especially > given we needed to call something to fault the page in/break COW anyway (or > extend what was there to call handle_mm_fault(), etc.). I see, thank. Would you mind add a short paragraph in the commit message talking about these two solutions and why we choose the GUP way? -- Peter Xu 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=-3.5 required=3.0 tests=BAYES_00,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 A918CC433B4 for ; Wed, 19 May 2021 16:29:27 +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 6C89860241 for ; Wed, 19 May 2021 16:29:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C89860241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=nouveau-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FA666EE35; Wed, 19 May 2021 16:29:15 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id B76EA6ED95 for ; Wed, 19 May 2021 12:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426872; 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: in-reply-to:in-reply-to:references:references; bh=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=aadB3nSK7zJu8MLuvZBnwJIwxcvxXFffv3horplEQW35HfRM12D6zRbCkuUb1AeVSk0Nrt XAPy3eFD3993+UOMa2COO5RBmilwY5BRi24cg/Jkq7JGByfjJO+QUgoNqe6YhlUEDLEmI1 JioP1UtKeJ9uyGOd6/goD5mhUaymIrs= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-TBw99y3UOn-xSlhZBfuxAw-1; Wed, 19 May 2021 08:21:10 -0400 X-MC-Unique: TBw99y3UOn-xSlhZBfuxAw-1 Received: by mail-qv1-f69.google.com with SMTP id e2-20020ad442a20000b02901f3586a14easo2669841qvr.12 for ; Wed, 19 May 2021 05:21:10 -0700 (PDT) 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=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=GoXStMCnrqoOcJ283RcWcE7+4+0QmNtCzUDceWx8zI0EtHrXnlVvpGdc0zTqpA+UuR n0S4mtH1wnYrwaEeNXpj5yFHGh66rGFfM+gARa07P9tgzXdv84gAZo3jC38Ei6G9AzzK SW55qTQWPWwuJo7++i566IpV/ChBOAQyJkKiwxDq+W8cLgleg8Ssnncm1uk/gBOov89z 0RYZ7fTSD33MEfxp1aSR1PWFpxhHDtWjC2j2W6TpZXL7llAqZ0fLxj9d2RVS3B+1VYqq GvCwUibW2Gv1JMwweKkClRFNJPa0Q/8grehEiRGQYSwW5reYuPQsxU8GJuTN+t4NphSH 2LXw== X-Gm-Message-State: AOAM530Iml1RxS1VhL0yB7T4nPUZMrFu6rt8YJTTZpjf4nhfSzEIyZMI eY+EVg47oyYY8FAiCcZG7ziIi7gtzpkp4BBmdtHZLDCocZSSxl4AmlKm4wCdljg4872A9b2x4iB dV/+MRy7rlkaj0xodI9VxiO/7wg== X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432106qks.425.1621426869767; Wed, 19 May 2021 05:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym25A+8CZrSnha27nfGC/bkh618yND6m6b6Lo8EgcNF6Oma7UyN8ZK+yut+/9S1ILrFjJgwA== X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432081qks.425.1621426869529; Wed, 19 May 2021 05:21:09 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id o10sm15018668qki.72.2021.05.19.05.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:21:09 -0700 (PDT) Date: Wed, 19 May 2021 08:21:08 -0400 From: Peter Xu To: Alistair Popple Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <2217153.lfGrokb94b@nvdebian> MIME-Version: 1.0 In-Reply-To: <2217153.lfGrokb94b@nvdebian> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Mailman-Approved-At: Wed, 19 May 2021 16:29:11 +0000 Subject: Re: [Nouveau] [PATCH v8 5/8] mm: Device exclusive memory access X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rcampbell@nvidia.com, willy@infradead.org, daniel@ffwll.ch, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, bsingharora@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-mm@kvack.org, bskeggs@redhat.com, jgg@nvidia.com, akpm@linux-foundation.org, Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed, May 19, 2021 at 09:35:10PM +1000, Alistair Popple wrote: > I think the approach you are describing is similar to what > migrate_vma_collect()/migrate_vma_unamp() does now and I think it could be > made to work. I ended up going with the GUP+unmap approach in part because > Christoph suggested it but primarily because it required less code especially > given we needed to call something to fault the page in/break COW anyway (or > extend what was there to call handle_mm_fault(), etc.). I see, thank. Would you mind add a short paragraph in the commit message talking about these two solutions and why we choose the GUP way? -- Peter Xu _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E9781C43460 for ; Wed, 19 May 2021 12:21:18 +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 A99EC613AE for ; Wed, 19 May 2021 12:21:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A99EC613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 E5DAC6ED94; Wed, 19 May 2021 12:21:17 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6CEC6ED94 for ; Wed, 19 May 2021 12:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426872; 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: in-reply-to:in-reply-to:references:references; bh=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=aadB3nSK7zJu8MLuvZBnwJIwxcvxXFffv3horplEQW35HfRM12D6zRbCkuUb1AeVSk0Nrt XAPy3eFD3993+UOMa2COO5RBmilwY5BRi24cg/Jkq7JGByfjJO+QUgoNqe6YhlUEDLEmI1 JioP1UtKeJ9uyGOd6/goD5mhUaymIrs= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-503-ED4xbqGqPkCfhWcatOBS0A-1; Wed, 19 May 2021 08:21:10 -0400 X-MC-Unique: ED4xbqGqPkCfhWcatOBS0A-1 Received: by mail-qk1-f198.google.com with SMTP id d15-20020a05620a136fb02902e9e93c69c8so9624882qkl.23 for ; Wed, 19 May 2021 05:21:10 -0700 (PDT) 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=iT4YtjBsBt0s/M51Kj84dkt6amzmmMXBn/lNki8qQn0=; b=YMvElkPNlT3tiZOuAf7OnNFddGpgP241Co8Y2dSGm/+jg77T9OKb6RWpp8kN/HGetr 3t0Ziy9Ln23zD2zTOOJrzuS2afmoVD0XUDKrm+QS5wl6gRp63RuujJH/oh/Exu/tZeLa 7gnb4AHT6LqPL5StwcyRv1AdUr4OwR9HqteMz+XYqf3k0fm1WEeVTnmETw0mf7EPmRDJ ZlfpQxL3KmC0nIcMhUATH+mJepkmGoS3LfRtpKTj2L79BM+Nrn/YXjUmLmS1nj4+IB8f SSh1dUAUQmI3KkT/hiw2YY1drJRAtKbpE7jU4fI9tgv3GvpwX3hvDz16CI1P4n4EO7N1 FMYw== X-Gm-Message-State: AOAM530Uvra+wlni9a2iaLqy3YsYO5f/m6R/VocgTO72jj/B+MWlcmGh FnPuldjBTAQ16YEB32OkafvNV4v3k+fYqTyjbM8mL+DN1rk9BFkboIo5PpfYz9pggG5CS1JZS6p PGeMPQTFsrsIgnntE9zjG3w8hUOh6 X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432099qks.425.1621426869766; Wed, 19 May 2021 05:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym25A+8CZrSnha27nfGC/bkh618yND6m6b6Lo8EgcNF6Oma7UyN8ZK+yut+/9S1ILrFjJgwA== X-Received: by 2002:a05:620a:818:: with SMTP id s24mr7432081qks.425.1621426869529; Wed, 19 May 2021 05:21:09 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id o10sm15018668qki.72.2021.05.19.05.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:21:09 -0700 (PDT) Date: Wed, 19 May 2021 08:21:08 -0400 From: Peter Xu To: Alistair Popple Subject: Re: [PATCH v8 5/8] mm: Device exclusive memory access Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <2217153.lfGrokb94b@nvdebian> MIME-Version: 1.0 In-Reply-To: <2217153.lfGrokb94b@nvdebian> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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: rcampbell@nvidia.com, willy@infradead.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, bsingharora@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-mm@kvack.org, jglisse@redhat.com, bskeggs@redhat.com, jgg@nvidia.com, jhubbard@nvidia.com, akpm@linux-foundation.org, Christoph Hellwig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, May 19, 2021 at 09:35:10PM +1000, Alistair Popple wrote: > I think the approach you are describing is similar to what > migrate_vma_collect()/migrate_vma_unamp() does now and I think it could be > made to work. I ended up going with the GUP+unmap approach in part because > Christoph suggested it but primarily because it required less code especially > given we needed to call something to fault the page in/break COW anyway (or > extend what was there to call handle_mm_fault(), etc.). I see, thank. Would you mind add a short paragraph in the commit message talking about these two solutions and why we choose the GUP way? -- Peter Xu