Subject: Re: Adding a size parameter to stackgap_init()
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 03/17/2002 12:33:15
On Mar 17,  6:26pm, jdolecek@netbsd.org (Jaromir Dolecek) wrote:
-- Subject: Re: Adding a size parameter to stackgap_init()

| Christos Zoulas wrote:
| > This is to avoid 'struct proc *p = curproc; /* XXX */' in the code.
| 
| Well, ~all those comments should be removed IMHO. using curproc
| is generally OK (if you know that the routine is supposed to be
| called in context of process which it's for, what is normally
| the case) even in MP kernels (on MULTIPROCESSOR kernels, 'curproc'
| is per-processor value), and it's cheap. It's actually cheaper than
| passing the proc pointer around through number of nested function calls.
| 

In this case it is a simple leaf node call, and we passed p->p_emul already
in the first call. In the second, it is again an extra argument to a leaf
procedure. Personally I'd like to remove all the p = curproc args where it
is simple to do so.

christos