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 8D458C433B4 for ; Wed, 19 May 2021 12:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E32661353 for ; Wed, 19 May 2021 12:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346485AbhESMRG (ORCPT ); Wed, 19 May 2021 08:17:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26540 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241057AbhESMRG (ORCPT ); Wed, 19 May 2021 08:17:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426546; 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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=iWJyJ2JzQRelZ805GCtdPoB9VQ1XEdIFM564RmmA7mx2ZGzJqSwzReDjGZYbV/b2mEll1M EWEOflN3vFnYnv+LNtdPgqnUgeQAmdbryad4yfCU6fCUY9bC7BpELXBFv9n0mkZJyVjMMT fKznwmsLn0Y2agTqb3v5v8170IhBbME= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-voVX9FLxPuGvjW7HNbFSdQ-1; Wed, 19 May 2021 08:15:45 -0400 X-MC-Unique: voVX9FLxPuGvjW7HNbFSdQ-1 Received: by mail-qt1-f197.google.com with SMTP id d7-20020ac811870000b02901e65f85117bso9686450qtj.18 for ; Wed, 19 May 2021 05:15:45 -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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=C0DCN82C+C1FXkCE1lyNVLakaMQutsIWNHz6Ch3FwzNqziyezEuSE1MOs6xaTPP9iJ Db8gQ7GfRHMS0yvPorfzKSv+a5T6t3yBp8IZ8oI2Hc5ZQC2KzBc6Pt98OXTda87iAyQi 52fWk7l5UDYrE9UkvrXDkoWMdTi3+aP9zyqrEPUP4GgdoKPrDFIcagTsYKHPdNMx9FHp 38M1lJQDiUkyZLHcAc/Q+OrA/pszTeW1+8FyMfeRCBPm8/q4mSTh8A7GGIIF1BreZNvU Sg3Xelewkhtjr2N/WtOJKi3bQ0lq6XSgKBcOLhL6gJ8xsXEqCANYd6WNrenVFuIOU4Ja qkIA== X-Gm-Message-State: AOAM531IAb3IhVEjEkceOsGTxiA3bpGMqjFuqajAp1Q6nxt+TEHr/WV4 Cw6+xSu9QcqZUtJAOe0WmXM6FJq8iAo06tkGYCsEkX5gYwNe/58T9gDnr3deEmxnL7Hfef7CGfC fkKNPQfovHNxBUTQbIIQH X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13194998qve.38.1621426543764; Wed, 19 May 2021 05:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJeMvnD48yKledjvAvmUkVuVahWxfS9KHq8l5vFptQfcG6pDYRH4satuz1xLVBYj0ZmxaSVA== X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13194979qve.38.1621426543531; Wed, 19 May 2021 05:15:43 -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 y9sm14576208qkm.19.2021.05.19.05.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:15:42 -0700 (PDT) Date: Wed, 19 May 2021 08:15:41 -0400 From: Peter Xu To: Alistair Popple Cc: Jason Gunthorpe , 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, 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> <20210518230327.GG1002214@nvidia.com> <2235357.HsqDk0zIjc@nvdebian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2235357.HsqDk0zIjc@nvdebian> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, May 19, 2021 at 09:04:53PM +1000, Alistair Popple wrote: > Failing fork() because we couldn't take a lock doesn't seem like the right > approach though, especially as there is already existing code that retries. I > get this adds complexity though, so would be happy to take a look at cleaning > copy_pte_range() up in future. Yes, I proposed that as this one won't affect any existing applications (unlike the existing ones) but only new userspace driver apps that will use this new atomic feature. IMHO it'll be a pity to add extra complexity and maintainance burden into fork() if only for keeping the "logical correctness of fork()" however the code never triggers. If we start with trylock we'll know whether people will use it, since people will complain with a reason when needed; however I still doubt whether a sane userspace device driver should fork() within busy interaction with the device underneath.. In all cases, please still consider to keep them in copy_nonpresent_pte() (and if to rework, separating patches would be great). Thanks, -- 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 E405EC433ED for ; Wed, 19 May 2021 16:43:14 +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 AAC4E610E9 for ; Wed, 19 May 2021 16:43:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAC4E610E9 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 D047E6EE27; Wed, 19 May 2021 16:29:11 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E30556ED91 for ; Wed, 19 May 2021 12:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426546; 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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=iWJyJ2JzQRelZ805GCtdPoB9VQ1XEdIFM564RmmA7mx2ZGzJqSwzReDjGZYbV/b2mEll1M EWEOflN3vFnYnv+LNtdPgqnUgeQAmdbryad4yfCU6fCUY9bC7BpELXBFv9n0mkZJyVjMMT fKznwmsLn0Y2agTqb3v5v8170IhBbME= 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-246-gcop4rCfNFy-wF9Kw3Iv3w-1; Wed, 19 May 2021 08:15:44 -0400 X-MC-Unique: gcop4rCfNFy-wF9Kw3Iv3w-1 Received: by mail-qv1-f69.google.com with SMTP id r11-20020a0cb28b0000b02901c87a178503so10112425qve.22 for ; Wed, 19 May 2021 05:15:44 -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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=FnEPvL1Iue9busYOotRsN9hWJbWhgkUcQvW/RP79YFe7Y5pmOJCxeg5tXgE+v2Kpzz MOFPlJXXfYYRLraqFZojYz1DBDXJOaBBR/B8oZwLKjzVbbTZ+eHOYaG+VaDzJl8oJl+/ ua6kyHOaM6wndQWdonyjD1VndwOWOcoC+uZ3shsGvzDSqFVRnw1om9IKY32m7p7oJZ2N qpWce++4z2VPWSsrhjLef9dtRWFqvm1ufSfCULKpeiEyQsSUXXgDjJ9/mkOQLog649y+ LY12XtUfT7Xod1+zAl9S7h3hXqkFGf5F6hmMg7mqlvuih87XHFjwMwZJ3wVnjWp2cW8r 0lKw== X-Gm-Message-State: AOAM531nK5uT9dU+Ty6uJDnKqhC1/C4hJrY0hC+g0i5WLEVeeOBL6kpf MNztiXTPd9UizpvCsc1XyU/Ca5LaUKsQDhwo2oxYrdr3DIDYco+1x1lNpO08kDbAfXyq2mNOGkt fTGpwYnDJApixxxEJ8um73lykLA== X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13195003qve.38.1621426543765; Wed, 19 May 2021 05:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJeMvnD48yKledjvAvmUkVuVahWxfS9KHq8l5vFptQfcG6pDYRH4satuz1xLVBYj0ZmxaSVA== X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13194979qve.38.1621426543531; Wed, 19 May 2021 05:15:43 -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 y9sm14576208qkm.19.2021.05.19.05.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:15:42 -0700 (PDT) Date: Wed, 19 May 2021 08:15:41 -0400 From: Peter Xu To: Alistair Popple Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <20210518230327.GG1002214@nvidia.com> <2235357.HsqDk0zIjc@nvdebian> MIME-Version: 1.0 In-Reply-To: <2235357.HsqDk0zIjc@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, Jason Gunthorpe , 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:04:53PM +1000, Alistair Popple wrote: > Failing fork() because we couldn't take a lock doesn't seem like the right > approach though, especially as there is already existing code that retries. I > get this adds complexity though, so would be happy to take a look at cleaning > copy_pte_range() up in future. Yes, I proposed that as this one won't affect any existing applications (unlike the existing ones) but only new userspace driver apps that will use this new atomic feature. IMHO it'll be a pity to add extra complexity and maintainance burden into fork() if only for keeping the "logical correctness of fork()" however the code never triggers. If we start with trylock we'll know whether people will use it, since people will complain with a reason when needed; however I still doubt whether a sane userspace device driver should fork() within busy interaction with the device underneath.. In all cases, please still consider to keep them in copy_nonpresent_pte() (and if to rework, separating patches would be great). Thanks, -- 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 3B76AC43462 for ; Wed, 19 May 2021 12:15:49 +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 F3DD06124C for ; Wed, 19 May 2021 12:15:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3DD06124C 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 0F9356ED84; Wed, 19 May 2021 12:15:48 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E28636ED84 for ; Wed, 19 May 2021 12:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621426545; 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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=XWnvgk+gmA8q335ZahEcIfurX3JWiQVieP+ijgBkA8GHETaQzRBva9P8v6AMP2XK5YEGKC GUlRBQyHMkN48LWDWQTsMFGIU1EVOzD86oqePIxoihk0KLbXBmuz0Tmux//77FLilHSht1 6/2bGeSVroWR5pTNFncy9VU+NjMZc5o= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-n9mQv1xAMgedcXgqbXMrig-1; Wed, 19 May 2021 08:15:44 -0400 X-MC-Unique: n9mQv1xAMgedcXgqbXMrig-1 Received: by mail-qk1-f199.google.com with SMTP id z12-20020a05620a08ccb02902ea1e4a963dso9634285qkz.13 for ; Wed, 19 May 2021 05:15:44 -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=tpsW6GoLBuPX3m2t6ZDWDsXVHyOzAne0XpIqOVeHL30=; b=txVoitSYX7vOmpvM3Hvj/JTJrgD2wkhD/+hXUyLKYqG7615iVfQIqg9F8nD7N9HxC6 /8GYxyn49c6SfDf4A/Icpnd6MgUSHTMjltkIMdcXCn83bRnPuTDyKgQu3+g1F//4yVIK 0rTQV7WGfpBy7ebYu8wfO1kA9vmKBm4KN1/tNOAemmDMwJlv0SyS72cPNn0yU2Elk71x bEdSQ/k7npWmmxay65KzK0XvtsZ3S6xQWJTMalk5chMgfKCiNgsCN3lM3mspcOok0wj1 1xKM460DBUHwcWDPcpNIlhFF/RRtHasQM0W6T/lg2mqpRwFlWcHJmjgTkfmB8s9xjtD3 j5Cw== X-Gm-Message-State: AOAM531PHaL8C3oi4yOGPO/lCwKh46SeB+PA97ngbvuaVkt8eaBlHUHg yh78W85x960TW7mCRrJkIGT8MWHuT4T9bmcP0TDf4thYkOkVFToYUHJwh6H9hR4MgNblg4dc2zS Ca3R7VEeSO7IDvMKG9I+rlDtZDh/D X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13195005qve.38.1621426543766; Wed, 19 May 2021 05:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJeMvnD48yKledjvAvmUkVuVahWxfS9KHq8l5vFptQfcG6pDYRH4satuz1xLVBYj0ZmxaSVA== X-Received: by 2002:a05:6214:20c4:: with SMTP id 4mr13194979qve.38.1621426543531; Wed, 19 May 2021 05:15:43 -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 y9sm14576208qkm.19.2021.05.19.05.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 05:15:42 -0700 (PDT) Date: Wed, 19 May 2021 08:15:41 -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> <20210518230327.GG1002214@nvidia.com> <2235357.HsqDk0zIjc@nvdebian> MIME-Version: 1.0 In-Reply-To: <2235357.HsqDk0zIjc@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, Jason Gunthorpe , 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:04:53PM +1000, Alistair Popple wrote: > Failing fork() because we couldn't take a lock doesn't seem like the right > approach though, especially as there is already existing code that retries. I > get this adds complexity though, so would be happy to take a look at cleaning > copy_pte_range() up in future. Yes, I proposed that as this one won't affect any existing applications (unlike the existing ones) but only new userspace driver apps that will use this new atomic feature. IMHO it'll be a pity to add extra complexity and maintainance burden into fork() if only for keeping the "logical correctness of fork()" however the code never triggers. If we start with trylock we'll know whether people will use it, since people will complain with a reason when needed; however I still doubt whether a sane userspace device driver should fork() within busy interaction with the device underneath.. In all cases, please still consider to keep them in copy_nonpresent_pte() (and if to rework, separating patches would be great). Thanks, -- Peter Xu