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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D977BE7717D for ; Wed, 11 Dec 2024 11:56:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 702856B007B; Wed, 11 Dec 2024 06:56:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 689986B0278; Wed, 11 Dec 2024 06:56:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B5B66B027A; Wed, 11 Dec 2024 06:56:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 721786B007B for ; Wed, 11 Dec 2024 06:56:21 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EEC6D80A62 for ; Wed, 11 Dec 2024 11:56:20 +0000 (UTC) X-FDA: 82882524438.07.EB72BFF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 19EFF180004 for ; Wed, 11 Dec 2024 11:55:54 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=R1VVLNxy; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733918163; h=from:from:sender: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:dkim-signature; bh=326SpeeyCAzcNnbN9vrCa6dkFE90sV+UdZih9OatjL0=; b=azG5iI8hWbYuEZFY72e3JFjnlS62WrFxFE9EQ7pPe+0/5/IEvXTJFk/pamPyGG9tv+5yKZ 1zyBjP7ce2ZQG0uBJdmytwQky0OT1IbKSwdgKch7L8dSPb78pQgaFTF/PrlfTsxOSZFcSw dT25kFHN9oJqyknN7bTTCFopVIIk7yI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733918163; a=rsa-sha256; cv=none; b=aBQxcxatMNjFstAHKIC0QdWLjfKTBXdemZkE22n+UT0rCCQ35TiQwXZSc4ygJsXmG5Ci6D UJuJOfmmqV/tPdt0/s/BG3YWjyA8V/RSqiOdG4BA47tBdNs2ZqbeQBLnE+tvx85tfn9BVN luGdc9kwuBkUoepyfdBCYhUVDJuN3fk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=R1VVLNxy; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733918177; 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=326SpeeyCAzcNnbN9vrCa6dkFE90sV+UdZih9OatjL0=; b=R1VVLNxynmxLNyqhO7LFO6aOa+bucOK1T/TtzbI8y89Cqd0WWegr2W+K3EG2fAyH1g8oRF E4ogKaHz73yh4XQHggczVmlmHzdU9PxpERuJIRitI4O5PHjaxeM8U9k+Iw9bHaOzNIgMnW IMWooFdn2oGHZCBd4DvBP7crtAcpqUc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-417-Y49ArG9IMQOuMFloshJ86Q-1; Wed, 11 Dec 2024 06:56:15 -0500 X-MC-Unique: Y49ArG9IMQOuMFloshJ86Q-1 X-Mimecast-MFC-AGG-ID: Y49ArG9IMQOuMFloshJ86Q Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-385e9c69929so1671114f8f.1 for ; Wed, 11 Dec 2024 03:56:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733918174; x=1734522974; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=326SpeeyCAzcNnbN9vrCa6dkFE90sV+UdZih9OatjL0=; b=q/Y5pYZ3308Xrly2iO4f/KN5ctYEud3L+DCF60VThgVg4e41roBW4NbD8k2zLduZpo J4+HfmK3xj+LScEz1V2Rzujm/xfSSY7gLbi9/tqBBW3QK+6s1YbhMHAfbaK4ijr9X08D R5wQOMSIygkdR5QcZi0WXwdzfAafvCP3yXw2/158/kVXaS+1fR/rwa0SsLRyvGZuBelo 82+KLDbTyl4Q6/5Ht4NNaoPfQ8IWDY0rT0CASJI1b3Da1331GOSBZdVpsULQpXUAegvT HjxtDAA1jxh/WkLFOuWCMs+zKZtFh8B+8CTG27grSTEU65TwRA3NjINRWj10EfVM965w CXgw== X-Gm-Message-State: AOJu0YzpFJ1i0m/slAj8yyrDA6Pf71y5SI2gVv3XiSgfgBgcZvtCeYhQ 7sc+ET/rgk3ZZBTxmie3nBbqQ61g9GjTvMnos6kYJLeLjv6wQdmfWfn0o+r4WQi0ocLkblQfFeZ mwa6xAC4bBiGKEsEuMdqmklNmTBqI+nZWFCt176kxjyUOOFCB3k93Tp08xOIrubvszw0RVNtCki nGqB4zXrGku1fQPDQcIn2R4+phdOU6sLE= X-Gm-Gg: ASbGnctA7wicDez+Ps4A5Qhm2Aec648SpW8bcqmBaQVmpX9aw3D1fnU0GcZXyHaKhCZ sSTx+coPxU+pT1Af2fzDz8WcpoV2w+/h4r4B9wIGfmFrbrraOUnBKSobMwnNk0quHBP7MAw+9PD P/qhaIwfIjjph2HusJuNU1ur6YAMMY3SlE+y6CVvIizRJR/69mVX30PuIQtW/Mx5XH2uAqjDRhT 31zOHyw06LDlUZQ9NmXneGc38vX//MV8FrRLC2McFLtkOb137NPoAFi6/efMog/twuvW2PghyUW X-Received: by 2002:a5d:59a7:0:b0:382:4926:98fa with SMTP id ffacd0b85a97d-3864cec56f0mr2111540f8f.40.1733918173785; Wed, 11 Dec 2024 03:56:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjzgQdDfQwaRsX/EoaWDKkBeEYnM+21iO2Q9bo06CzFVbRKY84v9hNi949zftNzW1mAdTDyQ== X-Received: by 2002:a5d:59a7:0:b0:382:4926:98fa with SMTP id ffacd0b85a97d-3864cec56f0mr2111513f8f.40.1733918173222; Wed, 11 Dec 2024 03:56:13 -0800 (PST) Received: from [10.32.64.156] (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526ac03sm264692935e9.4.2024.12.11.03.56.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Dec 2024 03:56:12 -0800 (PST) Message-ID: <3a9e7c3b-7b69-4f16-80ea-b1a0d4dba853@redhat.com> Date: Wed, 11 Dec 2024 12:56:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: The future of PageAnonExclusive From: David Hildenbrand To: "linux-mm@kvack.org" Cc: Ryan Roberts , Matthew Wilcox References: <9c2a17af-4df8-42f0-93c8-83133b6104fd@redhat.com> Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9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9w7Kv AxBQXWeXhJI9XQssfrf4Gusdqx8nPEpfOqCtbbwJMATbHyqLt7/oz/5deGuwxgb65pWIzufa N7eop7uh+6bezi+rugUI+w6DABEBAAHCwXwEGAEIACYCGwwWIQQb2cqtc1xMOkYN/MpN3hD3 AP+DWgUCXw7HsgUJEqkpoQAKCRBN3hD3AP+DWrrpD/4qS3dyVRxDcDHIlmguXjC1Q5tZTwNB boaBTPHSy/Nksu0eY7x6HfQJ3xajVH32Ms6t1trDQmPx2iP5+7iDsb7OKAb5eOS8h+BEBDeq 3ecsQDv0fFJOA9ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <9c2a17af-4df8-42f0-93c8-83133b6104fd@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QrRktmTVo0PV_GseAikBlhLXXPlp3e1JMLLV4v4wq1A_1733918174 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 19EFF180004 X-Stat-Signature: h9kip1pbbqgguxs8o1rhien368kmhqkp X-Rspam-User: X-HE-Tag: 1733918154-380094 X-HE-Meta: U2FsdGVkX1+//MW/Wce2BeloIgOD2rWPvUbVVSegoB/gQGQR8JpBJBNGWQUCEJmsEnIa1o3rw/Z+H4rIrd/8IezpYYmUWA85rLN5Gl5UBnn4Cveu7XmpbB51yqezv+knvqJCaEaNpXYpuVg9BsgF/qaVl+ZmyiKbmk1d7UoFLJSyQZhGapaZGbzOzGlgYTEBApyB3LrxRWtBqKz7ZLIOMCE5EAG+pNSkH4lBiZDsYXzO7BYh7x9JHjYTE4IeKJXtK5mzwemzdYKmFht6JMPXy0nHkdE9uSgejUF6a/4su7UXPtKZrPBnwZS4ogMQYm847+5XidBMSgqAPrw+vAts8Y+ojo/DlmCV1s52nGwHrOzE9H6H0Z/m3I0cdp04zTvqQJO7FUQLTgPKhI70lAeayjbLK8Z4sffWW603vNFS+qpvUW20P3EaRZivXAFgpewvHsK+1UHb7UXsUU7EaI//EDIF+HvjhG1mq7ajLXlvuw2rORGst5I3c7VfzFUiYGcEQgn+yMHufvk+kKUGjrwqFPyZ9/nXmdEU+VSxOft5cNOpfiy0F6n7pgh23BoVIS+j5Fbvn1oppftQ4PL5JleEsxJ2Hazk38xGr8AeFPkGwBuMUkY1BBxwwbEGD9AVERmJr/ialrFchPucZQv02iifWkM5cXSJZPKBm+jMx/uXOPW1HSjmCze4OuQhuNtKxFnapYNyjQiyY7kAf0/wZNXwEhkw7TXX9IwhWk02RVff2p0rEl6w+S8x1RGAZogWsyfMw5xUR8vJEMBR4UQtOq8PLC4lrSig2rRzT6njhPDE6Mqiqwu7s5Yl3ayseKXHAi1Wxipsklak/FRYIELP+qTD/BFc+i2XBa7jSeGGgsyhp0jFw0IiqRHOvRDA/B5BImBLxTxzfp357rSICo++QSORfWUq9zIBod/5ZJChCHPobhs+bNOYj+3j12vxGl+owIZX4HboDcqir/wCakUR75c 5PD+vRl8 MBs0QEY6j8B7JEZ36z2hMzVBLGsnPgXRskXtidqykaUUWtThyBBxMGo9FmWTGhCV00Xz+7X3IjTcSeeqk+gut+wAtCcjrS0Fw9qe3zytuXi1ykI+1dPosr28NbH219lCL1zSfDcPgANobsqL8YP8YaFcu7iFTm+zIb2ietXu2cChdkrr1uv6M5xF1iYPmZ7YM0BSCRHKMIlQFnG7O+h7b7RAkivPNBk9R4fSKfQdTbURTqiw9NM4E56RNbSKVuC+Gk9nsJeqMYOlH3+NzdUp43f4yJlFxcqsLG53hBpW0RCyCDx8gDUHRaQt6md9jxwKc3iENOuyUOVZiYCX7KERJRZWmHhAA9x+JjhfO+oREOtyhSf5UdY9HqEpU000pf2SBImJbsaelBisHB5tX+Z+DJLQ3qc70PKS+UZr1zzW4E1Q8BP5QJAjPiFm7ppAwyrizre7wMVl7pI3qFUo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now CCing the correct Willy :) On 11.12.24 12:55, David Hildenbrand wrote: > Hi, > > PageAnonExclusive (PAE) is working very reliable at this point. But > especially in the context of THPs (large folios) we'd like to do better: > > (1) For PTE-mapped THP, we have to maintain it per page. We'd like to > avoid per-page flags as good as possible (e.g., waste in "struct > page", touching many cachelines). > > (2) We currently have to use atomics to set/clear the flag, even when > working on tail pages. While there would be ways to mitigate this > when modifying the flags of multiple tail pages (bitlock protecting > all tail page flag updates), I'd much rather avoid messing with > page tail flags at all. > > > In general, the PAE bit can be considered an extended PTE bit that we > currently store in the "struct page" that is mapped by the PTE. Ideally, > we'd just store that information in the PTE, or alongside the PTE: > > A writable PTE implies PAE. A write-protected PTE needs additional > information whether it is PAE (-> whether we can just remap it writable, > FOLL_FORCE to it, PIN it ...). > > We are out of PTE bits, especially when having to implement it across > *all* architectures. That's one of the reasons we went with PAE back > then. As a nice side-effect it allowed for sanity checks when unpinning > folios (-> PAE must still be set, which is impossible when the > information stored in the PTE). > > > There are 3 main approaches I've been looking into: > > (A) Make it a per-folio flag. I've spent endless hours trying to get it > conceptually right, but it's just a big pain: as soon as we clear > the flag, we have to make sure that all PTEs are write-protected, > that the folio is not pinned, and that concurrent GUP cannot work. > So far the page table lock protected the PAE bit, but with a per- > folio flag that is not guaranteed for THPs. > > fork() with things like VM_DONTCOPY, VM_DONTFORK, early-abort, page > migration/swapout that can happen any time during fork etc. make > this really though to get right with THPs. My head hurts any time I > think about it. > > While I think fork() itself can be handled, the concurrent page > migration / swapout is where it gets extremely tricky. > > This can be done somehow I'm sure, but the devil is in the corner > cases when having multiple PTEs mapping a large folio. We'd still > need atomics to set/clear the single folio flag, because of the > nature of concurrent folio flag updates. > > (B) Allocate additional metadata (PAE bitmap) for page tables, protected > by the PTL. That is, when we want to *clear* PAE (fork(), KSM), we'd > lazily allocate the bitmap and store it for our page table. > > On x86: 512 PTEs -> 512bits -> 64byte > > fork() gets a bit more expensive, because we'd have to allocate this > bitmap for the parent and the child page table we are working on, so > we can mark the pages as "!PAE" in both page tables. > > This could work, I have not prototyped it. We'd have to support it > on the PTE/PMD/PUD-table level. > > One tricky thing is having multiple pagetables per page, but I > assume it can be handled (we should have a single PT lock for all of > them IIRC, and only need to address the bitmap at the right offset). > > Another challenge is how to link to this metadata from ptdesc on all > archs.. So far, __page_mapping is unused, and could maybe be used to > link to such metadata -- at least page tables can be identified > reliably using the page type. > > (C) Encode it in the PTE. > > pte_write() -> PAE > > !pte_write() && pte_dirty() -> PAE > > !pte_write && !pte_dirty() -> !PAE > > That implies, that when wrprotecting a PTE, we'd have to move the > dirty bit to the folio. When wr-unprotecting it, we could mark the > PTE dirty if the folio is dirty. > > I suspect that most anon folios are dirty most of the time either > way, and the common case of having them just writable in the PTE > wouldn't change. > > The main idea is that nobody (including HW) should ever be marking a > readonly PTE dirty (so the theory behind it). We have to take good > care whenever we modify/query the dirty bit or modify the writable > bit. > > There is quite some code to audit/sanitize. Further, we'd have to > decouple softdirty PTE handling from dirty PTE handling (pte_mkdirty > sets the pte softdirty), and adjust arm64 cont-pte and similar PTE > batching code to respect the per-PTE dirty bit when > the PTE is write-protected. > > This would be the most elegant solution, but requires a bit of care > + sanity checks. > > > Any thoughts or other ideas? > -- Cheers, David / dhildenb