Re: [v3 2/3] mm: Defer TLB flush by keeping both src and dst folios at migration

From: Byungchul Park
Date: Mon Oct 30 2023 - 18:40:51 EST


On Mon, Oct 30, 2023 at 03:58:44PM +0000, Nadav Amit wrote:
>
>
> > On Oct 30, 2023, at 2:51 PM, Byungchul Park <byungchul@xxxxxx> wrote:
> >
> > I really spent a lot of time hesitating whether splitting it or not.
> > However, the test result cannot be stable without those. I'm still
> > confused. I think the test result should be stable at each commit,
> > right?
>
> Of course. You can extract the optimization we mentioned, and perhaps
> have more preparatory patches.
>
> Just a couple of comments that may also help breaking the patches:
>
> 1. The “stopping” logic is a bit not great. Try to see if you can
> somehow use shrinker or OOM infrastructure instead.

The stopping means "temporarily pausing" expanding migrc's pending
queue, not shrinking folios.. Yeah my fault. I will rename it another
not to make guys get it wrong.

> 2. Regarding “overflows”, it’s not always a question of whether an
> overflow would happen naturally, but whether a malicious process can
> trigger it.

I understand what you are worried about. However, it's intended that
the variable is going to overflow. And the overflow doesn't matter if we
are aware of it and careful in handling it. See time_after() in
include/linux/jiffies.h. That would help you understand what I mean.

Byungchul
>
> Regards,
> Nadav
>