Subject: Re: ktrace-lwp branch
To: Chuck Silvers <chuq@chuq.com>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-kern
Date: 02/23/2005 11:25:25
In message <20050223171652.GA29104@spathi.chuq.com>, Chuck Silvers writes:

>On Wed, Feb 16, 2005 at 06:45:02AM -0800, Chuck Silvers wrote:

[...]

>I think that uio_procp was originally used more to refer to the address space
>than the thread, so it would be good to take a look at which (if any) paths
>actually need the lwp pointer and see if they can get it some other way.
>I took a quick look at this and almost all of the uses are just to get at
>the proc.

I'd second keeping uio_procp as a procp, for the given reason, if
that'll fly. And for accounting of uio I/o ops, which I assume is
still per-process (address space) rather than per-lwp?

Around October 2004 I did some cleanup in the networking stack,
replacing explicit uses of curproc to use (amongst others)
uio->uio_procp.  I strongly suspect changing uio_procp to a uio_lwp
will wreak havoc in those changes (or more accurately, havoc in my own
out-of-tree, kcont-using code which relies on those same changes, tho'
I freely acknowledge the latter is My Problem.)


If we do have to switch to uio_lwp, is there an macro/inline function
to go from the lwp to the struct proc *, or NULL, without panicking on
any NULL pointers between uio_lwp and the associated struct proc *?