From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 D56A9382370 for ; Fri, 10 Jul 2026 19:13:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783710785; cv=none; b=O77+L3n9mtynMU+YMNXiJ4+ot8TFEekLn23kFU5i7KlV6nHrXcvd8lFjRTG0v00vi6SCDWE45uiMMR6Pmy0QddxowrY9bwXxidfF3FzDH9rVlFkOrc4kbyC0uIUfAcSUScPHfE1beJPtPbc1cK5ar/wHZv9XFUP15UiVfG2IZNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783710785; c=relaxed/simple; bh=mbUpbN9JA5TocILiu7DT262VDuT+uIcfX8rdIywuDIw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p9Ro39ps71ArSPezMVhOq2X8TCz1FpY2LBmY6mJKxxSOiDo4ASs3GDqReD0HOc7w/2ugIP65qiaR2tE42EFe5GDJty4rGv2FhG8x2gCbUhFAqWiG1v9NO7PGQs63NAuNO+uQXMc7VrQOrR7oFma6v7nb983Ica1SQFyibGpX+VM= 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=mUx1VT0P; arc=none smtp.client-ip=209.85.219.48 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="mUx1VT0P" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-8f0d6853360so10617676d6.0 for ; Fri, 10 Jul 2026 12:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1783710783; x=1784315583; 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=Zl1BBUQ1SVF8WlDcAjuqmqY9e/JVxV3t5chHRhyKtnA=; b=mUx1VT0PIOg/xwhlOTlIJEriNCZxkdBJZVjc9C5uxphAkNM8EEs2imYn5i1hgOnvX4 xwXlqQICD+cOrqA5hIZZbrZaES3jwUi5ChfT30etJK+PoH8/mA2cDMsBTFHDmhUP0FPt z/CMZnu4OqUu+aiDWu+sem1azbKqRtlmsXojxJbFE0lsZeP1Hr3d6/Pr6CVkhwBKqRN5 ogd26C6iV69u+TuQzA1Fh2frC1svhr669/Z61r8cEK1brwL4XRueu3Ptbu8FgsDJfzXO 2DGBKApV0OVyOjSpaaYZ0h/o1TqS/+tA7LhRSCDGyE0WzhLeouwLG22YQFz+ZET9fA/U n8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783710783; x=1784315583; 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=Zl1BBUQ1SVF8WlDcAjuqmqY9e/JVxV3t5chHRhyKtnA=; b=YlAfamX7ncsHOolplWAdc5FD23/x1orNw+yaH7z/7TZ3rIG+Ogefckm3OIyaVuTGKC voYo6RwLRuuqHRyCNjVdO4wWaNf0xo5Af0vuOIGqbxUfEC5wceUNuRQgwbd9mpV/VPlf PyvRTcz6mmnqwp3rW9cKvG8BkV1UOGlQEL8Vxe0CEckkqWDoDPOG/EBweOrOoVhQSad9 BEoUooUMqR4OEmqC3JzkSwPFrxNWBzuX+FFw7X/iIuf8Cq5ijrNbXRhlZWa1gGdvbfQ9 TrCI20O5FqBXtFxl2Ba2wpPnQGMDKH0uWu1S2rgqXgVVRcRKpULOXr6DO7aXQsmIr5KJ 2cOQ== X-Forwarded-Encrypted: i=1; AHgh+RoDtHBXK6ZfYS2CYKr+sKnrAhOLet6ldONZEx1O4z1tFWKATwUOzwzJ89+jSFyZPybSocKVXUudgnH/ec52@vger.kernel.org X-Gm-Message-State: AOJu0Yzob35OW1Xl3KzJYH63/bpbBs7BnkqKsoQR5q8TNWYeZFMLSJee H8Y+LZ1WuCZZdEZD822Qcym1jg+cCpECEoTJrNpTGwocSZ6xrZk1NnAZY6MMZgsh/pU= X-Gm-Gg: AfdE7ckAV1Oe3Dm3SHqyNAIIOAGX2z+ynbF/JrGtH/f0PPxMCyTEAI14miWas+qMlhD CpFBkms2jlzPMg88caBTy7a1csR0mAecL92f1SnWpoSbyPohLH/JRBocBg8U9Y/dWWJVZoRlGeK x+98JHq2hT361Pgh2sBENWbF9CeLMzMyvSC8ZW0eiDvUGs140HLNwJ8DLSfkoxEr6d/zsSW5WQn 7RmQ2s0Qw7w2xXWlOUSXDMZ136vv/U6vCjGj5LdlaGzQyMoio+5krHUtzD3QYyfXgGQCgd8KO5i 9kcTwS03QiiHp9EaAj5wTs4HYhef/++GRrPIwCN6BjcnE4G3rMla9fhcbH+kA0eUu3ejM+JsSom bMJ6S1Lu6OS0bntYjNLjD1bmDG50Ug2XCKCsei6V+jwt+xzciiI4e2hJJwLAaSJ99QeSJZWT6eC iWJ1cys2SgMvM6VDPIwV5TrYnvroDayOO2WbI6mVapBfvBp4926fVYegEENKpoIrd4Np1Z X-Received: by 2002:a05:6214:450c:b0:8f0:9d9c:52c2 with SMTP id 6a1803df08f44-903fe450e5fmr5228126d6.5.1783710782628; Fri, 10 Jul 2026 12:13:02 -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-8ffd87c9128sm47321526d6.45.2026.07.10.12.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 12:13:02 -0700 (PDT) Date: Fri, 10 Jul 2026 15:12:57 -0400 From: Gregory Price To: Lorenzo Stoakes Cc: Andrew Morton , Russell King , Dinh Nguyen , Simon Schuster , "James E . J . Bottomley" , Helge Deller , Jarkko Sakkinen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Ian Abbott , H Hartley Sweeten , Lucas Stach , David Airlie , Simona Vetter , Patrik Jakobsson , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Dmitry Baryshkov , Tomi Valkeinen , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Christian Koenig , Huang Rui , Ankit Agrawal , Alex Williamson , Alexander Viro , Christian Brauner , Dan Williams , Muchun Song , Oscar Salvador , David Hildenbrand , Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , Marek Szyprowski , Peter Zijlstra , Arnaldo Carvalho de Melo , Namhyung Kim , Masami Hiramatsu , Oleg Nesterov , Steven Rostedt , SeongJae Park , Miaohe Lin , Hugh Dickins , Mike Rapoport , Kees Cook , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-sgx@vger.kernel.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-tegra@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, iommu@lists.linux.dev, linux-perf-users@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kasan-dev@googlegroups.com, damon@lists.linux.dev, Pedro Falcato , Rik van Riel , Harry Yoo , Jann Horn Subject: Re: [PATCH 25/30] mm/vma: update vmg_adjust_set_range() to offset pgoff instead Message-ID: References: <910f7b5be78232304dc7ca01cd57c6f5ca8f3d13.1782735110.git.ljs@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@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: <910f7b5be78232304dc7ca01cd57c6f5ca8f3d13.1782735110.git.ljs@kernel.org> On Mon, Jun 29, 2026 at 01:23:36PM +0100, Lorenzo Stoakes wrote: > We are calculating the pgoff as an offset, since we have vma_add_pgoff() > and vma_sub_pgoff() available, just offset this value directly and use > __vma_set_range() for vma->vm_[start, end] values. > > We take care to update the range before offsetting the page offset, so the > adjusted VMA's vm_start and vm_pgoff are mutually consistent at the point > the page offset helpers operate - this matters once vma_set_pgoff() comes > to assert invariants which relate the two. > Given the prior code just did it in 3 lines of code with no special dance, there's a presumption here that this is done in a critical section and no external actor can see the inconsistent state? (i.e. range is updated but offset is not) Just think about this from a bisection/debugging standpoint. > Doing so lays the foundation for future work which allows for use of > virtual page offsets for MAP_PRIVATE-file backed mappings. > > No functional change intended. > > Signed-off-by: Lorenzo Stoakes Reviewed-by: Gregory Price