kernel upcall documentation

Daniel Eischen deischen at freebsd.org
Fri Oct 21 11:23:54 PDT 2005


On Fri, 21 Oct 2005, Konstantinos Boukis wrote:

> Well, to be honest I managed to bypass the NULL fd_cdir problem by assigning a
> temporary valid filedesc to curthread->td_proc->p_fd just before the invocation
> to linker_load_module.
> However I am curious to see the upcall solution as well. When I read that:
> "When a thread blocks in the kernel, the (virtual) cpu is reallocated to
> another newly created context (thread) and it is allowed to proceed back
> to userland and runs a known routine with a known pointer as its
> argument." (from
> http://lists.freebsd.org/pipermail/freebsd-threads/2003-July/001018.html)
> I understood that when a kernel thread blocks it makes an upcall to userland and
> it calls the ku_func function. When ku_func accomplishes its operation then the
> kernel thread is resumed so as to comply with the upcall definition of clark's
> "The structuring of systems using upcalls" and Kohler's "the click modular
> router". So, have I got it right or I am missing something?

These set of functions are meant for user threading, not kernel
initiated threading.  I don't know what Clark and Kohler describe,
but these functions were specifically made for allowing thread
libraries to be written.  If you want userland to do something
based on a kernel event, traditionally userland calls into the
kernel and waits for the event, then does whatever it needs to
when the event occurs.

-- 
DE



More information about the freebsd-threads mailing list