Subject: Re: misc/37612: cpu_switchto(9) doesn't document 'returning' parameter
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Andrew Doran <ad@netbsd.org>
List: netbsd-bugs
Date: 12/25/2007 22:00:04
The following reply was made to PR misc/37612; it has been noted by GNATS.
From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: misc/37612: cpu_switchto(9) doesn't document 'returning' parameter
Date: Tue, 25 Dec 2007 21:57:54 +0000
On Wed, Dec 26, 2007 at 08:36:59AM +1100, matthew green wrote:
>
> Architecture: x86_64
> Machine: amd64
> >Description:
> The cpu_switchto(9) man page declares the function as:
It's on my list of pages to update; I haven't gotten around to it yet.
> lwp_t *cpu_switchto(lwp_t *oldlwp, lwp_t *newlwp);
>
> But should now read:
> lwp_t *cpu_switchto(lwp_t *oldlwp, lwp_t *newlwp, bool returning);
>
>
> interesting...
>
> andy, what is this bool returning? i notice that most
> platforms cpu_switchto() don't notice it..
It can safely be ignored if __HAVE_FAST_SOFTINTS is not defined.
From http://www.netbsd.org/~ad/smp/vmlocking.txt -
Minor changes to cpu_switchto(). It takes a extra boolean argument,
'returning'. If returning is set, it means we are returning for a soft
interrupt that is blocking (so will resume in the trampoline function).
If it's set, it's a good indication that any kind of address space or
user activity can be completely ignored (e.g. activity around
ras_lookup(), cache flushes, TLB wirings, lazy FPU state, etc). All
that's needed is to restore the register state and stack then return;
everything else has been 'borrowed' from the interrupted LWP that we are
returning to.
Andrew