Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5963953pxb; Mon, 14 Feb 2022 11:50:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg1AKnZ6PKcrvQI/D5H+ugoBwcic2I620c1O6QU4pB9GS8XrQDTYy1cREmu0rJog1MvxyM X-Received: by 2002:a17:902:e294:: with SMTP id o20mr495639plc.58.1644868218109; Mon, 14 Feb 2022 11:50:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644868218; cv=none; d=google.com; s=arc-20160816; b=YW5xOUo2lxMlKrzrUc8h9v3AQEJJt4RHLIN7sSb3R0JiMxIYx1cXVDgKBagnfrq1KB S+PNkXWOa5fKS2hiY0PXgaYglNVzzoiIVmqD+VJ7c/vFiOMv9b8gPO/u6onUJ805zNWx MYjehBOJ0oDKzegOKuK334PGNO5cpT+XidZtZBaEGmZqXKRWqDwad4GqYNtxA32qOf2x 943CkEfAoRAobVQp9nNMiexuusFoTi0WeUy5QdQGhicZw/z7A7IKRi39508btNaKvYwJ 0zb3i+TRIi4pSeoP+pOwH8Iakk9ngQGbpbc2tMz0rDZYwYD1YVY37aD84GXrnsuII/vu WXwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=81T6G2gHhfqrUwjVu5v8ouNRyx7VLTFiBZVLTO5rh/c=; b=DL61yUWpMk10MqVnxaOFN6AshyPHVMjQ/GOH78t/+xP5WiacL3hAKr46G8L/+EGE3q BlOJPjAX3yBb2Gc3hHM8FOgd+DYLyfwaJuxKHWat5tSkbKHjN/Om6bvwDNWYtuZqEZJx uNc2B1hxvqEtvMnl8K1onigQP2xnm6OtuHs0Bvbu54pmQxEQuLv8fd18Nrsl6WDGEPZc AhIKaBAAHZB906baABnlDohxEhvEsc43ZylXg+3U9Hx6DAPFFN85wmTjXBnWdTjaWY2V Qi78EtKNrnrFuJtEMRPcQAOOJvH9wU4UbpF5C2kChvKXXFoj+fOLqz4yEH4r+/Su+Uvb y+Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=Xd5rMP5h; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x125si15230586pfb.169.2022.02.14.11.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:50:18 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=Xd5rMP5h; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3855A12559C; Mon, 14 Feb 2022 11:33:30 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235784AbiBNRiG (ORCPT + 99 others); Mon, 14 Feb 2022 12:38:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbiBNRiE (ORCPT ); Mon, 14 Feb 2022 12:38:04 -0500 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B086541F for ; Mon, 14 Feb 2022 09:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:content-disposition; bh=81T6G2gHhfqrUwjVu5v8ouNRyx7VLTFiBZVLTO5rh/c=; b=Xd5rMP5hIZ0JwEE5p27UvD5QtH uCKd6i9XJg/PaBgi6VN01LvkTgzF6dtOL5wLEtbJtX37eKseK5Y7oQ9o/s1OPdTKqfznafrAyROqV MvNbDVdIgTbNEkyIOgzIBP6oTlTRCMIEBnG1ruZ9t2c+8ikid2c3sF1JDRXcbRnWRXDMHGWWDcI1t p6ha2v4ejdP6uPSa5r0VHjlrYpIXkaGki0cX0XXachfz6/U5Ll/GgQATG132vKqIk5mo62p6fk+SE gfw5DLnPL8RNLsPVhaaXiA+obF/x9nVyln4voBum/rQ3jkIgpv60w8nBYNSDluMB6z4KrGgNUk6NQ OxLOcjaw==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nJfIJ-0004H9-Iu; Mon, 14 Feb 2022 10:37:48 -0700 To: Christoph Hellwig , Andrew Morton , Dan Williams Cc: Felix Kuehling , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , Ben Skeggs , Karol Herbst , Lyude Paul , Jason Gunthorpe , Alistair Popple , Ralph Campbell , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, nvdimm@lists.linux.dev, linux-mm@kvack.org References: <20220210072828.2930359-1-hch@lst.de> <20220210072828.2930359-10-hch@lst.de> From: Logan Gunthorpe Message-ID: Date: Mon, 14 Feb 2022 10:37:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220210072828.2930359-10-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-mm@kvack.org, nvdimm@lists.linux.dev, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, rcampbell@nvidia.com, apopple@nvidia.com, jgg@ziepe.ca, lyude@redhat.com, kherbst@redhat.com, bskeggs@redhat.com, Xinhui.Pan@amd.com, christian.koenig@amd.com, alexander.deucher@amd.com, Felix.Kuehling@amd.com, dan.j.williams@intel.com, akpm@linux-foundation.org, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Subject: Re: [PATCH 09/27] mm: generalize the pgmap based page_free infrastructure X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-02-10 12:28 a.m., Christoph Hellwig wrote: > Key off on the existence of ->page_free to prepare for adding support for > more pgmap types that are device managed and thus need the free callback. > > Signed-off-by: Christoph Hellwig Great! This makes my patch simpler. Reviewed-by: Logan Gunthorpe > --- > mm/memremap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/memremap.c b/mm/memremap.c > index fef5734d5e4933..e00ffcdba7b632 100644 > --- a/mm/memremap.c > +++ b/mm/memremap.c > @@ -452,7 +452,7 @@ EXPORT_SYMBOL_GPL(get_dev_pagemap); > > void free_zone_device_page(struct page *page) > { > - if (WARN_ON_ONCE(!is_device_private_page(page))) > + if (WARN_ON_ONCE(!page->pgmap->ops || !page->pgmap->ops->page_free)) > return; > > __ClearPageWaiters(page); > @@ -460,7 +460,7 @@ void free_zone_device_page(struct page *page) > mem_cgroup_uncharge(page_folio(page)); > > /* > - * When a device_private page is freed, the page->mapping field > + * When a device managed page is freed, the page->mapping field > * may still contain a (stale) mapping value. For example, the > * lower bits of page->mapping may still identify the page as an > * anonymous page. Ultimately, this entire field is just stale >