From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 C527F381AEC for ; Fri, 10 Jul 2026 19:13:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783710785; cv=none; b=QLLpvuJYUBR4YUoJmuzebKb2yehU4QlBWqXZpayiVCEbsoHGtmSOHFAv/kBMcipUd6/m3tymDYOSZWbfIIeUnKI+/K/3ytel9iprYd8V+iOFFltdo33RNSDlvXdrStErJz0GhXDHKBCSh4xV5uNzoBHnpMhFay+3tRh9Nunk9X4= 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.47 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-f47.google.com with SMTP id 6a1803df08f44-8f0d6853360so10617666d6.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=cO8+/ADkjG4P4SOlngwXdQHUSOqK264JMy2HZgQrb7mDa1s/lIsE6G0ZZISygeBF/y ocqTPE/WunmtcRE9hssoZ1ODaOh1buXK7rsVmK3E45F8msEg2gBpXLLD/X2UTyPuXyM/ 4erGfiMCgOfm2tkHpuT5WjkJNXX1mDKyvIMmbFrTL4HFJFirc1ZzKc2np8j/sqpOznbw V/1pv61ACCq+xhpIGOHPPCRiBQySaUxsSwTjeQLTYqVQOVjMeGfqY/ZyIu6QBWeJudk5 dCTOzdLrelHMiWar5MPxeWuChnad5oWWSgVGh2MGypUJAxamM1bI9biz1ceo7QPpCzWf Kp2w== X-Forwarded-Encrypted: i=1; AHgh+Rrqg/9e0uHPoiQ3HkPC7U6lCQWEe08GINQTVUCBSqGyfi6hc+A5znhEaczBNx+KPv8/AzVVM1+oLFjZmes=@vger.kernel.org X-Gm-Message-State: AOJu0YwXohPlCVQFlA42fhNv/pxkjiKCykgrQK7A+iZmuvtw4c1pRIot otCD9CxBsAZdCABcI4OLPCxt0yg4VCnAr21A1kxyhlqDLB+Wbe+nlre3Rw/6ngq0Suk= X-Gm-Gg: AfdE7cnZvfTVekUViTpd0uLjukn2agcCsBtH15oG76KQIEJDDXShiKDtGRGUXK5Fu42 7bYrRT+IDQpOzjRxZhR80zvk/oEBRH3mq7Q6C6VNTfgotS/kwEMHgkppgCUslsKJ4YR6LExMjQw MOQoQ32TT0chFGVZCLLv0kT25Om6S3ivvhbHp7d1+PhrSSKPn+1C+rL3PNlseJiI7gcwc9PPwyR 6D+QfETgmt4/EoKipxqHE9dLxktLocNvR8H3fOzMLXGtCBgSSvB3o1sGJx3gkUPTmIOmtel+zEP SHZ0e2OP2ZiGTp4KwDsWeOmN+60/94WGTBsp4ISrFHeO7iReLxvQtoMSsn/W6rBP61gxsrLQEAJ rzM+B2PK2ckycSsOun6878VyAnJKRk3iOi/na0AccyFTOLaxxKiqKA3FqN2t6S0Nmbfcdj18MzY A9juUGB6aXPp5gUhk6CWS+d+sdbTjbEltDSYcqJMA5XtbYJVeu4mijoXpsQV5qpBP0CB7l 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-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: <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