From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 00:17:45 2003 Return-Path: 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 07F2F37B401 for ; Sun, 3 Aug 2003 00:17:45 -0700 (PDT) Received: from mail.numachi.com (meisai.numachi.com [198.175.254.6]) by mx1.FreeBSD.org (Postfix) with SMTP id B490E43F85 for ; Sun, 3 Aug 2003 00:17:43 -0700 (PDT) (envelope-from reichert@numachi.com) Received: (qmail 53028 invoked from network); 3 Aug 2003 07:17:42 -0000 Received: from natto.numachi.com (198.175.254.216) by meisai.numachi.com with SMTP; 3 Aug 2003 07:17:42 -0000 Received: (qmail 2551 invoked by uid 1001); 3 Aug 2003 07:17:42 -0000 Date: Sun, 3 Aug 2003 03:17:42 -0400 From: Brian Reichert To: freebsd-hackers@freebsd.org Message-ID: <20030803071742.GB298@numachi.com> References: <20030802155645.GE969@numachi.com> <20030802201132.GA53435@pc5.i.0x5.de> <20030802213455.GA298@numachi.com> <20030802214656.GA61028@pc5.i.0x5.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030802214656.GA61028@pc5.i.0x5.de> User-Agent: Mutt/1.4i Subject: Re: network crash dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 07:17:45 -0000 On Sat, Aug 02, 2003 at 11:46:56PM +0200, Nicolas Rachinsky wrote: > Did you really send a SIGABRT to init? This should cause init to exit > after a while (IIRC 30sec), which should cause a "Going nowhere > without my init" panic. I really did send a SIGABRT to init. Earlier, I explored a SIGSEGV with hte same symptoms. I did this while X was running, and was not at a text console. Maybe the panic message was hidden from me; I'll re-try to make sure. > > Nicolas > -- Brian 'you Bastard' Reichert 37 Crystal Ave. #303 Daytime number: (603) 434-6842 Derry NH 03038-1713 USA BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 00:23:43 2003 Return-Path: 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 0D58F37B401 for ; Sun, 3 Aug 2003 00:23:43 -0700 (PDT) Received: from mail.numachi.com (meisai.numachi.com [198.175.254.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 3B5A143F3F for ; Sun, 3 Aug 2003 00:23:42 -0700 (PDT) (envelope-from reichert@numachi.com) Received: (qmail 53178 invoked from network); 3 Aug 2003 07:23:41 -0000 Received: from natto.numachi.com (198.175.254.216) by meisai.numachi.com with SMTP; 3 Aug 2003 07:23:41 -0000 Received: (qmail 2637 invoked by uid 1001); 3 Aug 2003 07:23:41 -0000 Date: Sun, 3 Aug 2003 03:23:41 -0400 From: Brian Reichert To: John Polstra Message-ID: <20030803072341.GC298@numachi.com> References: <20030802193548.GH969@numachi.com> <200308022222.h72MM6Jl077237@strings.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308022222.h72MM6Jl077237@strings.polstra.com> User-Agent: Mutt/1.4i cc: hackers@freebsd.org Subject: Re: messing with CVS_LOCAL_BRANCH_NUM X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 07:23:43 -0000 On Sat, Aug 02, 2003 at 03:22:06PM -0700, John Polstra wrote: > In article <20030802193548.GH969@numachi.com>, > Brian Reichert wrote: > > I'm exploring the 'local repository' tactics as described in: > > > > > > > > which makes use of the CVS_LOCAL_BRANCH_NUM evironment variable. > [...] > > Any advice? > > Yes: look for a different approach, or at least backup your local > repository frequently. There are known bugs in CVSup which can cause > it to throw away your local branch under certain circumstances. I > won't have time to fix those issues any time soon. So my advice is, > don't use the CVS_LOCAL_BRANCH_NUM feature. Darn. :/ I had asked about this topic back in early March, search for message ID <20030307215517.GD41124@numachi.com>, if you care. I wanted to learn about maintaining a private repository, and the above URL was the sole concrete pointer. (Well, not true: someone else in that thread responded about a makefile patch, but no one else had any good ideas.) So, can the 'certain circumstances' be described, so that I might avoid them? Or is that just due to inherent wierdness in the whole CVSup process? Thanks for the feedback, in any case... > > John > -- > John Polstra > John D. Polstra & Co., Inc. Seattle, Washington USA > "Two buttocks cannot avoid friction." -- Malawi saying -- Brian 'you Bastard' Reichert 37 Crystal Ave. #303 Daytime number: (603) 434-6842 Derry NH 03038-1713 USA BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 00:57:33 2003 Return-Path: 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 273EB37B401 for ; Sun, 3 Aug 2003 00:57:33 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8046B43F93 for ; Sun, 3 Aug 2003 00:57:32 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.9/8.12.6) with ESMTP id h737vWVI017124; Sun, 3 Aug 2003 00:57:32 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9/8.12.6/Submit) id h737vVV4017123; Sun, 3 Aug 2003 00:57:31 -0700 (PDT) Date: Sun, 3 Aug 2003 00:57:31 -0700 (PDT) From: Matthew Dillon Message-Id: <200308030757.h737vVV4017123@apollo.backplane.com> To: Terry Lambert References: <20030731201227.28952.qmail@neuroflux.com> <200308022214.h72MEgrE015449@apollo.backplane.com> <3F2C59D3.43BBFE7C@mindspring.com> cc: freebsd-hackers@freebsd.org cc: Shawn Subject: Re: Assembly Syscall Question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 07:57:33 -0000 :You need 8K for this, minimally: 4K that's RO user/RW kernel and :4K that's RW user/RW kernel. You can use it for things like zero :system call getpid/getuid/etc.. : :It's also worth a page doubly mapped, with the second mapping with :the PG_G bit set on it (to make it RO visible to user space at the :sampe place in all programs) to hold the timecounter information; :the current timecounter implementation, with a scad of structures, :is both wasteful and unnecessary, given that pointer assigns are :atomic, so you can implement with only two, which only take a small :part of the page. Doing this, you can use a pointer reference and :a structure assign, and a compare-pointer-afterwards to make a zero :system call gettimeofday() and other calls (consider the benefits :to Apache, SQID, and other programs that have hard "logging with :timestamp" requirements). : :I've also been toying with the idea of putting environp ** in a COW :page, and dealing with changes as a "fixup" operation in the fault :handler (really, environp needs to die, to make way for logical name :tables; it persists because POSIX and SuS demand that it persist). : :So, Matt... how does the modified message based system call :interface fare in a before-and-after with "lmbench"? 8-) 8-). : :-- Terry In regards to using shared memory to optimize certain things, like the time functions... I believe it will be possible to do this in a portable fashion by going through the emulation layer (which is really misnamed... basically the syscall interface layer which will run in userspace but whos code will be managed by the kernel). We don't want the user program having direct knowledge of memory mapped gizmos, but it's perfectly acceptable for the emulation layer to have this knowledge, because the emulation layer will know how to fall back if the gizmo isn't where it's supposed to be (i.e. you boot an older kernel with a newer userland). The messaging code works fairly well so far performance-wise. My original getuid() vs messaging getuid() test on a DELL 2550 (SMP build) comes out: getuid() 0.974s 1088300 loops = 0.895uS/loop getuid() 0.937s 1047500 loops = 0.894uS/loop getuid() 0.971s 1084700 loops = 0.895uS/loop getuid_msg() 1.029s 935400 loops = 1.100uS/loop getuid_msg() 0.970s 881600 loops = 1.100uS/loop getuid_msg() 0.963s 876600 loops = 1.099uS/loop About 200ns slower, and I haven't really tried to optimize any of it yet (and I'm not going to worry about it until a lot more work has been accomplished anyway). -Matt Matthew Dillon From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 05:04:23 2003 Return-Path: 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 C0B9E37B404 for ; Sun, 3 Aug 2003 05:04:23 -0700 (PDT) Received: from polbsd.com (poluc.net1.nerim.net [62.212.101.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id A502A43F85 for ; Sun, 3 Aug 2003 05:04:21 -0700 (PDT) (envelope-from poluc@nerim.fr) Received: from webmail.polbsd.com (localhost [127.0.0.1]) by polbsd.com (8.12.9/8.12.6/1.0) with ESMTP id h73E5iKl019173 for ; Sun, 3 Aug 2003 14:05:45 GMT (envelope-from poluc@nerim.fr) From: "david ramblewski" To: "freebsd hackers" Date: Sun, 3 Aug 2003 15:05:39 +0100 Message-Id: <20030803140545.M99345@nerim.fr> X-Mailer: Open WebMail 2.01 20030425 X-OriginatingIP: 192.168.4.17 (poluc) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) Subject: FFS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 12:04:24 -0000 Hello, 1) I am modifying the mount code and i find this: malloc(...,M_UFSMNT,...) In malloc.h: #define M_UFSMNT 28 There is a lot of "define" about filesystems in malloc.h and it seems to represent every types of memories which can be allocated. I'm searching in the source but i don't know how and why they use it. Someone knows the solution? 2) Does someone knows where i can find documentations about filesystems under BSD (FFS). thanks. From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 09:16:12 2003 Return-Path: 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 4DC3437B401 for ; Sun, 3 Aug 2003 09:16:12 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8028143F75 for ; Sun, 3 Aug 2003 09:16:11 -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 h73GF3ai000251; Sun, 3 Aug 2003 12:15:03 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h73GF3a6000248; Sun, 3 Aug 2003 12:15:03 -0400 (EDT) Date: Sun, 3 Aug 2003 12:15:03 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: david ramblewski In-Reply-To: <20030803140545.M99345@nerim.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd hackers Subject: Re: FFS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 16:16:12 -0000 On Sun, 3 Aug 2003, david ramblewski wrote: > I am modifying the mount code and i find this: > malloc(...,M_UFSMNT,...) > > In malloc.h: > #define M_UFSMNT 28 > > There is a lot of "define" about filesystems in malloc.h and it seems to > represent every types of memories which can be allocated. I'm searching > in the source but i don't know how and why they use it. Someone knows > the solution? I don't believe code looking like this has existed in FreeBSD since 2.x, or maybe early 3.x; what version of the source code are you using? I noticed recently that Darwin uses this approach still, however. In FreeBSD 4.x and 5.x (and I believe 3.x), malloc types are defined using the MALLOC_DEFINE() macro, and declared using MALLOC_DECL(). You can read the malloc(9) man page for some details on how to use the buckets. If you use vmstat -m, you can see reports on the bucket sizes and allocation on a running kernel. > Does someone knows where i can find documentations about filesystems > under BSD (FFS). I'd suggest starting with the "BSD Book" -- Design and Implementation of 4.4BSD by McKusick, et al. That should include some basic background on the fast file system. More recently, you'll want to read the USENIX/FREENIX/BSDCON papers on Soft Updates, background file system checking, snapshotting, et al. Take a look at the USENIX web site for these papers. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 09:52:49 2003 Return-Path: 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 6476737B401 for ; Sun, 3 Aug 2003 09:52:49 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 433A743F75 for ; Sun, 3 Aug 2003 09:52:48 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (strings.polstra.com [206.213.73.20]) by wall.polstra.com (8.12.3p2/8.12.3) with ESMTP id h73GqlY3004026 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 3 Aug 2003 09:52:47 -0700 (PDT) (envelope-from jdp@strings.polstra.com) Received: (from jdp@localhost) by strings.polstra.com (8.12.6/8.12.6/Submit) id h73Gqko0001449; Sun, 3 Aug 2003 09:52:46 -0700 (PDT) (envelope-from jdp) Date: Sun, 3 Aug 2003 09:52:46 -0700 (PDT) Message-Id: <200308031652.h73Gqko0001449@strings.polstra.com> To: hackers@freebsd.org From: John Polstra In-Reply-To: <20030803072341.GC298@numachi.com> References: <20030802193548.GH969@numachi.com> <200308022222.h72MM6Jl077237@strings.polstra.com> <20030803072341.GC298@numachi.com> Organization: Polstra & Co., Seattle, WA X-Bogosity: No, tests=bogofilter, spamicity=0.499924, version=0.11.2 Subject: Re: messing with CVS_LOCAL_BRANCH_NUM X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 16:52:49 -0000 In article <20030803072341.GC298@numachi.com>, Brian Reichert wrote: > On Sat, Aug 02, 2003 at 03:22:06PM -0700, John Polstra wrote: > > Yes: look for a different approach, or at least backup your local > > repository frequently. There are known bugs in CVSup which can cause > > it to throw away your local branch under certain circumstances. I > > won't have time to fix those issues any time soon. So my advice is, > > don't use the CVS_LOCAL_BRANCH_NUM feature. > > Darn. :/ [...] > So, can the 'certain circumstances' be described, so that I might > avoid them? Or is that just due to inherent wierdness in the whole > CVSup process? The main situation in which it will occur is when somebody has directly manipulated or replaced an RCS file in the master CVS repository. CVSup notices that the client and server have entirely different RCS files, so it does a full replace instead of trying to send just deltas. Ideally this situation should never arise, but in the real world it happens all the time. That's actually the only scenario I know of where the problem should crop up. But on the other hand, I've had some suspicious-sounding reports of CVS_LOCAL_BRANCH_NUM lossage that can't be explained by this alone. Bottom line is, if you value your local branch then you should back it up before every update. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Two buttocks cannot avoid friction." -- Malawi saying From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 10:14:52 2003 Return-Path: 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 04E4E37B404 for ; Sun, 3 Aug 2003 10:14:52 -0700 (PDT) Received: from mail.numachi.com (meisai.numachi.com [198.175.254.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 257ED43FB1 for ; Sun, 3 Aug 2003 10:14:50 -0700 (PDT) (envelope-from reichert@numachi.com) Received: (qmail 61667 invoked from network); 3 Aug 2003 17:14:48 -0000 Received: from natto.numachi.com (198.175.254.216) by meisai.numachi.com with SMTP; 3 Aug 2003 17:14:48 -0000 Received: (qmail 462 invoked by uid 1001); 3 Aug 2003 17:14:47 -0000 Date: Sun, 3 Aug 2003 13:14:47 -0400 From: Brian Reichert To: freebsd-hackers@freebsd.org Message-ID: <20030803171447.GA407@numachi.com> References: <20030802155645.GE969@numachi.com> <20030802201132.GA53435@pc5.i.0x5.de> <20030802213455.GA298@numachi.com> <20030802214656.GA61028@pc5.i.0x5.de> <20030803071742.GB298@numachi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030803071742.GB298@numachi.com> User-Agent: Mutt/1.4i Subject: Re: network crash dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 17:14:52 -0000 On Sun, Aug 03, 2003 at 03:17:42AM -0400, Brian Reichert wrote: > On Sat, Aug 02, 2003 at 11:46:56PM +0200, Nicolas Rachinsky wrote: > > Did you really send a SIGABRT to init? This should cause init to exit > > after a while (IIRC 30sec), which should cause a "Going nowhere > > without my init" panic. > > I really did send a SIGABRT to init. Earlier, I explored a SIGSEGV > with hte same symptoms. > > I did this while X was running, and was not at a text console. > Maybe the panic message was hidden from me; I'll re-try to make > sure. OK, for the record: Sending a SIGABRT to init _does_ induce a panic, but the panic message only appears on the console. If X is running, video modes don't change. I don't know if that's desirable, but that's not important right now. And, also for the record, the netdump utility: Does _not_ work out-of-the box for FreeBSD 4.7-RELEASE. The kernel module, though loaded, does not seem to get invoked during a panic. If I can coax that into working, I'll let people know, but I wanted to get the current status of my efforts into the archives. Thanks for your time... -- Brian 'you Bastard' Reichert 37 Crystal Ave. #303 Daytime number: (603) 434-6842 Derry NH 03038-1713 USA BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 12:14:46 2003 Return-Path: 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 0281037B401 for ; Sun, 3 Aug 2003 12:14:46 -0700 (PDT) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66F7443F3F for ; Sun, 3 Aug 2003 12:14:45 -0700 (PDT) (envelope-from andrei@andruxa.sytes.net) Received: from h-68-164-154-78.snvacaid.covad.net ([68.164.154.78] helo=andruxa.sytes.net) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 19jOJY-00046g-00 for freebsd-hackers@freebsd.org; Sun, 03 Aug 2003 12:14:44 -0700 Received: from andruxa.sytes.net (localhost [127.0.0.1]) by andruxa.sytes.net (8.12.9/8.12.9) with ESMTP id h73JDncP001365 for ; Sun, 3 Aug 2003 12:13:49 -0700 (PDT) (envelope-from andrei@andruxa.sytes.net) Received: (from andrei@localhost) by andruxa.sytes.net (8.12.9/8.12.9/Submit) id h73JDhZ9001364 for freebsd-hackers@freebsd.org; Sun, 3 Aug 2003 12:13:43 -0700 (PDT) Date: Sun, 3 Aug 2003 12:13:43 -0700 From: Andrew Konstantinov To: freebsd-hackers@freebsd.org Message-ID: <20030803191343.GA1224@andruxa.sytes.net> Mail-Followup-To: Andrew Konstantinov , freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: libpcap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 19:14:46 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I am writing a program which takes advantage of libpcap but I've run into several problems with it: 1) Is there any way how I can specify in the filter description that it should match only incoming packets on some interface? inbound/outbound keywords work only for 'slip' (according to tcpdump man page). I could do that with 'not src host' and then put the local hostname after that, but is there a more general solution, without the need for local hostname or ip address? 2) I can't figure out how to setup a filter so it could match several ports at once. For example, I want the filter to only match 21-25 and 113 ports for incoming traffic. How do I do that? Right know I can see only two solutions. I could simply sniff all the traffic, and then filter out the interesting ports by myself, or I could setup several filters each of which would be responsible for a specific port. But both solutions seem to be inefficient. Is there a better way to accomplish this? Any help will be greatly appriciated. Thanks in advance. Andrew --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/LV7nttaE8kbpwrARAkcBAJ4l8ySo2vRGrjCA51uktzon3owQYwCcCkcL LrxIUZOPTJfsZ3wSD9vmrz4= =Z5DW -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 13:54:11 2003 Return-Path: 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 1D29737B401 for ; Sun, 3 Aug 2003 13:54:11 -0700 (PDT) Received: from priv-edtnes09-hme0.telusplanet.net (outbound02.telus.net [199.185.220.221]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43BD043F93 for ; Sun, 3 Aug 2003 13:54:10 -0700 (PDT) (envelope-from sh@bel.bc.ca) Received: from antalus ([154.5.106.237]) by priv-edtnes09-hme0.telusplanet.netSMTP <20030803205409.HKZJ1600.priv-edtnes09-hme0.telusplanet.net@antalus> for ; Sun, 3 Aug 2003 14:54:09 -0600 Message-ID: <000501c35a01$6383e040$0300000a@antalus> From: "Sean Hamilton" To: Date: Sun, 3 Aug 2003 13:54:10 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 20:54:11 -0000 Greetings, I have an application which has some task it must execute at some interval (approximately 1000 times per second.) This application calls select(2) in a loop, and uses its timeout parameter to try to keep the timing consistent. At the end of a cycle, it sends out a large amount of network traffic. During the select loop, it expects to receive replies to all this traffic. Should I set HZ to 1000 (the frequency of my application) or should I set it to a much higher value? The CPU is running at around 2 GHz, and I set it as high as 50,000 with no problems. However, the granularity of my timeout appears to be restricted to 1/1000th of a second. I would like to use poll(2) instead of select, but it appears to take its timeout parameter in milliseconds, which aren't precise enough to keep my timing reasonable, especially if I ever need to increase my frequency. Another option would be calling poll/select with no timeout, in a loop. However, this seems like a waste of CPU time. Also, as I am doing large amounts of network traffic, which NIC (preferably gigabit) should I be using, to cause the least interference with my timing? I do not require realtime performance. I am just looking to have this run as smoothly as possible. sh From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 16:11:41 2003 Return-Path: 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 B5E0A37B401 for ; Sun, 3 Aug 2003 16:11:41 -0700 (PDT) Received: from smtp7.andrew.cmu.edu (SMTP7.andrew.cmu.edu [128.2.10.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id F009243F93 for ; Sun, 3 Aug 2003 16:11:40 -0700 (PDT) (envelope-from eno@andrew.cmu.edu) Received: from andrew.cmu.edu (BLISS.PDL.CMU.EDU [128.2.134.47]) (user=eno mech=PLAIN (0 bits))h73NBcDf020890 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Sun, 3 Aug 2003 19:11:39 -0400 Message-ID: <3F2D96AB.9000607@andrew.cmu.edu> Date: Sun, 03 Aug 2003 19:11:39 -0400 From: Eno Thereska User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd hackers References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: getting from bio to buf in dastrategy() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2003 23:11:42 -0000 Hi all, I am hacking into the FreeBSD 5.0 code. I jumped from using 4.4 to 5.0 and a couple of things have changed. Here is my question: in /sys/cam/scsi/scsi_da.c the dastrategy() function takes as an argument "struct bio* bp" Now I need to get to the "struct *buf" that bp belongs to. In /sys/sys/buf.h I see that struct buf has as the first member "b_io" which is of type struct bio. I also see the BIOTOBUF #define which is supposed to take a bio and return the buf it belongs to. Now in dastrategy() if I use the BIOTOBUF function and try to access members of the struct buf I get junk, which means that the bio passed to the is not directly related to a buf. Am I missing something here? How do I know to which buf (if any) the bio belongs to? Also it seems to me that the new way of splitting the old struct buf into a struct bio and having a bunch of #defines inside the struct buf is kind of hacky. What was the rationale behind doing that (rather than just leaving it the way it was in 4.4)? Thanks Eno From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 17:33:39 2003 Return-Path: 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 CE12837B401 for ; Sun, 3 Aug 2003 17:33:39 -0700 (PDT) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68BE643F75 for ; Sun, 3 Aug 2003 17:33:38 -0700 (PDT) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id 1628F38B2A; Mon, 4 Aug 2003 02:33:31 +0200 (CEST) Date: Mon, 4 Aug 2003 02:33:31 +0200 From: Simon Barner To: Terry Lambert Message-ID: <20030804003331.GA408@zi025.glhnet.mhn.de> References: <20030730224505.GD531@zi025.glhnet.mhn.de> <1059607242.64020.5.camel@mjtdev1.dand06.au.bytecraft.au.com> <3F285560.2090607@acm.org> <1059608748.64020.10.camel@mjtdev1.dand06.au.bytecraft.au.com> <002201c356fa$4a66a700$1200a8c0@gsicomp.on.ca> <20030731134343.GB1323@zi025.glhnet.mhn.de> <1059693358.64020.31.camel@mjtdev1.dand06.au.bytecraft.au.com> <20030801153142.GA487@zi025.glhnet.mhn.de> <3F2B75E2.FBC18052@mindspring.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cmJC7u66zC7hs+87" Content-Disposition: inline In-Reply-To: <3F2B75E2.FBC18052@mindspring.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de cc: freebsd-hackers@freebsd.org cc: Heiner cc: Matthew Emmerton cc: Murray Taylor cc: kientzle@acm.org Subject: Re: [patch] Re: getfsent(3) and spaces in fstab X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 00:33:40 -0000 --cmJC7u66zC7hs+87 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Terry, > You need to add '\\' to the list of characters that can be escaped, > or you've just traded the inability to specify '\t' or ' ' for an > inability to speciy '\\'. Oh yes, I have overlook this special case. I revised my patch in order to get this right. Simon --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-fstab.c" Content-Transfer-Encoding: quoted-printable --- fstab.c.orig Fri Aug 1 17:18:00 2003 +++ fstab.c Mon Aug 4 01:46:55 2003 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -84,6 +85,140 @@ _fs_fstab.fs_spec =3D buf; } =20 +/* + * Get next token from string *stringp, where tokens are possibly-empty + * strings separated by characters from delim. + * + * Writes NULs into the string at *stringp to end tokens. + * delim need not remain constant from call to call. + * On return, *stringp points past the last NUL written (if there might + * be further tokens), or is NULL (if there are definitely no more tokens). + * + * If *stringp is NULL, es_strsep returns NULL. + * + * In contrast to strsep(3), es_strsep will allow escaped delimiters + * within a token. These escaped characters as well as the special case + * '\\' will be converted appropriately ('\' -> ', '\\' -> '= \' + * + */ +char * +es_strsep(char **stringp, const char *delim) +{ + bool escaped=3Dfalse; + char *s, *t, *u; + int i; + + + if (*stringp =3D=3D '\0') /* empty string */ + return NULL; + s =3D *stringp; + s +=3D strspn (s, delim); /* skip delimiters */ + + if (*s =3D=3D '\0') /* string consists only of delimiters */ + return NULL; +=09 + /* + * skip a string consisting of non-delimiters, + * escapted delimiters or '\\' + */ + for (t =3D s; *t !=3D '\0'; ++t) { + if (*t =3D=3D '\\') { + if (escaped) { /* convert \\ to \ */ + --t; + u =3D t; + escaped =3D false; + while (u[0] !=3D '\0') { + u[0] =3D u[1]; + ++u; + } + } else /* start \-Sequence */ + escaped =3D true; + continue; + } + =09 + /* search for delimiter */ + for (i=3D0; delim[i] !=3D '\0'; ++i) { + if (*t =3D=3D delim[i]) + break; + } + =09 + /* un-escaped delimiter found =3D> end of token */ + if (!escaped && delim[i] !=3D '\0') + break; + =20 + /* escaped delimiter found =3D> remove / */ + if (escaped) { + --t; + u =3D t; + escaped =3D false; + while (u[0] !=3D '\0') { + u[0] =3D u[1]; + ++u; + } + } + } + + if (*t !=3D '\0') { + *t =3D '\0'; /* end current token */ + *stringp =3D t+1; /* *t !=3D '\0' =3D> *(t+1) is valid */ + } else + *stringp =3D 0; /* end of string reached */=09 +=09 + return s; /* return current token */ +} + +/* + * This function converts escaped characters: + * '\' -> '', '\\' -> '\' + *=20 + * If there are unescaped delimiters, 'false' will be return to indicate + * an error, otherwise remove_escape returns 'true'. + */ +bool remove_escapes (char **s, const char* delim) { + bool escaped=3Dfalse; + char *t, *u; + int i; +=09 + for (t =3D *s; *t !=3D '\0'; ++t) { + if (*t =3D=3D '\\') { + if (escaped) { /* convert \\ to \ */ + --t; + u =3D t; + escaped =3D false; + while (u[0] !=3D '\0') { + u[0] =3D u[1]; + ++u; + } + } else /* start \-Sequence */ + escaped =3D true; + continue; + } + =09 + /* search for delimiter */ + for (i=3D0; delim[i] !=3D '\0'; ++i) { + if (*t =3D=3D delim[i]) + break; + } + =09 + /* un-escaped delimiter found =3D> error */ + if (!escaped && delim[i] !=3D '\0') + return false; + + /* escaped delimiter found =3D> remove / */ + if (escaped) { + --t; + u =3D t; + escaped =3D false; + while (u[0] !=3D '\0') { + u[0] =3D u[1]; + ++u; + } + } + } +=09 + return true; +} + static int fstabscan() { @@ -101,9 +236,19 @@ ++LineNo; if (*line =3D=3D '#' || *line =3D=3D '\n') continue; - if (!strpbrk(p, " \t")) { + + /* escapted white-spaces only are allowed in old-style format */ + cp =3D p; + while ((cp =3D strpbrk(cp, " \t")) !=3D 0 && + cp !=3D p && cp[-1] =3D=3D '\\') + ++cp; + if (cp =3D=3D 0) { _fs_fstab.fs_spec =3D strsep(&p, ":\n"); + if (!remove_escapes (&_fs_fstab.fs_spec, " \t")) + goto bad; _fs_fstab.fs_file =3D strsep(&p, ":\n"); + if (!remove_escapes (&_fs_fstab.fs_file, " \t")) + goto bad; fixfsfile(); _fs_fstab.fs_type =3D strsep(&p, ":\n"); if (_fs_fstab.fs_type) { @@ -124,13 +269,15 @@ goto bad; } /* OLD_STYLE_FSTAB */ - while ((cp =3D strsep(&p, " \t\n")) !=3D NULL && *cp =3D=3D '\0') + while ((cp =3D es_strsep(&p, " \t\n")) !=3D NULL && *cp =3D=3D '\0') ; _fs_fstab.fs_spec =3D cp; if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec =3D=3D '#') continue; - while ((cp =3D strsep(&p, " \t\n")) !=3D NULL && *cp =3D=3D '\0') + while ((cp =3D es_strsep(&p, " \t\n")) !=3D NULL && *cp =3D=3D '\0') ; + if (cp =3D=3D 0) + goto bad; _fs_fstab.fs_file =3D cp; fixfsfile(); while ((cp =3D strsep(&p, " \t\n")) !=3D NULL && *cp =3D=3D '\0') --HlL+5n6rz5pIUxbD-- --cmJC7u66zC7hs+87 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/LanbCkn+/eutqCoRAs7XAKCpZ+27mnva6IneR3gtL1BpkjqV/ACg4oed jyXs4Off13grX1MU/tpNx7A= =/Mku -----END PGP SIGNATURE----- --cmJC7u66zC7hs+87-- From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 21:18:11 2003 Return-Path: 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 6D78037B401 for ; Sun, 3 Aug 2003 21:18:11 -0700 (PDT) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D45743FBF for ; Sun, 3 Aug 2003 21:18:10 -0700 (PDT) (envelope-from vlm@netli.com) Received: (qmail 18836 invoked by uid 84); 4 Aug 2003 04:18:10 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.141084 secs); 04 Aug 2003 04:18:10 -0000 Received: from unknown (HELO netli.com) (172.17.1.12) by mx01-pal-lan.netli.lan with SMTP; 4 Aug 2003 04:18:10 -0000 Message-ID: <3F2DDEF2.4070401@netli.com> Date: Sun, 03 Aug 2003 21:20:02 -0700 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030521 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Andrew Konstantinov References: <20030803191343.GA1224@andruxa.sytes.net> In-Reply-To: <20030803191343.GA1224@andruxa.sytes.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: libpcap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 04:18:11 -0000 Andrew Konstantinov wrote: > Hello, > > I am writing a program which takes advantage of libpcap but I've run into > several problems with it: 1) Is there any way how I can specify in the > filter description that it should match only incoming packets on some > interface? inbound/outbound keywords work only for 'slip' (according to > tcpdump man page). I could do that with 'not src host' and then put the > local hostname after that, but is there a more general solution, without > the need for local hostname or ip address? No, there isn't. Please study the bpf manual page to find out what capabilities libpcap could export to its user, because libpcap uses bpf device on FreeBSD. > 2) I can't figure out how to > setup a filter so it could match several ports at once. For example, I > want the filter to only match 21-25 and 113 ports for incoming traffic. > How do I do that? Right know I can see only two solutions. I could simply > sniff all the traffic, and then filter out the interesting ports by > myself, or I could setup several filters each of which would be > responsible for a specific port. But both solutions seem to be > inefficient. Is there a better way to accomplish this? Any help will be > greatly appriciated. "port 21 or ... or port 25 or port 113" -- Lev Walkin vlm@netli.com From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 22:13:32 2003 Return-Path: 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 3D7E937B4DD; Sun, 3 Aug 2003 22:13:32 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB3D543FA3; Sun, 3 Aug 2003 22:13:29 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 806B9526AA; Mon, 4 Aug 2003 14:43:26 +0930 (CST) Date: Mon, 4 Aug 2003 14:43:26 +0930 From: Greg 'groggy' Lehey To: Paolo Pisati Message-ID: <20030804051326.GY95375@wantadilla.lemis.com> References: <20030731211452.GA210@newluxor.skynet.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fn23agWlbbdZ3cy5" Content-Disposition: inline In-Reply-To: <20030731211452.GA210@newluxor.skynet.org> User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: FreeBSD_Hackers cc: FreeBSD_Net Subject: Re: Netgraph node, first steps in kernel land and a bloody crash dump X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 05:13:33 -0000 --Fn23agWlbbdZ3cy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thursday, 31 July 2003 at 23:14:52 +0200, Paolo Pisati wrote: > > Hi guys, > > still here with my netgraph node. > > Today, after a couple of nice days without a problem, > i spent the last 4 hours trying to understand why the hell, > my module crash my stable box. > ... > #0 dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487 > 487 if (dumping++) { > (kgdb) where > #5 0xc0204f63 in trap (frame=3D{tf_fs =3D 16, tf_es =3D 16, tf_ds =3D 16, > tf_edi =3D -856166976, tf_esi =3D 0, tf_ebp =3D -856167184, > tf_isp =3D -856167216, tf_ebx =3D 69, tf_edx =3D 0, tf_ecx =3D 0, > tf_eax =3D -6422529, tf_trapno =3D 12, tf_err =3D 0, tf_eip =3D 784= , tf_cs =3D 8, > tf_eflags =3D 66118, tf_esp =3D -1071208512, tf_ss =3D 1861}) > at /usr/src/sys/i386/i386/trap.c:466 > #6 0x310 in ?? () > #7 0xc0163e70 in putchar (c=3D69, arg=3D0xccf7edc0) > at /usr/src/sys/kern/subr_prf.c:355 > #8 0xc0164086 in kvprintf (fmt=3D0xc0e24baa "AF NODE\n", > func=3D0xc0163dd0 , arg=3D0xccf7edc0, radix=3D10, ap=3D0xccf= 7edd8 "") > at /usr/src/sys/kern/subr_prf.c:532 > #9 0xc0163d4c in printf (fmt=3D0xc0e24ba8 "LEAF NODE\n") > at /usr/src/sys/kern/subr_prf.c:305 > #10 0xc0e2348a in ?? () > #11 0xc0e23354 in ?? () > > Ok, i'm not a guru, but it looks like the culprit is printf in > kernel land, or at least, a bad use of it from myself... (see #9). Hmm. Is this a kld? > I would like to fill the missing ?? in this dump, but i couldn't > find how to load the symbols from my node (and yes, i've tried > what's written in the handbook about the modules and it didn't > work). OK, what we see here is that the printf call calls putchar() to print the individual characters. The one it's printing now is 0x69 (frame 7), lowercase 'i'. That's not in the (first) string passed to printf(), but it could be in another parameter, or in the format string. You can't get the address of frame 6 because it's not a valid address. Kernel code sits above 0xc0000000, and this address is 0x310, which suggests to me that you've smashed a stack or something. I'd guess that you've overflowed the buffer. > on a side note: > [flag@newluxor flag]$ man 9 printf > No entry for printf in section 9 of the manual > [flag@newluxor flag]$ > > what's happened to the man page? Hasn't been written. Do you feel like doing it? Greg --=20 See complete headers for address and phone numbers --Fn23agWlbbdZ3cy5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE/Let2IubykFB6QiMRAmjJAJ9XywQ11NJVrqWVHnwbTIzdHK6YhQCcC0R8 +GmdJHu3uZ6aH3Ps11gxOxs= =9YnD -----END PGP SIGNATURE----- --Fn23agWlbbdZ3cy5-- From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 22:43:50 2003 Return-Path: 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 7A62937B401 for ; Sun, 3 Aug 2003 22:43:50 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8617343F93 for ; Sun, 3 Aug 2003 22:43:49 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h745hjV3083320; Mon, 4 Aug 2003 05:43:45 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h745hiPI010995; Mon, 4 Aug 2003 07:43:45 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Eno Thereska From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 03 Aug 2003 19:11:39 EDT." <3F2D96AB.9000607@andrew.cmu.edu> Date: Mon, 04 Aug 2003 07:43:44 +0200 Message-ID: <10994.1059975824@critter.freebsd.dk> cc: freebsd hackers Subject: Re: getting from bio to buf in dastrategy() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 05:43:50 -0000 In message <3F2D96AB.9000607@andrew.cmu.edu>, Eno Thereska writes: >Hi all, > >I am hacking into the FreeBSD 5.0 code. >I jumped from using 4.4 to 5.0 and a couple of things >have changed. Here is my question: > >in /sys/cam/scsi/scsi_da.c the dastrategy() >function takes as an argument "struct bio* bp" >Now I need to get to the "struct *buf" that bp >belongs to. You can't do that, there may not be any struct buf. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 3 22:52:29 2003 Return-Path: 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 DD71137B401; Sun, 3 Aug 2003 22:52:29 -0700 (PDT) Received: from thought.holo.org (h-68-166-32-19.SNVACAID.covad.net [68.166.32.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id A766843F75; Sun, 3 Aug 2003 22:52:26 -0700 (PDT) (envelope-from bwb@holo.org) Received: from localhost (localhost [127.0.0.1]) by thought.holo.org (8.12.9/8.12.9) with ESMTP id h745pMQP079146; Sun, 3 Aug 2003 22:51:23 -0700 (PDT) (envelope-from bwb@holo.org) Date: Sun, 3 Aug 2003 22:51:22 -0700 (PDT) From: Brian Buchanan To: "Greg 'groggy' Lehey" In-Reply-To: <20030804051326.GY95375@wantadilla.lemis.com> Message-ID: <20030803224202.V63360-100000@thought.holo.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: Netgraph node, first steps in kernel land and a bloody crash dump X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 05:52:30 -0000 > OK, what we see here is that the printf call calls putchar() to print > the individual characters. The one it's printing now is 0x69 (frame > 7), lowercase 'i'. That's not in the (first) string passed to > printf(), but it could be in another parameter, or in the format > string. It's actually 69 decimal, or 'E', which would be consistent with the format string. Looking at line 355 of subr_prf.c, I'm going to hazard a guess that something smashed the value of v_putc, which should have been pointing to cnputc(). Could have been a stack smash inside cnputc, too, but I don't see any obvious way that could have happened. - Brian -- Brian Buchanan, CISSP bwb@holo.org -------------------------------------------------------------------------- FreeBSD - The Power to Serve! http://www.freebsd.org From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 02:15:02 2003 Return-Path: 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 788C237B401 for ; Mon, 4 Aug 2003 02:15:02 -0700 (PDT) Received: from cadillac.meteo.fr (cadillac.meteo.fr [137.129.1.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C34D43F85 for ; Mon, 4 Aug 2003 02:15:00 -0700 (PDT) (envelope-from igor.pokrovsky@cnrm.meteo.fr) Received: from cti825.cnrm.meteo.fr (localhost.meteo.fr [127.0.0.1]) JAA13312 for ; Mon, 4 Aug 2003 09:14:56 GMT Received: from xdata.cnrm.meteo.fr (xdata.cnrm.meteo.fr [137.129.150.2]) LAA12221; Mon, 4 Aug 2003 11:14:54 +0200 (METDST) Received: from exmatis1.cnrm.meteo.fr (exmatis1.cnrm.meteo.fr [137.129.157.46]) by xdata.cnrm.meteo.fr with ESMTP (8.9.3 (PHNE_24419)/8.7.1) id LAA13524; Mon, 4 Aug 2003 11:15:19 +0200 (METDST) Received: from exmatis1.cnrm.meteo.fr (localhost [127.0.0.1]) h749C3dV001104; Mon, 4 Aug 2003 11:12:03 +0200 (CEST) (envelope-from pokrovsi@exmatis1.cnrm.meteo.fr) Received: (from pokrovsi@localhost) by exmatis1.cnrm.meteo.fr (8.12.9/8.12.9/Submit) id h749C33L001103; Mon, 4 Aug 2003 11:12:03 +0200 (CEST) Date: Mon, 4 Aug 2003 11:12:02 +0200 From: Igor Pokrovsky To: pat bey Message-ID: <20030804091202.GA1026@exmatis1.cnrm.meteo.fr> Mail-Followup-To: Igor Pokrovsky , pat bey , freebsd-hackers@freebsd.org References: <20030802195041.36168.qmail@web41201.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030802195041.36168.qmail@web41201.mail.yahoo.com> User-Agent: Mutt/1.4.1i X-Accept-Language: ru X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (cti825/CNRM) Organization: METEO FRANCE(CNRM) cc: freebsd-hackers@freebsd.org Subject: Re: Assembly interrupts and Developers handbook X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Igor Pokrovsky List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 09:15:02 -0000 On Sat, Aug 02, 2003 at 12:50:41PM -0700, pat bey wrote: > First I would like to know where I can buy a copy of the FreeBSD Developer's Handbook. > Nice to have a handbook that I can hold in my hand. Have you tried http://www.bsdmall.org ? -- Igor From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 06:05:36 2003 Return-Path: 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 72C0237B401 for ; Mon, 4 Aug 2003 06:05:36 -0700 (PDT) Received: from webfw.progtech.net (webfw.progtech.net [195.226.167.252]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BEDC43FCB for ; Mon, 4 Aug 2003 06:05:35 -0700 (PDT) (envelope-from grossman@webfw.progtech.net) Received: from isis.muc.progtech.intern (isis.muc.progtech.intern [10.25.0.100]) by webfw.progtech.net (8.12.9/8.12.9) with ESMTP id h74D5JEK037404; Mon, 4 Aug 2003 15:05:20 +0200 (CEST) (envelope-from grossman) Received: (from grossman@localhost) by isis.muc.progtech.intern (8.11.6/8.9.3) id h74D4u000654; Mon, 4 Aug 2003 15:04:56 +0200 (CEST) Date: Mon, 4 Aug 2003 15:04:56 +0200 (CEST) Message-Id: <200308041304.h74D4u000654@isis.muc.progtech.intern> From: Rolf Grossmann MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: freebsd-hackers@freebsd.org X-Mailer: VM 7.04 under Emacs 21.2.1 X-Virus-Scanned: by amavisd-new Subject: Using CVS diff to find out what has changed, including new files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 13:05:36 -0000 Hi, first of all, I'd like to apologise. This may be a little off topic for this list, but as I figured here are probably the people who have the most experience with CVS and that may have the same problem, I thought you might be able to help me. I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository and I have a (slightly modified) version of -STABLE checked out from there. Now there are certain areas where I'd like to see what changed before doing a "cvs update". Currently I'm using "cvs diff -u -N -r BASE -r RELENG_4" to do that. However this has one drawback that I'm hoping you'll be able to help me with: If files have been removed from the distribution, these files continue to show up as getting readded (even though they won't when doing an update). To see the problem, you can go to /usr/src/sbin/md5 and run the above cvs diff command. Now one possible workaround is to leave out the -N, but then I won't get a diff for files that really will be added. Did anyone else run into that problem? Any solutions that I'm overlooking? All suggestions welcome. Rolf From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 06:50:45 2003 Return-Path: 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 91DA237B401 for ; Mon, 4 Aug 2003 06:50:45 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5835943F93 for ; Mon, 4 Aug 2003 06:50:44 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h74Dodv11105; Mon, 4 Aug 2003 15:50:39 +0200 (MEST) Date: Mon, 4 Aug 2003 15:50:39 +0200 (CEST) From: Harti Brandt To: Sean Hamilton In-Reply-To: <000501c35a01$6383e040$0300000a@antalus> Message-ID: <20030804153252.M54895@beagle.fokus.fraunhofer.de> References: <000501c35a01$6383e040$0300000a@antalus> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 13:50:45 -0000 On Sun, 3 Aug 2003, Sean Hamilton wrote: SH>Greetings, SH> SH>I have an application which has some task it must execute at some interval SH>(approximately 1000 times per second.) This application calls select(2) in a SH>loop, and uses its timeout parameter to try to keep the timing consistent. SH> SH>At the end of a cycle, it sends out a large amount of network traffic. SH>During the select loop, it expects to receive replies to all this traffic. SH> SH>Should I set HZ to 1000 (the frequency of my application) or should I set it SH>to a much higher value? The CPU is running at around 2 GHz, and I set it as SH>high as 50,000 with no problems. However, the granularity of my timeout SH>appears to be restricted to 1/1000th of a second. I run almost all of my systems at HZ=10000. 50000 will break TCP as soon as you try to connect to systems that are a moderate round trip time away. The problem seems to be that the round trip time calculation is done in ticks and that overflows the variables at larger hertzes. You must also keep in mind that even on an otherwise idle system some processes can take longer than the 100usec when HZ=10000. A typical problem are the MII status updates of several cards like the xl(4). The time they require has drastically been reduced but they still need around 900usec. harti SH> SH>I would like to use poll(2) instead of select, but it appears to take its SH>timeout parameter in milliseconds, which aren't precise enough to keep my SH>timing reasonable, especially if I ever need to increase my frequency. SH> SH>Another option would be calling poll/select with no timeout, in a loop. SH>However, this seems like a waste of CPU time. SH> SH>Also, as I am doing large amounts of network traffic, which NIC (preferably SH>gigabit) should I be using, to cause the least interference with my timing? SH> SH>I do not require realtime performance. I am just looking to have this run as SH>smoothly as possible. SH> SH>sh SH> SH>_______________________________________________ SH>freebsd-hackers@freebsd.org mailing list SH>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers SH>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" SH> -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 07:19:05 2003 Return-Path: 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 C186F37B401 for ; Mon, 4 Aug 2003 07:19:05 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 900C343FBD for ; Mon, 4 Aug 2003 07:19:02 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h74EIwv14351; Mon, 4 Aug 2003 16:18:58 +0200 (MEST) Date: Mon, 4 Aug 2003 16:18:58 +0200 (CEST) From: Harti Brandt To: Bosko Milekic In-Reply-To: <20030801134428.GA9192@technokratis.com> Message-ID: <20030804161836.G54895@beagle.fokus.fraunhofer.de> References: <20030801185611.E4685@beagle.fokus.fraunhofer.de> <20030801134428.GA9192@technokratis.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: panic in uma_zdestroy X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 14:19:06 -0000 Thanks for that light-speed fix. harti On Fri, 1 Aug 2003, Bosko Milekic wrote: BM> BM>On Fri, Aug 01, 2003 at 01:32:05PM +0000, Bosko Milekic wrote: BM>> BM>> I screwed up... fix coming shortly. Sorry! BM>> BM>> On Fri, Aug 01, 2003 at 07:00:19PM +0200, Harti Brandt wrote: BM>> > BM>> > Hi, BM>> > BM>> > with a kernel from yesterday I get a panic on an SMP system when I BM>> > destroy a zone immediately after creating it. It have a driver (with the BM>> > probe routine set to return ENXIO) and the following module event BM>> > function: BM>... BM> BM> Again, I appologize. I just committed something which should fix BM> this: BM> BM>bmilekic 2003/08/01 10:42:27 PDT BM> BM> FreeBSD src repository BM> BM> Modified files: BM> sys/vm uma_core.c BM> Log: BM> Only free the pcpu cache buckets if they are non-NULL. BM> BM> Crashed this person's machine: harti BM> Pointy-hat to: me BM> BM> Revision Changes Path BM> 1.70 +6 -4 src/sys/vm/uma_core.c BM> BM> Let me know if you're still having problems. BM> BM> -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 08:50:53 2003 Return-Path: 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 D0CBC37B401 for ; Mon, 4 Aug 2003 08:50:53 -0700 (PDT) Received: from hysteria.spc.org (hysteria.spc.org [195.206.69.234]) by mx1.FreeBSD.org (Postfix) with SMTP id 192F143F3F for ; Mon, 4 Aug 2003 08:50:52 -0700 (PDT) (envelope-from bms@hysteria.spc.org) Received: (qmail 28680 invoked by uid 5013); 4 Aug 2003 15:48:16 -0000 Date: Mon, 4 Aug 2003 16:48:16 +0100 From: Bruce M Simpson To: pat bey Message-ID: <20030804154816.GA27970@spc.org> Mail-Followup-To: Bruce M Simpson , pat bey , freebsd-hackers@freebsd.org References: <20030802195041.36168.qmail@web41201.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030802195041.36168.qmail@web41201.mail.yahoo.com> User-Agent: Mutt/1.4.1i Organization: SPC cc: freebsd-hackers@freebsd.org Subject: Re: Assembly interrupts and Developers handbook X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 15:50:54 -0000 On Sat, Aug 02, 2003 at 12:50:41PM -0700, pat bey wrote: > First I would like to know where I can buy a copy of the FreeBSD Developer's Handbook. > Nice to have a handbook that I can hold in my hand. > > Secondly, What can I find a list of other interrupts within FreeBSD like the int 80h. Or is this the only interrupt. Like example interrupt for video stuff, disk access ....etc. .etc FreeBSD doesn't use interrupt vectors for that sort of thing; it's not DOS. You should always use the system calls for manipulating shared resources. It is possible to call the video BIOS under certain circumstances from a user process, but this is done through a v86 monitor, whilst in v86 mode; but generally, you should use the syscons(4) driver or Xlib if you wish to use graphics. The Developer's Handbook covers most of these topics. BMS From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 09:03:58 2003 Return-Path: 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 8637F37B405 for ; Mon, 4 Aug 2003 09:03:58 -0700 (PDT) Received: from hysteria.spc.org (hysteria.spc.org [195.206.69.234]) by mx1.FreeBSD.org (Postfix) with SMTP id 4A9CD43F75 for ; Mon, 4 Aug 2003 09:03:57 -0700 (PDT) (envelope-from bms@hysteria.spc.org) Received: (qmail 28979 invoked by uid 5013); 4 Aug 2003 16:01:21 -0000 Date: Mon, 4 Aug 2003 17:01:21 +0100 From: Bruce M Simpson To: Andrew Konstantinov , freebsd-hackers@freebsd.org Message-ID: <20030804160121.GB27970@spc.org> Mail-Followup-To: Bruce M Simpson , Andrew Konstantinov , freebsd-hackers@freebsd.org References: <20030803191343.GA1224@andruxa.sytes.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030803191343.GA1224@andruxa.sytes.net> User-Agent: Mutt/1.4.1i Organization: SPC Subject: Re: libpcap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 16:03:58 -0000 On Sun, Aug 03, 2003 at 12:13:43PM -0700, Andrew Konstantinov wrote: > 1) Is there any way how I can specify in the filter description that it should match only incoming packets on some interface? inbound/outbound keywords work only for 'slip' (according to tcpdump man page). I could do that with 'not src host' and then put the local hostname after that, but is there a more general solution, without the need for local hostname or ip address? You need to call pcap_open_live() with the appropriate device argument, if you wish to monitor individual interfaces. Unfortunately the pcap interface doesn't support a means of passing the interface name to a callback handler function. So you'd have to rewrite pcap_loop() to call pcap_dispatch() for individual pcap_t's for each interface you pay specific attention to. Most pcap apps I've written that do anything elaborate require me to override pcap_loop() anyway. Perhaps there's a good candidate for extending the interface so that this sort of thing can be more easily done. > 2) I can't figure out how to setup a filter so it could match several ports at once. For example, I want the filter to only match 21-25 and 113 ports for incoming traffic. How do I do that? Right know I can see only two solutions. I could simply sniff all the traffic, and then filter out the interesting ports by myself, or I could setup several filters each of which would be responsible for a specific port. But both solutions seem to be inefficient. Is there a better way to accomplish this? This is on PHK's kernel hacker TODO list! Patches gratefully accepted... http://people.freebsd.org/~phk/TODO/ BMS From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 09:05:12 2003 Return-Path: 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 D37D537B421 for ; Mon, 4 Aug 2003 09:05:12 -0700 (PDT) Received: from eugate02.e-mail.com (eugate02.e-mail.com [194.196.143.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6D5E43FBD for ; Mon, 4 Aug 2003 09:05:09 -0700 (PDT) (envelope-from Dimitar.Peikov@borg.de) Received: from borg.borg.de (unknown[194.120.172.57]) by eugate.e-mail.com (smtpgw2) with ESMTP id <20030804160508231027mea4e>; Mon, 4 Aug 2003 16:05:08 +0000 To: FreeBSD-hackers@freebsd.org MIME-Version: 1.0 X-Mailer: Lotus Notes Release 5.0.9 November 16, 2001 From: Dimitar.Peikov@borg.de Message-ID: Date: Mon, 4 Aug 2003 19:04:12 +0300 X-MIMETrack: MIME-CD by tm_grab on BORG/BORG(Release 5.0.10 |March 22, 2002) at 04.08.2003 18:04:14, MIME-CD complete at 04.08.2003 18:04:14, 04.08.2003 18:04:16 Content-type: text/plain; charset=us-ascii Subject: Installation and the 1024 cylinder boot problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 16:05:13 -0000 Recently I had to install 5.1-RELEASE at 60GB, and had a lot of troubles to start booting correctly. I hope that /stand/sysinstall have to handle >1024 cylinder booting. Otherwise I have to run 'boot0cfg' manually to fix this issue. MuTk0 From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 10:33:23 2003 Return-Path: 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 3176937B401 for ; Mon, 4 Aug 2003 10:33:23 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24B8E43FA3 for ; Mon, 4 Aug 2003 10:33:20 -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.9) with ESMTP id h74HXImQ004199; Mon, 4 Aug 2003 10:33:18 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h74HXIWA004198; Mon, 4 Aug 2003 10:33:18 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 4 Aug 2003 10:33:18 -0700 From: David Schultz To: pat bey Message-ID: <20030804173318.GA3935@HAL9000.homeunix.com> Mail-Followup-To: pat bey , freebsd-hackers@freebsd.org References: <20030802195041.36168.qmail@web41201.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030802195041.36168.qmail@web41201.mail.yahoo.com> cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Assembly interrupts and Developers handbook X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 17:33:23 -0000 On Sat, Aug 02, 2003, pat bey wrote: > Secondly, What can I find a list of other interrupts within > FreeBSD like the int 80h. Or is this the only interrupt. Like > example interrupt for video stuff, disk access ....etc. .etc On x86, all system calls are made through int 80h with %eax set to the syscall number. See src/sys/kern/syscalls.master. In general, you don't access the hardware directly unless you're writing a device driver. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 12:01:43 2003 Return-Path: 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 C767B37B409 for ; Mon, 4 Aug 2003 12:01:43 -0700 (PDT) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 210C243FBF for ; Mon, 4 Aug 2003 12:01:40 -0700 (PDT) (envelope-from des@des.no) Received: from smtp.des.no (37.80-203-228.nextgentel.com [80.203.228.37]) by mail.broadpark.no (Postfix) with ESMTP id 93FBE78D89; Mon, 4 Aug 2003 21:01:38 +0200 (MEST) Received: by smtp.des.no (Pony Express, from userid 666) id 60C6C9649F; Mon, 4 Aug 2003 21:01:38 +0200 (CEST) Received: from dwp.des.no (dwp.des.no [10.0.0.4]) by smtp.des.no (Pony Express) with ESMTP id B2E5396482; Mon, 4 Aug 2003 21:01:34 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 8F45FB824; Mon, 4 Aug 2003 21:01:34 +0200 (CEST) To: Rolf Grossmann References: <200308041304.h74D4u000654@isis.muc.progtech.intern> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Mon, 04 Aug 2003 21:01:34 +0200 In-Reply-To: <200308041304.h74D4u000654@isis.muc.progtech.intern> (Rolf Grossmann's message of "Mon, 4 Aug 2003 15:04:56 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-3.0 required=8.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_GNUS_UA version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-hackers@freebsd.org Subject: Re: Using CVS diff to find out what has changed, including new files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 19:01:44 -0000 Rolf Grossmann writes: > I'm using cvsup for a while now to get a copy of the FreeBSD CVS reposito= ry > and I have a (slightly modified) version of -STABLE checked out from ther= e. > Now there are certain areas where I'd like to see what changed before > doing a "cvs update". Currently I'm using "cvs diff -u -N -r BASE -r RELE= NG_4" > to do that. However this has one drawback that I'm hoping you'll be > able to help me with: If files have been removed from the distribution, > these files continue to show up as getting readded (even though they > won't when doing an update). To see the problem, you can go to > /usr/src/sbin/md5 and run the above cvs diff command. That's normal behaviour with CVS when using branches. The only workaround I know of is to specify the files explicitly. With zsh, you can do 'cvs diff -Nu -rBASE -rRELENG_4 **/*~*CVS*(.)' DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 12:14:47 2003 Return-Path: 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 F1F1437B404 for ; Mon, 4 Aug 2003 12:14:46 -0700 (PDT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FE7843FA3 for ; Mon, 4 Aug 2003 12:14:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7943 invoked from network); 4 Aug 2003 19:14:45 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 4 Aug 2003 19:14:45 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h74JEh9s018156; Mon, 4 Aug 2003 15:14:44 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030731201227.28952.qmail@neuroflux.com> Date: Mon, 04 Aug 2003 15:15:04 -0400 (EDT) From: John Baldwin To: Ryan Sommers cc: freebsd-hackers@freebsd.org Subject: RE: Assembly Syscall Question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 19:14:47 -0000 On 31-Jul-2003 Ryan Sommers wrote: > When making a system call to the kernel why is it necessary to push the > syscall value onto the stack when you don't call another function? > > Example: > > access.the.bsd.kernel: > int 80h > ret > > func: > mov eax, 4 ; Write > call access.the.bsd.kernel > ; End > > Works. However: > func: > mov eax, 4 ; Write > int 80h > ; End > > Doesn't. > > Now, if you change it to: > > func: > mov eax, 4 ; Write > push eax > int 80h > ; End > > It does work. I was able to find, "By default, the FreeBSD kernel uses the C > calling convention. Further, although the kernel is accessed using int 80h, > it is assumed the program will call a function that issues int 80h, rather > than issuing int 80h directly," in the developer's handbook. But I can't > figure out why the second example doesn't work. Is the call instruction > pushing the value onto the stack in addition to pushing the instruction > pointer on? > > Thank you in advance. > PS I'm not on the list. First off, why are you using asm for userland stuff? Secondly, the kernel assumes that all the other arguments besides the syscall to execute (i.e. %eax) are passed on the user stack. Thus, it has to have a set location relative to the user stack pointer to find the arguments. It allows for a return IP from a call instruction to be at the top of the stack. You can tell this by looking at syscall() in sys/i386/i386/trap.c: params = (caddr_t)frame.tf_esp + sizeof(int); code = frame.tf_eax; orig_tf_eflags = frame.tf_eflags; params is a userland pointer to the function arguments. Adding the sizeof(int) skips over the saved return address, or in your 3rd case, the dummy %eax value. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 12:41:32 2003 Return-Path: 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 5634E37B401 for ; Mon, 4 Aug 2003 12:41:32 -0700 (PDT) Received: from ptserver.progtech.net (pD9E8B912.dip.t-dialin.net [217.232.185.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C2B743F3F for ; Mon, 4 Aug 2003 12:41:30 -0700 (PDT) (envelope-from rg@progtech.net) Received: from PROGTECH.net (isis.muc.progtech.intern [10.25.0.100]) by ptserver.progtech.net (8.12.9/8.12.3) with ESMTP id h74JfNXo026494; Mon, 4 Aug 2003 21:41:28 +0200 (CEST) (envelope-from rg@PROGTECH.net) Message-ID: <3F2EB6CA.5000102@PROGTECH.net> Date: Mon, 04 Aug 2003 21:40:58 +0200 From: Rolf Grossmann User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030522 X-Accept-Language: en,German [de] MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: <200308041304.h74D4u000654@isis.muc.progtech.intern> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-hackers@freebsd.org Subject: Re: Using CVS diff to find out what has changed, including new files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 19:41:32 -0000 Dag-Erling Smørgrav wrote: >Rolf Grossmann writes: > > >>I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository >>and I have a (slightly modified) version of -STABLE checked out from there. >>Now there are certain areas where I'd like to see what changed before >>doing a "cvs update". Currently I'm using "cvs diff -u -N -r BASE -r RELENG_4" >>to do that. However this has one drawback that I'm hoping you'll be >>able to help me with: If files have been removed from the distribution, >>these files continue to show up as getting readded (even though they >>won't when doing an update). To see the problem, you can go to >>/usr/src/sbin/md5 and run the above cvs diff command. >> >> > >That's normal behaviour with CVS when using branches. > FWIW it also happens with HEAD (which of course is a branch aswell, but no way around). >The only >workaround I know of is to specify the files explicitly. With zsh, >you can do 'cvs diff -Nu -rBASE -rRELENG_4 **/*~*CVS*(.)' > Which, again, won't list the files I don't have yet. Wouldn't you consider it a bug listing files that are not really part of either revision? Maybe I should file a bug report with the CVS people? Anyway, thanks a lot for your reply. Rolf From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 19:07:24 2003 Return-Path: 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 98E2337B401 for ; Mon, 4 Aug 2003 19:07:24 -0700 (PDT) Received: from bspu.secna.ru (ns2.uni-altai.ru [80.247.102.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D89E943FA3 for ; Mon, 4 Aug 2003 19:07:21 -0700 (PDT) (envelope-from swp@uni-altai.ru) Received: from bspu.secna.ru (smmsp@localhost [127.0.0.1]) by bspu.secna.ru (8.12.9/8.12.9) with ESMTP id h7527bFl003734; Tue, 5 Aug 2003 09:07:37 +0700 (NOVST) Received: (from root@localhost) by bspu.secna.ru (8.12.9/8.12.9/Submit) id h7527au7003733; Tue, 5 Aug 2003 09:07:36 +0700 (NOVST) (envelope-from swp) Date: Tue, 5 Aug 2003 09:07:36 +0700 From: "mitrohin a.s." To: Simon Barner Message-ID: <20030805020736.GA1805@bspu.secna.ru> References: <20030730224505.GD531@zi025.glhnet.mhn.de> <1059607242.64020.5.camel@mjtdev1.dand06.au.bytecraft.au.com> <3F285560.2090607@acm.org> <1059608748.64020.10.camel@mjtdev1.dand06.au.bytecraft.au.com> <002201c356fa$4a66a700$1200a8c0@gsicomp.on.ca> <20030731134343.GB1323@zi025.glhnet.mhn.de> <1059693358.64020.31.camel@mjtdev1.dand06.au.bytecraft.au.com> <20030801153142.GA487@zi025.glhnet.mhn.de> <3F2B75E2.FBC18052@mindspring.com> <20030804003331.GA408@zi025.glhnet.mhn.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030804003331.GA408@zi025.glhnet.mhn.de> User-Agent: Mutt/1.5.1i cc: freebsd-hackers@freebsd.org Subject: Re: [patch] Re: getfsent(3) and spaces in fstab X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: swp@uni-altai.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 02:07:24 -0000 On Mon, Aug 04, 2003 at 02:33:31AM +0200, Simon Barner wrote: > Hi Terry, > > > You need to add '\\' to the list of characters that can be escaped, > > or you've just traded the inability to specify '\t' or ' ' for an > > inability to speciy '\\'. > > Oh yes, I have overlook this special case. I revised my patch in order > to get this right. > > Simon helo. imho - expensive algorithm... i want to see anything more simple... like "gtok()" instead "es_strsep() + remove_escapes()"? #include #include #include char *gtok(char **s, char const *delim) { int quoted, escaped; static char const esc_set[] = { 't', 'r', 'n', 'a', 0 }; static char const esc_rep[] = { '\t', '\r', '\n', '\a', 0 }; char *tok, *r, *w, *p; if (!s || !*s || !*(tok = *s + strspn(*s, delim)) || *tok == '#') return NULL; for (quoted = escaped = 0, r = w = tok; *r; r++) { if (!escaped) { if (*r == '\\') { escaped = 1; continue; } if (*r == '\"') { quoted ^= -1; continue; } if (!quoted && strchr(delim, *r)) { r++; break; } } else { escaped = 0; if ((p = strchr(esc_set, *r)) != NULL) { *w++ = esc_rep[p - esc_set]; continue; } } *w++ = *r; } *w = 0; *s = r; return tok; } #if 0 main() { char *s, *t, buf[0x1000]; while (fgets(buf, sizeof buf, stdin)) for (s = buf; t = gtok(&s, " \t\r\n"); ) printf("\"%s\"\n", t); return 0; } #endif /swp > --- fstab.c.orig Fri Aug 1 17:18:00 2003 > +++ fstab.c Mon Aug 4 01:46:55 2003 > @@ -49,6 +49,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -84,6 +85,140 @@ > _fs_fstab.fs_spec = buf; > } > > +/* > + * Get next token from string *stringp, where tokens are possibly-empty > + * strings separated by characters from delim. > + * > + * Writes NULs into the string at *stringp to end tokens. > + * delim need not remain constant from call to call. > + * On return, *stringp points past the last NUL written (if there might > + * be further tokens), or is NULL (if there are definitely no more tokens). > + * > + * If *stringp is NULL, es_strsep returns NULL. > + * > + * In contrast to strsep(3), es_strsep will allow escaped delimiters > + * within a token. These escaped characters as well as the special case > + * '\\' will be converted appropriately ('\' -> ', '\\' -> '\' > + * > + */ > +char * > +es_strsep(char **stringp, const char *delim) > +{ > + bool escaped=false; > + char *s, *t, *u; > + int i; > + > + > + if (*stringp == '\0') /* empty string */ > + return NULL; > + s = *stringp; > + s += strspn (s, delim); /* skip delimiters */ > + > + if (*s == '\0') /* string consists only of delimiters */ > + return NULL; > + > + /* > + * skip a string consisting of non-delimiters, > + * escapted delimiters or '\\' > + */ > + for (t = s; *t != '\0'; ++t) { > + if (*t == '\\') { > + if (escaped) { /* convert \\ to \ */ > + --t; > + u = t; > + escaped = false; > + while (u[0] != '\0') { > + u[0] = u[1]; > + ++u; > + } > + } else /* start \-Sequence */ > + escaped = true; > + continue; > + } > + > + /* search for delimiter */ > + for (i=0; delim[i] != '\0'; ++i) { > + if (*t == delim[i]) > + break; > + } > + > + /* un-escaped delimiter found => end of token */ > + if (!escaped && delim[i] != '\0') > + break; > + > + /* escaped delimiter found => remove / */ > + if (escaped) { > + --t; > + u = t; > + escaped = false; > + while (u[0] != '\0') { > + u[0] = u[1]; > + ++u; > + } > + } > + } > + > + if (*t != '\0') { > + *t = '\0'; /* end current token */ > + *stringp = t+1; /* *t != '\0' => *(t+1) is valid */ > + } else > + *stringp = 0; /* end of string reached */ > + > + return s; /* return current token */ > +} > + > +/* > + * This function converts escaped characters: > + * '\' -> '', '\\' -> '\' > + * > + * If there are unescaped delimiters, 'false' will be return to indicate > + * an error, otherwise remove_escape returns 'true'. > + */ > +bool remove_escapes (char **s, const char* delim) { > + bool escaped=false; > + char *t, *u; > + int i; > + > + for (t = *s; *t != '\0'; ++t) { > + if (*t == '\\') { > + if (escaped) { /* convert \\ to \ */ > + --t; > + u = t; > + escaped = false; > + while (u[0] != '\0') { > + u[0] = u[1]; > + ++u; > + } > + } else /* start \-Sequence */ > + escaped = true; > + continue; > + } > + > + /* search for delimiter */ > + for (i=0; delim[i] != '\0'; ++i) { > + if (*t == delim[i]) > + break; > + } > + > + /* un-escaped delimiter found => error */ > + if (!escaped && delim[i] != '\0') > + return false; > + > + /* escaped delimiter found => remove / */ > + if (escaped) { > + --t; > + u = t; > + escaped = false; > + while (u[0] != '\0') { > + u[0] = u[1]; > + ++u; > + } > + } > + } > + > + return true; > +} > + > static int > fstabscan() > { > @@ -101,9 +236,19 @@ > ++LineNo; > if (*line == '#' || *line == '\n') > continue; > - if (!strpbrk(p, " \t")) { > + > + /* escapted white-spaces only are allowed in old-style format */ > + cp = p; > + while ((cp = strpbrk(cp, " \t")) != 0 && > + cp != p && cp[-1] == '\\') > + ++cp; > + if (cp == 0) { > _fs_fstab.fs_spec = strsep(&p, ":\n"); > + if (!remove_escapes (&_fs_fstab.fs_spec, " \t")) > + goto bad; > _fs_fstab.fs_file = strsep(&p, ":\n"); > + if (!remove_escapes (&_fs_fstab.fs_file, " \t")) > + goto bad; > fixfsfile(); > _fs_fstab.fs_type = strsep(&p, ":\n"); > if (_fs_fstab.fs_type) { > @@ -124,13 +269,15 @@ > goto bad; > } > /* OLD_STYLE_FSTAB */ > - while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') > + while ((cp = es_strsep(&p, " \t\n")) != NULL && *cp == '\0') > ; > _fs_fstab.fs_spec = cp; > if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') > continue; > - while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') > + while ((cp = es_strsep(&p, " \t\n")) != NULL && *cp == '\0') > ; > + if (cp == 0) > + goto bad; > _fs_fstab.fs_file = cp; > fixfsfile(); > while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 00:21:55 2003 Return-Path: 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 2947F37B401 for ; Tue, 5 Aug 2003 00:21:55 -0700 (PDT) Received: from memphis.mephi.ru (memphis.mephi.ru [194.67.67.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id E03AE43FB1 for ; Tue, 5 Aug 2003 00:21:53 -0700 (PDT) (envelope-from timon@memphis.mephi.ru) Received: from [192.168.0.3] (ppp9-198.pppoe.mtu-net.ru [81.195.9.198]) (authenticated bits=0) by memphis.mephi.ru (8.12.6p2/8.12.6) with ESMTP id h757Lndr004953; Tue, 5 Aug 2003 11:21:50 +0400 (MSD) (envelope-from timon@memphis.mephi.ru) From: "Artem 'Zazoobr' Ignatjev" To: Rolf Grossmann In-Reply-To: <200308041304.h74D4u000654@isis.muc.progtech.intern> References: <200308041304.h74D4u000654@isis.muc.progtech.intern> Content-Type: text/plain Message-Id: <1060068108.643.10.camel@timon.nist> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 05 Aug 2003 11:21:48 +0400 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Using CVS diff to find out what has changed, including new files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 07:21:55 -0000 On Mon, 04.08.2003, at 17:04, Rolf Grossmann wrote: > I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository > and I have a (slightly modified) version of -STABLE checked out from there. > Now there are certain areas where I'd like to see what changed before > doing a "cvs update". Currently I'm using "cvs diff -u -N -r BASE -r RELENG_4" > to do that. However this has one drawback that I'm hoping you'll be > able to help me with: If files have been removed from the distribution, > these files continue to show up as getting readded (even though they > won't when doing an update). To see the problem, you can go to > /usr/src/sbin/md5 and run the above cvs diff command. Maybe server looks for those files in attic? as far as I understand logics of cvs update, it won't rub out your local changes - all you can get with cvs update are conflicts. Why not do cvs -n update -d, and then cvs update -d, or even cvs update -d -I your/changed/file1 -I another/changed/file, and then you can diff through this small (I suppose (: ) set of files -- Artem 'Zazoobr' Ignatjev From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 02:48:01 2003 Return-Path: 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 6924A37B401 for ; Tue, 5 Aug 2003 02:48:01 -0700 (PDT) Received: from sweeper.openet-telecom.com (mail.openet-telecom.com [62.17.151.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4647A43FA3 for ; Tue, 5 Aug 2003 02:47:58 -0700 (PDT) (envelope-from peter.edwards@openet-telecom.com) Received: from mail.openet-telecom.com (unverified) by sweeper.openet-telecom.com ; Tue, 5 Aug 2003 10:51:04 +0100 Received: from [10.0.0.40] (10.0.0.40) by mail.openet-telecom.com (NPlex 6.5.027) id 3F268E0000003BDE; Tue, 5 Aug 2003 10:46:25 +0100 From: Peter Edwards To: Simon Barner In-Reply-To: <20030730224505.GD531@zi025.glhnet.mhn.de> References: <20030730224505.GD531@zi025.glhnet.mhn.de> Content-Type: text/plain Organization: Openet Telecom Message-Id: <1060076564.57234.11.camel@rocklobster.openet-telecom.lan> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 05 Aug 2003 10:42:44 +0100 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: getfsent(3) and spaces in fstab X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 09:48:01 -0000 Hi, Check PR 37569: This bugged the hell out of me also, so I created a patch to allow enclosing the device name in quotes. The PR was logged over a year ago: I can't remember the details, but the source has been sitting silently in my tree and working since then. Whatever way the problem is resolved, can someone close the PR? On Wed, 2003-07-30 at 23:45, Simon Barner wrote: > Hi -hackers, > > discussing some modifications for the sysutils/linneighborhood port, > Heiner Eichmann and me came across the following problem: > > getfsent(3) will fail, if the name of the file system or the mount point > contains whitespaces, be them escaped or not (file system names with > spaces occur quite of with smbfs mounts). > > I searched the mail archives and the PR data base, but apart from this > email here > > http://freebsd.rambler.ru/bsdmail/freebsd-questions_2003/msg05947.html > > this problem seems to be either unknown or rather well-known but > accepted. > > I know there is workaround which is to create symbolic links for the > paths that contain spaces, but to my mind this is not a real solution. > > Before taking any further action: > > Do file system names and mount points with whitespaces violate the > specification of fstab? If so, the least thing I'd suggest is the document > this restriction. > > Or should one extend 'getfsent' such that is able to cope with those > whitespaces? I am not sure whether this would have any further > implications so I am asking here. > > Cheers, > Simon From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 03:06:02 2003 Return-Path: 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 7946437B401 for ; Tue, 5 Aug 2003 03:06:02 -0700 (PDT) Received: from tuminfo2.informatik.tu-muenchen.de (tuminfo2.informatik.tu-muenchen.de [131.159.0.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id A979D43F85 for ; Tue, 5 Aug 2003 03:06:01 -0700 (PDT) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id 5A06738B69; Tue, 5 Aug 2003 12:05:59 +0200 (CEST) Date: Tue, 5 Aug 2003 12:05:58 +0200 From: Simon Barner To: Peter Edwards Message-ID: <20030805100558.GA15128@zi025.glhnet.mhn.de> References: <20030730224505.GD531@zi025.glhnet.mhn.de> <1060076564.57234.11.camel@rocklobster.openet-telecom.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <1060076564.57234.11.camel@rocklobster.openet-telecom.lan> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de cc: freebsd-hackers@freebsd.org Subject: Re: getfsent(3) and spaces in fstab X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 10:06:02 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > Check PR 37569: This bugged the hell out of me also, so I created a > patch to allow enclosing the device name in quotes. The PR was logged > over a year ago: I can't remember the details, but the source has been > sitting silently in my tree and working since then. Whatever way the > problem is resolved, can someone close the PR? I can't believe it... I have searched the PR database, Google, etc. for existing solutions to this problem, but I did not find yours. I also considered using quotes, but since you need escape-sequences to encode quotes in your solution, too, the approach using '\ ', '\', '\\' is simpler and cleaner IMHO. Simon --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/L4GGCkn+/eutqCoRAqEoAKC3mxMpnpqgHhqc3BWJitB7/rIwEwCdE2++ yfAP0lzw8yKavT1qGGu6Lp4= =p6QQ -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 03:22:31 2003 Return-Path: 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 6595237B404 for ; Tue, 5 Aug 2003 03:22:31 -0700 (PDT) Received: from boeing.ieo-research.it (devil.ieo-research.it [193.204.98.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 938CC43FB1 for ; Tue, 5 Aug 2003 03:22:28 -0700 (PDT) (envelope-from andrea.cocito@ieo-research.it) Received: (qmail 9199 invoked from network); 5 Aug 2003 10:22:22 -0000 Received: from unknown (HELO ieo-research.it) (acocito@[62.211.141.65]) (envelope-sender ) by smtp.ieo-research.it (qmail-ldap-1.03) with SMTP for ; 5 Aug 2003 10:22:22 -0000 Mime-Version: 1.0 (Apple Message framework v578) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-hackers@freebsd.org From: Andrea Cocito Date: Tue, 5 Aug 2003 12:22:13 +0200 X-Mailer: Apple Mail (2.578) Subject: Patch for Alladin dallas (ALi) AGP kernel panic [long] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 10:22:31 -0000 Hallo, first of all: I am completely new to both FreeBSD kernel internals and to PC-Intel hardware stuff, and the last time I put my hands on a *BSD kernel was a few years ago, so I might be wrong.... but still: it works and for sure fixed an existing bug. My machine did not like to go beyond 4.7. Kernel panic after AGP probing, trying to contigmalloc1() with size = 0; the problem seem to be shared by several machines based on the ALi chipset. Compiling a custom kernel without the "agp" device worked. Looking into the code and several panic outputs I found these issues: - I am almost sure that the box here does not have an AGP bus at all (it has an onboard video, maybe an internal AGP bus is there but there is not a connector for sure). 4.7 did not show any agp* device at boot, 4.8 and 5.* without agp* just see the vga* on isa* and work. So *maybe* someone could investigate if the device is really an AGP bus... (or give me a clue on how to check it). - If it is an agp bus then for some reason it reports an aperture size of zero, does this make any sense ? Again: my knowledge of agp stuff is NULL. Could we leave the device attached without allocating anything there ? - In /src/sys/pci/agp_ali.c and others there is a loop that supposedly tries to alloc smaller apertures until it either fails reaching zero size or manages to allocate something: no matter what the two points above result to be the thing is just broken (as is will either alloc the requested size at the first shot, crash if it was zero, or fail if it ever tries to reduce the aperture), this is what I patched. The attached patch fixes the said loop to make it do something meaningful (try to malloc a progressively smaller aperture, until it reaches zero or succeeds, if it fails detaches the device and returns ENOMEM). As said: whatever the real origin of the problem was this thing was just broken and now does what the original code probably intended to do so that at least now the system boots. Maybe this helps also others having troubles with some Toshiba laptops using that chipset and that reported the same panic on several lists. Pasted down here the patch -rc3 for pci_ali.c. The same loop should be fixed on several other pci_*.c sources, let me know what patch style is preferred and if the list supports attachments and I'll be glad to send the complete diff for all pertinent files. Also let me know if returning ENOMEM when we are requested to have an aperture size of 0 is ok or I should better have it return EINVAL (this option looks better to me). Then is up to someone knowing a bit better the hardware and kernel internals to work on the real solution (understand if we fail the probe and this is not really an agp bus, or find a way to know correctly the aperture size). Ciao, A. ========= CUT HERE ========== *** agp_ali.c.unpatched Mon Aug 4 09:25:13 2003 --- agp_ali.c Mon Aug 4 12:13:44 2003 *************** *** 101,121 **** return error; sc->initial_aperture = AGP_GET_APERTURE(dev); ! for (;;) { gatt = agp_alloc_gatt(dev); if (gatt) break; ! ! /* ! * Probably contigmalloc failure. Try reducing the ! * aperture so that the gatt size reduces. ! */ ! if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) { agp_generic_detach(dev); return ENOMEM; - } } sc->gatt = gatt; /* Install the gatt. */ --- 101,120 ---- return error; sc->initial_aperture = AGP_GET_APERTURE(dev); + gatt = NULL; ! while (AGP_GET_APERTURE(dev) != 0) { gatt = agp_alloc_gatt(dev); if (gatt) break; ! AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2); ! } ! ! if (!gatt) { agp_generic_detach(dev); return ENOMEM; } + sc->gatt = gatt; /* Install the gatt. */ ========= CUT HERE ========== PS: cc: me on the replies please, I'm not on the list, thanks. ---------- Andrea Cocito < andrea.cocito@ieo-research.it > IEO -- European Institute of Oncology - Bioinformatics group tel: +39 02 57489 857 fax: +39 02 57489 851 "Imagination is more important than knowledge" -Albert Einstein From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 03:22:43 2003 Return-Path: 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 D031C37B401 for ; Tue, 5 Aug 2003 03:22:43 -0700 (PDT) Received: from netlx014.civ.utwente.nl (netlx014.civ.utwente.nl [130.89.1.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EE7D43FAF for ; Tue, 5 Aug 2003 03:22:42 -0700 (PDT) (envelope-from r.s.a.vandomburg@student.utwente.nl) Received: from student.utwente.nl (gog.student.utwente.nl [130.89.165.107]) by netlx014.civ.utwente.nl (8.11.4/HKD) with ESMTP id h75AMQY00298 for ; Tue, 5 Aug 2003 12:22:27 +0200 Message-ID: <3F2F8562.9090609@student.utwente.nl> Date: Tue, 05 Aug 2003 12:22:26 +0200 From: Roderick van Domburg Organization: University of Twente User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.76.4.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-UTwente-MailScanner: Found to be clean Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 10:22:44 -0000 There's this Linux kernel patch that allows for timeslice tuning. It's got the following rules of the thumb: * The optimal setting is your CPU's speed in MHz's / 2 * ...but there is no point in going above 1000 Hz * ...and be sure to use multiples of 100 Hz I am everything but an expert at scheduling, but somehow this makes sense: i.e. one jiffy for the scheduler and one jiffy for the process. Does all of this make any sense or is it just a load of hooey? Regards, Roderick From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 03:35:33 2003 Return-Path: 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 E6A9337B401 for ; Tue, 5 Aug 2003 03:35:33 -0700 (PDT) Received: from sweeper.openet-telecom.com (mail.openet-telecom.com [62.17.151.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9F9143F85 for ; Tue, 5 Aug 2003 03:35:32 -0700 (PDT) (envelope-from peter.edwards@openet-telecom.com) Received: from mail.openet-telecom.com (unverified) by sweeper.openet-telecom.com ; Tue, 5 Aug 2003 11:38:40 +0100 Received: from [10.0.0.40] (10.0.0.40) by mail.openet-telecom.com (NPlex 6.5.027) id 3F268E0000003CD2; Tue, 5 Aug 2003 11:34:01 +0100 From: Peter Edwards To: Simon Barner In-Reply-To: <20030805100558.GA15128@zi025.glhnet.mhn.de> References: <20030730224505.GD531@zi025.glhnet.mhn.de> <1060076564.57234.11.camel@rocklobster.openet-telecom.lan> <20030805100558.GA15128@zi025.glhnet.mhn.de> Content-Type: text/plain Organization: Openet Telecom Message-Id: <1060079419.57234.35.camel@rocklobster.openet-telecom.lan> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 05 Aug 2003 11:30:20 +0100 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: getfsent(3) and spaces in fstab X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 10:35:34 -0000 On Tue, 2003-08-05 at 11:05, Simon Barner wrote: > Hi, > > > Check PR 37569: This bugged the hell out of me also, so I created a > > patch to allow enclosing the device name in quotes. The PR was logged > > over a year ago: I can't remember the details, but the source has been > > sitting silently in my tree and working since then. Whatever way the > > problem is resolved, can someone close the PR? > > I can't believe it... I have searched the PR database, Google, etc. for > existing solutions to this problem, but I did not find yours. I also > considered using quotes, but since you need escape-sequences to encode > quotes in your solution, too, the approach using '\ ', '\', '\\' is > simpler and cleaner IMHO. > > Simon I find the "quotes" approach produces more readable (and manageable) fstabs, but I don't care about that sufficiently to argue further :-). Anything that addresses the problem and can close the PR will suit me! From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 04:03:01 2003 Return-Path: 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 908BA37B401 for ; Tue, 5 Aug 2003 04:03:01 -0700 (PDT) Received: from ptserver.progtech.net (pD9E8B737.dip.t-dialin.net [217.232.183.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA44743F3F for ; Tue, 5 Aug 2003 04:02:59 -0700 (PDT) (envelope-from rg@progtech.net) Received: from PROGTECH.net (isis.muc.progtech.intern [10.25.0.100]) by ptserver.progtech.net (8.12.9/8.12.3) with ESMTP id h75B2pXo079795; Tue, 5 Aug 2003 13:02:56 +0200 (CEST) (envelope-from rg@PROGTECH.net) Message-ID: <3F2F8EC0.9000900@PROGTECH.net> Date: Tue, 05 Aug 2003 13:02:24 +0200 From: Rolf Grossmann User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030522 X-Accept-Language: en,German [de] MIME-Version: 1.0 To: "Artem 'Zazoobr' Ignatjev" References: <200308041304.h74D4u000654@isis.muc.progtech.intern> <1060068108.643.10.camel@timon.nist> In-Reply-To: <1060068108.643.10.camel@timon.nist> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Using CVS diff to find out what has changed, including new files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 11:03:01 -0000 Hi, Artem 'Zazoobr' Ignatjev wrote: >On Mon, 04.08.2003, at 17:04, Rolf Grossmann wrote: > > >>I'm using cvsup for a while now to get a copy of the FreeBSD CVS repository >>and I have a (slightly modified) version of -STABLE checked out from there. >>Now there are certain areas where I'd like to see what changed before >>doing a "cvs update". Currently I'm using "cvs diff -u -N -r BASE -r RELENG_4" >>to do that. However this has one drawback that I'm hoping you'll be >>able to help me with: If files have been removed from the distribution, >>these files continue to show up as getting readded (even though they >>won't when doing an update). To see the problem, you can go to >>/usr/src/sbin/md5 and run the above cvs diff command. >> >> >Maybe server looks for those files in attic? > > Yes, it does. And rightfully so, because the given revision may still be present. However, I think it errs when it's not. >as far as I understand logics of cvs update, it won't rub out your local changes - >all you can get with cvs update are conflicts. Why not do cvs -n update -d, and then >cvs update -d, or even cvs update -d -I your/changed/file1 -I another/changed/file, >and then you can diff through this small (I suppose (: ) set of files > Sorry, I think you didn't quite understand what I'm trying to achive. I'd like to get a diff of what has changed in the repository *before* I update my sources (and without making a copy of any files). Rolf From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 10:22:42 2003 Return-Path: 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 7001B37B401 for ; Tue, 5 Aug 2003 10:22:42 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6430043FBD for ; Tue, 5 Aug 2003 10:22:41 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h75HMdV3014193 for ; Tue, 5 Aug 2003 17:22:39 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h75HMcPI033256 for ; Tue, 5 Aug 2003 19:22:39 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: hackers@freebsd.org From: Poul-Henning Kamp Date: Tue, 05 Aug 2003 19:22:38 +0200 Message-ID: <33255.1060104158@critter.freebsd.dk> Subject: small statistics tool in the tree ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 17:22:42 -0000 I written up a small statistics tool which is targeted at showing if a benchmark proves anything or not. critter phk> cat before 29195 29232 29226 29203 29211 critter phk> cat after 29179 29203 29195 29194 29196 critter phk> ./ministat before after x before + after +--------------------------------------------------------------------------+ |+ +*+ * x x x| | |___________A_M___|_____|___________M__A_____________________| | +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 5 29195 29232 29211 29213.4 15.469324 + 5 29179 29203 29195 29193.4 8.7920419 Difference at 95.0% confidence -20 ± 18.3497 -0.0684617% ± 0.0628127% (Student's t, pooled s = 12.5817) In this case the benchmark shows a very small improvement has obtained with 95% probability Here is a more convincing result: x before + after +--------------------------------------------------------------------------+ | + | | + | |x x + | |x x x + +| ||_________A__M______| |_____M____A_________| | +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 5 0.132 0.134 0.133 0.1328 0.00083666003 + 5 0.136 0.138 0.136 0.1364 0.00089442719 Difference at 99.5% confidence 0.0036 ± 0.0024642 2.71084% ± 1.85558% (Student's t, pooled s = 0.000866025) The program is a <500 line .c program and I was wondering if it belongs in the tree so we have an easy to use tool to point people at when they run benchmarks. Source: http://phk.freebsd.dk/patch/ministat Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 13:00:21 2003 Return-Path: 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 9C42137B407 for ; Tue, 5 Aug 2003 13:00:21 -0700 (PDT) Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C62EF43F93 for ; Tue, 5 Aug 2003 13:00:18 -0700 (PDT) (envelope-from des@des.no) Received: from smtp.des.no (37.80-203-228.nextgentel.com [80.203.228.37]) by mail.broadpark.no (Postfix) with ESMTP id 19F1E78A8F; Tue, 5 Aug 2003 22:00:17 +0200 (MEST) Received: by smtp.des.no (Pony Express, from userid 666) id D85C6965A6; Tue, 5 Aug 2003 22:00:16 +0200 (CEST) Received: from dwp.des.no (dwp.des.no [10.0.0.4]) by smtp.des.no (Pony Express) with ESMTP id 4FFA696440; Tue, 5 Aug 2003 22:00:13 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 2F921B822; Tue, 5 Aug 2003 22:00:13 +0200 (CEST) To: Poul-Henning Kamp References: <33255.1060104158@critter.freebsd.dk> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Tue, 05 Aug 2003 22:00:12 +0200 In-Reply-To: <33255.1060104158@critter.freebsd.dk> (Poul-Henning Kamp's message of "Tue, 05 Aug 2003 19:22:38 +0200") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-3.0 required=8.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_GNUS_UA version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: hackers@freebsd.org Subject: Re: small statistics tool in the tree ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 20:00:21 -0000 Poul-Henning Kamp writes: > The program is a <500 line .c program and I was wondering if it belongs > in the tree so we have an easy to use tool to point people at when they > run benchmarks. Just put it in src/tools/tools/... DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 21:33:55 2003 Return-Path: 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 324CB37B401 for ; Tue, 5 Aug 2003 21:33:55 -0700 (PDT) Received: from topperwein.pennasoft.com (user183.net446.oh.sprint-hsd.net [65.40.131.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FF3943F75 for ; Tue, 5 Aug 2003 21:33:54 -0700 (PDT) (envelope-from behanna@topperwein.pennasoft.com) Received: from topperwein.pennasoft.com (localhost [127.0.0.1]) h764Xq9j086362 for ; Wed, 6 Aug 2003 00:33:52 -0400 (EDT) (envelope-from behanna@topperwein.pennasoft.com) Received: from localhost (localhost [[UNIX: localhost]]) by topperwein.pennasoft.com (8.12.9/8.12.9/Submit) id h764Xles086361 for hackers@freebsd.org; Wed, 6 Aug 2003 00:33:47 -0400 (EDT) From: Chris BeHanna Organization: Western Pennsylvania Pizza Disposal Unit To: hackers@freebsd.org Date: Wed, 6 Aug 2003 00:33:47 -0400 User-Agent: KMail/1.5.3 References: <000501c35a01$6383e040$0300000a@antalus> In-Reply-To: <000501c35a01$6383e040$0300000a@antalus> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308060033.47237.chris@behanna.org> Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: chris@behanna.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 04:33:55 -0000 On Sunday 03 August 2003 16:54, Sean Hamilton wrote: > Greetings, > > [...wants to send out a lot of traffic, then read responses 1000 > times per second...is currently using select(2) in a loop...] > > Should I set HZ to 1000 (the frequency of my application) or should I set > it to a much higher value? The CPU is running at around 2 GHz, and I set it > as high as 50,000 with no problems. However, the granularity of my timeout > appears to be restricted to 1/1000th of a second. harti@ already answered this. I have no experience playing with HZ settings, but his response sounds reasonable enough. > I would like to use poll(2) instead of select, but it appears to take its > timeout parameter in milliseconds, which aren't precise enough to keep my > timing reasonable, especially if I ever need to increase my frequency. > > Another option would be calling poll/select with no timeout, in a loop. > However, this seems like a waste of CPU time. You could insert an appropriately-sized nanosleep(2) into such a loop. -- Chris BeHanna Software Engineer (Remove "bogus" before responding.) chris@bogus.behanna.org Turning coffee into software since 1990. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 21:44:00 2003 Return-Path: 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 5F23137B401 for ; Tue, 5 Aug 2003 21:44:00 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id D74EF43F75 for ; Tue, 5 Aug 2003 21:43:58 -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.9) with ESMTP id h764hsjX004028; Tue, 5 Aug 2003 21:43:55 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h764hqAl004027; Tue, 5 Aug 2003 21:43:52 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 5 Aug 2003 21:43:51 -0700 From: David Schultz To: Roderick van Domburg Message-ID: <20030806044351.GA3881@HAL9000.homeunix.com> Mail-Followup-To: Roderick van Domburg , freebsd-hackers@freebsd.org References: <3F2F8562.9090609@student.utwente.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F2F8562.9090609@student.utwente.nl> cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 04:44:00 -0000 On Tue, Aug 05, 2003, Roderick van Domburg wrote: > There's this Linux kernel patch that allows for timeslice tuning. It's > got the following rules of the thumb: > > * The optimal setting is your CPU's speed in MHz's / 2 > * ...but there is no point in going above 1000 Hz > * ...and be sure to use multiples of 100 Hz > > I am everything but an expert at scheduling, but somehow this makes > sense: i.e. one jiffy for the scheduler and one jiffy for the process. > > Does all of this make any sense or is it just a load of hooey? There might be some rationale behind that suggestion, but my first guess would be that someone pulled those numbers out of a hat. In general, doing a context switch has negative cache effects, in addition to the overhead that you pay up front. For optimum throughput, you want to set HZ to the smallest number that still gives acceptable resolution. 100 Hz works just fine for interactive jobs; humans can't tell the difference.[1] For many real-time applications, a higher value is needed. [1] In terms of overhead, I think 100 Hz is well into the noise these days, so bumping that up a little bit would result in negligible difference. I measured 100 vs. 500 a little while ago, and couldn't find a realistic benchmark that was negatively impacted by the higher frequency. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 22:54:03 2003 Return-Path: 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 55E1637B401; Tue, 5 Aug 2003 22:54:03 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A048743F93; Tue, 5 Aug 2003 22:54:02 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h765s1uN011835; Wed, 6 Aug 2003 01:54:01 -0400 (EDT) Date: Wed, 6 Aug 2003 01:54:01 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Schultz In-Reply-To: <20030806044351.GA3881@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Roderick van Domburg Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 05:54:03 -0000 On Tue, 5 Aug 2003, David Schultz wrote: > On Tue, Aug 05, 2003, Roderick van Domburg wrote: > > There's this Linux kernel patch that allows for timeslice tuning. It's > > got the following rules of the thumb: > > > > * The optimal setting is your CPU's speed in MHz's / 2 > > * ...but there is no point in going above 1000 Hz > > * ...and be sure to use multiples of 100 Hz > > > > I am everything but an expert at scheduling, but somehow this makes > > sense: i.e. one jiffy for the scheduler and one jiffy for the process. > > > > Does all of this make any sense or is it just a load of hooey? > > There might be some rationale behind that suggestion, but my first > guess would be that someone pulled those numbers out of a hat. In > general, doing a context switch has negative cache effects, in > addition to the overhead that you pay up front. For optimum > throughput, you want to set HZ to the smallest number that still > gives acceptable resolution. 100 Hz works just fine for > interactive jobs; humans can't tell the difference.[1] For many > real-time applications, a higher value is needed. > > > [1] In terms of overhead, I think 100 Hz is well into the noise > these days, so bumping that up a little bit would result in > negligible difference. I measured 100 vs. 500 a little while > ago, and couldn't find a realistic benchmark that was negatively > impacted by the higher frequency. I used to run my old Pentium I (200MHz) laptop at 1000Hz without any problems. I ran it this way for years until I retired it a few months ago. I'd support raising our default rate from 100Hz to 1000Hz. -- Dan Eischen From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:11:57 2003 Return-Path: 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 E553B37B401 for ; Wed, 6 Aug 2003 03:11:57 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EA5243F93 for ; Wed, 6 Aug 2003 03:11:56 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h76ABpaK089534 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Wed, 6 Aug 2003 12:11:54 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h76ABoAx043246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 6 Aug 2003 12:11:50 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h76ABnNS035022 for ; Wed, 6 Aug 2003 12:11:50 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h76ABnR3035021 for freebsd-hackers@freebsd.org; Wed, 6 Aug 2003 12:11:49 +0200 (CEST) Date: Wed, 6 Aug 2003 12:11:49 +0200 From: Bernd Walter To: freebsd-hackers@freebsd.org Message-ID: <20030806101148.GC32228@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i Subject: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:11:58 -0000 I need to add I2C support for a Elan520 based soekris system. The system has the required GPIO pins and there is the iicbb driver to handle generic bitbang code - just needing a simple layer driver to enable, disable and read pins. But unlike normal isa/pci hardware probing the existence of the GPIO line is a bit difficult. The current elan-mmcr.c gets started from i386/pci/pci_bus.c at host bridge probing, because that's seems to be the only place to safely detect this special CPU. >From the logicaly standpoint the extensions had to be attached to nexus, but nowhere is the current code path there is a handle for nexus or any other device_t. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:18:32 2003 Return-Path: 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 5A2E937B401 for ; Wed, 6 Aug 2003 03:18:32 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65DC443F93 for ; Wed, 6 Aug 2003 03:18:31 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h76AISV3028942; Wed, 6 Aug 2003 10:18:28 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h76AISPI040314; Wed, 6 Aug 2003 12:18:28 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: ticso@cicely.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 06 Aug 2003 12:11:49 +0200." <20030806101148.GC32228@cicely12.cicely.de> Date: Wed, 06 Aug 2003 12:18:28 +0200 Message-ID: <40313.1060165108@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:18:32 -0000 In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: >I need to add I2C support for a Elan520 based soekris system. >The system has the required GPIO pins and there is the iicbb driver >to handle generic bitbang code - just needing a simple layer driver to >enable, disable and read pins. >But unlike normal isa/pci hardware probing the existence of the GPIO >line is a bit difficult. >The current elan-mmcr.c gets started from i386/pci/pci_bus.c at >host bridge probing, because that's seems to be the only place to >safely detect this special CPU. That's my doing, based on my reading of the datasheet from AMD. It would be better if we could detect the Elan in the normal CPU identification stuff, but I couldn't seem to find a reliable way. >>From the logicaly standpoint the extensions had to be attached to >nexus, but nowhere is the current code path there is a handle for >nexus or any other device_t. In fact what you may want to do is hang the entire MMCR off the nexus as a bus, and hang the various drivers off that bus. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:35:53 2003 Return-Path: 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 8DEA137B401; Wed, 6 Aug 2003 03:35:53 -0700 (PDT) Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71EF243F75; Wed, 6 Aug 2003 03:35:50 -0700 (PDT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Wed, 6 Aug 2003 11:35:48 +0100 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 19kLdn-0007Za-00; Wed, 06 Aug 2003 11:35:35 +0100 Date: Wed, 6 Aug 2003 11:35:35 +0100 (BST) From: Jan Grant X-X-Sender: cmjg@mail.ilrt.bris.ac.uk To: David Schultz In-Reply-To: <20030806044351.GA3881@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Jan Grant cc: freebsd-hackers cc: Roderick van Domburg Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:35:53 -0000 On Tue, 5 Aug 2003, David Schultz wrote: > 100 Hz works just fine for > interactive jobs; humans can't tell the difference.[1] They can if they're using X :-) I gave Denim* a trial recently; it was unusable at 100Hz and fine at 1000. jan * gesture-recognition web design toy: http://guir.berkeley.edu/projects/denim/ -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/ "Roger Penrose can never be convinced that this sentence is true." (If he doesn't get the joke, you can at least prove that he owes you money.) From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:40:24 2003 Return-Path: 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 B876637B401 for ; Wed, 6 Aug 2003 03:40:24 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C25243F75 for ; Wed, 6 Aug 2003 03:40:23 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h76AeBaK089821 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 6 Aug 2003 12:40:19 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h76Ae2Ax043325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2003 12:40:03 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h76Ae2NS035102; Wed, 6 Aug 2003 12:40:02 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h76Ae1YP035101; Wed, 6 Aug 2003 12:40:01 +0200 (CEST) Date: Wed, 6 Aug 2003 12:40:01 +0200 From: Bernd Walter To: Poul-Henning Kamp Message-ID: <20030806104001.GD32228@cicely12.cicely.de> References: <20030806101148.GC32228@cicely12.cicely.de> <40313.1060165108@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40313.1060165108@critter.freebsd.dk> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:40:25 -0000 On Wed, Aug 06, 2003 at 12:18:28PM +0200, Poul-Henning Kamp wrote: > In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: > >I need to add I2C support for a Elan520 based soekris system. > >The system has the required GPIO pins and there is the iicbb driver > >to handle generic bitbang code - just needing a simple layer driver to > >enable, disable and read pins. > >But unlike normal isa/pci hardware probing the existence of the GPIO > >line is a bit difficult. > >The current elan-mmcr.c gets started from i386/pci/pci_bus.c at > >host bridge probing, because that's seems to be the only place to > >safely detect this special CPU. > > That's my doing, based on my reading of the datasheet from AMD. > > It would be better if we could detect the Elan in the normal CPU > identification stuff, but I couldn't seem to find a reliable way. I could reread the datasheet, but don't give it much hope if you hadn't find anything usefull. > >>From the logicaly standpoint the extensions had to be attached to > >nexus, but nowhere is the current code path there is a handle for > >nexus or any other device_t. > > In fact what you may want to do is hang the entire MMCR off the nexus > as a bus, and hang the various drivers off that bus. What needs to be in *_probe() to conditionalize on elan existence? -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 03:45:52 2003 Return-Path: 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 55A9837B401 for ; Wed, 6 Aug 2003 03:45:52 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EA1C43F3F for ; Wed, 6 Aug 2003 03:45:51 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h76AjhV3029325; Wed, 6 Aug 2003 10:45:43 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h76AjhPI040471; Wed, 6 Aug 2003 12:45:43 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: ticso@cicely.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 06 Aug 2003 12:40:01 +0200." <20030806104001.GD32228@cicely12.cicely.de> Date: Wed, 06 Aug 2003 12:45:43 +0200 Message-ID: <40470.1060166743@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 10:45:52 -0000 In message <20030806104001.GD32228@cicely12.cicely.de>, Bernd Walter writes: >On Wed, Aug 06, 2003 at 12:18:28PM +0200, Poul-Henning Kamp wrote: >> In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: >> >I need to add I2C support for a Elan520 based soekris system. >> >The system has the required GPIO pins and there is the iicbb driver >> >to handle generic bitbang code - just needing a simple layer driver to >> >enable, disable and read pins. >> >But unlike normal isa/pci hardware probing the existence of the GPIO >> >line is a bit difficult. >> >The current elan-mmcr.c gets started from i386/pci/pci_bus.c at >> >host bridge probing, because that's seems to be the only place to >> >safely detect this special CPU. >> >> That's my doing, based on my reading of the datasheet from AMD. >> >> It would be better if we could detect the Elan in the normal CPU >> identification stuff, but I couldn't seem to find a reliable way. > >I could reread the datasheet, but don't give it much hope if you >hadn't find anything usefull. > >> >>From the logicaly standpoint the extensions had to be attached to >> >nexus, but nowhere is the current code path there is a handle for >> >nexus or any other device_t. >> >> In fact what you may want to do is hang the entire MMCR off the nexus >> as a bus, and hang the various drivers off that bus. > >What needs to be in *_probe() to conditionalize on elan existence? Well, my idea was to hang the mmcr bus on nexus when we find out it is an elan. It may be that you are not allowed to attach a bus to the nexus when we find out it is an elan in the host/pci bridge probe, but then I guess you could just hang it off that instead. Pressumably some newbus magic will then probe that bus. If its not an elan, there is no mmcr bus and nothing will get probed. I'm not the worlds greatest newbus specialist, so check this concept with somebody who know what they are talking about before you do it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 04:00:29 2003 Return-Path: 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 0E1CA37B401 for ; Wed, 6 Aug 2003 04:00:29 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id B15A343F93 for ; Wed, 6 Aug 2003 04:00:27 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h76B0HaK090005 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 6 Aug 2003 13:00:23 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h76B0EAx043415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2003 13:00:15 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h76B0ENS035203; Wed, 6 Aug 2003 13:00:14 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h76B0DTH035202; Wed, 6 Aug 2003 13:00:13 +0200 (CEST) Date: Wed, 6 Aug 2003 13:00:13 +0200 From: Bernd Walter To: Poul-Henning Kamp Message-ID: <20030806110013.GE32228@cicely12.cicely.de> References: <20030806104001.GD32228@cicely12.cicely.de> <40470.1060166743@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40470.1060166743@critter.freebsd.dk> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 11:00:29 -0000 On Wed, Aug 06, 2003 at 12:45:43PM +0200, Poul-Henning Kamp wrote: > In message <20030806104001.GD32228@cicely12.cicely.de>, Bernd Walter writes: > >On Wed, Aug 06, 2003 at 12:18:28PM +0200, Poul-Henning Kamp wrote: > >> In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: > >> >>From the logicaly standpoint the extensions had to be attached to > >> >nexus, but nowhere is the current code path there is a handle for > >> >nexus or any other device_t. > >> > >> In fact what you may want to do is hang the entire MMCR off the nexus > >> as a bus, and hang the various drivers off that bus. > > > >What needs to be in *_probe() to conditionalize on elan existence? > > Well, my idea was to hang the mmcr bus on nexus when we find out it > is an elan. Back to the original question: How do I get the device_t from nexus? Is there a get_nexus() function somewhere? > It may be that you are not allowed to attach a bus to the nexus when > we find out it is an elan in the host/pci bridge probe, but then I guess > you could just hang it off that instead. There is also no other device_t in the code path available. The last function knowing a device_t is nexus_pcib_identify. We then have to pass this as an argument to nexus_pcib_is_host_bridge(). > Pressumably some newbus magic will then probe that bus. If its not > an elan, there is no mmcr bus and nothing will get probed. Yes - that part is clear. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 04:26:55 2003 Return-Path: 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 9EC8737B401 for ; Wed, 6 Aug 2003 04:26:55 -0700 (PDT) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id A94A943F85 for ; Wed, 6 Aug 2003 04:26:54 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.8/8.12.8) with ESMTP id h76BQmV3029888; Wed, 6 Aug 2003 11:26:48 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h76BQlPI040819; Wed, 6 Aug 2003 13:26:47 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: ticso@cicely.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 06 Aug 2003 13:00:13 +0200." <20030806110013.GE32228@cicely12.cicely.de> Date: Wed, 06 Aug 2003 13:26:47 +0200 Message-ID: <40818.1060169207@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 11:26:55 -0000 In message <20030806110013.GE32228@cicely12.cicely.de>, Bernd Walter writes: >On Wed, Aug 06, 2003 at 12:45:43PM +0200, Poul-Henning Kamp wrote: >> In message <20030806104001.GD32228@cicely12.cicely.de>, Bernd Walter writes: >> >On Wed, Aug 06, 2003 at 12:18:28PM +0200, Poul-Henning Kamp wrote: >> >> In message <20030806101148.GC32228@cicely12.cicely.de>, Bernd Walter writes: >> >> >>From the logicaly standpoint the extensions had to be attached to >> >> >nexus, but nowhere is the current code path there is a handle for >> >> >nexus or any other device_t. >> >> >> >> In fact what you may want to do is hang the entire MMCR off the nexus >> >> as a bus, and hang the various drivers off that bus. >> > >> >What needs to be in *_probe() to conditionalize on elan existence? >> >> Well, my idea was to hang the mmcr bus on nexus when we find out it >> is an elan. > >Back to the original question: >How do I get the device_t from nexus? >Is there a get_nexus() function somewhere? That's were I don't know enough newbus :-) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 08:39:00 2003 Return-Path: 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 3755437B401 for ; Wed, 6 Aug 2003 08:39:00 -0700 (PDT) Received: from smtp.goamerica.net (ny-mx-02.goamerica.net [208.200.67.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30FDC43F85 for ; Wed, 6 Aug 2003 08:38:59 -0700 (PDT) (envelope-from eaja@erols.com) Received: from localhost (165.sub-166-141-30.myvzw.com [166.141.30.165]) by smtp.goamerica.net (8.12.8/8.12.8) with SMTP id h76FcYvT009937; Wed, 6 Aug 2003 11:38:40 -0400 (EDT) Date: Wed, 6 Aug 2003 15:34:01 -0400 From: Eric Jacobs To: ticso@cicely.de Message-Id: <20030806153401.79a57974.eaja@erols.com> In-Reply-To: <20030806110013.GE32228@cicely12.cicely.de> References: <20030806104001.GD32228@cicely12.cicely.de> <40470.1060166743@critter.freebsd.dk> <20030806110013.GE32228@cicely12.cicely.de> X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-portbld-freebsd4.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 15:39:00 -0000 On Wed, 6 Aug 2003 13:00:13 +0200 Bernd Walter wrote: > > Back to the original question: > How do I get the device_t from nexus? > Is there a get_nexus() function somewhere? You can do it this way: devclass_t nexusdc = devclass_find("nexus"); device_t nexus = devclass_get_device(nexusdc, 0); It is in fact in the code path as "parent" in nexus_pcib_identify, but not in the special PCI bridge identification function. If you call BUS_ADD_CHILD at that time, you don't need to probe or attach your device; it will be automatically probed and attached later and you can whatever logic you want in your probe and attach routines. Eric From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 08:51:48 2003 Return-Path: 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 76E6A37B401 for ; Wed, 6 Aug 2003 08:51:48 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39A6843F85 for ; Wed, 6 Aug 2003 08:51:47 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h76FpYaK094229 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 6 Aug 2003 17:51:37 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h76FpXAx044917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2003 17:51:33 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h76FpWNS036313; Wed, 6 Aug 2003 17:51:32 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h76FpWAJ036312; Wed, 6 Aug 2003 17:51:32 +0200 (CEST) Date: Wed, 6 Aug 2003 17:51:31 +0200 From: Bernd Walter To: Eric Jacobs Message-ID: <20030806155131.GD35859@cicely12.cicely.de> References: <20030806104001.GD32228@cicely12.cicely.de> <40470.1060166743@critter.freebsd.dk> <20030806110013.GE32228@cicely12.cicely.de> <20030806153401.79a57974.eaja@erols.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030806153401.79a57974.eaja@erols.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 15:51:48 -0000 On Wed, Aug 06, 2003 at 03:34:01PM -0400, Eric Jacobs wrote: > On Wed, 6 Aug 2003 13:00:13 +0200 > Bernd Walter wrote: > > > > > Back to the original question: > > How do I get the device_t from nexus? > > Is there a get_nexus() function somewhere? > > You can do it this way: > > devclass_t nexusdc = devclass_find("nexus"); > device_t nexus = devclass_get_device(nexusdc, 0); > > It is in fact in the code path as "parent" in nexus_pcib_identify, > but not in the special PCI bridge identification function. If you > call BUS_ADD_CHILD at that time, you don't need to probe or attach > your device; it will be automatically probed and attached later and > you can whatever logic you want in your probe and attach routines. Thank you - I think that were they key parts missing. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 09:31:07 2003 Return-Path: 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 6ADEB37B401 for ; Wed, 6 Aug 2003 09:31:07 -0700 (PDT) Received: from marblerye.cs.uga.edu (marblerye.cs.uga.edu [128.192.101.172]) by mx1.FreeBSD.org (Postfix) with SMTP id 493DC43FA3 for ; Wed, 6 Aug 2003 09:31:06 -0700 (PDT) (envelope-from ecashin@uga.edu) Received: (qmail 14456 invoked from network); 6 Aug 2003 16:31:05 -0000 Received: from localhost (HELO uga.edu) (127.0.0.1) by 0 with SMTP; 6 Aug 2003 16:31:05 -0000 To: hackers@freebsd.org From: Ed L Cashin Date: Wed, 06 Aug 2003 12:31:04 -0400 Message-ID: <87he4uzr1z.fsf@uga.edu> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.2 (i386-debian-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: COW and mprotect on non-shared memory X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 16:31:07 -0000 Hi. I've noticed that in FreeBSD, the struct vm_map_entry has an eflags member that can have the MAP_ENTRY_COW bit set. In the vm_map_protect function, which is used by mprotect, it looks like this bit is used to determine whether or not to set the page table entries for write access or not: if (current->protection != old_prot) { #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, current->end, current->protection & MASK(current)); #undef MASK } ... so if this vm_map_entry describes a VM region that is set for COW, then the page table entries will not allow writes. If it's not COW, though, the page table entries will be set to allow writes. Is that correct so far? The reason I'm interested in this is that I'm doing some VM work on Linux, where they might have COW pages sprinkled throughout a VM region. The Linux VM region descriptor analogous to FreeBSD's vm_map_entry is the vm_area_struct, and it doesn't have any special bit for COW. In Linux, COW is recognizable only by the situation where for a given page in a region of VM, the vm_area_struct has the VM_WRITE bit set and the page table entry is write protected. For that reason, when you mprotect an area of non-shared, anonymous memory to no access and then back to writable, Linux has no way of knowing that the memory wasn't set for COW before you make it unwritable. It goes ahead and makes all the pages in the area COW. That means that if I do this: for (i = 0; i < n; ++i) { assert(!mprotect(p, pgsiz, PROT_NONE)); assert(!mprotect(p, pgsiz, PROT_READ|PROT_WRITE|PROT_EXEC)); p[i] = i & 0xff; } ... I get n minor page faults! Pretty amazing, but I guess they figured nobody does that. More surprising is that the same test program has the same behavior on FreeBSD. (At least, the "/usr/bin/time -l ..." output shows the number of page reclaims increasing at the same rate that I increase the value of n in the loop.) I thought that in FreeBSD any COW area would have its own vm_map_entry with the MAP_ENTRY_COW bit set. That way, you could run this test without any minor faults at all. Now I suspect I was incorrect. Could anyone help clarify the situation for me? Thanks. -- --Ed L Cashin | PGP public key: ecashin@uga.edu | http://noserose.net/e/pgp/ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 10:05:32 2003 Return-Path: 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 4806F37B404 for ; Wed, 6 Aug 2003 10:05:32 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 359CC43FAF for ; Wed, 6 Aug 2003 10:05:31 -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.9) with ESMTP id h76H5IjX007219; Wed, 6 Aug 2003 10:05:19 -0700 (PDT) (envelope-from das@freebsd.org) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h76H5HtJ007218; Wed, 6 Aug 2003 10:05:17 -0700 (PDT) (envelope-from das@freebsd.org) Date: Wed, 6 Aug 2003 10:05:17 -0700 From: David Schultz To: Jan Grant Message-ID: <20030806170517.GA6961@HAL9000.homeunix.com> Mail-Followup-To: Jan Grant , Roderick van Domburg , freebsd-hackers References: <20030806044351.GA3881@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-hackers cc: Roderick van Domburg Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 17:05:32 -0000 On Wed, Aug 06, 2003, Jan Grant wrote: > On Tue, 5 Aug 2003, David Schultz wrote: > > > 100 Hz works just fine for > > interactive jobs; humans can't tell the difference.[1] > > They can if they're using X :-) I gave Denim* a trial recently; it was > unusable at 100Hz and fine at 1000. Yes, polling a tablet device is an interesting case where it matters. If you reread my last message carefully, you'll noticed that I suggested bumping up the default HZ a bit, since the overhead appears to be well into the noise even at 500 Hz. An alternative would be to implement a high-resolution timer facility similar to the Solaris cyclics implementation. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 12:39:20 2003 Return-Path: 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 3B78437B401 for ; Wed, 6 Aug 2003 12:39:20 -0700 (PDT) Received: from mail1.co.ru (mail1.co.ru [194.85.128.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 02C7E43F93 for ; Wed, 6 Aug 2003 12:39:19 -0700 (PDT) (envelope-from freebsd1@centrum.cz) Received: from mailhub.co.ru ([194.85.128.15] verified) by mail1.co.ru (CommuniGate Pro SMTP 4.0.6) with ESMTP id 33763777 for freebsd-hackers@freebsd.org; Wed, 06 Aug 2003 23:39:17 +0400 Received: from PINGA (n3-36.dialup.co.ru [195.16.34.36]) by mailhub.co.ru (8.12.9/8.11.0) with ESMTP id h76JdFKv017590 for ; Wed, 6 Aug 2003 23:39:16 +0400 (MSD) Date: Wed, 6 Aug 2003 23:39:23 +0400 From: Buckie X-Mailer: The Bat! (v1.62r) X-Priority: 3 (Normal) Message-ID: <4310441759.20030806233923@centrum.cz> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: Ultra ATA card doesn't seem to provide Ultra speeds. - SOLVED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Buckie List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 19:39:20 -0000 Hello folks. Some of you may remember my trouble with SI0680-based ULTRADMA ATA controller card. Well, the problem was obvivously the faulty card. After replacing it works fine. I don't know what magic Soeren has put in the SI driver, but unlike Windows it never crashed, never hang, it even tried to use UDMA modes. So kudos to Soeren for writing quality drivers like that one. I also remember Peter Kiesser has had some issues with drives falling back to PIO with SIS controller. I had this too on the drive that FreeBSD5.1_RELEASE used to start from. So now we know this can be an issue with a broken controller. (It doesn't fall back to PIO here after replacement is made). Again, thanks to Soeren it just magically worked (as best as it could obvivously) in spite of all the fish. That's all! Z From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 12:59:51 2003 Return-Path: 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 DCCAA37B401 for ; Wed, 6 Aug 2003 12:59:51 -0700 (PDT) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 889D943F3F for ; Wed, 6 Aug 2003 12:59:46 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.12.9/8.12.6) with ESMTP id h76Jxg35027367 for ; Wed, 6 Aug 2003 12:59:43 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.12.9/8.12.6) with ESMTP id h76Jxg7N068621 for ; Wed, 6 Aug 2003 12:59:42 -0700 (PDT) (envelope-from frank@realtime.exit.com) Received: (from frank@localhost) by realtime.exit.com (8.12.9/8.12.9/Submit) id h76JxghJ068620 for hackers@freebsd.org; Wed, 6 Aug 2003 12:59:42 -0700 (PDT) From: Frank Mayhar Message-Id: <200308061959.h76JxghJ068620@realtime.exit.com> To: hackers@freebsd.org Date: Wed, 6 Aug 2003 12:59:42 -0700 (PDT) X-Copyright0: Copyright 2003 Frank Mayhar. All Rights Reserved. X-Copyright1: Permission granted for electronic reproduction as Usenet News or email only. X-Mailer: ELM [version 2.4ME+ PL99f (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM1060199982-68449-1_ Content-Transfer-Encoding: 7bit Subject: USB versus SMP and Epson printers. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: frank@exit.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 19:59:52 -0000 --ELM1060199982-68449-1_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII On Monday I received my brand-new Epson C82, a replacement for a 900N with a dead print head. I had already configured CUPS so I imagined that I would just hook it up with USB and everything would be happy. Well, that's not how it turned out. I tried two different machines, both with Tyan dual-CPU motherboards. One is a Thunder 2500 (S1867) with dual PIII 866, my gateway/fax/server box and the one I preferred. The other is my main desktop box, a Tiger MPX (2466N-4M) with dual Athlon MP 1900+. Both displayed essentially the same problem, although the Tiger MPX seemed to come a little bit closer to working than the Thunder 2500. Basically, although usbdevs would show the device, when I tried to do, say, an 'escputil -s -r /dev/ulpt0' (to show the ink levels), the process would seem to send something to the printer (I say "seem to" because I saw no evidence of it on the printer side), then sit in the USB code forever, timing out and looping. On the Tiger MPX I did see the "port disabled" message when I connected the printer (although nothing when I disconnected it). The Thunder 2500 didn't do that much. I've attached the dmesg from the Thunder 2500; I don't have one handy for the MPX. If anyone can give me any hints about this, I would be very grateful. Thanks. -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/ --ELM1060199982-68449-1_ Content-Transfer-Encoding: 7bit Content-Type: text/plain Content-Disposition: attachment; filename=TINKER.dmesg Content-Description: Copyright (c) 1992-2003 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.8-STABLE #1: Mon Aug 4 14:54:45 PDT 2003 frank@tinker.exit.com:/usr/src/sys/compile/TINKER Timecounter "i8254" frequency 1193182 Hz CPU: Intel Pentium III (868.64-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x686 Stepping = 6 Features=0x383fbff real memory = 2147483648 (2097152K bytes) avail memory = 2087452672 (2038528K bytes) Programming 16 pins in IOAPIC #0 IOAPIC #0 intpin 2 -> irq 0 Programming 16 pins in IOAPIC #1 FreeBSD/SMP: Multiprocessor motherboard: 2 CPUs cpu0 (BSP): apic id: 1, version: 0x00040011, at 0xfee00000 cpu1 (AP): apic id: 0, version: 0x00040011, at 0xfee00000 io0 (APIC): apic id: 2, version: 0x000f0011, at 0xfec00000 io1 (APIC): apic id: 3, version: 0x000f0011, at 0xfec01000 Preloaded elf kernel "kernel" at 0xc0406000. Pentium Pro MTRR support enabled Using $PIR table, 12 entries at 0xc00fdf00 npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard IOAPIC #1 intpin 13 -> irq 2 IOAPIC #1 intpin 12 -> irq 16 IOAPIC #1 intpin 0 -> irq 17 IOAPIC #1 intpin 2 -> irq 18 IOAPIC #1 intpin 4 -> irq 19 IOAPIC #1 intpin 7 -> irq 20 pci0: on pcib0 pci0: (vendor=0x1166, dev=0x0005) at 0.1 sym0: <896> port 0xf800-0xf8ff mem 0xfeafe000-0xfeafffff,0xfeaf8c00-0xfeaf8fff irq 2 at device 1.0 on pci0 sym0: Symbios NVRAM, ID 7, Fast-40, SE, parity checking sym0: open drain IRQ line driver, using on-chip SRAM sym0: using LOAD/STORE-based firmware. sym0: handling phase mismatch from SCRIPTS. sym1: <896> port 0xf400-0xf4ff mem 0xfeafc000-0xfeafdfff,0xfeaf8800-0xfeaf8bff irq 16 at device 1.1 on pci0 sym1: Symbios NVRAM, ID 7, Fast-40, SE, parity checking sym1: open drain IRQ line driver, using on-chip SRAM sym1: using LOAD/STORE-based firmware. sym1: handling phase mismatch from SCRIPTS. pci0: (vendor=0x11cb, dev=0x2000) at 3.0 irq 17 tl0: port 0xfc90-0xfc9f mem 0xfeafbc00-0xfeafbc0f irq 18 at device 4.0 on pci0 tl0: Ethernet address: 00:08:c7:b1:93:c3 miibus0: on tl0 nsphy0: on miibus0 nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto tlphy0: on miibus0 tlphy0: 10base2/BNC, 10base5/AUI fxp0: port 0xfca0-0xfcbf mem 0xfe800000-0xfe8fffff,0xfceff000-0xfcefffff irq 19 at device 5.0 on pci0 fxp0: Ethernet address 00:90:27:1c:5e:6a inphy0: on miibus1 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp1: port 0xfcc0-0xfcff mem 0xfe900000-0xfe9fffff,0xfeaf7000-0xfeaf7fff irq 20 at device 7.0 on pci0 fxp1: Ethernet address 00:e0:81:01:ff:6c inphy1: on miibus2 inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto isab0: at device 15.0 on pci0 isa0: on isab0 pci0: at 15.1 ohci0: mem 0xfeaf6000-0xfeaf6fff irq 17 at device 15.2 on pci0 usb0: OHCI version 1.0, legacy support usb0: on ohci0 usb0: USB revision 1.0 uhub0: (0x1166) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 4 ports with 4 removable, self powered pcib1: on motherboard IOAPIC #1 intpin 1 -> irq 21 pci1: on pcib1 pci1: at 0.0 irq 21 pcib2: on motherboard IOAPIC #1 intpin 8 -> irq 22 IOAPIC #1 intpin 10 -> irq 23 pci2: on pcib2 tl1: port 0xf0b0-0xf0bf mem 0xefeffc00-0xefeffc0f irq 22 at device 1.0 on pci2 tl1: Ethernet address: 00:08:c7:28:52:93 miibus3: on tl1 nsphy1: on miibus3 nsphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto tlphy1: on miibus3 tlphy1: 10base2/BNC, 10base5/AUI fxp2: port 0xf040-0xf07f mem 0xefec0000-0xefedffff,0xefefe000-0xefefefff irq 23 at device 2.0 on pci2 fxp2: Ethernet address 00:02:b3:33:59:5f inphy2: on miibus4 inphy2: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto orm0: