cvs commit: src/sys/dev/fdc fdc.c fdcvar.h

John Baldwin jhb at FreeBSD.org
Thu Sep 23 18:01:12 PDT 2004


On Thursday 23 September 2004 07:27 pm, Nate Lawson wrote:
> John Baldwin wrote:
> > On Thursday 23 September 2004 07:19 pm, Nate Lawson wrote:
> >>Or simpler:
> >>
> >>foo_kill():
> >>         error = kthread_suspend(p, kproc_shutdown_wait * hz);
> >>         if (error == EWOULDBLOCK)
> >>                 printf("timed out\n");
> >>
> >>foo_thread():
> >>         for (;;) {
> >>                 mtx_unlock(&bdlock);
> >>                 kthread_suspend_check(bufdaemonproc);
> >>                 ...
> >>                 mtx_lock(&bdlock);
> >>                 if (numdirtybuffers <= lodirtybuffers)
> >>                         msleep(&bd_request, &bdlock, PVM, "psleep", hz);
> >
> > That doesn't actually cause the thread to exit, it just goes to sleep. 
> > If fdc wants to support detaching and kldunload it needs the thread to
> > actually go away, not just go to sleep.
>
> If a thread is suspended and the module is unloaded, what would be the
> failure case?

Leaving unclaimed KVM around that can never be recovered.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list