From owner-freebsd-arch@FreeBSD.ORG Sun May 18 06:53:04 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6007137B401 for ; Sun, 18 May 2003 06:53:04 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 1885A43FBD for ; Sun, 18 May 2003 06:53:03 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 18 May 2003 14:53:02 +0100 (BST) To: Nate Lawson In-Reply-To: Your message of "Sat, 17 May 2003 23:04:54 PDT." <20030517230020.B87908@root.org> Date: Sun, 18 May 2003 14:53:01 +0100 From: Ian Dowse Message-ID: <200305181453.aa61367@salmon.maths.tcd.ie> cc: arch@freebsd.org Subject: Re: backtrace() not printing to kernel log X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2003 13:53:04 -0000 In message <20030517230020.B87908@root.org>, Nate Lawson writes: >I've found an annoyance when tracking down a new LoR. Since >db_print_backtrace() uses db_printf() instead of printf(), the backtrace >doesn't make it to the kernel buffer but is printed directly to the >console. Below is the simple workaround patch I use. However, this introduces many further problems, because printf is not safe to use at arbitrary times due to the fact that it can call into the tty code, and has other reentrancy problems. You can probably find more details in mails from bde in the archives. Mainly based on Bruce's comments and suggestions, I have been putting together a patch that tries to improve the usability of printf by making the message buffer code more reentrant, and using another message buffer for passing text to the tty subsystem via a timeout handler. The patch is at an early stage and not very pleasant in a few areas, but if you're interested, see: http://www.maths.tcd.ie/~iedowse/FreeBSD/msgbuf.diff Ian Index: db_output.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/ddb/db_output.c,v retrieving revision 1.27 diff -u -r1.27 db_output.c --- db_output.c 20 Mar 2002 05:14:28 -0000 1.27 +++ db_output.c 12 Mar 2003 22:09:28 -0000 @@ -98,6 +98,11 @@ int c; /* character to output */ void * arg; { +#if 1 + printf("%c", c); + if (c == '\r' || c == '\n') + db_check_interrupt(); +#else if (c > ' ' && c <= '~') { /* * Printing character. @@ -136,6 +141,7 @@ cnputc(c); } /* other characters are assumed non-printing */ +#endif } /* From owner-freebsd-arch@FreeBSD.ORG Tue May 20 13:34:19 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A93837B4CB; Tue, 20 May 2003 13:34:19 -0700 (PDT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1C7A43FAF; Tue, 20 May 2003 13:34:18 -0700 (PDT) (envelope-from hmp@perrin.int.nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1072) id 325C52105A; Tue, 20 May 2003 13:34:18 -0700 (PDT) Date: Tue, 20 May 2003 13:34:18 -0700 From: Hiten Pandya To: arch@FreeBSD.ORG Message-ID: <20030520203418.GA92706@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD FreeBSD 4.7-STABLE User-Agent: Mutt/1.5.4i cc: jeff@FreeBSD.ORG cc: des@FreeBSD.ORG Subject: ALQ manual page review X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2003 20:34:20 -0000 Hi gang. I have written a manual page for the Asynchronous Logging Queues (ALQ) facility, available in FreeBSD 5.x. I have been trying to reach Jeff by various methods of contact (IRC, mail etc) but I have not had a response from him. Viewing copy is available: http://people.FreeBSD.ORG/~hmp/manpages/alq.9.pdf http://people.FreeBSD.ORG/~hmp/manpages/alq.9.txt Groff copy of the manual page: http://people.FreeBSD.ORG/~hmp/manpages/alq.9 The manual page has been reviewed by my mentor (des@). Commands and suggestions welcome. Thanking in anticipation. -- Hiten (hmp@FreeBSD.ORG) From owner-freebsd-arch@FreeBSD.ORG Tue May 20 21:57:12 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDC4037B401; Tue, 20 May 2003 21:57:12 -0700 (PDT) Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id B52DC43F93; Tue, 20 May 2003 21:57:11 -0700 (PDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h4L4vAc56197; Wed, 21 May 2003 00:57:10 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Wed, 21 May 2003 00:57:10 -0400 (EDT) From: Jeff Roberson To: Hiten Pandya In-Reply-To: <20030520203418.GA92706@perrin.int.nxad.com> Message-ID: <20030521004947.X52717-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@FreeBSD.ORG cc: jeff@FreeBSD.ORG cc: des@FreeBSD.ORG Subject: Re: ALQ manual page review X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 04:57:13 -0000 On Tue, 20 May 2003, Hiten Pandya wrote: > Hi gang. > > I have written a manual page for the Asynchronous Logging Queues (ALQ) > facility, available in FreeBSD 5.x. I have been trying to reach Jeff by > various methods of contact (IRC, mail etc) but I have not had a response > from him. > Sorry Hiten, I'm pretty well occupied lately. I was just telling mini that I need to get back to you on this. Anyway, I have a few comments. The ae_flags are for internal use only. Consumers of the API should not modify them. The second sentence in the section describing alq_open() is a little bit confusing. Please considering breaking it up. You should probably say 'with the "alqget" wait message'. The wait channel is not so important to the consumer of the API. You might want to go into a little detail about how alq_get() and alq_post() are intended as a more effecient way to do alq_write(). They save the memcpy into the ale. Thanks! Jeff > Viewing copy is available: > > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.pdf > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.txt > > Groff copy of the manual page: > > http://people.FreeBSD.ORG/~hmp/manpages/alq.9 > > The manual page has been reviewed by my mentor (des@). > Commands and suggestions welcome. > > Thanking in anticipation. > > -- Hiten (hmp@FreeBSD.ORG) > From owner-freebsd-arch@FreeBSD.ORG Wed May 21 09:19:06 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5656B37B401; Wed, 21 May 2003 09:19:06 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A83A43F3F; Wed, 21 May 2003 09:19:05 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h4LGIWOn079957; Wed, 21 May 2003 12:18:32 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h4LGIWcg079954; Wed, 21 May 2003 12:18:32 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Wed, 21 May 2003 12:18:32 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Jeff Roberson In-Reply-To: <20030521004947.X52717-100000@mail.chesapeake.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Hiten Pandya cc: jeff@FreeBSD.ORG cc: des@FreeBSD.ORG cc: arch@FreeBSD.ORG Subject: Re: ALQ manual page review X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 16:19:06 -0000 On Wed, 21 May 2003, Jeff Roberson wrote: > On Tue, 20 May 2003, Hiten Pandya wrote: > > > Hi gang. > > > > I have written a manual page for the Asynchronous Logging Queues (ALQ) > > facility, available in FreeBSD 5.x. I have been trying to reach Jeff by > > various methods of contact (IRC, mail etc) but I have not had a response > > from him. > > > <...> > The second sentence in the section describing alq_open() is a little bit > confusing. Please considering breaking it up. Another thing that probably needs to appear in the man page is that the credential associated with the thread invoking alq_open() is the credential used to authorize the open(). Right now, alq_open() is invoked only by a sysctl handler requiring privilege to invoke, so this is fine--but the caller should be aware of this and avoid embaressing circumstances (such as using a root privileged thread to open a queue on behalf of an unprivileged process, etc). Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories From owner-freebsd-arch@FreeBSD.ORG Wed May 21 09:52:55 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0FC837B404; Wed, 21 May 2003 09:52:54 -0700 (PDT) Received: from out006.verizon.net (out006pub.verizon.net [206.46.170.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A91A43F3F; Wed, 21 May 2003 09:52:53 -0700 (PDT) (envelope-from mtm@identd.net) Received: from kokeb.ambesa.net ([151.200.236.15]) by out006.verizon.net (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP id <20030521165252.GJEW25800.out006.verizon.net@kokeb.ambesa.net>; Wed, 21 May 2003 11:52:52 -0500 Date: Wed, 21 May 2003 12:52:51 -0400 From: Mike Makonnen To: Hiten Pandya In-Reply-To: <20030520203418.GA92706@perrin.int.nxad.com> References: <20030520203418.GA92706@perrin.int.nxad.com> X-Mailer: Sylpheed version 0.8.10 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out006.verizon.net from [151.200.236.15] at Wed, 21 May 2003 11:52:51 -0500 Message-Id: <20030521165252.GJEW25800.out006.verizon.net@kokeb.ambesa.net> cc: arch@FreeBSD.org Subject: Re: ALQ manual page review X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 16:52:55 -0000 On Tue, 20 May 2003 13:34:18 -0700 Hiten Pandya wrote: > Hi gang. > > I have written a manual page for the Asynchronous Logging Queues (ALQ) > facility, available in FreeBSD 5.x. I have been trying to reach Jeff by > various methods of contact (IRC, mail etc) but I have not had a response > from him. > > Viewing copy is available: > > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.pdf > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.txt This is really more of an "observation" than a request to do something about it. Most (all) manual pages have separate sections for 'RETURN VALUES' and 'ERRORS.' I find this very useful. While including return values and errors with the description of the function does make sense, the former makes it much easier for me to find what I'm looking for. For example, a lot of times I already know what the function does, and I just want to quickly find out what values it returns and the possible errors. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 mtm@FreeBSD.Org| FreeBSD - The Power To Serve From owner-freebsd-arch@FreeBSD.ORG Wed May 21 10:54:14 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C62F437B401; Wed, 21 May 2003 10:54:14 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19E4B43F93; Wed, 21 May 2003 10:54:14 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h4LHsBUO029108; Wed, 21 May 2003 10:54:11 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h4LHsB5d029107; Wed, 21 May 2003 10:54:11 -0700 Date: Wed, 21 May 2003 10:54:11 -0700 From: Brooks Davis To: Mike Makonnen Message-ID: <20030521175411.GA3076@Odin.AC.HMC.Edu> References: <20030520203418.GA92706@perrin.int.nxad.com> <20030521165252.GJEW25800.out006.verizon.net@kokeb.ambesa.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline In-Reply-To: <20030521165252.GJEW25800.out006.verizon.net@kokeb.ambesa.net> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: Hiten Pandya cc: arch@freebsd.org Subject: Re: ALQ manual page review X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 17:54:15 -0000 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 21, 2003 at 12:52:51PM -0400, Mike Makonnen wrote: > On Tue, 20 May 2003 13:34:18 -0700 > Hiten Pandya wrote: >=20 > > Hi gang. > >=20 > > I have written a manual page for the Asynchronous Logging Queues (ALQ) > > facility, available in FreeBSD 5.x. I have been trying to reach Jeff by > > various methods of contact (IRC, mail etc) but I have not had a response > > from him. > >=20 > > Viewing copy is available: > >=20 > > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.pdf > > http://people.FreeBSD.ORG/~hmp/manpages/alq.9.txt >=20 > This is really more of an "observation" than a request to do something ab= out it. >=20 > Most (all) manual pages have separate sections for 'RETURN VALUES' and 'E= RRORS.' > I find this very useful. While including return values and errors with the > description of the function does make sense, the former makes it much > easier for me to find what I'm looking for. For example, a lot of times I > already know what the function does, and I just want to quickly find out = what > values it returns and the possible errors. I second this. I find the RETURN VALUES sections especialy useful. Thanks for the good work Hiten! -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --ZPt4rx8FFjLCG7dd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+y71AXY6L6fI4GtQRAtLhAKDChRbWeeE6nanPX0BOuT+3j2aw+gCgrRGc RiEaxYPucg9Lc6X7jEUfP+4= =AfEj -----END PGP SIGNATURE----- --ZPt4rx8FFjLCG7dd-- From owner-freebsd-arch@FreeBSD.ORG Wed May 21 19:18:31 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30BAE37B401 for ; Wed, 21 May 2003 19:18:31 -0700 (PDT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5F1143F75 for ; Wed, 21 May 2003 19:18:30 -0700 (PDT) (envelope-from hmp@perrin.int.nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1072) id DA07021068; Wed, 21 May 2003 19:18:29 -0700 (PDT) Date: Wed, 21 May 2003 19:18:29 -0700 From: Hiten Pandya To: arch@FreeBSD.ORG Message-ID: <20030522021829.GA6619@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline X-Operating-System: FreeBSD FreeBSD 4.7-STABLE User-Agent: Mutt/1.5.4i Subject: vnode(9) update X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 02:18:31 -0000 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Gang. I am requesting a review of removing the ``struct vnode'' from the vnode(9) manual page, and also updating a little text. I was asked by some people to ask arch@ for a review before making such change, so here it is. Patch is attached with this mail. Patch also available from: http://people.FreeBSD.ORG/~hmp/patches/vnode.9.patch Comments and suggestions welcome. Cheers. -- Hiten (hmp@FreeBSD.ORG) --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vnode.9.patch" Index: vnode.9 =================================================================== RCS file: /home/ncvs/src/share/man/man9/vnode.9,v retrieving revision 1.24 diff -u -r1.24 vnode.9 --- vnode.9 6 Mar 2003 23:55:51 -0000 1.24 +++ vnode.9 20 May 2003 21:28:10 -0000 @@ -1,5 +1,3 @@ -.\" -*- nroff -*- -.\" .\" Copyright (c) 1996 Doug Rabson .\" .\" All rights reserved. @@ -28,7 +26,7 @@ .\" .\" $FreeBSD: src/share/man/man9/vnode.9,v 1.24 2003/03/06 23:55:51 ceri Exp $ .\" -.Dd June 30, 1999 +.Dd May 20, 2003 .Os .Dt VNODE 9 .Sh NAME @@ -37,114 +35,20 @@ .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h -.Pp -.Bd -literal -/* - * Vnode types. VNON means no type. - */ -enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD }; - -/* - * Each underlying file system allocates its own private area and hangs - * it from v_data. If non-null, this area is freed in getnewvnode(). - */ -TAILQ_HEAD(buflists, buf); - -typedef int vop_t(void *); -struct namecache; - -/* - * Reading or writing any of these items requires holding the appropriate lock. - * v_freelist is locked by the global vnode_free_list simple lock. - * v_mntvnodes is locked by the global mntvnodes simple lock. - * v_flag, v_usecount, v_holdcount and v_writecount are - * locked by the v_interlock simple lock. - * v_pollinfo is locked by the lock contained inside it. - */ -struct vnode { - u_long v_flag; /* vnode flags (see below) */ - int v_usecount; /* reference count of users */ - int v_writecount; /* reference count of writers */ - int v_holdcnt; /* page & buffer references */ - u_long v_id; /* capability identifier */ - struct mount *v_mount; /* ptr to vfs we are in */ - vop_t **v_op; /* vnode operations vector */ - TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ - LIST_ENTRY(vnode) v_mntvnodes; /* vnodes for mount point */ - struct buflists v_cleanblkhd; /* clean blocklist head */ - struct buflists v_dirtyblkhd; /* dirty blocklist head */ - LIST_ENTRY(vnode) v_synclist; /* vnodes with dirty buffers */ - long v_numoutput; /* num of writes in progress */ - enum vtype v_type; /* vnode type */ - union { - struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */ - struct socket *vu_socket; /* unix ipc (VSOCK) */ - struct { - struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ - SLIST_ENTRY(vnode) vu_specnext; - } vu_spec; - struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ - } v_un; - struct nqlease *v_lease; /* Soft reference to lease */ - daddr_t v_lastw; /* last write (write cluster) */ - daddr_t v_cstart; /* start block of cluster */ - daddr_t v_lasta; /* last allocation */ - int v_clen; /* length of current cluster */ - struct vm_object *v_object; /* Place to store VM object */ - struct simplelock v_interlock; /* lock on usecount and flag */ - struct lock *v_vnlock; /* used for non-locking fs's */ - const char *v_tag; /* type of underlying data */ - void *v_data; /* private data for fs */ - LIST_HEAD(, namecache) v_cache_src; /* Cache entries from us */ - TAILQ_HEAD(, namecache) v_cache_dst; /* Cache entries to us */ - struct vnode *v_dd; /* .. vnode */ - u_long v_ddid; /* .. capability identifier */ - struct { - struct simplelock vpi_lock; /* lock to protect below */ - struct selinfo vpi_selinfo; /* identity of poller(s) */ - short vpi_events; /* what they are looking for */ - short vpi_revents; /* what has happened */ - } v_pollinfo; -}; -#define v_mountedhere v_un.vu_mountedhere -#define v_socket v_un.vu_socket -#define v_rdev v_un.vu_spec.vu_specinfo -#define v_specnext v_un.vu_spec.vu_specnext -#define v_fifoinfo v_un.vu_fifoinfo - -/* - * Vnode flags. - */ -#define VROOT 0x00001 /* root of its file system */ -#define VTEXT 0x00002 /* vnode is a pure text prototype */ -#define VSYSTEM 0x00004 /* vnode being used by kernel */ -#define VISTTY 0x00008 /* vnode represents a tty */ -#define VXLOCK 0x00100 /* vnode is locked to change underlying type */ -#define VXWANT 0x00200 /* process is waiting for vnode */ -#define VBWAIT 0x00400 /* waiting for output to complete */ -#define VOBJBUF 0x02000 /* Allocate buffers in VM object */ -#define VAGE 0x08000 /* Insert vnode at head of free list */ -#define VOLOCK 0x10000 /* vnode is locked waiting for an object */ -#define VOWANT 0x20000 /* a process is waiting for VOLOCK */ -#define VDOOMED 0x40000 /* This vnode is being recycled */ -#define VFREE 0x80000 /* This vnode is on the freelist */ -#define VTBFREE 0x100000 /* This vnode is on the to-be-freelist */ -#define VONWORKLST 0x200000 /* On syncer work-list */ -#define VMOUNT 0x400000 /* Mount in progress */ - -.Ed .Sh DESCRIPTION The vnode is the focus of all file activity in .Ux . +A vnode is described by +.Vt "struct vnode" . There is a unique vnode allocated for each active file, each current directory, each mounted-on file, text file, and the root. .Pp Each vnode has three reference counts, -.Dv v_usecount , -.Dv v_holdcnt +.Va v_usecount , +.Va v_holdcnt and -.Dv v_writecount . +.Va v_writecount . The first is the number of clients within the kernel which are using this vnode. This count is maintained by .Xr vref 9 , @@ -158,9 +62,9 @@ and .Xr vdrop 9 . When both the -.Dv v_usecount +.Va v_usecount and the -.Dv v_holdcnt +.Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. The transition to and from the freelist is handled by @@ -180,7 +84,7 @@ .Xr VOP_LOOKUP 9 etc.) will increase the -.Dv v_usecount +.Va v_usecount of the vnode by one. When the caller is finished with the vnode, it should release this reference by calling .Xr vrele 9 @@ -189,17 +93,17 @@ if the vnode is locked). .Pp Other commonly used members of the vnode structure are -.Dv v_id +.Va v_id which is used to maintain consistency in the name cache, -.Dv v_mount +.Va v_mount which points at the file system which owns the vnode, -.Dv v_type +.Va v_type which contains the type of object the vnode represents and -.Dv v_data +.Va v_data which is used by file systems to store file system specific data with the vnode. The -.Dv v_op +.Va v_op field is used by the .Dv VOP_* macros to call functions in the file system which implement the vnode's --ew6BAiZeqk4r7MaW-- From owner-freebsd-arch@FreeBSD.ORG Wed May 21 23:50:56 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E264537B401; Wed, 21 May 2003 23:50:56 -0700 (PDT) Received: from HAL9000.homeunix.com (12-233-57-131.client.attbi.com [12.233.57.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 415A143F3F; Wed, 21 May 2003 23:50:56 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.5) with ESMTP id h4M6osqN009990; Wed, 21 May 2003 23:50:54 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.5/Submit) id h4M6os9V009989; Wed, 21 May 2003 23:50:54 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 21 May 2003 23:50:54 -0700 From: David Schultz To: Hiten Pandya Message-ID: <20030522065054.GA9917@HAL9000.homeunix.com> Mail-Followup-To: Hiten Pandya , arch@freebsd.org References: <20030522021829.GA6619@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030522021829.GA6619@perrin.int.nxad.com> cc: arch@FreeBSD.ORG Subject: Re: vnode(9) update X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 06:50:57 -0000 On Wed, May 21, 2003, Hiten Pandya wrote: > Hello Gang. > > I am requesting a review of removing the ``struct vnode'' from the > vnode(9) manual page, and also updating a little text. I was asked > by some people to ask arch@ for a review before making such change, > so here it is. Patch is attached with this mail. I find it useful in that it decreases the amount of cross- referencing I need to do. (It's great that section 9 in our manual is reasonably complete these days!) However, if it's hard to keep the manpage in sync with the code, or if there's another good reason to axe it, then by all means do. From owner-freebsd-arch@FreeBSD.ORG Thu May 22 02:57:13 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 994F837B401; Thu, 22 May 2003 02:57:13 -0700 (PDT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F7D143F93; Thu, 22 May 2003 02:57:13 -0700 (PDT) (envelope-from hmp@perrin.int.nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1072) id 9EA7B21062; Thu, 22 May 2003 02:57:12 -0700 (PDT) Date: Thu, 22 May 2003 02:57:12 -0700 From: Hiten Pandya To: David Schultz Message-ID: <20030522095712.GA39016@perrin.int.nxad.com> References: <20030522021829.GA6619@perrin.int.nxad.com> <20030522065054.GA9917@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030522065054.GA9917@HAL9000.homeunix.com> X-Operating-System: FreeBSD FreeBSD 4.7-STABLE User-Agent: Mutt/1.5.4i cc: arch@FreeBSD.ORG Subject: Re: vnode(9) update X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 09:57:13 -0000 On Wed, May 21, 2003 at 11:50:54PM -0700, David Schultz wrote: > On Wed, May 21, 2003, Hiten Pandya wrote: > > Hello Gang. > > > > I am requesting a review of removing the ``struct vnode'' from the > > vnode(9) manual page, and also updating a little text. I was asked > > by some people to ask arch@ for a review before making such change, > > so here it is. Patch is attached with this mail. > > I find it useful in that it decreases the amount of cross- > referencing I need to do. (It's great that section 9 in our > manual is reasonably complete these days!) However, if it's hard > to keep the manpage in sync with the code, or if there's another > good reason to axe it, then by all means do. Yes, its really hard to maintain big structures in manual pages. Only half of struct vnode was explained in the vnode(9) manual page. I will commit this change later on today. Cheers. -- Hiten (hmp@FreeBSD.ORG) From owner-freebsd-arch@FreeBSD.ORG Thu May 22 03:06:22 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FCB337B401; Thu, 22 May 2003 03:06:22 -0700 (PDT) Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4596F43F75; Thu, 22 May 2003 03:06:21 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh by axl.seasidesoftware.co.za with local (Exim 4.20) id 19Imxl-0006lb-K3; Thu, 22 May 2003 12:06:17 +0200 Date: Thu, 22 May 2003 12:06:17 +0200 From: Sheldon Hearn To: Hiten Pandya Message-ID: <20030522100617.GO25247@starjuice.net> Mail-Followup-To: Hiten Pandya , David Schultz , arch@FreeBSD.ORG References: <20030522021829.GA6619@perrin.int.nxad.com> <20030522065054.GA9917@HAL9000.homeunix.com> <20030522095712.GA39016@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030522095712.GA39016@perrin.int.nxad.com> User-Agent: Mutt/1.5.4i Sender: Sheldon Hearn cc: arch@FreeBSD.ORG cc: David Schultz Subject: Re: vnode(9) update X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 10:06:23 -0000 On (2003/05/22 02:57), Hiten Pandya wrote: > Yes, its really hard to maintain big structures in manual pages. > Only half of struct vnode was explained in the vnode(9) manual > page. I will commit this change later on today. You're not alone, feeling that way. It's an unfortunate limitation of the tools we use. One day, we'll have a doc toolset that can include parts of source files based on metadata embedded in those source files. Until then, it's just a PITA we have to put up with. Hang in there, you're doing good work. :-) Ciao, Sheldon. From owner-freebsd-arch@FreeBSD.ORG Sat May 24 17:48:57 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B97DF37B401; Sat, 24 May 2003 17:48:57 -0700 (PDT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id C265543F75; Sat, 24 May 2003 17:48:56 -0700 (PDT) (envelope-from hmp@nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1072) id 9511320F01; Sat, 24 May 2003 17:48:55 -0700 (PDT) Date: Sat, 24 May 2003 17:48:55 -0700 From: Hiten Pandya To: arch@FreeBSD.ORG Message-ID: <20030525004855.GA67985@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline X-Operating-System: FreeBSD FreeBSD 4.7-STABLE User-Agent: Mutt/1.5.4i cc: des@FreeBSD.ORG Subject: scheduler determination X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2003 00:48:58 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Gang. It would be really nice if there was a way to find out the name of the current scheduler in the system. I have attached a patch which adds a sysctl called kern.sched.name, which does just that. Comments and suggestions welcome. Cheers. -- Hiten (hmp@FreeBSD.ORG) --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="scheduler-name.patch" Index: kern/kern_mib.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_mib.c,v retrieving revision 1.65 diff -u -r1.65 kern_mib.c --- kern/kern_mib.c 30 Apr 2003 12:57:39 -0000 1.65 +++ kern/kern_mib.c 25 May 2003 00:04:44 -0000 @@ -85,6 +85,8 @@ "Regression test MIB"); #endif +SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "SCHED"); + SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD, osrelease, 0, "Operating system release"); Index: kern/sched_4bsd.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sched_4bsd.c,v retrieving revision 1.18 diff -u -r1.18 sched_4bsd.c --- kern/sched_4bsd.c 30 Apr 2003 12:57:39 -0000 1.18 +++ kern/sched_4bsd.c 25 May 2003 00:44:07 -0000 @@ -46,9 +46,9 @@ #include #include #include +#include #include #include -#include #include /* @@ -87,6 +87,10 @@ SYSINIT(sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL) +static char sched_name[] = "4bsd"; +SYSCTL_STRING(_kern_sched, OID_AUTO, name, CTLFLAG_RD, sched_name, 0, + "Current scheduler"); + /* * Global run queue. */ @@ -109,7 +113,7 @@ return (0); } -SYSCTL_PROC(_kern, OID_AUTO, quantum, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, CTLTYPE_INT|CTLFLAG_RW, 0, sizeof sched_quantum, sysctl_kern_quantum, "I", "Roundrobin scheduling quantum in microseconds"); Index: kern/sched_ule.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sched_ule.c,v retrieving revision 1.34 diff -u -r1.34 sched_ule.c --- kern/sched_ule.c 2 May 2003 06:18:55 -0000 1.34 +++ kern/sched_ule.c 25 May 2003 00:43:08 -0000 @@ -34,10 +34,10 @@ #include #include #include +#include #include #include #include -#include #include #include #ifdef DDB @@ -60,7 +60,9 @@ static void sched_setup(void *dummy); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL) -static SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "SCHED"); +static char sched_name[] = "ule"; +SYSCTL_STRING(_kern_sched, OID_AUTO, name, CTLFLAG_RD, sched_name, 0, + "Current scheduler"); static int sched_strict; SYSCTL_INT(_kern_sched, OID_AUTO, strict, CTLFLAG_RD, &sched_strict, 0, ""); Index: sys/sched.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sched.h,v retrieving revision 1.4 diff -u -r1.4 sched.h --- sys/sched.h 11 Apr 2003 03:39:06 -0000 1.4 +++ sys/sched.h 25 May 2003 00:17:35 -0000 @@ -92,4 +92,8 @@ extern struct p_sched *proc0_sched; extern struct td_sched *thread0_sched; +#ifdef SYSCTL_DECL +SYSCTL_DECL(_kern_sched); +#endif + #endif /* !_SYS_SCHED_H_ */ --RnlQjJ0d97Da+TV1-- From owner-freebsd-arch@FreeBSD.ORG Sat May 24 20:00:47 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F194037B401; Sat, 24 May 2003 20:00:46 -0700 (PDT) Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5CB343F85; Sat, 24 May 2003 20:00:45 -0700 (PDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h4P30j240765; Sat, 24 May 2003 23:00:45 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Sat, 24 May 2003 23:00:45 -0400 (EDT) From: Jeff Roberson To: Hiten Pandya In-Reply-To: <20030525004855.GA67985@perrin.int.nxad.com> Message-ID: <20030524225928.W69975-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: des@freebsd.org Subject: Re: scheduler determination X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2003 03:00:47 -0000 On Sat, 24 May 2003, Hiten Pandya wrote: > Hi Gang. > > It would be really nice if there was a way to find out the name of > the current scheduler in the system. I have attached a patch which adds > a sysctl called kern.sched.name, which does just that. > > Comments and suggestions welcome. > Cheers. > To reduce the redundant code you should define sched_name[] extern in sched.h and define the sysctl that reads it outside of each scheduler. This makes the name part of the api. A kernel wont compile with a scheduler that is missing this part of the scheduler definition. > -- Hiten (hmp@FreeBSD.ORG) >