From: Pedro Falcato <pfalcato@suse.de>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: Pan Deng <pan.deng@intel.com>,
akpm@linux-foundation.org, liam@infradead.org,
vbabka@kernel.org, jannh@google.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Tianyou Li <tianyou.li@intel.com>,
Wangyang Guo <wangyang.guo@intel.com>,
Zhiguo Zhou <zhiguo.zhou@intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH] mm/vma: avoid redundant file rmap tree re-insert on new_below=0 split
Date: Fri, 25 Sep 2026 16:43:37 +0100 [thread overview]
Message-ID: <araVBBBVY-jafePL@pedro-suse.tail5790ac.ts.net> (raw)
In-Reply-To: <araI4WsI0XMXOR10@gremlin>
On Fri, Sep 25, 2026 at 04:27:44PM +0100, Lorenzo Stoakes (ARM) wrote:
> > This change skips the re-insert for that case. vma_prepare() no longer
> > removes vp->vma from the tree; instead vma_complete() detects that case and
> > only recomputes shared.rb_subtree_last up the ancestor chain. Everything
> > else keeps the remove + re-insert path.
>
> This could really do with a diagram and a simple explanation.
>
> In general you should rewrite the entire commit message yourself and not
> use the LLM output at all.
+1 on this. Even with the Assisted-by, this needs to be understandable by
hoomans.
>
> >
> > The case is detected by comparing vma_start_pgoff(vp->insert) against
> > vma_start_pgoff(vp->vma): only a new_below=0 split leaves the former
> > greater. __split_vma() adjusts pgoff via vma_add_pgoff(new,
> > linear_page_delta(vma, addr)), and linear_page_delta() is
> > (addr - vm_start) >> PAGE_SHIFT with addr strictly inside the VMA, so the
> > delta is at least one page and the new VMA's pgoff is strictly greater.
> > For new_below=1 the two are initially equal and vp->vma's pgoff then
> > increases, so the comparison is false both before and after the caller's
> > endpoint updates, and the original path is taken.
>
> This is useless description of the code in English, it's not telling me
> anything useful at all. Human beings don't have a large 'stack' with which
> to hold things in our minds.
>
> Write with humans in mind please :)
>
> >
> > Inferring the case this way keeps the change small: struct vma_prepare
> > gains no field and no caller changes.
>
> I don't understand what inferring the case means? I think this can be
> dropped.
>
> >
> > Moving the remove() out of vma_prepare() leaves vp->vma in the tree with a
> > possibly stale sort key across the caller's endpoint updates, so
>
> I mean what?
>
> What does a 'possibly stale sort key' mean? And what does 'across the
> caller's endpoint updates' mean? Which caller? What's an endpoint? What
> updates?
>
> > vma_complete() re-keys it *before* inserting vp->adj_next: otherwise that
> > key-driven descent could place adj_next in the wrong subtree.
>
> Re-keys what? WHat does re-key mean?
>
> What you're saying here really makes me nervous. You're changing a very
> sensitive part of the kernel and talking about intentionally leaving stale
> state around.
>
> This patch cannot possibly be considered for upstream until I fully
> understand exactly what this means and that you understand what you're
> doing.
>
> >
> > Measured on v7.3-rc4, on a 2-socket 192C/384T system running UnixBench
> > execl (384 concurrent execve of the same binary), dropping the redundant
> > remove + re-insert yields ~14% higher throughput by shortening the
> > i_mmap_rwsem write-side critical section during the file VMA splits that
> > execve performs on the shared libraries.
For what it's worth, I'm vaguely accepting of a similar change, but this needs
to be _really_ well commented out, and ideally in file rmap code, _not_
spaghetti'd in VMAs. The interval tree is complicated and some bits are not
very intuitive. This needs to be robust. Not LLM'd into existence.
This also reminds me that I should reboot the sharded file rmap effort...
>
> This is really unconvincing I'm sorry. Real numbers please with statistical
> evidence to back them.
>
> Additionally I notice you have not made one comment referring to locking
> anywhere.
>
> This part of the kernel has VERY subtle and sensitive locking
> requirements. I am not convinced you understand this, either.
>
> >
> > Signed-off-by: Pan Deng <pan.deng@intel.com>
>
> This patch feels like a hack. You are creating a whole new set of very
> fragile assumptions that have to be maintained throughout.
>
> Again as above, a member of the core team should take this over.
>
> > Reviewed-by: Tianyou Li <tianyou.li@intel.com>
> > Reviewed-by: Wangyang Guo <wangyang.guo@intel.com>
> > Reviewed-by: Zhiguo Zhou <zhiguo.zhou@intel.com>
> > Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
>
> Please don't do this.
>
> Upstream is not interested in private reviews. Review tags upstream are
> based on review done in _public_.
Yeah, this too. It's just noise.
--
Pedro
next prev parent reply other threads:[~2026-09-25 15:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 5:43 Pan Deng
2026-09-25 15:27 ` Lorenzo Stoakes (ARM)
2026-09-25 15:43 ` Pedro Falcato [this message]
2026-09-25 16:08 ` Lorenzo Stoakes (ARM)
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=araVBBBVY-jafePL@pedro-suse.tail5790ac.ts.net \
--to=pfalcato@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=pan.deng@intel.com \
--cc=tianyou.li@intel.com \
--cc=tim.c.chen@linux.intel.com \
--cc=vbabka@kernel.org \
--cc=wangyang.guo@intel.com \
--cc=zhiguo.zhou@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®