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=-5.8 required=3.0 tests=BAYES_00,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 124FDC433E0 for ; Tue, 9 Feb 2021 13:43:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C001464E0D for ; Tue, 9 Feb 2021 13:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231802AbhBINnH (ORCPT ); Tue, 9 Feb 2021 08:43:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbhBINkP (ORCPT ); Tue, 9 Feb 2021 08:40:15 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD84C06178A for ; Tue, 9 Feb 2021 05:39:35 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id 19so7716694qkc.13 for ; Tue, 09 Feb 2021 05:39:35 -0800 (PST) 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=aQhoXa9jPalDWlVkfGxPk+c+I0Q9JZFKo47tCsmclHZEsPNYfreM817gCFAr4kOU8W fHBrAIQilQhVmk1iG9w5EWskZgjnukqG4cUDzLNZ6BylHXqnGvwuThK4UN4InIuRH/ze cvAS/4B/aBNt8AOe4VR/tiAtWA123wCajp47c9XzIXZFa0/I9e6/nmkjO6l7O80x9iCT kP9CrF06fB0beIFQO/9dbuqk7hvLl+4qLhMBYJj+SEwVoqE/HfXTlsjgBKUF7reYwTlf Ov9fDvgK+9WKyztUGrdI96zt7nHKT/h6nbpz8LPo9nETq4dWfycOqz7C26v5rJTgWElw YGyw== 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=HycOYystmsemqZMTh0rIRa0bBvAYZaXwVpswcxuFN7KhomjcLZwSWvkaDULLHnPhJ1 LtZ7r4GDMw6+Jf2vko/cvubeUIu8H3WC+jci1W52RH4puqGC0jYq8kfEYJFFZjFclX3I aWIQg/g2OEul1b9GvdYWZcPeaLUGEEP6w4Y1FmYdvKej/Hg9w7ZEsJle9/MPtZRTrLSX kAKtByYAMlaVJr3w6hG8818wa+IXZg/vHtlw5Oy6X27EhXmLZDIpyelDAh5+0cHw9164 gRfOBfouRNfJiiYtBaHU5rSYASoi0LWD6l2ICI6834w7P1HQnpjuj/6rfyi4b+Tb17FR wIgQ== X-Gm-Message-State: AOAM530ipo348VCKInUO8VzadmEKdO5eaRDwe+u3g8X/8lRAr+g6qmYk kfIbJidcqBUd6fEhB2lxwbCPOg== X-Google-Smtp-Source: ABdhPJzETc8qT6BXd1BDQmX3B26rXpyj1TrCOmYb4Fqo0JHFF6LTk7HRkfK/22tofKGhVc50wAK02g== X-Received: by 2002:a37:5a45:: with SMTP id o66mr21362019qkb.446.1612877974387; Tue, 09 Feb 2021 05:39:34 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id m21sm17197217qtq.52.2021.02.09.05.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 05:39:33 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l9TEq-005RKt-Q3; Tue, 09 Feb 2021 09:39:32 -0400 Date: Tue, 9 Feb 2021 09:39:32 -0400 From: Jason Gunthorpe 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, kvm-ppc@vger.kernel.org, dri-devel@lists.freedesktop.org, jhubbard@nvidia.com, rcampbell@nvidia.com, jglisse@redhat.com Subject: Re: [PATCH 1/9] mm/migrate.c: Always allow device private pages to migrate Message-ID: <20210209133932.GD4718@ziepe.ca> References: <20210209010722.13839-1-apopple@nvidia.com> <20210209010722.13839-2-apopple@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209010722.13839-2-apopple@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 12:07:14PM +1100, Alistair Popple wrote: > Device private pages are used to represent device memory that is not > directly accessible from the CPU. Extra references to a device private > page are only used to ensure the struct page itself remains valid whilst > waiting for migration entries. Therefore extra references should not > prevent device private page migration as this can lead to failures to > migrate pages back to the CPU which are fatal to the user process. This should identify the extra references in expected_count, just disabling this protection seems unsafe, ZONE_DEVICE is not so special that the refcount means nothing Is this a side effect of the extra refcounts that Ralph was trying to get rid of? I'd rather see that work finished :) Jason 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 9337CC433E0 for ; Tue, 9 Feb 2021 13:39:36 +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 3554764ED3 for ; Tue, 9 Feb 2021 13:39:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3554764ED3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca 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 A76186EB36; Tue, 9 Feb 2021 13:39:35 +0000 (UTC) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24CFE6EB36 for ; Tue, 9 Feb 2021 13:39:35 +0000 (UTC) Received: by mail-qk1-x72c.google.com with SMTP id h8so7644632qkk.6 for ; Tue, 09 Feb 2021 05:39:35 -0800 (PST) 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=aQhoXa9jPalDWlVkfGxPk+c+I0Q9JZFKo47tCsmclHZEsPNYfreM817gCFAr4kOU8W fHBrAIQilQhVmk1iG9w5EWskZgjnukqG4cUDzLNZ6BylHXqnGvwuThK4UN4InIuRH/ze cvAS/4B/aBNt8AOe4VR/tiAtWA123wCajp47c9XzIXZFa0/I9e6/nmkjO6l7O80x9iCT kP9CrF06fB0beIFQO/9dbuqk7hvLl+4qLhMBYJj+SEwVoqE/HfXTlsjgBKUF7reYwTlf Ov9fDvgK+9WKyztUGrdI96zt7nHKT/h6nbpz8LPo9nETq4dWfycOqz7C26v5rJTgWElw YGyw== 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=T4luR0oYfIKmVSXzvVzb1CjrEnqBg9sbKnvPDIanErBkOiA/gFGcWblHENAZVqBRR8 Dp48ae/nwZXXhYNKzVsoXRrOGZt7D+Oi6rrOPJzSJlSFwtngOvh1LB4jg7YolhhJDyZ1 Dyglzj4wmjAvX8XUhOwHzDKeYlImY8SXRfdRblmTTX4okYHK+fGVwVuKk3K9dTZcXLFw JhWUjSVCvVykuVk4GaLNZKpQQOehs49eH5yN+XiS8ESsj55N/kV9UHs0OCs5uAAu4fF0 h5HUzuaCgWRb1Fa2TRHXVWqIkwFXQnLdPGE19K8dwQdsfMmjRPsUlDa/de1XnnDgyrR6 Uh1w== X-Gm-Message-State: AOAM530xStgRojRQRjx+p4CnzrJao75EunZQbnuWaFNk44E9VY6lJvLC W7h572YwxBoswo5tux+1KCLvOA== X-Google-Smtp-Source: ABdhPJzETc8qT6BXd1BDQmX3B26rXpyj1TrCOmYb4Fqo0JHFF6LTk7HRkfK/22tofKGhVc50wAK02g== X-Received: by 2002:a37:5a45:: with SMTP id o66mr21362019qkb.446.1612877974387; Tue, 09 Feb 2021 05:39:34 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id m21sm17197217qtq.52.2021.02.09.05.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 05:39:33 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l9TEq-005RKt-Q3; Tue, 09 Feb 2021 09:39:32 -0400 Date: Tue, 9 Feb 2021 09:39:32 -0400 From: Jason Gunthorpe To: Alistair Popple Message-ID: <20210209133932.GD4718@ziepe.ca> References: <20210209010722.13839-1-apopple@nvidia.com> <20210209010722.13839-2-apopple@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210209010722.13839-2-apopple@nvidia.com> Subject: Re: [Nouveau] [PATCH 1/9] mm/migrate.c: Always allow device private pages to migrate 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, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org, bskeggs@redhat.com, akpm@linux-foundation.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Tue, Feb 09, 2021 at 12:07:14PM +1100, Alistair Popple wrote: > Device private pages are used to represent device memory that is not > directly accessible from the CPU. Extra references to a device private > page are only used to ensure the struct page itself remains valid whilst > waiting for migration entries. Therefore extra references should not > prevent device private page migration as this can lead to failures to > migrate pages back to the CPU which are fatal to the user process. This should identify the extra references in expected_count, just disabling this protection seems unsafe, ZONE_DEVICE is not so special that the refcount means nothing Is this a side effect of the extra refcounts that Ralph was trying to get rid of? I'd rather see that work finished :) Jason _______________________________________________ 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,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 BDD65C433DB for ; Tue, 9 Feb 2021 13:39:37 +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 7DB6E64ECC for ; Tue, 9 Feb 2021 13:39:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DB6E64ECC 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 A35036EB2B; Tue, 9 Feb 2021 13:39:35 +0000 (UTC) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2486E6EB2B for ; Tue, 9 Feb 2021 13:39:35 +0000 (UTC) Received: by mail-qk1-x72d.google.com with SMTP id q85so5581182qke.8 for ; Tue, 09 Feb 2021 05:39:35 -0800 (PST) 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=aQhoXa9jPalDWlVkfGxPk+c+I0Q9JZFKo47tCsmclHZEsPNYfreM817gCFAr4kOU8W fHBrAIQilQhVmk1iG9w5EWskZgjnukqG4cUDzLNZ6BylHXqnGvwuThK4UN4InIuRH/ze cvAS/4B/aBNt8AOe4VR/tiAtWA123wCajp47c9XzIXZFa0/I9e6/nmkjO6l7O80x9iCT kP9CrF06fB0beIFQO/9dbuqk7hvLl+4qLhMBYJj+SEwVoqE/HfXTlsjgBKUF7reYwTlf Ov9fDvgK+9WKyztUGrdI96zt7nHKT/h6nbpz8LPo9nETq4dWfycOqz7C26v5rJTgWElw YGyw== 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=q4gBt83LBvEvfgqjMk5XxBqoQUgJu0Updm2eupI2oTY=; b=AQCM3sdPcDjvCq8ozTCJso+YipbjzcfTASHFt5MKFoKQ5uz0RtjIYhILhKkHEv2vjm vEozAHk6mpPnO73XclwBj08cRRXLbr2B0+0LiispdoDpKGMWvq2qUWbcEjAdsPQOyM9U gv5TLd+pt79m397x/zipMHTCxFziUU6VUoQW6VBlu1C66Tkmv3l71j/8EhPgniMnMSnz E56s1EvJQfjqw4Q4EmPk52CSwkTaSrXJ32uPcWQ2167sKV2AIX5qX4r35oBorpaGsqhj K2LCV3V740/OBT0P9qtxO9mrEqHLmGekI7aGauUF3UFCx+sSpQjCFuiLIgp5jsqSmuM8 ueGw== X-Gm-Message-State: AOAM5316/7fLBRv9rOwp5Jhw1UsexSzJfv4Ib0YnQdjgHUtf7HlqMex+ 3QRMz/aXOSuI675gePyy4p+Ypg== X-Google-Smtp-Source: ABdhPJzETc8qT6BXd1BDQmX3B26rXpyj1TrCOmYb4Fqo0JHFF6LTk7HRkfK/22tofKGhVc50wAK02g== X-Received: by 2002:a37:5a45:: with SMTP id o66mr21362019qkb.446.1612877974387; Tue, 09 Feb 2021 05:39:34 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id m21sm17197217qtq.52.2021.02.09.05.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 05:39:33 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l9TEq-005RKt-Q3; Tue, 09 Feb 2021 09:39:32 -0400 Date: Tue, 9 Feb 2021 09:39:32 -0400 From: Jason Gunthorpe To: Alistair Popple Subject: Re: [PATCH 1/9] mm/migrate.c: Always allow device private pages to migrate Message-ID: <20210209133932.GD4718@ziepe.ca> References: <20210209010722.13839-1-apopple@nvidia.com> <20210209010722.13839-2-apopple@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210209010722.13839-2-apopple@nvidia.com> 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, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org, jglisse@redhat.com, bskeggs@redhat.com, jhubbard@nvidia.com, akpm@linux-foundation.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Feb 09, 2021 at 12:07:14PM +1100, Alistair Popple wrote: > Device private pages are used to represent device memory that is not > directly accessible from the CPU. Extra references to a device private > page are only used to ensure the struct page itself remains valid whilst > waiting for migration entries. Therefore extra references should not > prevent device private page migration as this can lead to failures to > migrate pages back to the CPU which are fatal to the user process. This should identify the extra references in expected_count, just disabling this protection seems unsafe, ZONE_DEVICE is not so special that the refcount means nothing Is this a side effect of the extra refcounts that Ralph was trying to get rid of? I'd rather see that work finished :) Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Date: Tue, 09 Feb 2021 13:39:32 +0000 Subject: Re: [PATCH 1/9] mm/migrate.c: Always allow device private pages to migrate Message-Id: <20210209133932.GD4718@ziepe.ca> List-Id: References: <20210209010722.13839-1-apopple@nvidia.com> <20210209010722.13839-2-apopple@nvidia.com> In-Reply-To: <20210209010722.13839-2-apopple@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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, kvm-ppc@vger.kernel.org, dri-devel@lists.freedesktop.org, jhubbard@nvidia.com, rcampbell@nvidia.com, jglisse@redhat.com On Tue, Feb 09, 2021 at 12:07:14PM +1100, Alistair Popple wrote: > Device private pages are used to represent device memory that is not > directly accessible from the CPU. Extra references to a device private > page are only used to ensure the struct page itself remains valid whilst > waiting for migration entries. Therefore extra references should not > prevent device private page migration as this can lead to failures to > migrate pages back to the CPU which are fatal to the user process. This should identify the extra references in expected_count, just disabling this protection seems unsafe, ZONE_DEVICE is not so special that the refcount means nothing Is this a side effect of the extra refcounts that Ralph was trying to get rid of? I'd rather see that work finished :) Jason