Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Sep 2006 16:03:54 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Nestor Wheelock <nestor@mingus.eyedotmind.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: just what does kserel mean?
Message-ID:  <89A4BF2E-0A65-4FE4-96D0-47E0827F1C14@mac.com>
In-Reply-To: <20060911221120.K2564@mingus.eyedotmind.com>
References:  <20060911221120.K2564@mingus.eyedotmind.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?89A4BF2E-0A65-4FE4-96D0-47E0827F1C14>