Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2002 13:09:34 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Kyunghwan Kim <redjade@ada.snu.ac.kr>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Kernel process(thread) in SMP system
Message-ID:  <Pine.BSF.4.21.0212101254110.28346-100000@root.org>
In-Reply-To: <20021206141136.GA16433@ada.snu.ac.kr>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0212101254110.28346-100000>