From owner-cvs-src Tue Mar 4 3: 1:31 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA3BE37B401; Tue, 4 Mar 2003 03:01:28 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDEA843FBD; Tue, 4 Mar 2003 03:01:26 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA01584; Tue, 4 Mar 2003 22:01:07 +1100 Date: Tue, 4 Mar 2003 22:02:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Jeff Roberson Cc: Alfred Perlstein , , , , Subject: Re: cvs commit: src/sys/kern vfs_default.c In-Reply-To: <20030303203530.D72102-100000@mail.chesapeake.net> Message-ID: <20030304214414.A37482-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 3 Mar 2003, Jeff Roberson wrote: > On Mon, 3 Mar 2003, Alfred Perlstein wrote: > > > * Jeff Roberson [030303 16:39] wrote: > > > On Mon, 3 Mar 2003, Alfred Perlstein wrote: > > > > > Log: > > > > > - Correct the wchan in vop_stdfsync() > > > > > > > > > > This is almost what bde asked for. There is some desire to have per fs wchans > > > > > still but that is difficult giving the current arrangement of the code. > > > > > > char wchanbuf[7] = " sync"; > > > wchanbuf[0] = vp->v_type[0]; > > > wchanbuf[1] = vp->v_type[1]; I'd prefer more of "fsync" in the name (fsync != sync). ffs_fsync() abbreviates "fsync" to "fsn" and doesn't abbreviate its own name, giving the rather cryptic sleep message of "ffsfsn". I don't want this to take long at runtime. The above is probably OK, but snprintf() wouldn't be. Use a character array of size 8 so that it can be initialized with word-wide writes on normal machines and check that gcc generates only 1 or 2 word-wide writes to initialize it. Unfortunately the 3+3 split prevents the v_type assignment being compiled to a single (16 or 32 but) assignment. > > Although I provided that intial suggestion I'm actually opposed to > > non-const strings being passed into tsleep. The reaon being, if > > someone gets a process wedged, it should be trivial to grep for the > > wchan that it's stuck in. Adding something like this, while pretty > > actually would make it harder to debug things later. Do you mean literal constant strings? I tend to agree, but ... > > While this one exception wouldn't be too bad I'm afraid it will lead > > to (un)clever abuses later. ... almost everything is not a literal constant already. Examples include - strings passed down to sleeps in locking functions. - __func__ instead of literal function names in panics and KASSERTs. - ANSI string concatenation used to obfuscate literal strings. > Any comments bde? This seems like a bit of a judgement call to me. I'm > not sure which I prefer. See above. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message