From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6993434D3BE for ; Thu, 30 Jul 2026 03:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785382333; cv=none; b=B7TUJp+6ZmL52YcN2mNzZyHUYB52YqPk9ErH6V7YnaxyO5t/xEB4M6Z6LJyBUp9MtDxtjbKUNV3UEdTt9v1Ls8/RT1LkG2/zJe+xzgjyy4t13U0Ex2wZAJaEAm/3qSOdWulRkhvKU+mDUDoo4QnrI2bUblEGa9Ikn9VqIALkCvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785382333; c=relaxed/simple; bh=V8PGeWeyokDrNTSzkeX0jP1Wwsix/DVehHwbDVareWk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dBEpRNwZ7UMnuuJ5LGdkucc8d91bqpXN9b0HZQ3mGOmu+AFRGvEQJdUJtq19lTMVsnDlmKHcEOSZlD1QRHqXn0K2rYCau5iIOpbOreCAjx2QpPery8C9UY4l4rxREsx5SD9MaZoklsARLqTTzqxkuk4ZgKx4SkZuyGk0SzzbKu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=FJOXcIr7; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="FJOXcIr7" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-930fad20240so89620585a.0 for ; Wed, 29 Jul 2026 20:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1785382330; x=1785987130; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=HJ2tPnxbrcFKcFZzwn864hCbrfOqlBJ/Hk+311dwGeA=; b=FJOXcIr77Ck9WU5lIz1XKl8wt0M1P/WB0i+NClo1czpP0tyf3qiQiJeFFHw2Yumbj5 EP3jyHB407dAb4Wmb/BM8axIqZecYdKUvtrRCGQ3um4YpEvqjk/dQdXnyUOLNbzTFxMZ +LotiaZgwOKlEj3e80/PPwQiq+uSlmpEKLCTeEd6qDtwU3AlvjBr4uewcuyyVXvEM91F vkSmX8wjCKFyYTIf2jzof6weHIWEhokGXu33ebTUbQYAyE4dYsXMqwhZ/ZrAHd4TTTan qS2KM1AtgpkbI17z0dAioxxW2v03Vf0tRMNGLAxds3as7Pg4a1B9FIc1stFR+W28llRi cWkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785382330; x=1785987130; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HJ2tPnxbrcFKcFZzwn864hCbrfOqlBJ/Hk+311dwGeA=; b=kGwbrno7dTbMi6Xzj226RMbuNtbmKHMVtg/4HyRxS2NCce7uK5y6iPf69BpRAa/sUx eOjACqgnMt80VKKQ2H3wjuc8ai1GyNlaOr+IxXNjMHRasNh6o9ObS3FecuW0TgBtVXY6 yNmP1K+cgA+IYeGptsbL3//FD7BMRsNj5TkDYW6QFb2exTGtjy2C4R2fuSBwUzNNNqiX p4WN7WeDl9gE3VLqz1EC2MMV0ZEE12BBEy6/Hk+tXvpj/PkvYmf3vXJjAUjh21Brs21j CYdh8/j2ut2k3KCndwT85yoQLKmUYYoEewp3RAxE579wriebCEhctx2nB/COoVv0rIR1 HlOQ== X-Forwarded-Encrypted: i=1; AHgh+Rrfr0ijAXxMuxNie1sYpbMSjEcMHP6wgFzsk+vVjlQD9afnK8jn7Hnw1r9XWHplX0Q7ICjAupNkAynzbJo=@vger.kernel.org X-Gm-Message-State: AOJu0YyEUpe5BTR0UUt3UgRJnCjbX3c2+nqG2YWoM0ssMCTuWLUVssry uMBb59QQTTM72eNN0eLUMXyimblTeK9pKi6hb+ZC29iAh8JgsDOYE6zhnQXh2lMewp8= X-Gm-Gg: AR+sD1290g3HtGIIVFxXv0HdAEJqI6v5keuHyEpmLPIe4UFiw+VDDZL+Nob1NqWSFEg EYutlywZVNZz222Eglfa0lkvxX31i3JqKTdLvMKgjAEJ7LpNXMCKWS6jrLICdcw7uxMAMZDhMuQ 1QX9riXjZJyRlWKO5zZbZUITUeuMfAbciu/oaAi5yME/wPWKNFNWgbq6Zj99aQNC7yRVDjtqCDM qFskN6Rf/CdHb2a/zpoZBw/VdRP+peF8Rd7ZHBRF57EZwohUaw/5Ce12gC+Zty7SVSI0PvKnoXj QnPxxGtCWnDq3J2dAdaL/msF9zcqSewojGVOcTXGUGkfK3VZUtDq2lxWVU4wZbz2r0zQIDVPYNp LCbO9CVh/nPM7R1cjFdfYW/arcrap3j6kGOdQ30pEygetpQLbYCRhk1+Bn9SO69LtsvP4H/2AJp eX6ksz9+/vz/Q5i/ztmJjfq/kRfdOtognPt1jcrC9uMgD1v9Q5+TIk9jhLJ3BG/N0DGCLf/88qY PHGWXyxrwIXZu2GGpSJjnXnT7/6qU4T3acpOeyHZJC2 X-Received: by 2002:a05:6214:3b88:b0:8ea:7785:f3e6 with SMTP id 6a1803df08f44-908347b2701mr8202616d6.42.1785382329952; Wed, 29 Jul 2026 20:32:09 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-908323eb01esm6949626d6.30.2026.07.29.20.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2026 20:32:07 -0700 (PDT) Date: Wed, 29 Jul 2026 23:32:04 -0400 From: Gregory Price To: "Lorenzo Stoakes (ARM)" 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 01/15] mm/vma: introduce VMA anon page offset field and add helpers Message-ID: References: <20260729-b4-scalable-cow-virt-pgoff-v3-0-e8ecfefea812@kernel.org> <20260729-b4-scalable-cow-virt-pgoff-v3-1-e8ecfefea812@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260729-b4-scalable-cow-virt-pgoff-v3-1-e8ecfefea812@kernel.org> On Wed, Jul 29, 2026 at 05:48:36PM +0100, Lorenzo Stoakes (ARM) wrote: > This patch establishes fields within the vm_area_struct type to store the > anonymous page offset of VMAs. > > The anonymous page offset of a VMA is equal to vma->vm_start >> PAGE_SHIFT > if they are unfaulted or were not remapped, otherwise it is equal to this > value at the point of first fault. > > Currently, anonymous folios belonging to CoW'd MAP_PRIVATE-mapped > file-backed VMAs are tracked by their file offset. By adding anonymous > offset as a property of VMAs, we can now track them by their anonymous page > offset instead. > > By tracking this, we provide the means by which to eliminate this > inconsistency, and more importantly lay the foundations for future work for > the scalable CoW anonymous rmap rework. > > This patch simply adds the fields and some simple helpers. Subsequent > patches will update mm code to make use of these fields correctly. > > The fields chosen are packed in the VMA such that, for 64-bit kernel > builds, no additional space is taken up. > > The first field is present on cacheline 0 containing key VMA fields, and > the second on cacheline 3, which contains file-backed reverse mapping > fields. > > Given the relative time spent accessing reverse mapping fields as well as > updating them, there shouldn't be any performance impact here from false > sharing. > > Update the VMA userland tests to account for this change. > > No callsites are updated yet, so no functional change intended. > > Signed-off-by: Lorenzo Stoakes (ARM) Much clearer :], appreciate the rewording. Reviewed-by: Gregory Price (Meta)