Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page

From: Linus Torvalds
Date: Thu Jan 20 2022 - 12:22:27 EST


On Thu, Jan 20, 2022 at 5:46 PM David Hildenbrand <david@xxxxxxxxxx> wrote:
>
> I'm, not concerned about fork(), I'm concerned about other false positives.

Without a fork(), you won't have the THP marked for COW, so is it
really an issue?

> Here is what I currently have, I hope that makes sense:

>From a quick look, that patch looks fine to me, but there might be
something I'm missing... And who knows what odd usage patterns there
might be in this area. The whole odd Android thing with forking that
zygote process.

Because that zygote thing _does_ use THP, I think, and it's where the
wrong-way COW thing mattered. Obviously doing COW is the right thing
to do, and that case doesn't want any sharing of pages (all copies),
but it might be worth at least checking that it works and there isn't
some odd performance gotcha.

Linus