[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0908261040440.23885@gandalf.stny.rr.com>
Date: Wed, 26 Aug 2009 10:41:38 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
cc: Frederic Weisbecker <fweisbec@...il.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>,
Jason Baron <jbaron@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
Lai Jiangshan <laijs@...fujitsu.com>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
jiayingz@...gle.com, mbligh@...gle.com, lizf@...fujitsu.com,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 08/12] add trace events for each syscall entry/exit
On Wed, 26 Aug 2009, Peter Zijlstra wrote:
> On Wed, 2009-08-26 at 09:48 -0400, Steven Rostedt wrote:
> > On Wed, 26 Aug 2009, Frederic Weisbecker wrote:
> > > >
> > > > That won't always work as pointed out in the other example:
> > > > - Process doing sys_init_module then scheduled away
> > > > - User enables syscall tracing -> TIF_SYSCALL_FTRACE gets set
> > > > - init function of the module gets called and is doing kernel_thread()
> > > > (old API) -> kernel thread inherits TIF_SYSCALL_FTRACE.
> > > >
> > > > I don't think that's what you want. You might want to clear the flag for
> > > > new processes during fork (only for kernel threads I would guess).
> > > >
> > > > At least the current patch leaves a hole.
> > >
> > >
> > > Ah, there are callsites that use kernel_thread() directly?
> > > Does it means that t->mm could be non NULL for such resulting
> > > kernel threads, in that case it would be hard to hook on
> > > do_fork() to check that.
> >
> > All kernel threads have a NULL t->mm. Since do_fork is called by kthreadd
> > and not by kthread_create, the caller of do_fork will also have a
> > t->mm = NULL.
>
> Weren't there a few sites in the kernel where kernel threads temporarily
> borrow the mm from someone?
All kernel threads borrow a mm, but they don't set it as their own. That's
what t->active_mm is for.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists