From owner-freebsd-arch Tue Aug 29 10:21:12 2000 Delivered-To: freebsd-arch@freebsd.org Received: from wally.eecs.harvard.edu (wally.eecs.harvard.edu [140.247.60.30]) by hub.freebsd.org (Postfix) with ESMTP id 408CA37B440 for ; Tue, 29 Aug 2000 10:21:05 -0700 (PDT) Received: from localhost (stein@localhost) by wally.eecs.harvard.edu (8.10.0/8.10.0) with ESMTP id e7THG2822762; Tue, 29 Aug 2000 13:16:02 -0400 (EDT) Date: Tue, 29 Aug 2000 13:16:02 -0400 (EDT) From: Christopher Stein X-Sender: stein@wally To: Jake Burkholder Cc: freebsd-arch@freebsd.org Subject: Re: seeking information on kernel threads In-Reply-To: <20000829024432.90592BA69@io.yi.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 28 Aug 2000, Jake Burkholder wrote: > This isn't really -arch material... Ok, which list would you suggest? This is certainly OS architecture related. Perhaps the -arch in freebsd-arch@ represent machine architecture rather than OS architecture? If this is the case, please direct me to the OS architecture list. > proc0 I guess, which is eventually the swapper. They get started by > sysinits, which are run from mi_startup(). > > SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp) > Here's some ps waux output from my 4.0 system: root 0 0.0 0.0 0 0 ?? DLs Wed04PM 0:00.23 (swapper) root 4 0.0 0.0 0 0 ?? DL Wed04PM 0:00.50 (bufdaemon) root 5 0.0 0.0 0 0 ?? DL Wed04PM 1:59.45 (syncer) bufdaemon and swapper appear to be distinct processes. > > DESCRIPTION > > The update kernel process helps protect the integrity of disk volumes > > by flushing volatile cached filesystem data to disk. This is done at > > thirty second intervals by default. The time period may be changed by > > using sysctl(8) to modify the kern.update variable. The update process > > does the equivalent of the sync(2) function call to do the task. > > > > -- cut here -- > > > > Is this out of date? I thought FreeBSD implemented a trickle sync > > algorithm, which would contradict much of the description above. > > I don't really know what this means. Yes, it is (was) out of date. The man page was replaced with a syncer page in 4.1. My point was that a trickle sync algorithm is more than just an update process with a small period between wakeups. Trickle sync processes a fraction of the dirty buffers on every wakeup, unlike the more bursty update, which used to sync all the dirty blocks. > > > > (2) Syncer (pid 5): sched_sync() in kern/vfs_subr.c. Pretty clear that > > this one writes dirty buffers. However, it seems to have a variable > > throttle (speedup_syncer()).. why then the bufdaemon process? Also the pid > > number suggests that it is started *after* the bufdaemon. Hmm. > > Its not really relevant which is started first, they won't be needed > until after all the sysinits are over and the scheduler() starts. So the syncer writes dirty file system buffers. What does bufdaemon do then? Here are the 3 kernel VM daemons: root 2 0.0 0.0 0 0 ?? DL Wed04PM 0:00.51 (pagedaemon) root 3 0.0 0.0 0 0 ?? DL Wed04PM 0:00.00 (vmdaemon) root 0 0.0 0.0 0 0 ?? DLs Wed04PM 0:00.23 (swapper) How are they different? From the source (vm/vm_pageout.c) vm_daemon appears to perform swapping activities; that is, the eviction of full processes from core. Pagedaemon (also vm/vm_pageout.c) appears to write and evict pages to the swap device. What then does the swapper do? thx -Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message