[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200429125245.5a804f62@gandalf.local.home>
Date: Wed, 29 Apr 2020 12:52:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Joerg Roedel <jroedel@...e.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Shile Zhang <shile.zhang@...ux.alibaba.com>,
Andy Lutomirski <luto@...capital.net>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Tzvetomir Stoyanov <tz.stoyanov@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [RFC][PATCH] x86/mm: Sync all vmalloc mappings before
text_poke()
On Wed, 29 Apr 2020 18:20:26 +0200
Joerg Roedel <jroedel@...e.de> wrote:
> On Wed, Apr 29, 2020 at 06:17:47PM +0200, Joerg Roedel 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.
> >
> > And that buffer is written to at any function entry?
>
> What I meant to say, is it possible that the page-fault handler does not
> complete because at its beginning it calls into trace-code and faults
> again on the same address?
>
It should be read only at sched_switch.
Basically, it's a big bitmask, where each bit represents a possible process
id (can be 2 gigs if we allow all positive ints!).
Then, it is only written when setting it up. Bits 1 and 2 are set here
(-P1,2). At context switch, next->pid is checked against this bitmask, and
if it is set, it means we should allow this process to be traced.
This mask should only be accessed at sched_switch time, not at other times.
And it may read any possible page in that mask depending on the process id
of the next task to be scheduled in.
-- Steve
Powered by blists - more mailing lists