Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2008 17:14:59 -0400
From:      David Schultz <das@FreeBSD.ORG>
To:        kr Lekha <kr.lekha@gmail.com>
Cc:        freebsd-hackers@FreeBSD.ORG, Rui Paulo <rpaulo@FreeBSD.ORG>
Subject:   Re: killing a kthread
Message-ID:  <20080903211459.GA60350@zim.MIT.EDU>
In-Reply-To: <96b2ec350809030516y2d6f26d1h3cd7eb39231c4da0@mail.gmail.com>
References:  <96b2ec350809030134j73a61369m35395391a1218975@mail.gmail.com> <20080903095605.GB21178@alpha.local> <96b2ec350809030516y2d6f26d1h3cd7eb39231c4da0@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 03, 2008, kr Lekha wrote:
> I understand when thread finishes it should call kthread_exit().
> but if this thread was suspended before it finished, it might not be able to
> call kthread_exit().
> 
> Due to which we still see the thread suspended. I am unable to kill it
> even with killproc / psignal with in the kernel module.

That's by design. Kernel threads can hold arbitrary kernel
resources, and there's no mechanism to clean up after them
automatically. They are expected to clean up after themselves and
exit gracefully. In your case, you'll need to wake up the
suspended thread and somehow notify it that you want it to
terminate.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080903211459.GA60350>