e7045955c7
an offset between ss_sp and struct sa_stackinfo_t (located in struct __pthread_st) when calling sa_register. The kernel increments the sast_gen counter in struct sastack when an upcall stack is used. libpthread increments the sasi_stackgen counter in struct sa_stackinfo_t when an upcall stack is freed. The kernel compares the two counters to decide if a stack is free or in use. - add struct sa_stackinfo_t with sasi_stackgen to count stack use in userland - add sast_gen to struct sastack to count stack use in kernel - add SA_FLAG_STACKINFO to enable the stackinfo_offset argument in the sa_register syscall - add sa_stackinfo_offset to struct sadata for offset between ss_sp and struct sa_stackinfo_t - add ssize_t stackinfo_offset argument to sa_register, initialize struct sadata's sa_stackinfo_offset from it if SA_FLAG_STACKINFO is set - add sa_getstack, sa_getstack0, sa_stackused and sa_setstackfree functions to find/use/free upcall stacks and use these where appropriate - don't record stack for upcall in sa_upcall0 - pass sau to sa_switchcall instead of l2 (l2 = curlwp in sa_switchcall) - add sa_vp_blocker to struct sadata to pass recently blocked lwp to sa_switchcall - delay finding a stack for blocked upcalls to sa_switchcall - add sa_stacknext to struct sadata pointing to next most likely free upcall stack; also g/c sa_stackslist in struct sadata and sast_list in struct sastack - add L_SA_WOKEN flag: LWP is on sa_woken queue - add L_SA_RECYCLE flag: LWP should be recycled in sa_setwoken - replace l_upcallstack with L_SA_WOKEN/L_SA_RECYCLE/L_SA_BLOCKING flags - g/c now unused sast_blocker in struct sastack - make sa_switchcall, sa_upcall0 and sa_upcall_getstate static in kern_sa.c - call sa_upcall_userret only once in userret - split sa_makeupcalls out of sa_upcall_userret and use to process the sa_upcalls queue - on process exit: mark LWPs sleeping in saunblock interruptible; also there are no LWPs sleeping on l->l_upcallstack anymore; also clear sa_wokenq_head to prevent unblocked upcalls additional changes: - cleanup timerupcall sa_vp == curlwp check - add check in sa_yield if we didn't block on our way here and we wouldn't any longer be the LWP on the VP - invalidate sa_vp_ofaultaddr after resolving pagefault |
||
---|---|---|
.. | ||
compile | ||
conf | ||
dev | ||
fpu | ||
include | ||
sparc | ||
stand | ||
Makefile |