All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Pedro Falcato <pfalcato@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 David Hildenbrand <david@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	 Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Rik van Riel <riel@surriel.com>,
	 Harry Yoo <harry@kernel.org>, Jann Horn <jannh@google.com>,
	Lance Yang <lance.yang@linux.dev>,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Pan Deng <pan.deng@intel.com>
Subject: Re: [PATCH v2] mm/vma: don't remove VMA from rmap if pgoff unchanged
Date: Fri, 2 Oct 2026 15:27:50 +0100	[thread overview]
Message-ID: <ar-_D5gGYNKl6VVu@gremlin> (raw)
In-Reply-To: <ar-9z-Ls26elb5JI@pedro-suse.tail5790ac.ts.net>

On Fri, Oct 02, 2026 at 03:24:07PM +0100, Pedro Falcato wrote:
> On Wed, Sep 30, 2026 at 06:53:36PM +0100, Lorenzo Stoakes (ARM) wrote:
> > Suggested-by: Pan Deng <pan.deng@intel.com>
> > Reviewed-by: Rik van Riel <riel@surriel.com>
> > Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
>
> Looks great, thanks!
>
> Reviewed-by: Pedro Falcato <pfalcato@suse.de>

Thanks!

> > --- a/mm/vma.c
> > +++ b/mm/vma.c
> > @@ -201,8 +201,15 @@ static void init_multi_vma_prep(struct vma_prepare *vp,
> >  	if (vp->file)
> >  		vp->mapping = vma->vm_file->f_mapping;
> >
> > -	if (vmg && vmg->skip_vma_uprobe)
> > +	if (!vmg)
> > +		return;
> > +
> > +	if (vmg->skip_vma_uprobe)
> >  		vp->skip_vma_uprobe = true;
> > +	if (vma_start_pgoff(vma) == vmg_start_pgoff(vmg))
> > +		vp->file_pgoff_unchanged = true;
> > +	if (vma_start_anon_pgoff(vma) == vmg_start_anon_pgoff(vmg))
> > +		vp->anon_pgoff_unchanged = true;
>
> FWIW I kinda would've liked to abstract this out to rmap code, but a quick look
> shows that it is likely to become a header dependency hell if put in rmap.h. Could
> perhaps have been separated out to a function call.
>
> Anyway, your call :) This version already hides most of the ugly to
> interval tree code.

I'd rather keep it as-is. These case are explicitly setting the state because of
things known at that point, and as you say it's not possible to do it sensibly
due to headers etc.

--
Cheers, Lorenzo


      reply	other threads:[~2026-10-02 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 17:53 [PATCH v2] mm/vma: don't remove VMA from rmap if pgoff unchanged Lorenzo Stoakes (ARM)
2026-10-01 15:45 ` Lance Yang
2026-10-02 14:05   ` Lorenzo Stoakes (ARM)
2026-10-02 14:15     ` Lance Yang
2026-10-02 14:24 ` Pedro Falcato
2026-10-02 14:27   ` Lorenzo Stoakes (ARM) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ar-_D5gGYNKl6VVu@gremlin \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=harry@kernel.org \
    --cc=jannh@google.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=pan.deng@intel.com \
    --cc=pfalcato@suse.de \
    --cc=riel@surriel.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.