Re: [RFC][PATCH] x86/mm: Sync all vmalloc mappings before text_poke()

From: Steven Rostedt
Date: Wed Apr 29 2020 - 10:32:21 EST


On Wed, 29 Apr 2020 16:10:04 +0200
Joerg Roedel <jroedel@xxxxxxx> wrote:

> On Wed, Apr 29, 2020 at 10:07:31AM -0400, Steven Rostedt wrote:
> > Talking with Mathieu about this on IRC, he pointed out that my code does
> > have a vzalloc() that is called:
> >
> > in trace_pid_write()
> >
> > pid_list->pids = vzalloc((pid_list->pid_max + 7) >> 3);
> >
> > This is done when -P1,2 is on the trace-cmd command line.
>
> Yeah, I was guessing something like this, init_mm has a mapping which
> poking_mm has not. I currently try to reproduce this on one of my
> machines.

Note, in use_temporary_mm(poking_mm), poking_mm only contains the page that
needs to be updated. But will get added to per_cpu(cpu_tlbstate.loaded_mm),
which appears to be the one that's not updated.

-- Steve