Re: [v2 PATCH] mm: mmu_gather: remove __tlb_reset_range() for force flush

From: Peter Zijlstra
Date: Tue May 14 2019 - 07:51:10 EST


On Tue, May 14, 2019 at 07:21:33AM +0000, Nadav Amit wrote:
> > On May 14, 2019, at 12:15 AM, Jan Stancek <jstancek@xxxxxxxxxx> wrote:

> > Replacing fullmm with need_flush_all, brings the problem back / reproducer hangs.
>
> Maybe setting need_flush_all does not have the right effect, but setting
> fullmm and then calling __tlb_reset_range() when the PTEs were already
> zapped seems strange.
>
> fullmm is described as:
>
> /*
> * we are in the middle of an operation to clear
> * a full mm and can make some optimizations
> */
>
> And this not the case.

Correct; starting with fullmm would be wrong. For instance
tlb_start_vma() would do the wrong thing because it assumes the whole mm
is going away. But we're at tlb_finish_mmu() time and there the
difference doesn't matter anymore.

But yes, that's a wee abuse.