From owner-freebsd-hackers Tue Dec 10 13: 9:34 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF49837B401 for ; Tue, 10 Dec 2002 13:09:33 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 57FAF43EC2 for ; Tue, 10 Dec 2002 13:09:33 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 28435 invoked by uid 1000); 10 Dec 2002 21:09:34 -0000 Date: Tue, 10 Dec 2002 13:09:34 -0800 (PST) From: Nate Lawson To: Kyunghwan Kim Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel process(thread) in SMP system In-Reply-To: <20021206141136.GA16433@ada.snu.ac.kr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 6 Dec 2002, Kyunghwan Kim wrote: > I've heard that kernel of RELENG_4 branch is single-threaded, > but can hardly check out if kernel process(thread) like pagedaemon can > run on other cpu concurrently when another cpu is processing an network > interrupt. Using Kernel process(thread) for cpu-bound job in SMP environment > will be beneficial? It there any method to tell which process including > user and kernel process is in kernel mode? -stable can run multiple processes at once but only one can enter the kernel at a time. A network interrupt runs at splnet and the pagedaemon runs with no interupts disabled (and splvm at some parts) so technically they can run concurrently. Still, a user proc can run concurrently with a splnet interrupt and vm_pageout() kern proc. So going to a kern proc has no bearing on your cpu-bound work. Just use multiple user procs (i.e. fork()) and you'll get the most out of your -stable box, given that your computation is divisible. You can tell what procs are doing with "ps axl" or top. If they're running, top shows as CPU0 or 1. Unfortunately, this doesn't tell if it's in kernel mode or not -- you have to use profiling to get an average view of this. -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message