just what does kserel mean?
Chuck Swiger
cswiger at mac.com
Mon Sep 11 16:03:58 PDT 2006
On Sep 11, 2006, at 3:14 PM, Nestor Wheelock wrote:
> I have searched all over the net for a good definition of what the
> top state, "kserel" means. When I run mysql this is the state in
> which it runs.
>
> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU
> COMMAND
> 2117 mysql 17 20 0 323M 59080K kserel 0 0:02 0.00%
> mysqld
>
> I'm a newbie with freebsd and am concerned that this might be some
> sort of problem since my installation of Mysql turned out to be
> rather challenging.
This state is set in the kse_release() call in sys/kern/kern_kse.c,
and appears to mean that the process is waiting to be woken up by a
signal or is otherwise blocked waiting for more work; this is handled
by returning control to userspace via an "upcall".
See "man kse_release":
In other words, as soon as there is a scheduling decision to be
made, the
KSE becomes unassigned, because the kernel does not presume to
know how
the process' other runnable threads should be scheduled.
Unassigned KSEs
always return to user space as soon as possible via the upcall
mechanism
(described below), allowing the user process to decide how that
KSE
should be utilized next. KSEs always complete as much work as
possible
in the kernel before becoming unassigned.
[ ... ]
The kse_release() system call is used to ``park'' the KSE
assigned to the
currently running thread when it is not needed, e.g., when
there are more
available KSEs than runnable user threads. The thread converts
to an
upcall but does not get scheduled until there is a new reason
to do so,
e.g., a previously blocked thread becomes runnable, or the timeout
expires. If successful, kse_release() does not return to the
caller.
--
-Chuck
More information about the freebsd-questions
mailing list