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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAEE0E77180 for ; Sat, 14 Dec 2024 15:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WzJW0Dxa8i83uf13tdPe4mY1mNQ+O1FvKqm+giPK/c8=; b=mez+cQTzJuNJzmumlrxdq39IwO Z8M0u7V8Le7Wz1om9MLWoQoB5RP66doEF9nfXjS1YiE3pggXn7J46YmZda6Bn0V4z/M/abo8kmelU 4RfLdB50iKpJuO/se1D8pMr19vzswxFyci4qP0Kvqa2ZwQpUPMYLZ/UdOP6dnydrGO6pL1U5URtsk 1rUPDHcjrP4QwXDJItoXq7UolnuSOKI6uh4xtgNcyca1Qne/PVo9CsFjHzX+GxGUKuoqwH5HmhwBU qzm2rmeVNFxYdmG8+oaqWNxDFyAttZgB7c4D7CvaHrpvWnPvQMDIDnkMsY9HNHwlwprO/RDj1m5jl Glg+BnRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tMU0D-00000006YNh-1zTV; Sat, 14 Dec 2024 15:24:21 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tMTz3-00000006Y8w-3lDO for linux-arm-kernel@lists.infradead.org; Sat, 14 Dec 2024 15:23:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734189787; 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:autocrypt:autocrypt; bh=WzJW0Dxa8i83uf13tdPe4mY1mNQ+O1FvKqm+giPK/c8=; b=PVxNFLLIZ8ckeORn0BbM0TPZLvWvhCSoFEHpsg2oeJCM0mnZp+S5qC20NvJq8FSAruPqW6 /vny9JsamR3m0vJA07TTkks5E+LWM3GI9UuLrxwShP/FWK9DzJ4c2k/X5j+QJkzyFvrHQ2 COAysVGHZz9FZ8FQzIWcsl0tSnNyQ50= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554---G5wSW6NsmLG9U303_UqA-1; Sat, 14 Dec 2024 10:23:04 -0500 X-MC-Unique: --G5wSW6NsmLG9U303_UqA-1 X-Mimecast-MFC-AGG-ID: --G5wSW6NsmLG9U303_UqA Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-436228ebc5eso15412455e9.3 for ; Sat, 14 Dec 2024 07:23:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734189783; x=1734794583; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=WzJW0Dxa8i83uf13tdPe4mY1mNQ+O1FvKqm+giPK/c8=; b=irHLZIgeu02K27rIXF8a3RTvI2tah5mgpYI+3NfqMJFYs7JZJZVgBQ/a9RN0gKZqqs 064i/iayDvzIjKxTxfcec/bUqCNzNQvxOMdPy2jyIgYgFAX7SRp46obtq/H9XsDwyqfi fn3KaGkQwevnOw37RG7lOeMXeSx0sEWa8RPwIap0xkNFLUMMhMGzHjQiGWN4U7FFCHR3 nYq8H2BGciiLcaSrDcS9C8ExFpSRnZTf+5YyzRj/tSvFnwpmDf5BZwX/9WjKiKM0DaoX uSTjzkBZ3KiWc1desj5toqhxch6E5R4uEHDQoR0pEAxArny8cciY8ZPg2x6gp/wU8qDg ydPA== X-Forwarded-Encrypted: i=1; AJvYcCUVD9KKlIZaiUqm/Mpi1/awOJXSoZsJFeb5G6wLuvkSbpaD1lqf+MKDIF41vyyhokRi2k4f+/H//cg7lki2lVYb@lists.infradead.org X-Gm-Message-State: AOJu0YxNaZ5ciqC5b2Rv1sdnrXio6E3pYl0dps+SptjB8AyApdvOb139 TVh6GG+CCApKnjl/26kxSA9zaeG3LLwSPOgoexCPBjaDHzASQvIrr4kcRKXkubdxP18PnYDM1xE U1wNDFLckaen4xA+A7DoKUVoDU2Sj0N0ifp3YrdP716k7hOmEAPX4tI8py3bugi9YbWEKIeM/ X-Gm-Gg: ASbGncudUhP/i78uM4TGdhbdlbRxlcQAhR4EL8Ip85v9Knt7OnrL7vrRZcK/SsPwGVr Y+uWyF7rMsLz2X+3E648i+/kOz+OzWNrfr7uTsU8FS+he0BzgYZ3QxOryP7poS6B8WLh2SnYY1r hoFScbWYyzyYk2vU+8KXe3HDoLBto4qbXzMOKqupSMxzL6iD1RdVP0l1JnYVomLkMrrlw3DPeFP HaiJQsM/KUM/Ynu8W743sbJ/Dz3Ac6wwYPmlzuRW/Qz4vBVRqHHaVwxttt2uEbQfXBOUKRlOAkd g1+DlCpkknBO7VLdOrsqOhacisIwgwOG3btSDbc+ifs+21ZE9zbLqXN28yPUDmRRa3PbunH2ARu eZ8ZuNKsH X-Received: by 2002:a05:600c:1c07:b0:434:a968:89a3 with SMTP id 5b1f17b1804b1-4362aa2e544mr63037895e9.9.1734189783525; Sat, 14 Dec 2024 07:23:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFroEMk6tFJ9Cy5+aMYXPulXjntj5yFN5KYCR5CVhsKcoZETtTRpp5EY+z8zXmRnRx7Xb1Kzg== X-Received: by 2002:a05:600c:1c07:b0:434:a968:89a3 with SMTP id 5b1f17b1804b1-4362aa2e544mr63037545e9.9.1734189783051; Sat, 14 Dec 2024 07:23:03 -0800 (PST) Received: from ?IPV6:2003:cb:c711:6400:d1b9:21c5:b517:5f4e? (p200300cbc7116400d1b921c5b5175f4e.dip0.t-ipconnect.de. [2003:cb:c711:6400:d1b9:21c5:b517:5f4e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43625550518sm82347835e9.5.2024.12.14.07.22.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Dec 2024 07:23:01 -0800 (PST) Message-ID: <45555f72-e82a-4196-94af-22d05d6ac947@redhat.com> Date: Sat, 14 Dec 2024 16:22:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts To: Dan Williams , Alistair Popple , linux-mm@kvack.org Cc: lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com, akpm@linux-foundation.org, sfr@canb.auug.org.au References: <675ce1e5a3d68_fad0294d0@dwillia2-xfh.jf.intel.com.notmuch> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZgEEwEIAEICGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAhkBFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAl8Ox4kFCRKpKXgACgkQTd4Q 9wD/g1oHcA//a6Tj7SBNjFNM1iNhWUo1lxAja0lpSodSnB2g4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Organization: Red Hat In-Reply-To: <675ce1e5a3d68_fad0294d0@dwillia2-xfh.jf.intel.com.notmuch> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WrqSf-FFIQWEoBkAREdv_D5vd-Ie1M3i1um59tlfI1E_1734189784 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241214_072310_049069_2B30EE50 X-CRM114-Status: GOOD ( 29.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14.12.24 02:39, Dan Williams wrote: > [ add akpm and sfr for next steps ] > > Alistair Popple wrote: >> Main updates since v2: >> >> - Rename the DAX specific dax_insert_XXX functions to vmf_insert_XXX >> and have them pass the vmf struct. >> >> - Seperate out the device DAX changes. >> >> - Restore the page share mapping counting and associated warnings. >> >> - Rework truncate to require file-systems to have previously called >> dax_break_layout() to remove the address space mapping for a >> page. This found several bugs which are fixed by the first half of >> the series. The motivation for this was initially to allow the FS >> DAX page-cache mappings to hold a reference on the page. >> >> However that turned out to be a dead-end (see the comments on patch >> 21), but it found several bugs and I think overall it is an >> improvement so I have left it here. >> >> Device and FS DAX pages have always maintained their own page >> reference counts without following the normal rules for page reference >> counting. In particular pages are considered free when the refcount >> hits one rather than zero and refcounts are not added when mapping the >> page. >> >> Tracking this requires special PTE bits (PTE_DEVMAP) and a secondary >> mechanism for allowing GUP to hold references on the page (see >> get_dev_pagemap). However there doesn't seem to be any reason why FS >> DAX pages need their own reference counting scheme. >> >> By treating the refcounts on these pages the same way as normal pages >> we can remove a lot of special checks. In particular pXd_trans_huge() >> becomes the same as pXd_leaf(), although I haven't made that change >> here. It also frees up a valuable SW define PTE bit on architectures >> that have devmap PTE bits defined. >> >> It also almost certainly allows further clean-up of the devmap managed >> functions, but I have left that as a future improvment. It also >> enables support for compound ZONE_DEVICE pages which is one of my >> primary motivators for doing this work. > > So this is feeling ready for -next exposure, and ideally merged for v6.14. I > see the comments from John and Bjorn and that you were going to respin for > that, but if it's just those details things they can probably be handled > incrementally. > > Alistair, are you ready for this to hit -next? > > As for which tree... > > Andrew, we could take this through -mm, but my first instinct would be to try > to take it through nvdimm.git mainly to offload any conflict wrangling work and > small fixups which are likely to be an ongoing trickle. > > However, I am not going to put up much of a fight if others prefer this go > through -mm. > > Thoughts? I'm in the process of preparing v2 of [1] that will result in conflicts with this series in the rmap code (in particular [PATCH v3 14/25] huge_memory: Allow mappings of PUD sized pages). I'll be away for 2 weeks over Christmas, but I assume I'll manage to post v2 shortly. Which reminds me that I still have to take a closer look at some things in this series :) Especially also #14 regarding accounting. I wonder if we could split out the rmap changes in #14, and have that patch simply in two trees? No idea. [1] https://lore.kernel.org/all/20240829165627.2256514-1-david@redhat.com/T/#u -- Cheers, David / dhildenb