From owner-freebsd-questions@FreeBSD.ORG Mon Sep 11 23:03:58 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02BFD16A403 for ; Mon, 11 Sep 2006 23:03:58 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B74443D45 for ; Mon, 11 Sep 2006 23:03:57 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin03-en2 [10.13.10.148]) by smtpout.mac.com (Xserve/8.12.11/smtpout14/MantshX 4.0) with ESMTP id k8BN3vk1023400; Mon, 11 Sep 2006 16:03:57 -0700 (PDT) Received: from [17.214.13.96] (a17-214-13-96.apple.com [17.214.13.96]) (authenticated bits=0) by mac.com (Xserve/smtpin03/MantshX 4.0) with ESMTP id k8BN3s3O025965; Mon, 11 Sep 2006 16:03:56 -0700 (PDT) In-Reply-To: <20060911221120.K2564@mingus.eyedotmind.com> References: <20060911221120.K2564@mingus.eyedotmind.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <89A4BF2E-0A65-4FE4-96D0-47E0827F1C14@mac.com> Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Mon, 11 Sep 2006 16:03:54 -0700 To: Nestor Wheelock X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAQAAA+k= X-Language-Identified: TRUE Cc: freebsd-questions@freebsd.org Subject: Re: just what does kserel mean? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 23:03:58 -0000 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