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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD2EBC54FD2 for ; Thu, 30 Jul 2026 10:16:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACB3E6B0095; Thu, 30 Jul 2026 06:16:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA3FB6B0098; Thu, 30 Jul 2026 06:16:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E0FA6B009D; Thu, 30 Jul 2026 06:16:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7B44D6B0095 for ; Thu, 30 Jul 2026 06:16:51 -0400 (EDT) Received: from smtpin24.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EF8A8A0917 for ; Thu, 30 Jul 2026 10:16:50 +0000 (UTC) X-FDA: 85045039380.24.5D6F377 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf11.hostedemail.com (Postfix) with ESMTP id 60FFA40004 for ; Thu, 30 Jul 2026 10:16:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=gicFi79A; spf=pass (imf11.hostedemail.com: domain of ljs@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=ljs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1785406609; b=PdouFJRYdX97ZHkOr+HU/oRkRyiffn2W3pwvX5gi3z4olOqv7PpjvQHwWTZETsxacou2hg y3y1Kdq6nsP/iz89PA+955h4ucdPnjJ1WiU2mb0XmWvpQATmP8MpRiY/AqAA5JepXHC/bp hEMxT3Q0suAZ4zvGv7BlGA1zOwVfT1E= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=gicFi79A; spf=pass (imf11.hostedemail.com: domain of ljs@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=ljs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1785406609; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jY7VtAKWV/98Ym8QzylyCgqneeBfbLyDYEdBY8MaJjs=; b=YzzZG+s2UbZ6YF5e4uhSzyALxgPqKklB7ZWk8t7TrWFuPRg59nChFo/3EIsm8AZL93BmyU ukoaBjLSeRkU8M1qdbcuB788TwG9iqmLNrXB16JasEzdE8qqnXTBpzWXTV+lBNgmbXQpCq lufK17D20DjxEqSBKEptqWz+xz5Iuyw= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 11D4F600AB; Thu, 30 Jul 2026 10:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81F2D1F000E9; Thu, 30 Jul 2026 10:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785406607; bh=jY7VtAKWV/98Ym8QzylyCgqneeBfbLyDYEdBY8MaJjs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=gicFi79A1plyT5Ti6H4RX8MMHL+IUzcvhaDxk+855KtXagGlz88zpfpsLlMy6qiWp KrMOEXmTZ9YJV8WurjO/RePpEPPCJFTrJYf4zkVCmofvO9P9CYTZZGtQsmkbmkyviF 4P3QQ9cB7b3pi9ZzhJ7V+wJasty4ReS8mTQzt2zhu1rim+TbsQVxlDGF+wZ7ZougrS vXPQ+mv6Wb4YXCTWJLRoTOJzjKraalZtYoo0h7uc0Ln8jxlGGUaZTbSsRQumeclcX2 aLHXyf2rM3HWXJlUX2XrOB52z8JLwApbZUFOu/q2n4aD283FkJYC0jCY1hRrVWDMD1 oM+G+hzJQ9LGg== Date: Thu, 30 Jul 2026 11:16:24 +0100 From: "Lorenzo Stoakes (ARM)" To: Gregory Price Cc: Andrew Morton , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , "Matthew Wilcox (Oracle)" , Jan Kara , Miaohe Lin , Naoya Horiguchi , Rik van Riel , Harry Yoo , Lance Yang , Kees Cook , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Usama Arif , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Peter Xu , Xu Xin , Chengming Zhou , Arnd Bergmann , Greg Kroah-Hartman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 03/15] mm: abstract vma_address() and introduce vma_anon_address() Message-ID: References: <20260729-b4-scalable-cow-virt-pgoff-v3-0-e8ecfefea812@kernel.org> <20260729-b4-scalable-cow-virt-pgoff-v3-3-e8ecfefea812@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 60FFA40004 X-Stat-Signature: zwiyk8srg5gx5j6pjybuigmmeowaksmn X-Rspam-User: X-HE-Tag: 1785406609-337420 X-HE-Meta: U2FsdGVkX1+KL3U2Zxm3J9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H0Wc/mvDjjjxUSgtgc0zyl8VLMi6NmEPurlBO3Z7kxtaIKO6f2zychZxG3H65xvzLobr7k3PQMwLTsjGTYjyT3ZZaOWatwWvWodp64bsksOM8ZJdV2lhFBMlXaTZZTiSCeGju6pjip0RmuMJcWcLjovhXtdr8Tp92IvJP8lYW0Xea0lsKCFXEPmlghBze7Hl9YabmOemFQM4/IxW5d0JWkKe8q0/9iCw6rsKhrrFCBHv5sJCOhEm+/ATuGc9hprLDsWCOgg== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Jul 30, 2026 at 02:39:27AM -0400, Gregory Price wrote: > On Thu, Jul 30, 2026 at 12:58:22AM -0400, Gregory Price wrote: > > On Wed, Jul 29, 2026 at 05:48:38PM +0100, Lorenzo Stoakes (ARM) wrote: > > > > > > This will be necessary for determining the address of a folio's index > > > within a VMA when the folio belongs to a MAP_PRIVATE file-backed VMA but > > > has been CoW'd, and thus is anonymous, once the anonymous VMA page offset > > > field is used for the reverse mapping. > > > > > > > This is a doozy of a sentence... > > > > ... determines the address of a folio's index within a VMA when > > - the folio belongs to a MAP_PRIVATE file-backed VMA, but > > - has been cow'd > > - thus is anonymous (as well) > > - The original VMA may or may not also be marked anonymous? > > (just clarifying, could be original mapper or a COW that COWs) > > > > Ow, my brain. One question below > > > > After re-reading the cover-letter again - my note here is wrong and > my brain hurts more. > > ... determines the address of a folio's index within a VMA when > - the folio belongs to a MAP_PRIVATE file-backed VMA, but > - has been CoW'd > - thus is anonymous > - The original folio may or may not have been anonymous > (depending on whether it, itself, was a CoW copy) Yeah :) this message is meant to be effectively a placeholder for 'there's a good reason for doing this' :) I go to greater lengths to explain in the bits that actually implement it. > > Lorenzo you are truly doing Darwin's work untangling all of this. Thanks :) This is really painful stuff and trying to get to scalable CoW the 'right way' (i.e. several series and probably 3 figures of patches) is a slog, but once in place will be worthwhile (and also save a bunch of memory :) > > ~Gregory