Re: [RESEND PATCH] fs: avoid mmap sem relocks when coredumping with many missing pages

Mateusz Guzik
2025-01-20T16:59:29Z

On Mon, Jan 20, 2025 at 5:00 PM Jan Kara <jack@suse.cz> wrote:
> BTW: I don't see how we could fundamentally move away from page-sized
> iteration because core dumping is "by definition" walking page tables and
> gathering pages there. But it could certainly be much more efficient if
> implemented properly (e.g. in the example above we'd see that most of PGD
> level tables are not even allocated so we could be skipping 1GB ranges of
> address space in one step).
>

I was thinking find first allocated page starting at X, then fill in
the gap from the last one as required by the format. Rinse & repeat
until the entire vma is covered.

Surely finding the next page which is known to be there is going to be
cheaper than specifically checking if a given page is there.

--
Mateusz Guzik <mjguzik gmail.com>