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:09:17
On Mar 17, 10:08am, jdolecek@netbsd.org (Jaromir Dolecek) wrote:
-- Subject: Re: Adding a size parameter to stackgap_init()

| The stackgap alloc function is used to allocate piece of userspace
| memory where results of native syscalls are temporarily stored
| before they are converted to compat ones, copied to space
| pointed out by compat syscall and syscall  is returned.
| AFAIK copyout() doesn't work with kernel adresses as the target
| (IIRC it panics, which is right).

Yes, so the problem is that swapctl() needs more that 1K of arg space.

| BTW, the stackgap_init() size parameter doesn't make too much sense.
| The maximum can't be changed at proc runtime and using that as indication
| of maximum stackgap thread usage would be a bit of PITA to get the value
| right in many cases.

I understand that. But in the future that might be allowed, with a different
implementation of stackgap.

| Also, what is the purpose of the 'struct proc' argument? I realize
| the functions aren't LWP safe (i.e. different clone(2)d processes
| would all share single stackgap since they share VM space), do you
| plan any further work on it?

This is to avoid 'struct proc *p = curproc; /* XXX */' in the code.

christos