Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4365488pxb; Sat, 12 Feb 2022 02:40:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDj+RXRACo5Ymx8CfE0xeUolIFI5kzS/Qu5dmaD2A17HMGScOUKv8LY/suHsFdg05ysfyt X-Received: by 2002:a17:906:99c2:: with SMTP id s2mr4441693ejn.317.1644662431473; Sat, 12 Feb 2022 02:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644662431; cv=none; d=google.com; s=arc-20160816; b=V43mvZXsTNx8PcG+wsZHFVzmrWw4ivfjjOjDeXkG2pRJ+aiwja7xFQ0mNyB++rk1A7 FMdOJ+f7YBm3TkRDwc/9ct9tFMABt3LjTt4jchM/DSp8IeHPrv+YOKGakRcxCvMomFAU fCq5OT0lMpoV+uGmqE2QLmlFRPb4k5qymh/Ku3brpuU/INVLrPE+oKi9c9UDLVlPpL8+ oNwPwaisc3xa8J9KXk8OB+uNTR8veT3TNdRXFDYAlcHVQ4NTYjLTklbn27qA/EW4e7ji 0l3WDayozqkOgsrJrTaRdrWs26IrUoLKuRKXeKdCsmTdKld+pzaWicJzWKy7q/Wr8HNc YpNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=52cEaDM7AWwIPaCJI/Mv+zVmcSm8DpO7Z0SPMFeXq1c=; b=0PS65BlFcaPAntE2r44tQAvTgcEzwHXQejH8gPJk8/P2aqQJTdsuTDBYyMnP2w58wN URgaNjiootsVm+DYEiMKgP+QaVgpVRX48B2Ch/JFO5mu/mlYGYN9JFxL3keYEsasREaE sd8LR1/YVhVF+HoLYDCCjIyaNWaYzMZ+pWTl8wDUD+gjWnApWsE8jjTldH8Q17ZADl7I BOiTpuYlv+mDik1aW4Yh+WJt2U0w+f5+F5dkgTQFIFBezVdsrGJ9IklwWNtTlJBsq551 7Cqb88nCPtIV9rifth0j3CCSUhMnIfPlFh3uKjjIcGy0yoZPxM3MvZsBcdSwN9Qlp2rR 5coA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bJLO6AY3; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fz1si9337195ejc.316.2022.02.12.02.39.54; Sat, 12 Feb 2022 02:40:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bJLO6AY3; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344717AbiBKQjq (ORCPT + 99 others); Fri, 11 Feb 2022 11:39:46 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349644AbiBKQjp (ORCPT ); Fri, 11 Feb 2022 11:39:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 98F90CCA for ; Fri, 11 Feb 2022 08:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644597583; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=52cEaDM7AWwIPaCJI/Mv+zVmcSm8DpO7Z0SPMFeXq1c=; b=bJLO6AY3o67F1huAqMfx4YN1y0Y5CKMTW+rD9APQ/veSsJQi6T7IGi6TwlgoQZ7ewhYpKG VMW/ZQ/l/j2DBGTW2BZlvu+avhijFWWMaYDriKi2jw+85UBZwgV14hOi0VgUTdT8l9ymsK 8qpCXyTRu6lHB5Zce8LEiZ+ywT89vfw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-zxOg0D0uPue6qDjWPrFn1g-1; Fri, 11 Feb 2022 11:39:42 -0500 X-MC-Unique: zxOg0D0uPue6qDjWPrFn1g-1 Received: by mail-wm1-f71.google.com with SMTP id be14-20020a05600c1e8e00b0037c2a7b3ab6so894419wmb.9 for ; Fri, 11 Feb 2022 08:39:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:organization:in-reply-to :content-transfer-encoding; bh=52cEaDM7AWwIPaCJI/Mv+zVmcSm8DpO7Z0SPMFeXq1c=; b=YL7z6eKW6qb45hQRSjYU4zdet+ThLihDzw0GQc+0V5XDE1FwfwmjSotioF2Ic1fsvL NChroIQeO50jRKCXrsNTc4N+uy6SrQKKiBDd6aJ15S+prkGkWkxR52IcVffEOwBmCaDP bmdwuoHkTgldpXna/ki6BKGsaWrVOfOPWWfLYJN1+WgdALhS5MGrVruygsB64YAhlIjZ t8j+msHleAWcqwpr9RUHDEuRi0/P8jJlwp7TWG3YIq1VI6VfaMF+cYFD1E5nNuUc3fXL KJHGyRQM+Qx4nEKup5oKYetiTMXyf565WELLpfi6qb8nt+pjDOOEfKAusShohRs9o6fu fuoQ== X-Gm-Message-State: AOAM532K1wQJUCCbLpSQUQFMGeYb/LW5pmrG84XM/d8Wy41N6VcD3aeD nfMIgzvdE9mT17GRlf490QepZrsCTnSLjU6iHvkwCETYss2HV8jYOEBrOKCUSfdG6rLh+GSoh6T l55XCEHPVM0fv61sa1pGeQA== X-Received: by 2002:adf:fd8b:: with SMTP id d11mr1992002wrr.324.1644597581301; Fri, 11 Feb 2022 08:39:41 -0800 (PST) X-Received: by 2002:adf:fd8b:: with SMTP id d11mr1991978wrr.324.1644597581081; Fri, 11 Feb 2022 08:39:41 -0800 (PST) Received: from ?IPV6:2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f? (p200300cbc70caa004cc6d24a90ae8c1f.dip0.t-ipconnect.de. [2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f]) by smtp.gmail.com with ESMTPSA id d18sm1232773wmq.18.2022.02.11.08.39.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 08:39:40 -0800 (PST) Message-ID: Date: Fri, 11 Feb 2022 17:39:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v6 01/10] mm: add zone device coherent type memory support Content-Language: en-US From: David Hildenbrand To: Alex Sierra , akpm@linux-foundation.org, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jgg@nvidia.com, jglisse@redhat.com, apopple@nvidia.com, willy@infradead.org References: <20220201154901.7921-1-alex.sierra@amd.com> <20220201154901.7921-2-alex.sierra@amd.com> Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 11.02.22 17:15, David Hildenbrand wrote: > On 01.02.22 16:48, Alex Sierra wrote: >> Device memory that is cache coherent from device and CPU point of view. >> This is used on platforms that have an advanced system bus (like CAPI >> or CXL). Any page of a process can be migrated to such memory. However, >> no one should be allowed to pin such memory so that it can always be >> evicted. >> >> Signed-off-by: Alex Sierra >> Acked-by: Felix Kuehling >> Reviewed-by: Alistair Popple > > So, I'm currently messing with PageAnon() pages and CoW semantics ... > all these PageAnon() ZONE_DEVICE variants don't necessarily make my life > easier but I'm not sure yet if they make my life harder. I hope you can > help me understand some of that stuff. > > 1) What are expected CoW semantics for DEVICE_COHERENT? > > I assume we'll share them just like other PageAnon() pages during fork() > readable, and the first sharer writing to them receives an "ordinary" > !ZONE_DEVICE copy. > > So this would be just like DEVICE_EXCLUSIVE CoW handling I assume, just > that we don't have to go through the loop of restoring a device > exclusive entry? > > 2) How are these pages freed to clear/invalidate PageAnon() ? > > I assume for PageAnon() ZONE_DEVICE pages we'll always for via > free_devmap_managed_page(), correct? > > > 3) FOLL_PIN > > While you write "no one should be allowed to pin such memory", patch #2 > only blocks FOLL_LONGTERM. So I assume we allow ordinary FOLL_PIN and > you might want to be a bit more precise? > > > ... I'm pretty sure we cannot FOLL_PIN DEVICE_PRIVATE pages, but can we > FILL_PIN DEVICE_EXCLUSIVE pages? I strongly assume so? > > > Thanks for any information. > (digging a bit more, I realized that device exclusive pages are not actually/necessarily ZONE_DEVICE pages -- so I assume DEVICE_COHERENT will be the actual first PageAnon() ZONE_DEVICE pages that can be present in a page table.) -- Thanks, David / dhildenb