On Tue, Jun 30, 2026 at 05:16:51PM +0100, Pedro Falcato wrote: > On Mon, Jun 29, 2026 at 01:23:16PM +0100, Lorenzo Stoakes wrote: > > Update the file comment to clarify that both file-backed and anonymous > > interval trees are provided, referencing the relevant data types for > > clarity. > > > > Also add comments to indicate which parts of the file apply to each. > > > > While we're here, convert the VM_BUG_ON_VMA() to VM_WARN_ON_ONCE_VMA(). > > > > Signed-off-by: Lorenzo Stoakes <[email protected]> > > Reviewed-by: Pedro Falcato <[email protected]> > > This is fine for now, but I'm wondering if it doesn't make sense to, in the > long term, have: > > mm/rmap.c - common rmap mechanisms > mm/anon_rmap.c - anon rmap gunk > mm/file_rmap.c - file rmap gunk > > or even something like mm/rmap/{core,anon,file,ksm??}.c > > While working on my file rmap patches I noticed there's so much stuff just > splurged all over rmap.c - interval_tree.c - fs.h - fs/inode.c. > It's a little silly.
Well, Wei had something like this idea a way back, but I'd rather avoid it. Firstly, with scalable cow coming, I'd rather us not make anon_vma a special citizen in any way, and I'm going to be heavily modifying all this anyway. On the interval tree side, I'm simply going to get rid of the anon side of it altogether with scalable CoW also so that can live as it is now for the time being. In general we try to have generalised rmap walk logic for file vs. anon with rmap_walk -> rmap_walk_[anon, file]() for one obviously. But obviously there's separate rmap walker logic for file vs. anon. I used to harbour a belief that we could make anon like file-backed but now I'm kind of thinking that's not possible :) So I guess the real answer is - yeah, but let's revisit it after scalable CoW (and anyway I'm likely to do sensible architectural breakouts as part of that work anyway). > > -- > Pedro Cheers, Lorenzo
