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 07AC6C021B1 for ; Thu, 20 Feb 2025 09:24:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 949B12802B5; Thu, 20 Feb 2025 04:24:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D35F2802B4; Thu, 20 Feb 2025 04:24:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 725A62802B5; Thu, 20 Feb 2025 04:24:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 508292802B4 for ; Thu, 20 Feb 2025 04:24:08 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 00A93A2D3F for ; Thu, 20 Feb 2025 09:24:07 +0000 (UTC) X-FDA: 83139786576.18.D9186C4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 50E78120007 for ; Thu, 20 Feb 2025 09:24:05 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KYWEBBYj; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1740043445; 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=fFvyCIWMKh3wka+TR0+Xm2EQq9FKeB2rd7/ppzgWCJ4=; b=Y+omyt4+JW0EEnaqjlYMLFaZOGqr8IFKsrTnx7XsMXgp39G39tGmZjFAFanfqBEH9xsYid OEwTPtKDFdon8mARQGtWMaz+rJOfKHWIKl9sbvIuVKeTdFv3pX88yfL7DiedpTFl+1twD2 zHce2BYluunNN75uyuxrH40YuAGd6rU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KYWEBBYj; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740043445; a=rsa-sha256; cv=none; b=P32JyR2cgrd83S1SDzNS9UscqSjrvdcvsRsCxJj+gq8CztyctRpz3jEhab+KpovS8s077T g1/j9fkFFRoo8SiN/Zj/H0amlpR8QC7dfmOmsomt/bfOe5YkFh6sJzez1kKm0+6D8ypbkD DwidVkzRQRC4BdrjJwQAMFM5GASjfbw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740043444; 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=fFvyCIWMKh3wka+TR0+Xm2EQq9FKeB2rd7/ppzgWCJ4=; b=KYWEBBYjE2C38KGtaNQxKz5BmaZmtGu4P4D0Q3SP7Wha7yT5a/TH47o18O3HgHg/AxbZKL mremH6tIzljT2f0Hm9H2nsa/XRbdbXltv7wFGX74VPsaQfMJBo7RUzYn+DI3ew4kwMDHai BGgHwcJg4avljV5qKlU1Hy53cToqfUI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-d_qK9cB2MZyM-Cf3XhMc2Q-1; Thu, 20 Feb 2025 04:24:02 -0500 X-MC-Unique: d_qK9cB2MZyM-Cf3XhMc2Q-1 X-Mimecast-MFC-AGG-ID: d_qK9cB2MZyM-Cf3XhMc2Q_1740043441 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-38f28a4647eso333174f8f.1 for ; Thu, 20 Feb 2025 01:24:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740043441; x=1740648241; 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=fFvyCIWMKh3wka+TR0+Xm2EQq9FKeB2rd7/ppzgWCJ4=; b=HgOCt2GY6141sqKKg9lIekCsq5BCGNiJtS7hRWcDwKj6BnScHmBfhIOkbXOcShhI3A +LH52Vl0HDMr5evHBse0kZedIMsZakEGm3+xPvho5YMNqPILcnXP3FqDD3XpaYe9DCMO j2EBt+pPMg6Fkwejps9ZjoBsZai6X6WLBEcX4vPoPZphlj+dLJUwBwSdePam6QiNvL3M s0wJJcvidIDX1lzmfuZS75pPIvCFL9YL6rcraMwoSyQPRd/xiqZAroRmMWIXvEiZ6FFn EZ2KMIfwkVUEPEAdVP+R9CHdf2Z4qxj6tCLx90xAha3s/HjMn9XBu1OZrK8tOohIskjv x8xA== X-Forwarded-Encrypted: i=1; AJvYcCWx5m1eLM6pXN3wjuAChM2vi27KRywNP8RbQWa4TS0IplNodAvjkhBUvTzAQdUlqO/l9baP6E6QDQ==@kvack.org X-Gm-Message-State: AOJu0YwRPKMwwMUVXdZ3goRTHVHcptkHSBXOGjF0z7FU1CHzgyWZDq2i Dlm1B0Xiy4KxvgDycLyIOW6nl7hwZSLtwVNK8X9e7cXUEaYE1xWuWeMaD0SDl71dfb/GAUlqpsS y6HaZrPMqxNVzs5pXcHlgRq4WC5PLSEKOEj5UnCHnMLayLFEk X-Gm-Gg: ASbGnctEZs8cu0YjwHAqmQ9fhXQzAVgTSQLtaF+0jMZhqPWzGoMdc8EuYaShH90mOrU vb6pFSv/Yd9iOTjGpUHEl3rd7eaVcLTLPrVmtOwPfgQuSLCDqcYcndDsDtKa6CxGtXsAzKji9pG sShlYPCwc8fk6RlACuBbOIA6VSlt+jDbfQ34itTZrTdsiI2IhZTggxvkO+2Rtz4IeLsyQ1SJByT N+zxeM9qbMEY55jpjXma379oNjVQtnPFjurKj0pdHARWL5I5GsSxZQyCqa7GpzzNXzK9dDfyu4U 2BatCYzAA8jXqoknSPTx1hSkp6ajDx9W4Y2HAkll3RSgjIrkOTzM92lwjz7UsJK11FH2U0XDtNf okm1Ylb38+VeUoTycYDW4do871TqUGA== X-Received: by 2002:a5d:6402:0:b0:38f:2f0e:980c with SMTP id ffacd0b85a97d-38f33f57c13mr13344122f8f.47.1740043441317; Thu, 20 Feb 2025 01:24:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGI3roX65hkIqh5GF76I3lV0G/tJhHexZzeUM6o+hPY34QemFDlxno+ImnmvamvVYBP2oAW3A== X-Received: by 2002:a5d:6402:0:b0:38f:2f0e:980c with SMTP id ffacd0b85a97d-38f33f57c13mr13344095f8f.47.1740043440896; Thu, 20 Feb 2025 01:24:00 -0800 (PST) Received: from ?IPV6:2003:cb:c706:2000:e44c:bc46:d8d3:be5? (p200300cbc7062000e44cbc46d8d30be5.dip0.t-ipconnect.de. [2003:cb:c706:2000:e44c:bc46:d8d3:be5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f2591513bsm20268843f8f.55.2025.02.20.01.23.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Feb 2025 01:23:59 -0800 (PST) Message-ID: <387f3516-99f2-41e9-967e-4b051a8d21b8@redhat.com> Date: Thu, 20 Feb 2025 10:23:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] mm: permit guard regions for file-backed/shmem mappings To: Lorenzo Stoakes Cc: Kalesh Singh , Andrew Morton , Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , Vlastimil Babka , "Paul E . McKenney" , Jann Horn , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org, John Hubbard , Juan Yescas References: <45297010-a0a4-4a42-84e8-6f4764eab3b3@lucifer.local> <41af4ffb-0383-4d00-9639-0bf16e1f5f37@redhat.com> <6e356431-5ac9-4363-b876-78a69ae7622a@lucifer.local> <4aa97b5c-3ddc-442b-8ec9-cc43ebe9e599@redhat.com> 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/pT4wJCfxwocmqaRr6UYmrtZmND89X0Kig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+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: H5QVorCj2DYC0OPaoCKrIU8sDC-QtRDMVKwCEsnhufQ_1740043441 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: rspam04 X-Rspamd-Queue-Id: 50E78120007 X-Stat-Signature: bsn5npmgrzg7bj7mkapo4decfjxz5bdp X-Rspam-User: X-HE-Tag: 1740043445-929912 X-HE-Meta: U2FsdGVkX19jAv4tOefkUjkuM42qaYLsp26x+soK6A71AK9VTUzXuIwhjE0i7diHBQeQtQJExhFyImEDodO3VH/Ss/9GNllDNmOXOzy3AgoUkiwP3jDppF4Hj3pZ7iJBdml/ZvztEpv1MTVoXAKONEguwx6RxkLIM1FDN6xnB5lQPplyOnILjh3HZLVRm2hOz88wdBzTrTfTiiit1wZzq5GpvQPFLyihuVAjpGditryBHMiQ9TZ4uhb/3Du0sS8lAPLurMwE+apV2VxbHo1ZEGNlBBHuVzZDDU+2Ii83xSd42XLmDcLvbgahZbTqtroSNKDJULkSZggksCSphjWhv8/NX+xGBqGwFrjXuMrg5zqJpYRmY72+yaYXgC2rGc49VYRq7XCNww5tH5hdQt4T7haDwdImmFhdLW1eRvmLr/3u83Y7hYVadxtYD+OpBB9y+3K3LZL7cs7fdarGovse6YR4e158txa7Kjb4qHQJ52lslQYoeIs8nnhfh7I3gCA8J49RCl/n5LzWyiZE4r60JHnpbX0bPpERRSDq09Ujo2U2iogu/IxWmFbaHGiXMp//cxp3faAYxjg5X7Qg3E1tChtZKT4Dt9T/VO5lDwB/wBSTSdRPEutYiQXShaDH6nMbtpw7im7qkhOI3njF7231LwUSbxwvUu9yU19TWf1eYJsJ9/hQRC4cQwTcDCJLOYRuqviYAXPbln6eu8SkiZrkEpiaxtaZSTtSz+lXi3/8vkKM841YPJdm9aJ73Ci8nbjvYk8JDXMD0cJpvliNmYBMiO4bJR/tD1e1RqJDFl6MHwSOuIUjk/npSqElvhq9RKSBaf2TscNUnI9L7tuoqeckOPVWbVn7+fiOcg+qJuMMlwvsQBWATJFlZRM2mSSVoWMHY5yWDMv9BIrHsVvq4tj/OToGn+tJW7bFx0lPsYxBCE3d1NbUZhpjeG08X0S6epUOklm/4wTLhLqIwoqHiGu GdezywDX sg32GVrdtEa5qrAnp5g1Lf8GeslHe+cBxBUQ9omr2PIPYYXC2pqHh28YpKEksM+TgdPVpUkn+sDQ+qIgrTlGFf8BMT2VX+mC6dEu0tMvOriyFsyY3XDyBbc34emLA1H3jWzIJ4cgMEVrWPJRpyQevxS8KqZevpjn2y3AuJKj9IdDb4yrmGGJgNL5JSCIKkdUEQal61+9g/z/uD/wzLUgqJR1kmWOMxNKyNHQdpw7uvVa/R/Je8+ckfkM6LkEf/2rqN7qEgb3LZ0KVgdVnAFqekFiIJ+pTV6K+tucJhaJ3c3LJZl5aG8nwHM0AyVmGv2fxqX3FfDT6tZ7A8tZzxkvYr5I86Ei7krhU9yx3J5FEH/G6+MZ7ZSBWrmM0iog1YesTRUr+DqNQ5ro/R7Wq8gph4Id3VQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 20.02.25 10:04, Lorenzo Stoakes wrote: > On Thu, Feb 20, 2025 at 09:57:37AM +0100, David Hildenbrand wrote: >> On 20.02.25 09:51, Lorenzo Stoakes wrote: >>> On Wed, Feb 19, 2025 at 12:56:31PM -0800, Kalesh Singh wrote: >>>>> We also can't change smaps in the way you want, it _has_ to still give >>>>> output per VMA information. >>>> >>>> Sorry I wasn't suggesting to change the entries in smaps, rather >>>> agreeing to your marker suggestion. Maybe a set of ranges for each >>>> smaps entry that has guards? It doesn't solve the use case, but does >>>> make these regions visible to userspace. >>> >>> No, you are not providing a usecase for this. /proc/$pid/pagemaps does not >>> contaminate the smaps output, mess with efforts to make it RCU readable, >>> require updating the ioctl interface, etc. so it is clearly the better >>> choice. >>> >>>> >>>>> >>>>> The proposed change that would be there would be a flag or something >>>>> indicating that the VMA has guard regions _SOMEWHERE_ in it. >>>>> >>>>> Since this doesn't solve your problem, adds complexity, and nobody else >>>>> seems to need it, I would suggest this is not worthwhile and I'd rather not >>>>> do this. >>>>> >>>>> Therefore for your needs there are literally only two choices here: >>>>> >>>>> 1. Add a bit to /proc/$pid/pagemap OR >>>>> 2. a new interface. >>>>> >>>>> I am not in favour of a new interface here, if we can just extend pagemap. >>>>> >>>>> What you'd have to do is: >>>>> >>>>> 1. Find virtual ranges via /proc/$pid/maps >>>>> 2. iterate through /proc/$pid/pagemaps to retrieve state for all ranges. >>>>> >>>> >>>> Could we also consider an smaps field like: >>>> >>>> VmGuards: [AAA, BBB), [CCC, DDD), ... >>>> >>>> or something of that sort? >>> >>> No, absolutely, categorically not. You realise these could be thousands of >>> characters long right? >>> >>> /proc/$pid/pagemaps resolves this without contaminating this output. >>> >>>>> Well I'm glad that you guys find it useful for _something_ ;) >>>>> >>>>> Again this wasn't written only for you (it is broadly a good feature for >>>>> upstream), but I did have your use case in mind, so I'm a little >>>>> disappointed that it doesn't help, as I like to solve problems. >>>>> >>>>> But I'm glad it solves at least some for you... >>>> >>>> I recall Liam had a proposal to store the guard ranges in the maple tree? >>>> >>>> I wonder if that can be used in combination with this approach to have >>>> a better representation of this? >>> >>> This was an alternative proposal made prior to the feature being >>> implemented (and you and others at Google were welcome to comment and many >>> were cc'd, etc.). >>> >>> There is no 'in combination with'. This feature would take weeks/months to >>> implement, fundamentally impact the maple tree VMA implementation >>> and... not actually achieve anything + immediately be redundant. >>> >>> Plus it'd likely be slower, have locking implications, would have kernel >>> memory allocation implications, a lot more complexity and probably other >>> problems besides (we discussed this at length at the time and a number of >>> issues came up, I can't recall all of them). >>> >>> To be crystal clear - we are empathically NOT changing /proc/$pid/maps to >>> lie about VMAs regardless of underlying implementation, nor adding >>> thousands of characters to /proc/$pid/smaps entries. >> >> Yes. Calling it a "guard region" might be part of the problem >> (/"misunderstanding"), because it reminds people of "virtual memory >> regions". >> >> "Guard markers" or similar might have been clearer that these operate on >> individual PTEs, require page table scanning etc ... which makes them a lot >> more scalable and fine-grained and provides all these benfits, with the >> downside being that we don't end up with that many "virtual memory regions" >> that maps/smaps operate on. > > Honestly David you and the naming... :P > > I disagree, sorry. Saying 'guard' anything might make people think one> thing or another. We can't account for that. I mean don't get me started on > 'pinning' or any of the million other overloaded terms we use... > > I _hugely_ publicly went out of my way to express the limitations, I gave a> talk, we had meetings, I mentioned it in the series. > > Honestly if at that point you still don't realise, that's not a naming > problem. It's a 'did not participate with upstream' problem. > > I like guard regions, as they're not pages as we previously referred to > them. People have no idea what a marker is, it doesn't sound like it spans > ranges, no don't like it sorry. > > And sorry but this naming topic is closed :) I already let you change the > naming of the MADV_'s, which broke my heart, there will not be a second > heart breaking... Lorenzo, I was not pushing for it to be changed *now*, that ship has sailed, and personally, I *don't* find it confusing because I know how it works under the hood. I was trying to find a reason *why* people would thing that it would show up in smaps in the first place. For example, just when reading the MAN page *today*. Doesn't really matter now, it is named the way it is, and all we can do is try making documentation clearer if it keeps confusing people. Your conclusion is 'did not participate with upstream'; I don't agree with that. But maybe you and Kalesh have a history on that that let's you react on his questions IMHO more emotionally than it should have been. > >> >> [...] >> >>> >>> As I said to you earlier, the _best_ we could do in smaps would be to add a >>> flag like 'Grd' or something to indicate some part of the VMA is >>> guarded. But I won't do that unless somebody has an -actual use case- for >>> it. >> >> Right, and that would limit where you have to manually scan. Something >> similar is being done with uffd-wp markers IIRC. > > Yeah that's a good point, but honestly if you're reading smaps that reads > the page tables, then reading /proc/$pid/pagemaps and reading page tables > TWICE that seems inefficient vs. just reading /proc/$pid/maps, then reading > /proc/$pid/pagemaps and reading page tables once. Right; I recently wished that we would have an interface to obtain more VMA flags without having to go through smaps -- Cheers, David / dhildenb