From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 01:55: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 46F8616A4CE for ; Sun, 16 Nov 2003 01:55:32 -0800 (PST) Received: from mbox2.netikka.net (mbox2.netikka.net [213.250.81.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 932DF43FB1 for ; Sun, 16 Nov 2003 01:55:31 -0800 (PST) (envelope-from markus.niemisto@iki.fi) Received: from ogorod (fh181.netikka.fi [81.209.123.181]) by mbox2.netikka.net (Postfix) with SMTP id 8AF6B35C08F for ; Sun, 16 Nov 2003 11:55:30 +0200 (EET) Date: Sun, 16 Nov 2003 11:55:30 +0200 From: Markus =?ISO-8859-15?Q?Niemist=F6?= To: freebsd-hackers@freebsd.org Message-Id: <20031116115530.01e5be79.markus.niemisto@iki.fi> Organization: -=Die LocalWarez=- X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i386-unknown-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Loading a shared Linux library from a FreeBSD program? 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, 16 Nov 2003 09:55:32 -0000 Hi, Is there any way to load a shared Linux library from a FreeBSD program? I need to get one freeware (but not open source) library only available for Linux working with my native FreeBSD program. I hear there is somekind of a wrapper for Linux browser plugins. What kind of technique it uses? I believe I should first load Linux' libc and then the library I need. Could this work? And can I just dlopen /compat/linux/libc.so.6? Thanks, Markus Niemist=F6 From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 02:28:27 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 37B9916A4CE for ; Sun, 16 Nov 2003 02:28:27 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-63-207-60-234.dsl.lsan03.pacbell.net [63.207.60.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E55C43F93 for ; Sun, 16 Nov 2003 02:28:26 -0800 (PST) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id EA79366B80; Sun, 16 Nov 2003 02:28:25 -0800 (PST) Date: Sun, 16 Nov 2003 02:28:25 -0800 From: Kris Kennaway To: Markus Niemist? Message-ID: <20031116102825.GA8917@xor.obsecurity.org> References: <20031116115530.01e5be79.markus.niemisto@iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <20031116115530.01e5be79.markus.niemisto@iki.fi> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org Subject: Re: Loading a shared Linux library from a FreeBSD program? 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, 16 Nov 2003 10:28:27 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 16, 2003 at 11:55:30AM +0200, Markus Niemist? wrote: > Hi, >=20 > Is there any way to load a shared Linux library from a FreeBSD program? I don't think so. With a bit of effort, you can compile your source as a Linux binary on FreeBSD. This has been discussed a number of times in the past - see the mailing list archives. Kris --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/t1FJWry0BWjoQKURAqGdAKDAhnA1gFVtmYELe+PdamEYsuyFsgCeIDjF vj95LXWfD0eTuFT57FVCd0g= =iJe+ -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q-- From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 02:46: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 E47BF16A4CE for ; Sun, 16 Nov 2003 02:46:12 -0800 (PST) Received: from rubyfalls.dnsrouter.com (rubyfalls.dnsrouter.com [69.61.37.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C17EC43FE5 for ; Sun, 16 Nov 2003 02:46:11 -0800 (PST) (envelope-from websehri@rubyfalls.dnsrouter.com) Received: from websehri by rubyfalls.dnsrouter.com with local (Exim 4.24) id 1ALKPy-0002uh-37 for freebsd-hackers@freebsd.org; Sun, 16 Nov 2003 05:46:10 -0500 To: freebsd-hackers@freebsd.org Message-Id: From: websehri@rubyfalls.dnsrouter.com Date: Sun, 16 Nov 2003 05:46:10 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rubyfalls.dnsrouter.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [32084 32084] / [47 12] X-AntiAbuse: Sender Address Domain - rubyfalls.dnsrouter.com Subject: =?iso-8859-1?q?Websehri=2Ecom_A=E7=FDld=FD?= 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, 16 Nov 2003 10:46:13 -0000 www.websehri.com Websehri.com Acildi From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 02:52: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 B25FB16A4CE for ; Sun, 16 Nov 2003 02:52:31 -0800 (PST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id E080943F93 for ; Sun, 16 Nov 2003 02:52:29 -0800 (PST) (envelope-from doconnor@gsoft.com.au) Received: from midget.dons.net.au (ppp110-132.lns1.adl1.internode.on.net [150.101.110.132])hAGAqRTn023345; Sun, 16 Nov 2003 21:22:27 +1030 (CST) Received: from localhost (root@localhost.dons.net.au [127.0.0.1]) by midget.dons.net.au (8.12.9/8.12.9) with ESMTP id hAGAqPlT051341; Sun, 16 Nov 2003 21:22:25 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: Kris Kennaway , Markus Niemist? Date: Sun, 16 Nov 2003 21:22:24 +1030 User-Agent: KMail/1.5.3 References: <20031116115530.01e5be79.markus.niemisto@iki.fi> <20031116102825.GA8917@xor.obsecurity.org> In-Reply-To: <20031116102825.GA8917@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311162122.24541.doconnor@gsoft.com.au> X-Spam-Score: -5 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.26 (www . roaringpenguin . com / mimedefang) cc: freebsd-hackers@freebsd.org Subject: Re: Loading a shared Linux library from a FreeBSD program? 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, 16 Nov 2003 10:52:31 -0000 On Sunday 16 November 2003 20:58, Kris Kennaway wrote: > > Is there any way to load a shared Linux library from a FreeBSD program? > > I don't think so. With a bit of effort, you can compile your source > as a Linux binary on FreeBSD. This has been discussed a number of > times in the past - see the mailing list archives. Hmm, well I think you CAN do it - the flash wrapper (www/flashpluginwrapper) does it. There be dragons, voodoo etc.. Probably easier to write a wrapper linux program and talk to it over a pipe :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 04:40: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 C686516A4CF; Sun, 16 Nov 2003 04:40:07 -0800 (PST) Received: from oneplusone.ch (oneplusone.ch [212.55.208.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 825A543F75; Sun, 16 Nov 2003 04:40:05 -0800 (PST) (envelope-from ast@marabu.ch) Received: from oneplusone.ch (localhost [127.0.0.1]) by oneplusone.ch (8.12.9p1/8.12.9) with ESMTP id hAGCe3i3035152; Sun, 16 Nov 2003 13:40:03 +0100 (MET) (envelope-from ast@marabu.ch) Received: (from uucp@localhost) by oneplusone.ch (8.12.9p1/8.12.9/Submit) with UUCP id hAGCe3Ya035151; Sun, 16 Nov 2003 13:40:03 +0100 (MET) (envelope-from ast@marabu.ch) Received: from marabu.marabu.ch (marabu.marabu.ch [192.168.21.3]) by nano.marabu.ch (8.12.9/8.12.9) with ESMTP id hAGCXvuv071131; Sun, 16 Nov 2003 13:33:58 +0100 (MET) (envelope-from ast@marabu.marabu.ch) Received: by marabu.marabu.ch (8.7.5/20001028-ast-8.3) id NAA27227; Sun, 16 Nov 2003 13:33:56 +0100 (CET) Message-Id: <200311161233.NAA27227@marabu.marabu.ch> MIME-Version: 1.0 (NeXT Mail 3.3 v124.8483.6) Content-Type: text/plain In-Reply-To: <3FB6EB4D.8050901@soekris.com> X-Nextstep-Mailer: Mail 3.3 (Enhance 2.0b6) Received: by NeXT.Mailer (1.124.8483.6) From: Adrian Steinmann Date: Sun, 16 Nov 2003 13:33:53 +0100 To: Soren Kristensen References: <32365.1068624044@critter.freebsd.dk> <3FB281B4.5060105@soekris.com> <200311160131.CAA21864@marabu.marabu.ch> <3FB6EB4D.8050901@soekris.com> X-Organization: Webgroup Consulting AG, Apollostrasse 21, 8032 Zurich X-Phone-Numbers: Switzerland, Tel +41 1 380 30 83 Fax +41 1 380 30 85 cc: Poul-Henning Kamp cc: hackers@freebsd.org cc: msmith@freebsd.org Subject: Re: BTX loader reboot on Soekris comBIOS1.22 fails (patches for btx.s and loader/main.c enclosed) 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, 16 Nov 2003 12:40:07 -0000 Soren We seem to have localized the loader reboot hang back to the first far jump happening in btx.s: observed: > warm boot (writes 0x1234 to 0x472) and then jumps to the BIOS reboot > handler: > - ljmp $0xffff,$0x0 # reboot the machine > > however in various literature it is mentioned that $0xf000,$0xfff0 > is bound to work better on most platforms, so I tried > + ljmp $0xf000,$0xfff0 # reboot the machine > > which indeed works! (OpenBSD, for example, uses ljmp $0xf000,$0xfff0). replied: The reason is that on some hardware (t.ex the Geode) there need to be work done early on in the BIOS to enable access to the BIOS in low memory before that first far jump, and therefore the first jump is not a far jump as on the original PC, but a near jump. Having the segment set at FFFF can screw up that first near jump.... This is exactly what I have read in the book "The Undocumented PC" by Frank van Gilluwe, 1st ed., Addison Wesley 1994, ISBN 0-201-62277-7, p91ff. In there, he also says that using INT19 or jumping to BIOS boot f000:ffff are "misconceptions" and that software control (keyboard reset) should be used whenever possible (hence both of my patches). I will wait for feedback from some Cc: people and if required, submit PRs to fix btx.s and loader/main.c. then opined: So the ljmp $0xf000,$0xfff0 would be the best way, but since my BIOS patches F000:FFF0 after copying the BIOS from flash to ram, I could also change my near jump to a far jump to increase compatibility.... Both! FreeBSD should fix the jmp in btx.s and you could do an initial far jump for increased compatibility. Adrian From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 07:53: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 1E33816A4CF for ; Sun, 16 Nov 2003 07:53:31 -0800 (PST) Received: from web21409.mail.yahoo.com (web21409.mail.yahoo.com [216.136.232.79]) by mx1.FreeBSD.org (Postfix) with SMTP id 1305F43FBD for ; Sun, 16 Nov 2003 07:53:30 -0800 (PST) (envelope-from zkzklj@yahoo.com) Message-ID: <20031116155330.42894.qmail@web21409.mail.yahoo.com> Received: from [129.130.5.229] by web21409.mail.yahoo.com via HTTP; Sun, 16 Nov 2003 07:53:30 PST Date: Sun, 16 Nov 2003 07:53:30 -0800 (PST) From: Kai Zhu To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Questions on intercepting execve syscall 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, 16 Nov 2003 15:53:31 -0000 Hello all, I am writing a KLD module to intercept execve() as following: static int my_execve(struct thread *td, struct execve_args *uap) { return(execve(td,uap)); } As you can see, I first just want to make sure that my_execve won't affect the original execve, then I will add some new logic in my_execve before returning to execve(). After kldload with this module, I always get "Bad address" error if I use any command like ls, cd, etc. Does anyone know where my problem is? Thanks! --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 10:24: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 1950A16A4CF; Sun, 16 Nov 2003 10:24:50 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB2CD43FAF; Sun, 16 Nov 2003 10:24:48 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id hAGIOjfO028872; Sun, 16 Nov 2003 19:24:45 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Adrian Steinmann From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 16 Nov 2003 13:33:53 +0100." <200311161233.NAA27227@marabu.marabu.ch> Date: Sun, 16 Nov 2003 19:24:45 +0100 Message-ID: <28871.1069007085@critter.freebsd.dk> cc: hackers@freebsd.org cc: msmith@freebsd.org Subject: Re: BTX loader reboot on Soekris comBIOS1.22 fails (patches for btx.s and loader/main.c enclosed) 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, 16 Nov 2003 18:24:50 -0000 In message <200311161233.NAA27227@marabu.marabu.ch>, Adrian Steinmann writes: >Soren > >We seem to have localized the loader reboot hang back to the first >far jump happening in btx.s: > > observed: > > warm boot (writes 0x1234 to 0x472) and then jumps to the BIOS reboot > > handler: > > - ljmp $0xffff,$0x0 # reboot the machine > > > > however in various literature it is mentioned that $0xf000,$0xfff0 > > is bound to work better on most platforms, so I tried > > + ljmp $0xf000,$0xfff0 # reboot the machine > > > > which indeed works! (OpenBSD, for example, uses ljmp $0xf000,$0xfff0). committed to FreeBSD -current. -- 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 Nov 16 12:13:22 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 09C0E16A4CE for ; Sun, 16 Nov 2003 12:13:22 -0800 (PST) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.FreeBSD.org (Postfix) with SMTP id 159D843FBF for ; Sun, 16 Nov 2003 12:13:20 -0800 (PST) (envelope-from murat@enderunix.org) Received: (qmail 26746 invoked by uid 1002); 16 Nov 2003 20:13:23 -0000 Date: Sun, 16 Nov 2003 22:13:23 +0200 From: Murat Balaban To: Kai Zhu Message-ID: <20031116201323.GA26716@enderunix.org> References: <20031116155330.42894.qmail@web21409.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031116155330.42894.qmail@web21409.mail.yahoo.com> cc: freebsd-hackers@freebsd.org Subject: Re: Questions on intercepting execve syscall 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, 16 Nov 2003 20:13:22 -0000 Hi, It might be that you have some bad address in the execve index of sysent array. See http://www.enderunix.org/murat/linux_subexec/linux_subexec.c for a simple example. PS: don't mind the naming :). On Sun, Nov 16, 2003 at 07:53:30AM -0800, Kai Zhu wrote: > Hello all, > > I am writing a KLD module to intercept execve() as following: > > static int my_execve(struct thread *td, struct execve_args *uap) > { > return(execve(td,uap)); > } > > As you can see, I first just want to make sure that my_execve won't affect the original execve, then I will add some new logic in my_execve before returning to execve(). > After kldload with this module, I always get "Bad address" error if I use any command like ls, cd, etc. > > Does anyone know where my problem is? Thanks! > > > --------------------------------- > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- "When all else fails, read the instructions -- Murphy's Technology Laws" Murat Balaban http://www.enderunix.org From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 13:27: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 E412F16A4CE for ; Sun, 16 Nov 2003 13:27:03 -0800 (PST) Received: from malasada.lava.net (malasada.lava.net [64.65.64.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3155143FDD for ; Sun, 16 Nov 2003 13:27:03 -0800 (PST) (envelope-from cliftonr@lava.net) Received: by malasada.lava.net (Postfix, from userid 102) id 89A28153AB2; Sun, 16 Nov 2003 11:27:02 -1000 (HST) Date: Sun, 16 Nov 2003 11:27:02 -1000 From: Clifton Royston To: Wes Peters Message-ID: <20031116112702.A3485@tikitechnologies.com> References: <20031114113705.D5759@tikitechnologies.com> <20031114214813.GA8188@freebie.xs4all.nl> <20031114125719.E5759@tikitechnologies.com> <200311152214.35765.wes@softweyr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200311152214.35765.wes@softweyr.com>; from wes@softweyr.com on Sat, Nov 15, 2003 at 10:14:35PM -0800 cc: hackers@freebsd.org Subject: Re: Observations on make release process? 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, 16 Nov 2003 21:27:04 -0000 On Sat, Nov 15, 2003 at 10:14:35PM -0800, Wes Peters wrote: > Patches or additions to existing documentation, or even just providing > text to one of our many dedicated doco contributors, would be greatly > appreciated. What can you do for FreeBSD today? ;^) That's all I needed to hear. I'll try to put some doc updates together as a starter. -- Clifton -- Clifton Royston -- cliftonr@tikitechnologies.com Tiki Technologies Lead Programmer/Software Architect Did you ever fly a kite in bed? Did you ever walk with ten cats on your head? Did you ever milk this kind of cow? Well we can do it. We know how. If you never did, you should. These things are fun, and fun is good. -- Dr. Seuss From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 13:51: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 9F86E16A4CE for ; Sun, 16 Nov 2003 13:51:46 -0800 (PST) Received: from web21407.mail.yahoo.com (web21407.mail.yahoo.com [216.136.232.77]) by mx1.FreeBSD.org (Postfix) with SMTP id 0528643FA3 for ; Sun, 16 Nov 2003 13:51:46 -0800 (PST) (envelope-from zkzklj@yahoo.com) Message-ID: <20031116215145.33059.qmail@web21407.mail.yahoo.com> Received: from [129.130.5.229] by web21407.mail.yahoo.com via HTTP; Sun, 16 Nov 2003 13:51:45 PST Date: Sun, 16 Nov 2003 13:51:45 -0800 (PST) From: Kai Zhu To: Murat Balaban In-Reply-To: <20031116201323.GA26716@enderunix.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: freebsd-hackers@freebsd.org Subject: Re: Questions on intercepting execve syscall 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, 16 Nov 2003 21:51:46 -0000 Thanks Murat! I have tried your example, and fixed the problem of my code accordingly. Murat Balaban wrote: Hi, It might be that you have some bad address in the execve index of sysent array. See http://www.enderunix.org/murat/linux_subexec/linux_subexec.c for a simple example. PS: don't mind the naming :). On Sun, Nov 16, 2003 at 07:53:30AM -0800, Kai Zhu wrote: > Hello all, > > I am writing a KLD module to intercept execve() as following: > > static int my_execve(struct thread *td, struct execve_args *uap) > { > return(execve(td,uap)); > } > > As you can see, I first just want to make sure that my_execve won't affect the original execve, then I will add some new logic in my_execve before returning to execve(). > After kldload with this module, I always get "Bad address" error if I use any command like ls, cd, etc. > > Does anyone know where my problem is? Thanks! > > > --------------------------------- > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- "When all else fails, read the instructions -- Murphy's Technology Laws" Murat Balaban http://www.enderunix.org --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 00:02: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 8366E16A4CE for ; Mon, 17 Nov 2003 00:02:29 -0800 (PST) Received: from host.server-23.net (host.server-23.net [64.191.95.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4590643FE3 for ; Mon, 17 Nov 2003 00:02:28 -0800 (PST) (envelope-from samy@kerneled.com) Received: from cpanel by host.server-23.net with local (Exim 4.24) id 1ALeKo-0005iE-OI; Mon, 17 Nov 2003 00:02:10 -0800 Received: from 212.138.47.26 ([212.138.47.26]) by www.kerneled.com (IMP) with HTTP for ; Mon, 17 Nov 2003 11:02:10 +0300 Message-ID: <1069056130.3fb8808299d19@www.kerneled.com> Date: Mon, 17 Nov 2003 11:02:10 +0300 From: Samy Al Bahra To: Murat Balaban References: <20031116155330.42894.qmail@web21409.mail.yahoo.com> <20031116201323.GA26716@enderunix.org> In-Reply-To: <20031116201323.GA26716@enderunix.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 212.138.47.26 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.server-23.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - kerneled.com cc: freebsd-hackers@freebsd.org cc: Kai Zhu Subject: Re: Questions on intercepting execve syscall 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, 17 Nov 2003 08:02:29 -0000 Quoting Murat Balaban : > It might be that you have some bad address in the execve index of sysent > array. This is likely. He could add a printf statement before calling the original execve just to be sure. > See http://www.enderunix.org/murat/linux_subexec/linux_subexec.c for a simple > example. This is 4.X specific (proc usage). I would just like to note that there is an execve symbol which you can reference in your code directly (rather than creating your own pointer for deinitialization). EX: -sysent[SYS_execve].sy_call = (sy_call_t *)oldexecve; +sysent[SYS_execve].sy_call = (sy_call_t *)execve; On Sun, Nov 16, 2003 at 07:53:30AM -0800, Kai Zhu wrote: [...] > > As you can see, I first just want to make sure that my_execve won't affect > the original execve, then I will add some new logic in my_execve before > returning to execve(). How exactly are you modifying the system call entry table? Are you modifying sysent even? -- +-----------------------------------+ | Samy Al Bahra | samy@kerneled.com | |-----------------------------------| | B3A7 F5BE B2AE 67B1 AC4B | | 0983 956D 1F4A AA54 47CB | |-----------------------------------| | http://www.kerneled.com | +-----------------------------------+ From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 03:13: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 8985F16A4CE for ; Mon, 17 Nov 2003 03:13:05 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31EB343F75 for ; Mon, 17 Nov 2003 03:13:04 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id B91EC530C; Mon, 17 Nov 2003 12:13:02 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 7E82F5308; Mon, 17 Nov 2003 12:12:50 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 173BC33C68; Mon, 17 Nov 2003 12:12:50 +0100 (CET) To: "Daniel O'Connor" References: <20031114113705.D5759@tikitechnologies.com> <200311151512.20032.doconnor@gsoft.com.au> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Mon, 17 Nov 2003 12:12:50 +0100 In-Reply-To: <200311151512.20032.doconnor@gsoft.com.au> (Daniel O'Connor's message of "Sat, 15 Nov 2003 15:12:19 +1030") 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: Clifton Royston cc: hackers@freebsd.org Subject: Re: Observations on make release process? 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, 17 Nov 2003 11:13:05 -0000 "Daniel O'Connor" writes: > but the way I do it is not 'normal' - I don't use the CVS repo > because I can't commit into that tree Be careful what you wish for :) DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 04:53:28 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 2707116A4CE for ; Mon, 17 Nov 2003 04:53:28 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 347CA43FCB for ; Mon, 17 Nov 2003 04:53:27 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id B03613ABB4E; Mon, 17 Nov 2003 13:51:41 +0100 (CET) Date: Mon, 17 Nov 2003 13:51:41 +0100 From: Pawel Jakub Dawidek To: Samy Al Bahra Message-ID: <20031117125141.GA511@garage.freebsd.pl> References: <20031116155330.42894.qmail@web21409.mail.yahoo.com> <20031116201323.GA26716@enderunix.org> <1069056130.3fb8808299d19@www.kerneled.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <1069056130.3fb8808299d19@www.kerneled.com> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: Murat Balaban cc: freebsd-hackers@freebsd.org cc: Kai Zhu Subject: Re: Questions on intercepting execve syscall 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, 17 Nov 2003 12:53:28 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 17, 2003 at 11:02:10AM +0300, Samy Al Bahra wrote: +> > See http://www.enderunix.org/murat/linux_subexec/linux_subexec.c for a= simple +> > example. +>=20 +> This is 4.X specific (proc usage). I would just like to note that there = is an=20 +> execve symbol which you can reference in your code directly (rather than= =20 +> creating your own pointer for deinitialization). +>=20 +> EX: +> -sysent[SYS_execve].sy_call =3D (sy_call_t *)oldexecve; +> +sysent[SYS_execve].sy_call =3D (sy_call_t *)execve; And if there are two modules that intercept execve(2)? Storing old value in dedicated pointer is correct. There still will be a problem when modules are loaded and unloaded in random order. Unload order have to be reverse load order, if not, invalid pointer (of module that was already unloaded) will be stored in sysent table. --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP7jEXT/PhmMH/Mf1AQEyzwP/UvhVFPSmgDJkpuDdBbPKi2CSrwlZkawL SHQNZPP6ihYJLqvv2FbSqNPZYjqIk4gbMSxBJh6EyZkNCDkTrX8ff7wiNf6Dy3jC PgLnh64vNsDEf3oK+yDwCA98yT9uu8PYzUsI+w8R968rj4W/U6TFkEeAnbnbsOyR 9WK6VOgATuM= =gqZy -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 04:58: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 E0CB316A4CE for ; Mon, 17 Nov 2003 04:58:36 -0800 (PST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id C45E843F3F for ; Mon, 17 Nov 2003 04:58:34 -0800 (PST) (envelope-from doconnor@gsoft.com.au) Received: from midget.dons.net.au (ppp110-132.lns1.adl1.internode.on.net [150.101.110.132])hAHCwRaG060900; Mon, 17 Nov 2003 23:28:28 +1030 (CST) Received: from localhost (root@localhost.dons.net.au [127.0.0.1]) by midget.dons.net.au (8.12.9/8.12.9) with ESMTP id hAHCwPlT068613; Mon, 17 Nov 2003 23:28:25 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Mon, 17 Nov 2003 23:28:24 +1030 User-Agent: KMail/1.5.3 References: <20031114113705.D5759@tikitechnologies.com> <200311151512.20032.doconnor@gsoft.com.au> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200311172328.24253.doconnor@gsoft.com.au> X-Spam-Score: -5 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_01_02,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.26 (www . roaringpenguin . com / mimedefang) cc: Clifton Royston cc: hackers@freebsd.org Subject: Re: Observations on make release process? 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, 17 Nov 2003 12:58:37 -0000 On Monday 17 November 2003 21:42, Dag-Erling Sm=F8rgrav wrote: > "Daniel O'Connor" writes: > > but the way I do it is not 'normal' - I don't use the CVS repo > > because I can't commit into that tree > > Be careful what you wish for :) Heheh.. I predict great bike sheds ahoy if I committed all my local patches 8-) =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 10:53:13 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 9EEBA16A4CE for ; Mon, 17 Nov 2003 10:53:13 -0800 (PST) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2643543FA3 for ; Mon, 17 Nov 2003 10:53:12 -0800 (PST) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id hAHIoArM043305 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Mon, 17 Nov 2003 21:50:10 +0300 (MSK) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id hAHImoqp043257 for ; (8.12.8/vak/2.1) Mon, 17 Nov 2003 21:48:50 +0300 (MSK) (envelope-from rik@cronyx.ru) Message-ID: <3FB918CE.4070002@cronyx.ru> Date: Mon, 17 Nov 2003 21:51:58 +0300 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030401 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: MAJOR number #2 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, 17 Nov 2003 18:53:13 -0000 -------- Original Message -------- Subject: MAJOR number Date: Fri, 14 Nov 2003 22:12:37 +0300 From: Roman Kurakin To: freebsd-hackers@freebsd.org Hi, I need a new MAJOR number for our new device. How can I get it? I've read that FreeBSD doesn't use them any more. But we may need it to not interfere with other device drivers in previous releases of FreeBSD. ??? ce Cronyx Tau-32 E1 adapter ___ Best regars, Roman Kurakin Cronyx Engineering http://www.cronyx.ru _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 11:22: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 C9E9916A4CE for ; Mon, 17 Nov 2003 11:22:53 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD8CA43FAF for ; Mon, 17 Nov 2003 11:22:52 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAHJMk1G014219; Mon, 17 Nov 2003 14:22:46 -0500 (EST) Date: Mon, 17 Nov 2003 14:22:46 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Roman Kurakin In-Reply-To: <3FB918CE.4070002@cronyx.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: MAJOR number #2 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, 17 Nov 2003 19:22:53 -0000 On Mon, 17 Nov 2003, Roman Kurakin wrote: > -------- Original Message -------- > Subject: MAJOR number > Date: Fri, 14 Nov 2003 22:12:37 +0300 > From: Roman Kurakin > To: freebsd-hackers@freebsd.org > > > Hi, > > I need a new MAJOR number for our new device. > How can I get it? > > I've read that FreeBSD doesn't use them any more. > But we may need it to not interfere with other device > drivers in previous releases of FreeBSD. > > ??? ce Cronyx Tau-32 E1 adapter You don't need them in -current. You might want to send this to -stable or -arch if noone responds. -- Dan Eischen From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 18:17: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 ECF3C16A4CE for ; Mon, 17 Nov 2003 18:17:52 -0800 (PST) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6698043FD7 for ; Mon, 17 Nov 2003 18:17:52 -0800 (PST) (envelope-from brett-brown@earthlink.net) Received: from user-0ccsijc.cable.mindspring.com ([24.206.74.108] helo=192.168.2.2) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1ALvR9-00042p-00 for freebsd-hackers@freebsd.org; Mon, 17 Nov 2003 18:17:51 -0800 From: "Brett L. Brown" To: freebsd-hackers@freebsd.org Date: Mon, 17 Nov 2003 20:18:13 -0600 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311172018.13263.brett-brown@earthlink.net> Subject: CVSUP error... 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, 18 Nov 2003 02:17:53 -0000 Hey! I'm looking for help on with a CVSUP problem. I'm trying to run CVSUP with a supfile, I'm typing: cvsup ports-supfile and receiving the following: Cannot get IP address of my own host -- is its hostname correct? I'm using the host cvsup7.FreeBSD.org (129.250.31.140). I've have also included this information in my /etc/hosts file. No worky. Any help would be great! brett From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 23:19: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 07C8416A4CE for ; Mon, 17 Nov 2003 23:19:12 -0800 (PST) Received: from dmz2.unixjunkie.com (adsl-65-70-175-250.dsl.rcsntx.swbell.net [65.70.175.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB62C43FE1 for ; Mon, 17 Nov 2003 23:19:08 -0800 (PST) (envelope-from strgout@unixjunkie.com) Received: from mail.unixjunkie.com (mail [10.253.254.36]) by dmz2.unixjunkie.com (8.12.8p2/8.12.8) with ESMTP id hAI7j9Gf074647 for ; Tue, 18 Nov 2003 01:45:09 -0600 (CST) (envelope-from strgout@mail.unixjunkie.com) Received: from mail.unixjunkie.com (mail [10.253.254.36]) by mail.unixjunkie.com (8.12.8p2/8.12.8) with ESMTP id hAI7j9mf074644 for ; Tue, 18 Nov 2003 01:45:09 -0600 (CST) (envelope-from strgout@mail.unixjunkie.com) Received: (from strgout@localhost) by mail.unixjunkie.com (8.12.8p2/8.12.8/Submit) id hAI7j869074643 for freebsd-hackers@freebsd.org; Tue, 18 Nov 2003 01:45:08 -0600 (CST) (envelope-from strgout) Date: Tue, 18 Nov 2003 01:45:08 -0600 From: John To: freebsd-hackers@freebsd.org Message-ID: <20031118074508.GA74626@mail.unixjunkie.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: pge.c, its a power thing! 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, 18 Nov 2003 07:19:12 -0000 Sooo.. is there any chance someone could take a look at this http://www.seanadams.com/pge/pge.c and tell me what needs to be done to port this, or maybe just give me some pointers so i can spend the next year working on this? :) I think the big problem (well for me) will be converting this from asm/io.h to something else. maybe ppi? If you want to see what the end result is check this out.. http://www.seanadams.com/pge/ i found this on a mrtg mailing list after looking around for something like what phk did to monitor his gas usage. From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 00:39:38 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 AE03F16A4CE for ; Tue, 18 Nov 2003 00:39:38 -0800 (PST) Received: from web21509.mail.yahoo.com (web21509.mail.yahoo.com [66.163.169.58]) by mx1.FreeBSD.org (Postfix) with SMTP id 1BB4443F93 for ; Tue, 18 Nov 2003 00:39:38 -0800 (PST) (envelope-from lucyloo168@yahoo.com) Message-ID: <20031118083937.63444.qmail@web21509.mail.yahoo.com> Received: from [129.130.5.229] by web21509.mail.yahoo.com via HTTP; Tue, 18 Nov 2003 00:39:37 PST Date: Tue, 18 Nov 2003 00:39:37 -0800 (PST) From: lucy loo To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Conflict between & ... ? 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, 18 Nov 2003 08:39:38 -0000 I am writing a kernel loadable module to reimplement some system calls. I have included , , etc. -- very standard header files for kld implmentation. I also want to do file i/o in this module, therefore I need to include . But it obviously conflicts with those , and make won't pass. Anyone knows how to fix this? Thanks! --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 01:19:19 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 3BD9216A4CE for ; Tue, 18 Nov 2003 01:19:19 -0800 (PST) Received: from freebsd.org.ru (www.freebsd.org.ru [194.84.67.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BDD943FAF for ; Tue, 18 Nov 2003 01:19:18 -0800 (PST) (envelope-from osa@freebsd.org.ru) Received: by freebsd.org.ru (Postfix, from userid 1000) id 64AAE1A9; Tue, 18 Nov 2003 12:19:16 +0300 (MSK) Date: Tue, 18 Nov 2003 12:19:16 +0300 From: "Sergey A. Osokin" To: "Brett L. Brown" Message-ID: <20031118091916.GA85661@freebsd.org.ru> References: <200311172018.13263.brett-brown@earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200311172018.13263.brett-brown@earthlink.net> User-Agent: Mutt/1.5.5.1i cc: freebsd-hackers@freebsd.org Subject: Re: CVSUP error... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: osa@FreeBSD.org.ru List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2003 09:19:19 -0000 On Mon, Nov 17, 2003 at 08:18:13PM -0600, Brett L. Brown wrote: > I'm looking for help on with a CVSUP problem. > > I'm trying to run CVSUP with a supfile, I'm typing: > > cvsup ports-supfile > > and receiving the following: > > Cannot get IP address of my own host -- is its hostname correct? > > I'm using the host cvsup7.FreeBSD.org (129.250.31.140). I've have > also included this information in my /etc/hosts file. > > No worky. Any help would be great! And your $ hostname is ... -- Rgdz, /"\ ASCII RIBBON CAMPAIGN Sergey Osokin aka oZZ, \ / AGAINST HTML MAIL http://ozz.pp.ru/ X AND NEWS / \ From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 03:38:04 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 C4AB716A4CE for ; Tue, 18 Nov 2003 03:38:04 -0800 (PST) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 997EE43FB1 for ; Tue, 18 Nov 2003 03:38:03 -0800 (PST) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 5E0DE65213; Tue, 18 Nov 2003 11:38:02 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 45050-01; Tue, 18 Nov 2003 11:38:02 +0000 (GMT) Received: from saboteur.dek.spc.org (unknown [82.147.19.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 789A7651F1; Tue, 18 Nov 2003 11:38:01 +0000 (GMT) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id F0BAD5; Tue, 18 Nov 2003 11:37:48 +0000 (GMT) Date: Tue, 18 Nov 2003 11:37:48 +0000 From: Bruce M Simpson To: lucy loo Message-ID: <20031118113748.GF87527@saboteur.dek.spc.org> Mail-Followup-To: lucy loo , freebsd-hackers@freebsd.org References: <20031118083937.63444.qmail@web21509.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031118083937.63444.qmail@web21509.mail.yahoo.com> cc: freebsd-hackers@freebsd.org Subject: Re: Conflict between & ... ? 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, 18 Nov 2003 11:38:04 -0000 On Tue, Nov 18, 2003 at 12:39:37AM -0800, lucy loo wrote: > I am writing a kernel loadable module to reimplement some system calls. I have included , , etc. -- very standard header files for kld implmentation. I also want to do file i/o in this module, therefore I need to include . But it obviously conflicts with those , and make won't pass. RTFM - particularly style(9), do not include userland headers in the kernel. BMS From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 04:39:10 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 EA86D16A4CE for ; Tue, 18 Nov 2003 04:39:10 -0800 (PST) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB1143FB1 for ; Tue, 18 Nov 2003 04:39:09 -0800 (PST) (envelope-from jilles@stack.nl) Received: from toad.stack.nl (zen.stack.nl [2001:610:1108:5010::130]) by mailhost.stack.nl (Postfix) with ESMTP id 501A61F001; Tue, 18 Nov 2003 13:39:08 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id 2E9B69A; Tue, 18 Nov 2003 13:39:08 +0100 (CET) Date: Tue, 18 Nov 2003 13:39:08 +0100 From: Jilles Tjoelker To: John Message-ID: <20031118123907.GA98199@stack.nl> References: <20031118074508.GA74626@mail.unixjunkie.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031118074508.GA74626@mail.unixjunkie.com> User-Agent: Mutt/1.5.5.1i cc: freebsd-hackers@freebsd.org Subject: Re: pge.c, its a power thing! 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, 18 Nov 2003 12:39:11 -0000 On Tue, Nov 18, 2003 at 01:45:08AM -0600, John wrote: > Sooo.. is there any chance someone could take a look at this > http://www.seanadams.com/pge/pge.c > and tell me what needs to be done to port this, or maybe just > give me some pointers so i can spend the next year working on > this? :) > I think the big problem (well for me) will be converting this > from asm/io.h to something else. maybe ppi? ppi would be more clean, but you can do it the same dirty way under FreeBSD as well. Use i386_set_ioperm() instead of ioperm(). See the manpage, although I think the arguments are the same. Use instead of (ignore the comment about , that's a kernel-only include file). Ignore the setuid crap in the webpage, of course. Just start it as root (that could be fixed if you used ppi). Be warned that I haven't tested any of this. -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 07:32: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 0273216A542 for ; Tue, 18 Nov 2003 07:32:49 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C2F04404B for ; Tue, 18 Nov 2003 07:30:17 -0800 (PST) (envelope-from freebsd-hackers@m.gmane.org) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AM7nz-0001XG-00 for ; Tue, 18 Nov 2003 16:30:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AM7lL-0001Vx-00 for ; Tue, 18 Nov 2003 16:27:31 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AM7lL-0008Ep-00 for ; Tue, 18 Nov 2003 16:27:31 +0100 From: Amit Date: Tue, 18 Nov 2003 10:27:45 -0500 Lines: 18 Message-ID: References: <200311172018.13263.brett-brown@earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org User-Agent: KNode/0.7.2 Sender: news Subject: Re: CVSUP error... 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, 18 Nov 2003 15:32:49 -0000 Brett L. Brown wrote: > Hey! > > I'm looking for help on with a CVSUP problem. > > I'm trying to run CVSUP with a supfile, I'm typing: > > cvsup ports-supfile > > and receiving the following: > > Cannot get IP address of my own host -- is its hostname correct? > > I'm using the host cvsup7.FreeBSD.org (129.250.31.140). I've have > also included this information in my /etc/hosts file. To clarify, is your own hostname in /etc/hosts? From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 08:53:34 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 4044416A4CE for ; Tue, 18 Nov 2003 08:53:34 -0800 (PST) Received: from blake.polstra.com (dsl081-189-066.sea1.dsl.speakeasy.net [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A9E643FE5 for ; Tue, 18 Nov 2003 08:53:33 -0800 (PST) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (dsl081-189-067.sea1.dsl.speakeasy.net [64.81.189.67]) by blake.polstra.com (8.12.9p2/8.12.9) with ESMTP id hAIGrC8b078635; Tue, 18 Nov 2003 08:53:12 -0800 (PST) (envelope-from jdp@polstra.com) 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: <200311172018.13263.brett-brown@earthlink.net> Date: Tue, 18 Nov 2003 08:53:12 -0800 (PST) From: John Polstra To: "Brett L. Brown" X-Bogosity: No, tests=bogofilter, spamicity=0.449932, version=0.14.5 cc: freebsd-hackers@freebsd.org Subject: RE: CVSUP error... 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, 18 Nov 2003 16:53:34 -0000 On 18-Nov-2003 Brett L. Brown wrote: > > I'm looking for help on with a CVSUP problem. > > I'm trying to run CVSUP with a supfile, I'm typing: > > cvsup ports-supfile > > and receiving the following: > > Cannot get IP address of my own host -- is its hostname correct? This problem is discussed in the CVSup FAQ at www.cvsup.org. John From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 09:00: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 725E316A4D2; Tue, 18 Nov 2003 09:00:41 -0800 (PST) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id B834643FF5; Tue, 18 Nov 2003 09:00:36 -0800 (PST) (envelope-from ljwu@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2657.72) id ; Tue, 18 Nov 2003 12:00:35 -0500 Message-ID: From: Loh John Wu To: "'freebsd-hackers@freebsd.org'" Date: Tue, 18 Nov 2003 12:00:33 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" cc: "'freebsd-questions@freebsd.org'" Subject: console redirection to serial in Freebsd 5.1 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, 18 Nov 2003 17:00:41 -0000 So I have a fresh install of FreeBSD 5.1 from a CD (ISO). Now I'm trying to turn on console redirection in my image, but I can't seem to get it to work properly. I read the article on turning on console redirection at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setu p.html but I think that doc was geared towards a 4.X release as it says that specific sio options need to be set in the kernel config file. However, reading the man page on the sio driver in 5.1-release man pages at http://www.freebsd.org/cgi/man.cgi?query=sio&apropos=0&sektion=0&manpath=Fre eBSD+5.1-RELEASE&format=html it seems that we just need to set those configs that used to be in the kernel conf file in 4.7 in the /boot/devices.hints file. So I've set these options in the hints file to turn on the serial redirection with the flag 0x90 hint.sio.0.at="isa" hint.sio.0.port="0x3F8" hint.sio.0.flags="0x90" hint.sio.0.irq="4" hint.sio.1.at="isa" hint.sio.1.port="0x2F8" hint.sio.1.irq="3" hint.sio.2.at="isa" hint.sio.2.disabled="1" hint.sio.2.port="0x3E8" hint.sio.2.irq="5" hint.sio.3.at="isa" hint.sio.3.disabled="1" hint.sio.3.port="0x2E8" hint.sio.3.irq="9" I've also set in the /boot.config file the -P flag to set the console to the serial console in the presence of a keyboard. and I've changed /etc/ttys to allow for the ttyd0 as well. I am using the generic FreeBSD 5.1 kernel with the generic 5.1 kernel config options, but from what I read, I think I can still enable serial console redirection with the generic kernel. Any ideas as to what I might be missing to have the redirection to teh serial console. Thanks, John From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 09:57: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 DADC216A4CE for ; Tue, 18 Nov 2003 09:57:43 -0800 (PST) Received: from mail.x123.info (165.Red-80-37-224.pooles.rima-tde.net [80.37.224.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83F3543FBF for ; Tue, 18 Nov 2003 09:57:41 -0800 (PST) (envelope-from esn@x123.info) Received: from x123.info (wlani.x123.info [192.168.1.4]) by mail.x123.info (Postfix) with ESMTP id DB6741707F for ; Tue, 18 Nov 2003 18:56:35 +0100 (CET) Date: Tue, 18 Nov 2003 18:56:56 +0100 From: "Sebastian Yepes F. [ESN]" To: freebsd-hackers@freebsd.org Message-Id: <20031118185656.3407a628.esn@x123.info> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: console redirection to serial in Freebsd 5.1 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, 18 Nov 2003 17:57:44 -0000 On Tue, 18 Nov 2003 12:00:33 -0500 Loh John Wu wrote: > So I have a fresh install of FreeBSD 5.1 from a CD (ISO). > > Now I'm trying to turn on console redirection in my image, but I can't seem > to get it to work properly. > > I read the article on turning on console redirection at > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setu > p.html > > but I think that doc was geared towards a 4.X release as it says that > specific sio options > need to be set in the kernel config file. > > However, reading the man page on the sio driver in 5.1-release man pages at > > http://www.freebsd.org/cgi/man.cgi?query=sio&apropos=0&sektion=0&manpath=Fre > eBSD+5.1-RELEASE&format=html > > it seems that we just need to set those configs that used to be in the > kernel conf file in 4.7 in the > /boot/devices.hints file. > > So I've set these options in the hints file to turn on the serial > redirection with the flag 0x90 > > hint.sio.0.at="isa" > hint.sio.0.port="0x3F8" > hint.sio.0.flags="0x90" > hint.sio.0.irq="4" > hint.sio.1.at="isa" > hint.sio.1.port="0x2F8" > hint.sio.1.irq="3" > hint.sio.2.at="isa" > hint.sio.2.disabled="1" > hint.sio.2.port="0x3E8" > hint.sio.2.irq="5" > hint.sio.3.at="isa" > hint.sio.3.disabled="1" > hint.sio.3.port="0x2E8" > hint.sio.3.irq="9" > > I've also set in the /boot.config file the -P flag to > set the console to the serial console in the presence of a keyboard. > > and I've changed /etc/ttys to allow for the ttyd0 as well. > > I am using the generic FreeBSD 5.1 kernel with the generic 5.1 kernel config > options, > but from what I read, I think I can still enable serial console redirection > with the generic kernel. > Any ideas as to what I might be missing to have the redirection to teh > serial console. > > Thanks, > John > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" echo "-h" >/boot.conf and you well have serial... -- if (Better You Treat Them) { return "Worst You Get Treated"; } I have a dream that one day this nation will rise up and live out the true meaning of its creed.. (Martin Luther King) /* FingerPrint: 0D42 F870 F650 6B86 CA9E E199 A57D 3824 F8AA A934 */ From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 12:49: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 EC91E16A4CE for ; Tue, 18 Nov 2003 12:49:44 -0800 (PST) Received: from ms-smtp-01-eri0.socal.rr.com (ms-smtp-01-qfe0.socal.rr.com [66.75.162.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2705243FBD for ; Tue, 18 Nov 2003 12:49:44 -0800 (PST) (envelope-from sean@mcneil.com) Received: from blue.mcneil.com (cpe-66-75-176-109.socal.rr.com [66.75.176.109])hAIKnev1011926 for ; Tue, 18 Nov 2003 12:49:41 -0800 (PST) Received: from [66.75.176.109] (mcneil.com [66.75.176.109]) by blue.mcneil.com (8.12.10/8.12.10) with ESMTP id hAIKnZUe076305 for ; Tue, 18 Nov 2003 12:49:36 -0800 (PST) (envelope-from sean@mcneil.com) From: Sean McNeil To: freebsd-hackers@freebsd.org Content-Type: text/plain Organization: Sean McNeil Consulting Message-Id: <1069188575.76277.8.camel@blue.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 18 Nov 2003 12:49:35 -0800 Content-Transfer-Encoding: 7bit X-DCC-Servercave-Metrics: blue.mcneil.com 1183; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: memory address space conversion 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, 18 Nov 2003 20:49:45 -0000 Hello all, I ask a while ago a question and received great response. I'm hoping to repeat the experience :) I have a driver that I cannot change the ioctl API to. Unfortunately, it has a peculiar need to return a user-space address based on the physical address. Here is the scenario: user calls mmap and gets a user-space mapping to a chunk of memory. user calls an ioctl that passes an array of user-space addresses inside that mapping. I had a hack working for the case of a single-threaded process, but it will not work in a threaded environment. Here is what I came up with: static vm_map_entry_t find_entry (vm_map_t map, vm_paddr_t address) { vm_map_entry_t entry; int i; for (i = 0, entry = &map->header; i < map->nentries; i++, entry = entry->next) { vm_page_t page; vm_paddr_t paddr; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) { vm_map_entry_t sub_entry = find_entry (entry->object.sub_map, address); if (! sub_entry) continue; entry = sub_entry; break; } if (entry->object.vm_object == NULL) continue; VM_OBJECT_LOCK (entry->object.vm_object); page = vm_page_lookup (entry->object.vm_object, OFF_TO_IDX(MMAP_OFFSET)); paddr = (page) ? VM_PAGE_TO_PHYS (page) : 0; VM_OBJECT_UNLOCK (entry->object.vm_object); if (paddr == address) break; } return (i < map->nentries) ? entry : NULL; } where MMAP_OFFSET is 0x40000000. This was the offset passed in by the mmap call. Does anyone know of a more proper mechanism that will work for the threaded model? Any and all assistance will be greatly appreciated. TIA, Sean From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 13:02:30 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 C5C2916A4CE for ; Tue, 18 Nov 2003 13:02:30 -0800 (PST) Received: from herbelot.dyndns.org (herbelot.net1.nerim.net [62.212.117.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id A625B43F85 for ; Tue, 18 Nov 2003 13:02:28 -0800 (PST) (envelope-from thierry@herbelot.com) Received: from diversion.herbelot.nom (diversion.herbelot.nom [192.168.2.6]) by herbelot.dyndns.org (8.12.9/8.12.9) with ESMTP id hAIKrYWg029937 for ; Tue, 18 Nov 2003 21:53:34 +0100 (CET) From: Thierry Herbelot To: hackers@freebsd.org Date: Tue, 18 Nov 2003 22:02:26 +0100 User-Agent: KMail/1.5.4 X-Warning: Windows can lose your files X-Op-Sys: Le FriBi de la mort qui tue X-Org: TfH&Co X-MailScanner: Found to be clean MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311182202.26160.thierry@herbelot.com> Subject: ICH5 + SATA + Seagate Barracuda 7200.7 ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: thierry@herbelot.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2003 21:02:30 -0000 Hello, I'm in the process of selecting new computers, and I'm tempted by an ASUS P4P800, with Seagate SATA disks. After googling a bit, it seems that the ICH5 is indeed supported in SATA mode from the 4.9-Release (perhaps also 5.1 ?) (at least the chip is correctly identified by ) The driver seems to be a bit fragile, if this message is to be relied on : Under Linux, the SATA support also is very recent : it should be included in 2.4.23 So the question is : is there some actual, positive, experience in using the above combination, and with which stability ? Cheers TfH From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 15:59: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 F09F016A4CE for ; Tue, 18 Nov 2003 15:59:20 -0800 (PST) Received: from cyclone.he.net (cyclone.he.net [64.62.230.2]) by mx1.FreeBSD.org (Postfix) with SMTP id 610EA43FDF for ; Tue, 18 Nov 2003 15:59:20 -0800 (PST) (envelope-from lists@battleface.com) Received: from battleface.com ([24.52.31.3]) by cyclone.he.net for ; Tue, 18 Nov 2003 15:59:18 -0800 Date: Tue, 18 Nov 2003 18:59:17 -0500 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: lists@battleface.com To: freebsd-hackers@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <383537BA-1A23-11D8-B220-000A95775140@battleface.com> X-Mailer: Apple Mail (2.552) Subject: mtime and directories... 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, 18 Nov 2003 23:59:21 -0000 Changing a file, of course, results in a change to its modification time. Am I correct in determining that the mtime of the enclosing directory is also updated? The reason I'm asking this is because I need to be able to determine if any file has changed within a directory from a shell script, Perl, or Python. All I need to know is if at least one file has changed. I don't need to find all such files. [Sidelight: anyone know how, if possible, to stop find after finding one file? I can't figure this one out alone.] My initial solution was to use 'find' to find any files newer than a marker file. However, I believe I've determined that the mtime of enclosing directories also changes to reflect the last file that was updated within its hierarchy. So, it makes sense that I simply check the directory that contains the marker file. Thanks, Alex From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 16:31: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 E8C8916A4CE for ; Tue, 18 Nov 2003 16:31:46 -0800 (PST) Received: from web11404.mail.yahoo.com (web11404.mail.yahoo.com [216.136.131.234]) by mx1.FreeBSD.org (Postfix) with SMTP id 89AB443FD7 for ; Tue, 18 Nov 2003 16:31:46 -0800 (PST) (envelope-from raysonlogin@yahoo.com) Message-ID: <20031119003133.18473.qmail@web11404.mail.yahoo.com> Received: from [65.49.82.34] by web11404.mail.yahoo.com via HTTP; Tue, 18 Nov 2003 16:31:32 PST Date: Tue, 18 Nov 2003 16:31:32 -0800 (PST) From: Rayson Ho To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: "secure" file flag? 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, 19 Nov 2003 00:31:47 -0000 I am wondering if it is useful to have a "secure" file flag?? The secure file flag will be set for files that contain sensitive data. Then the OS will take special care when operating on those "secure" files. e.g. when deleting a "secure" file, the OS will overwrite the file with random data. One advantage would be to have "secure" files in the same filesystem as other normal files. Any one knows if FreeBSD has already implemented this?? Thanks, Rayson __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 18:28:22 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 B7C0D16A4CE for ; Tue, 18 Nov 2003 18:28:22 -0800 (PST) Received: from episec.com (episec.com [198.78.65.141]) by mx1.FreeBSD.org (Postfix) with SMTP id F298543FA3 for ; Tue, 18 Nov 2003 18:28:21 -0800 (PST) (envelope-from edelkind-freebsd-hackers@episec.com) Received: (qmail 15100 invoked by uid 1024); 19 Nov 2003 02:28:09 -0000 Date: Tue, 18 Nov 2003 21:28:09 -0500 From: ari To: freebsd-hackers@freebsd.org Message-ID: <20031119022809.GF58437@episec.com> Mail-Followup-To: ari , freebsd-hackers@freebsd.org References: <383537BA-1A23-11D8-B220-000A95775140@battleface.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <383537BA-1A23-11D8-B220-000A95775140@battleface.com> Subject: Re: mtime and directories... 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, 19 Nov 2003 02:28:22 -0000 lists@battleface.com said this stuff: > Changing a file, of course, results in a change to its modification > time. Am I correct in determining that the mtime of the enclosing > directory is also updated? The mtime of a directory is updated when the directory "file" changes. Directory "file"s contain filenames and their associated inode numbers. Modify any of that information (e.g., create a new file, remove or rename an existing file), and the mtime will be changed. Changing the ctime or mtime of a file within a directory does not modify that of the directory itself. > The reason I'm asking this is because I need to be able to determine if > any file has changed within a directory from a shell script, Perl, or > Python. All I need to know is if at least one file has changed. I don't > need to find all such files. [Sidelight: anyone know how, if possible, > to stop find after finding one file? I can't figure this one out alone.] % find /some/dir |head -1 In this case, 'head' will exit after reading one line, causing 'find' to receive a SIGPIPE if it tries writing more data. The 'find' command doesn't typically trap SIGPIPE, so the process will exit. Of course, it won't receive the signal immediately --- only if it calls write(2) again, and on descriptor 1. If 'find' matches only one file, it will wind up seeking through the entire tree. This may not be sufficient for your application. To truly make find exit after it matches one file, you can do something along the lines of: % prescript find /some/dir -exec postscript '{}' \; ... where prescript contains a somewhat more error-tolerant version of the following: #!/bin/sh echo $$ >/pid/dir/find.pid exec $@ ... and postscript contains a somewhat more useful version of the following: #!/bin/sh dostuffwith $@ & pid=`cat /pid/dir/find.pid` rm -f /pid/dir/find.pid kill $pid > My initial solution was to use 'find' to find any files newer than a > marker file. However, I believe I've determined that the mtime of > enclosing directories also changes to reflect the last file that was > updated within its hierarchy. So, it makes sense that I simply check > the directory that contains the marker file. Again, a directory's modification time is updated only if the actual directory contents have changed, not the contents or inodes of the files within it. ari From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 18:35: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 71AA216A4CE for ; Tue, 18 Nov 2003 18:35:50 -0800 (PST) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49A9F43FB1 for ; Tue, 18 Nov 2003 18:35:49 -0800 (PST) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 04D49653D4; Wed, 19 Nov 2003 02:35:48 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 53967-01-2; Wed, 19 Nov 2003 02:35:47 +0000 (GMT) Received: from saboteur.dek.spc.org (unknown [82.147.19.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 82289653D8; Wed, 19 Nov 2003 02:35:47 +0000 (GMT) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 594791B; Wed, 19 Nov 2003 02:35:33 +0000 (GMT) Date: Wed, 19 Nov 2003 02:35:33 +0000 From: Bruce M Simpson To: Rayson Ho Message-ID: <20031119023533.GB90922@saboteur.dek.spc.org> Mail-Followup-To: Rayson Ho , freebsd-hackers@freebsd.org References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031119003133.18473.qmail@web11404.mail.yahoo.com> cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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, 19 Nov 2003 02:35:50 -0000 On Tue, Nov 18, 2003 at 04:31:32PM -0800, Rayson Ho wrote: > I am wondering if it is useful to have a "secure" file flag?? ... > e.g. when deleting a "secure" file, the OS will overwrite the file with > random data. I've got patches somewhere for zeroing out memory mappings in this way, but they are incomplete. :-( BMS From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 19:25: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 A04CB16A4CE for ; Tue, 18 Nov 2003 19:25:46 -0800 (PST) Received: from smtp.covadmail.net (mx05.covadmail.net [63.65.120.65]) by mx1.FreeBSD.org (Postfix) with SMTP id 7FBAD43F75 for ; Tue, 18 Nov 2003 19:25:45 -0800 (PST) (envelope-from strick@covad.net) Received: (covad.net 12873 invoked from network); 19 Nov 2003 03:25:40 -0000 Received: from unknown (HELO mist.nodomain) (67.101.100.205) by sun-qmail12 with SMTP; 19 Nov 2003 03:25:39 -0000 Received: from mist.nodomain (localhost [127.0.0.1]) by mist.nodomain (8.12.9p2/8.12.9) with ESMTP id hAJ3PaQV000881; Tue, 18 Nov 2003 19:25:37 -0800 (PST) (envelope-from dan@mist.nodomain) Received: (from dan@localhost) by mist.nodomain (8.12.9p2/8.12.9/Submit) id hAJ3PaJ2000880; Tue, 18 Nov 2003 19:25:36 -0800 (PST) (envelope-from dan) Date: Tue, 18 Nov 2003 19:25:36 -0800 (PST) From: Dan Strick Message-Id: <200311190325.hAJ3PaJ2000880@mist.nodomain> To: thierry@herbelot.com cc: hackers@freebsd.org cc: dan@mist.nodomain Subject: Re: ICH5 + SATA + Seagate Barracuda 7200.7 ? 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, 19 Nov 2003 03:25:46 -0000 >> > I'm in the process of selecting new computers, and I'm tempted by an > ASUS P4P800, with Seagate SATA disks. > > ... > > is there some actual, positive, experience in using the above combination, > and with which stability ? >> The ASUS P4P800 uses the Intel 865PE chipset. I have a Gigabyte 8KNXP which uses the Intel 875P chipset (almost the same thing) and a pair of Seagate ST3120026AS (120 GB Barracuda 7200.7) disks. They seem to work fine with FreeBSD 4.9-Release in either native or legacy mode even though 4.9-Release understands the ICH5 SATA controller only as yet another model of ICHx ATA controller. The driver thinks the disks are on an old 40 conductor IDE cable and tries to do dma at ATA33 speed, but the controller ignores the driver and runs at SATA150 rates. I used to operate the ICH5 SATA controller in native mode but had to switch to legacy mode because the AWARD BIOS won't boot off the controller in native mode. Legacy mode is less than ideal because the driver can't operate both drives at once. FreeBSD-current probably understands the SATA controller better than 4.9. I used to use 5.1-Release but had to give it up because it was just too flaky. (The rest of 5.1 was flaky. The 5.1 ATA driver seemed to work ok.) I have not attempted to upgrade to current because the traffic in current@freebsd.org suggests that it works correctly only on alternate weekdays. I have made no real attempt to stress the disk system. It seems to work. I have used it to install FreeBSD several times and caused hours of continuous disk activity building ports and running miscellaneous programs. I have noticed no hiccups. Dan Strick strick@covad.net From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 00:46:14 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 AD53C16A4CE for ; Wed, 19 Nov 2003 00:46:14 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 497B943F85 for ; Wed, 19 Nov 2003 00:46:13 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 421CC5309; Wed, 19 Nov 2003 09:46:12 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 7E7B25308 for ; Wed, 19 Nov 2003 09:46:02 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 1408533C65; Wed, 19 Nov 2003 09:46:02 +0100 (CET) To: hackers@freebsd.org From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Wed, 19 Nov 2003 09:46:02 +0100 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 Subject: interrupt statistics 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, 19 Nov 2003 08:46:14 -0000 ISTR there is a tool (other than systat -vmstat) that shows interrupt statistics for all interrupts, but I can't find anything except the hw.intrnames and hw.intrcnt sysctls, which aren't directly human- readable. Does anyone have any idea of what my deficient memory won't tell me? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 05:48:17 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 A273116A4CE for ; Wed, 19 Nov 2003 05:48:17 -0800 (PST) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id A2D5C43F93 for ; Wed, 19 Nov 2003 05:48:16 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 19 Nov 2003 13:48:16 +0000 (GMT) Date: Wed, 19 Nov 2003 13:48:14 +0000 From: David Malone To: des@des.no Message-ID: <20031119134814.GA5199@walton.maths.tcd.ie> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i Sender: dwmalone@maths.tcd.ie cc: hackers@freebsd.org Subject: Re: interrupt statistics 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, 19 Nov 2003 13:48:17 -0000 On Wed, Nov 19, 2003 at 09:46:02AM +0100, des@des.no wrote: > ISTR there is a tool (other than systat -vmstat) that shows interrupt > statistics for all interrupts, but I can't find anything except the > hw.intrnames and hw.intrcnt sysctls, which aren't directly human- > readable. Does anyone have any idea of what my deficient memory won't > tell me? Could vmstat -i be what you are thinking of? David. From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 06:48:04 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 1CA8416A4CF for ; Wed, 19 Nov 2003 06:48:04 -0800 (PST) Received: from shaft.techsupport.co.uk (shaft.techsupport.co.uk [212.250.77.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 190C343F85 for ; Wed, 19 Nov 2003 06:48:03 -0800 (PST) (envelope-from setantae@submonkey.net) Received: from cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com ([81.103.67.204] helo=shrike.submonkey.net ident=mailnull) by shaft.techsupport.co.uk with esmtp (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.24; FreeBSD 4.9) id 1AMTcf-000NPG-FW; Wed, 19 Nov 2003 14:48:01 +0000 Received: from setantae by shrike.submonkey.net with local (Exim 4.24; FreeBSD 4.9) id 1AMTcd-0000In-6w; Wed, 19 Nov 2003 14:47:59 +0000 Date: Wed, 19 Nov 2003 14:47:59 +0000 From: Ceri Davies To: Dag-Erling Sm?rgrav Message-ID: <20031119144759.GA66785@submonkey.net> Mail-Followup-To: Ceri Davies , Dag-Erling Sm?rgrav , hackers@freebsd.org References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.4i Sender: Ceri Davies cc: hackers@freebsd.org Subject: Re: interrupt statistics 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, 19 Nov 2003 14:48:04 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2003 at 09:46:02AM +0100, Dag-Erling Sm?rgrav wrote: > ISTR there is a tool (other than systat -vmstat) that shows interrupt > statistics for all interrupts, but I can't find anything except the > hw.intrnames and hw.intrcnt sysctls, which aren't directly human- > readable. Does anyone have any idea of what my deficient memory won't > tell me? Do you mean something other than vmstat -i? Ceri --=20 --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/u4KeocfcwTS3JF8RAtOfAJ9XY3S9uuxJbPE8BfBUo9gKFtQTbQCfW5Bp DGJ9Lp5ZJgSBqOBvXCdGFbQ= =BByt -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 07:33: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 30C4316A4CE for ; Wed, 19 Nov 2003 07:33:03 -0800 (PST) Received: from cyclone.he.net (cyclone.he.net [64.62.230.2]) by mx1.FreeBSD.org (Postfix) with SMTP id 9A98143FD7 for ; Wed, 19 Nov 2003 07:33:02 -0800 (PST) (envelope-from lists@battleface.com) Received: from battleface.com ([24.52.31.3]) by cyclone.he.net for ; Wed, 19 Nov 2003 07:33:01 -0800 Date: Wed, 19 Nov 2003 10:32:59 -0500 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) To: ari From: lists@battleface.com In-Reply-To: <20031119022809.GF58437@episec.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) cc: freebsd-hackers@freebsd.org Subject: Re: mtime and directories... 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, 19 Nov 2003 15:33:03 -0000 Thanks, Ari. This helps. I forgot to ask if this is documented anywhere. Kernel code is fine as long as I know where to look. Thanks, again. Alex On Tuesday, November 18, 2003, at 09:28 PM, ari wrote: > lists@battleface.com said this stuff: > >> Changing a file, of course, results in a change to its modification >> time. Am I correct in determining that the mtime of the enclosing >> directory is also updated? > > The mtime of a directory is updated when the directory "file" changes. > Directory "file"s contain filenames and their associated inode numbers. > Modify any of that information (e.g., create a new file, remove or > rename an existing file), and the mtime will be changed. Changing the > ctime or mtime of a file within a directory does not modify that of the > directory itself. > ------------------------------------------------------------- ALEXANDER SENDZIMIR Battleface Consulting 290 Marble Island Road 802 863 5502 Colchester, Vermont info@battleface.com From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 20:13:06 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 D161116A4CE; Wed, 19 Nov 2003 20:13:06 -0800 (PST) Received: from smtp3.sentex.ca (smtp3.sentex.ca [64.7.153.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93EDB43FCB; Wed, 19 Nov 2003 20:13:05 -0800 (PST) (envelope-from mike@sentex.net) Received: from smtp2.sentex.ca (smtp2c.sentex.ca [64.7.153.30]) by smtp3.sentex.ca (8.12.9p2/8.12.9) with ESMTP id hAK4D2m5033854; Wed, 19 Nov 2003 23:13:02 -0500 (EST) (envelope-from mike@sentex.net) Received: from BLUELAPIS.sentex.ca (cage.simianscience.com [64.7.134.1]) by smtp2.sentex.ca (8.12.9p2/8.12.9) with SMTP id hAK4D1Ln010412; Wed, 19 Nov 2003 23:13:02 -0500 (EST) (envelope-from mike@sentex.net) From: Mike Tancsa To: des@des.no (=?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?=) Date: Wed, 19 Nov 2003 23:13:03 -0500 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 04:13:06 -0000 Speaking of which, why is it some devices are not always present (same with systat -vmstat) eg on one machine v2% vmstat -i interrupt total rate stray irq7 2 0 hifn0 irq10 15680 0 fxp0 irq11 259067 2 mux irq15 378597 3 atkbd0 irq1 1 0 sio0 irq4 178 0 clk irq0 11466632 99 rtc irq8 14677398 127 Total 26797555 233 yet on another, offsite# vmstat -i interrupt total rate fxp0 irq11 29547828 61 mux irq15 453753 0 sio0 irq4 177 0 clk irq0 48204090 99 rtc irq8 61701185 127 Total 139907033 290 offsite#=20 offsite# dmesg | grep hifn hifn0 mem 0xe9802000-0xe9802fff,0xe9801000-0xe9801fff irq 10 at device 0.0 on pci1 hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions offsite#=20 How come the hifn does not show up ? I have noticed this with other devices as well ---Mike On Wed, 19 Nov 2003 09:46:02 +0100, in sentex.lists.freebsd.hackers you wrote: >ISTR there is a tool (other than systat -vmstat) that shows interrupt >statistics for all interrupts, but I can't find anything except the >hw.intrnames and hw.intrcnt sysctls, which aren't directly human- >readable. Does anyone have any idea of what my deficient memory won't >tell me? > >DES From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 20:49: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 F019D16A4CE for ; Wed, 19 Nov 2003 20:49:49 -0800 (PST) Received: from falcon.midgard.homeip.net (h76n3fls24o1048.bredband.comhem.se [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 15EDC43FBD for ; Wed, 19 Nov 2003 20:49:48 -0800 (PST) (envelope-from ertr1013@student.uu.se) Received: (qmail 45199 invoked by uid 1001); 20 Nov 2003 04:49:46 -0000 Date: Thu, 20 Nov 2003 05:49:45 +0100 From: Erik Trulsson To: Mike Tancsa Message-ID: <20031120044945.GA44933@falcon.midgard.homeip.net> Mail-Followup-To: Mike Tancsa , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , hackers@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 04:49:50 -0000 On Wed, Nov 19, 2003 at 11:13:03PM -0500, Mike Tancsa wrote: > Speaking of which, why is it some devices are not always present > (same with systat -vmstat) > > eg on one machine > v2% vmstat -i > interrupt total rate > stray irq7 2 0 > hifn0 irq10 15680 0 > fxp0 irq11 259067 2 > mux irq15 378597 3 > atkbd0 irq1 1 0 > sio0 irq4 178 0 > clk irq0 11466632 99 > rtc irq8 14677398 127 > Total 26797555 233 > > yet on another, > offsite# vmstat -i > interrupt total rate > fxp0 irq11 29547828 61 > mux irq15 453753 0 > sio0 irq4 177 0 > clk irq0 48204090 99 > rtc irq8 61701185 127 > Total 139907033 290 > offsite# > offsite# dmesg | grep hifn > hifn0 mem 0xe9802000-0xe9802fff,0xe9801000-0xe9801fff irq 10 at device > 0.0 on pci1 > hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions > offsite# > > How come the hifn does not show up ? I have noticed this with other > devices as well vmstat -i only displays those devices that have generated interrupts. I.e. if some device would have the total number of interrupts as 0, it will not be show by vmstat -i You will note that in your listings above, all the devices displayed have generated at least one interrupt. -- Erik Trulsson ertr1013@student.uu.se From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 21:26: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 3F7F616A4CE; Wed, 19 Nov 2003 21:26:11 -0800 (PST) Received: from monkeyflinger.anonymizer.com (monkeyflinger.anonymizer.com [168.143.113.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C09843FA3; Wed, 19 Nov 2003 21:26:10 -0800 (PST) (envelope-from rabbi@anonymizer.com) Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> Content-Transfer-Encoding: 7bit From: Len Sassaman Date: Wed, 19 Nov 2003 21:26:10 -0800 To: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.606) Subject: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Thu, 20 Nov 2003 05:26:11 -0000 Hi folks, I have a problem, and I am unable to find previous discussions of it. Any pointers or clues would be much appreciated. I have a FreeBSD 5.1 server that needs to be able to handle several thousand simultaneous ssh sessions from distinct users. (I am using FreeBSD 5.1 because I need to be able to support ldap authentication.) Hardware info: CPU: AMD Athlon(tm) MP 2000+ (1666.74-MHz 686-class CPU) real memory = 1610088448 (1535 MB) avail memory = 1558822912 (1486 MB) My version of ssh is 3.6.1p2 patched to address the security concerns. (I am not using 3.7.1p because it dropped support for password authentication with PAM, and I cannot assume keyboard-interactive authentication will be present in my users' clients.) All of these users are doing ssh port forwarding, and are not assigned ptys. I have not modified login.conf in any way -- the defaults of "no limits" remain. The kernel tunables in /boot/loader.conf are set to: kern.maxfiles="49312" kern.maxproc="24656" kern.maxprocperuid="11094" kern.ipc.maxsockets="24656" kern.ipc.somaxconn="8192" The kernel is compiled with NMBCLUSTERS=65536 and maxusers=0 (which defaults to 384). The problem is that after about 150 users log in (300ish sshd sessions, since I am using privsep), incoming connections start getting dropped. i.e., bash-2.05b# ssh -v localhost OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Rhosts Authentication disabled, originating port will not be trusted. debug1: Connecting to localhost [::1] port 22. socket: Protocol not supported debug1: Connecting to localhost [127.0.0.1] port 22. debug1: Connection established. debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host debug1: Calling cleanup 0x805f010(0x0) bash-2.05b# It is my intuition from this behavior that the sshd master process listening for connections is unable to spawn a new process to complete the authentication step, and thus the connection is being dropped. There is no information of use in dmesg, nor in the system logs. (I've cranked up LogLevel to DEBUG3 in sshd_config). I have a RedHat Linux server running the 2.4.18-3smp kernel on a dual Athlon MP 1800+ and 2048MB RAM that is known to handle 1000 users without issue -- so I have to believe the FreeBSD box, though not as beefy hardware-wise, should be able to do better than a few hundred users. I believe this to be some sort of resource limit issue, but I have addressed everything I could think of. Here's the sysctl vm.zone output: vm.zone: ITEM SIZE LIMIT USED FREE REQUESTS FFS2 dinode: 256, 0, 1089, 21, 1359 FFS1 dinode: 128, 0, 0, 0, 0 FFS inode: 144, 0, 1089, 59, 1359 SWAPMETA: 276, 121576, 0, 0, 0 unpcb: 140, 65548, 329, 63, 31364 ripcb: 228, 49317, 0, 0, 0 syncache: 136, 15370, 0, 58, 36747 tcptw: 48, 49385, 3812, 255, 89831 tcpcb: 360, 49313, 1048, 63, 195072 inpcb: 228, 49317, 4921, 94, 195072 udpcb: 228, 49317, 1, 33, 114497 socket: 256, 49320, 1383, 102, 340934 KNOTE: 64, 0, 0, 124, 114453 PIPE: 176, 0, 622, 68, 17402 DIRHASH: 1024, 0, 138, 6, 138 NAMEI: 1024, 0, 9, 11, 451791 VNODEPOLL: 76, 0, 0, 0, 0 VNODE: 292, 0, 1473, 35, 1473 g_bio: 144, 0, 259, 49, 186276 VMSPACE: 256, 0, 424, 26, 11035 UPCALL: 44, 0, 0, 0, 0 KSE: 64, 0, 496, 62, 496 KSEGRP: 120, 0, 496, 62, 496 THREAD: 292, 0, 496, 11, 496 PROC: 480, 0, 461, 35, 11074 Files: 60, 0, 6051, 153, 89241268 65536: 65536, 0, 3, 3, 3 32768: 32768, 0, 3, 3, 32 16384: 16384, 0, 56, 22, 1733 8192: 8192, 0, 2, 4, 50 4096: 4096, 0, 736, 44, 11965 2048: 2048, 0, 71, 5, 359215 1024: 1024, 0, 408, 20, 284756 512: 512, 0, 102, 18, 43908 256: 256, 0, 5166, 84, 131327 128: 128, 0, 6784, 253, 535182 64: 64, 0, 3032, 68, 87489 32: 32, 0, 2155, 182, 211243 16: 16, 0, 4485, 295, 844397 DP fakepg: 72, 0, 0, 0, 0 PV ENTRY: 28, 5324340, 347293, 45827, 7291251 MAP ENTRY: 60, 0, 27235, 89, 560399 KMAP ENTRY: 60, 32802, 817, 107, 22218 MAP: 176, 0, 8, 38, 6 VM OBJECT: 148, 0, 18751, 122, 318636 UMA Buckets: 512, 0, 741, 1, 0 UMA Hash: 128, 0, 1, 30, 0 UMA Slabs: 34, 0, 1092, 8, 0 UMA Zones: 284, 0, 48, 8, 0 Am I missing anything? Thanks, Len From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 04:02:17 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 4DAD016A4CE for ; Thu, 20 Nov 2003 04:02:17 -0800 (PST) Received: from firecrest.mail.pas.earthlink.net (firecrest.mail.pas.earthlink.net [207.217.121.247]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CDA743F3F for ; Thu, 20 Nov 2003 04:02:16 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfikl.dialup.mindspring.com ([165.247.202.149] helo=mindspring.com) by firecrest.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 1AMnVm-0006El-00; Thu, 20 Nov 2003 04:02:15 -0800 Message-ID: <3FBCACCE.B1537278@mindspring.com> Date: Thu, 20 Nov 2003 04:00:14 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: lucy loo References: <20031118083937.63444.qmail@web21509.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a435a33cbb9bcd211e2324aaef52a19a74666fa475841a1c7a350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: Conflict between & ... ? 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: Thu, 20 Nov 2003 12:02:17 -0000 lucy loo wrote: > I am writing a kernel loadable module to reimplement some system calls. > I have included , , etc. -- very standard > header files for kld implmentation. So far... > I also want to do file i/o in this module, therefore I need to include > . But it obviously conflicts with those , and make > won't pass. Anyone knows how to fix this? You cannot use libc functions in the kernel. The kernel does not link against libc. It is not an application, it is a kernel. There are some libc functions which are provided in the kernel; there are other libc functions for which there are similar kernel functions of the same name (e.g. "printf"), and there are some "libc" functions -- quoted because they aren't really there, but you can use them -- that are inlined by the compiler. Programming in the kernel environment is not the same as programming in the normal applications environment (the "POSIX" environment). -- Terry From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 04:59: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 3FB9D16A4CE; Thu, 20 Nov 2003 04:59:43 -0800 (PST) Received: from smtp3.sentex.ca (smtp3.sentex.ca [64.7.153.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11CED43F3F; Thu, 20 Nov 2003 04:59:40 -0800 (PST) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smtp3.sentex.ca (8.12.9p2/8.12.9) with ESMTP id hAKCxbm5007980; Thu, 20 Nov 2003 07:59:37 -0500 (EST) (envelope-from mike@sentex.net) Received: from simian.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.12.9p2/8.12.9) with ESMTP id hAKCxbUr025867; Thu, 20 Nov 2003 07:59:37 -0500 (EST) (envelope-from mike@sentex.net) Message-Id: <6.0.1.1.0.20031120075335.081474e0@209.112.4.2> X-Sender: mdtpop@209.112.4.2 (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Thu, 20 Nov 2003 08:03:43 -0500 To: Erik Trulsson From: Mike Tancsa In-Reply-To: <20031120044945.GA44933@falcon.midgard.homeip.net> References: <20031120044945.GA44933@falcon.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new cc: hackers@freebsd.org Subject: Re: interrupt statistics (broken hifn ?) 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: Thu, 20 Nov 2003 12:59:43 -0000 Hmmm Indeed this seems to be the case. I guess the next question is, what would cause the hifn card not to work in 3 machines despite showing up? hifn0@pci1:2:0: class=0x0b4000 card=0x00000000 chip=0x001213a3 rev=0x01 hdr=0x00 vendor = 'HI-FN Inc.' device = '7951 Security Processor' class = processor # sysctl -Ax hw.hifn hw.hifn.stats: Format:S,hifn_stats Length:76 Dump:0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 hw.hifn.maxbatch: 1 # dmesg | grep hifn hifn0 mem 0xe8411000-0xe8411fff,0xe8410000-0xe8410fff irq 14 at device 2.0 on pci1 hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions # vmstat -i interrupt total rate fxp0 irq11 29556405 57 mux irq15 457055 0 sio0 irq4 186 0 clk irq0 51379331 99 rtc irq8 65765489 127 Total 147158466 286 pseudo-device crypto # core crypto support pseudo-device cryptodev # /dev/crypto for access to h/w device hifn # Hifn 7951, 7781, etc. On another machine it doesnt show up I imagine because its a shared interrupt backup2# grep "irq 12" /var/run/dmesg.boot hifn0 mem 0xfa000000-0xfa000fff,0xfa800000-0xfa800fff irq 12 at device 15.0 on pci0 dc3: port 0x7800-0x787f mem 0xf8000000-0xf80003ff irq 12 at device 7.0 on pci2 backup2# vmstat -i interrupt total rate stray irq7 50 0 ata0 irq14 4673816 1 ata1 irq15 1196290 0 mux irq11 7628323 2 mux irq10 8999969 2 dc0 irq3 3 0 mux irq12 159117751 43 fdc0 irq6 1 0 sio0 irq4 787823 0 clk irq0 3618815078 1000 rtc irq8 463185486 128 Total 4264404590 1178 backup2# sysctl -Ax hw.hifn hw.hifn.stats: Format:S,hifn_stats Length:76 Dump:0xb0bd02a2c1000000b0bd02a2c1000000fa39f708fa39f70800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 hw.hifn.maxbatch: 1 backup2# ---Mike At 11:49 PM 19/11/2003, Erik Trulsson wrote: >On Wed, Nov 19, 2003 at 11:13:03PM -0500, Mike Tancsa wrote: > > Speaking of which, why is it some devices are not always present > > (same with systat -vmstat) > > > > eg on one machine > > v2% vmstat -i > > interrupt total rate > > stray irq7 2 0 > > hifn0 irq10 15680 0 > > fxp0 irq11 259067 2 > > mux irq15 378597 3 > > atkbd0 irq1 1 0 > > sio0 irq4 178 0 > > clk irq0 11466632 99 > > rtc irq8 14677398 127 > > Total 26797555 233 > > > > yet on another, > > offsite# vmstat -i > > interrupt total rate > > fxp0 irq11 29547828 61 > > mux irq15 453753 0 > > sio0 irq4 177 0 > > clk irq0 48204090 99 > > rtc irq8 61701185 127 > > Total 139907033 290 > > offsite# > > offsite# dmesg | grep hifn > > hifn0 mem 0xe9802000-0xe9802fff,0xe9801000-0xe9801fff irq 10 at device > > 0.0 on pci1 > > hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions > > offsite# > > > > How come the hifn does not show up ? I have noticed this with other > > devices as well > >vmstat -i only displays those devices that have generated interrupts. >I.e. if some device would have the total number of interrupts as 0, it >will not be show by vmstat -i >You will note that in your listings above, all the devices displayed >have generated at least one interrupt. > > > >-- > >Erik Trulsson >ertr1013@student.uu.se From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 05:19:10 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 5BB3E16A4CE for ; Thu, 20 Nov 2003 05:19:10 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 2B7D543FB1 for ; Thu, 20 Nov 2003 05:19:07 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 20117 invoked from network); 20 Nov 2003 13:17:35 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 20 Nov 2003 13:17:35 -0000 Received: (qmail 93310 invoked by uid 1000); 20 Nov 2003 13:19:03 -0000 Date: Thu, 20 Nov 2003 15:19:03 +0200 From: Peter Pentchev To: Mike Tancsa Message-ID: <20031120131903.GG300@straylight.m.ringlet.net> Mail-Followup-To: Mike Tancsa , Dag-Erling Sm?rgrav , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <20031120044945.GA44933@falcon.midgard.homeip.net> User-Agent: Mutt/1.5.5.1i cc: Dag-Erling Sm?rgrav cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 13:19:10 -0000 --VrqPEDrXMn8OVzN4 Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline --AqsLC8rIMeq19msA Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2003 at 05:49:45AM +0100, Erik Trulsson wrote: > On Wed, Nov 19, 2003 at 11:13:03PM -0500, Mike Tancsa wrote: > > Speaking of which, why is it some devices are not always present > > (same with systat -vmstat) > >=20 > > eg on one machine > > v2% vmstat -i > > interrupt total rate > > stray irq7 2 0 > > hifn0 irq10 15680 0 > > fxp0 irq11 259067 2 > > mux irq15 378597 3 > > atkbd0 irq1 1 0 > > sio0 irq4 178 0 > > clk irq0 11466632 99 > > rtc irq8 14677398 127 > > Total 26797555 233 > >=20 > > yet on another, > > offsite# vmstat -i > > interrupt total rate > > fxp0 irq11 29547828 61 > > mux irq15 453753 0 > > sio0 irq4 177 0 > > clk irq0 48204090 99 > > rtc irq8 61701185 127 > > Total 139907033 290 > > offsite#=20 > > offsite# dmesg | grep hifn > > hifn0 mem 0xe9802000-0xe9802fff,0xe9801000-0xe9801fff irq 10 at device > > 0.0 on pci1 > > hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions > > offsite#=20 > >=20 > > How come the hifn does not show up ? I have noticed this with other > > devices as well >=20 > vmstat -i only displays those devices that have generated interrupts. > I.e. if some device would have the total number of interrupts as 0, it > will not be show by vmstat -i > You will note that in your listings above, all the devices displayed > have generated at least one interrupt. This is easily fixed, e.g. by the attached. Note that I've only tested the RELENG_4 patch, my 5.x machine is out of commission for the next few days :( (and no, I couldn't test it on ref5 for obvious reasons related to /dev/mem ;) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 because I didn't think of a good beginning of it. --AqsLC8rIMeq19msA Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="vmstat-a-HEAD.patch" Content-Transfer-Encoding: quoted-printable Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.25 diff -u -r1.25 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 14 Apr 2003 07:22:25 -0000 1.25 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 12:23:59 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl fimsz +.Op Fl afimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -62,6 +62,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.69 diff -u -r1.69 vmstat.c --- src/usr.bin/vmstat/vmstat.c 9 Nov 2003 20:39:56 -0000 1.69 +++ src/usr.bin/vmstat/vmstat.c 20 Nov 2003 12:24:28 -0000 @@ -129,6 +129,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -174,8 +175,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -756,7 +760,7 @@ "rate"); inttotal =3D 0; while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -829,7 +833,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --AqsLC8rIMeq19msA Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="vmstat-a-RELENG_4.patch" Content-Transfer-Encoding: quoted-printable Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.16.2.5 diff -u -r1.16.2.5 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 16 Aug 2001 13:17:13 -0000 1.16.2.5 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 12:21:23 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl imsz +.Op Fl aimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -61,6 +61,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.38.2.5 diff -u -r1.38.2.5 vmstat.c --- src/usr.bin/vmstat/vmstat.c 20 Sep 2003 19:10:01 -0000 1.38.2.5 +++ src/usr.bin/vmstat/vmstat.c 20 Nov 2003 12:22:59 -0000 @@ -135,6 +135,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -169,8 +170,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -739,7 +743,7 @@ inttotal =3D 0; nintr /=3D sizeof(long); while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-12s %20lu %10lu\n", intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -917,7 +921,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --AqsLC8rIMeq19msA-- --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vL9H7Ri2jRYZRVMRAuCZAJkBbauemP3VdOGY+3v+kNMGUGRKsQCbBnBg FZwH9QJfvWTR9GzrExSimKI= =5yy0 -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4-- From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 06:00: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 C70FC16A4CE for ; Thu, 20 Nov 2003 06:00:12 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E52143FBD for ; Thu, 20 Nov 2003 06:00:09 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 974C65309; Thu, 20 Nov 2003 15:00:04 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 6A6F05308; Thu, 20 Nov 2003 14:59:55 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 525DF33C81; Thu, 20 Nov 2003 14:59:55 +0100 (CET) To: Mike Tancsa References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Thu, 20 Nov 2003 14:59:55 +0100 In-Reply-To: <20031120131903.GG300@straylight.m.ringlet.net> (Peter Pentchev's message of "Thu, 20 Nov 2003 15:19:03 +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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 14:00:12 -0000 Peter Pentchev writes: > This is easily fixed, e.g. by the attached. Note that I've only tested > the RELENG_4 patch, my 5.x machine is out of commission for the next few > days :( (and no, I couldn't test it on ref5 for obvious reasons related > to /dev/mem ;) Hmm, vmstat should uses sysctls, not /dev/mem. Perhaps you can make a patch for that too? :) DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 07:14: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 75E0616A4CE for ; Thu, 20 Nov 2003 07:14:32 -0800 (PST) Received: from zeta.uta.edu (zeta.uta.edu [129.107.56.16]) by mx1.FreeBSD.org (Postfix) with SMTP id 65E1B43F85 for ; Thu, 20 Nov 2003 07:14:31 -0800 (PST) (envelope-from dxb8335@exchange.uta.edu) Received: (from bennettlapdell [129.107.27.168]) by zeta.uta.edu (SAVSMTP 3.1.1.32) with SMTP id M2003112009143029190 for ; Thu, 20 Nov 2003 09:14:30 -0600 From: "David Bennett" To: Date: Thu, 20 Nov 2003 09:11:54 -0600 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000D_01C3AF46.576A6D70" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MS-TNEF-Correlator: X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: sign me up 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: Thu, 20 Nov 2003 15:14:32 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C3AF46.576A6D70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit David Bennett CSE@UTA Programming the Future!!! ------=_NextPart_000_000D_01C3AF46.576A6D70-- From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 07:37:09 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 8E8C616A4CE for ; Thu, 20 Nov 2003 07:37:09 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id B278543FDF for ; Thu, 20 Nov 2003 07:37:05 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 19290 invoked from network); 20 Nov 2003 15:35:28 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 20 Nov 2003 15:35:28 -0000 Received: (qmail 94936 invoked by uid 1000); 20 Nov 2003 15:36:55 -0000 Date: Thu, 20 Nov 2003 17:36:55 +0200 From: Peter Pentchev To: Dag-Erling Sm?rgrav Message-ID: <20031120153655.GI300@straylight.m.ringlet.net> Mail-Followup-To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h3LYUU6HlUDSAOzy" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1i cc: hackers@freebsd.org cc: Mike Tancsa Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 15:37:09 -0000 --h3LYUU6HlUDSAOzy Content-Type: multipart/mixed; boundary="f5QefDQHtn8hx44O" Content-Disposition: inline --f5QefDQHtn8hx44O Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2003 at 02:59:55PM +0100, Dag-Erling Sm?rgrav wrote: > Peter Pentchev writes: > > This is easily fixed, e.g. by the attached. Note that I've only tested > > the RELENG_4 patch, my 5.x machine is out of commission for the next few > > days :( (and no, I couldn't test it on ref5 for obvious reasons related > > to /dev/mem ;) >=20 > Hmm, vmstat should uses sysctls, not /dev/mem. Perhaps you can make a > patch for that too? :) Awwighty, attached is a patch that converts getuptime() and dointr() to use sysctl, and then adds the -a option to display all interrupts. This one was tested on both RELENG_4 and HEAD (ref5) :) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This would easier understand fewer had omitted. --f5QefDQHtn8hx44O Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="vmstat-sysctl-intr-HEAD.patch" Content-Transfer-Encoding: quoted-printable ? src/usr.bin/vmstat/.depend ? src/usr.bin/vmstat/vmstat ? src/usr.bin/vmstat/vmstat.8.gz Index: src/usr.bin/vmstat/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/Makefile,v retrieving revision 1.9 diff -u -r1.9 Makefile --- src/usr.bin/vmstat/Makefile 8 Feb 2002 23:07:36 -0000 1.9 +++ src/usr.bin/vmstat/Makefile 20 Nov 2003 15:33:37 -0000 @@ -3,6 +3,7 @@ =20 PROG=3D vmstat MAN=3D vmstat.8 +CFLAGS+=3D-DVMSTAT_SYSCTL BINGRP=3D kmem BINMODE=3D2555 DPADD=3D ${LIBKVM} ${LIBDEVSTAT} Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.25 diff -u -r1.25 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 14 Apr 2003 07:22:25 -0000 1.25 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 15:33:37 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl fimsz +.Op Fl afimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -62,6 +62,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.69 diff -u -r1.69 vmstat.c --- src/usr.bin/vmstat/vmstat.c 9 Nov 2003 20:39:56 -0000 1.69 +++ src/usr.bin/vmstat/vmstat.c 20 Nov 2003 15:33:37 -0000 @@ -129,6 +129,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -174,8 +175,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -239,24 +243,26 @@ if (nlistf !=3D NULL || memf !=3D NULL) setgid(getgid()); =20 - kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - if (kd =3D=3D 0)=20 - errx(1, "kvm_openfiles: %s", errbuf); - setgid(getgid()); - - if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { - if (c > 0) { - warnx("undefined symbols:"); - for (c =3D 0; - c < (int)(sizeof(namelist)/sizeof(namelist[0])); - c++) - if (namelist[c].n_type =3D=3D 0) - (void)fprintf(stderr, " %s", - namelist[c].n_name); - (void)fputc('\n', stderr); - } else - warnx("kvm_nlist: %s", kvm_geterr(kd)); - exit(1); + if (todo & ~INTRSTAT) { + kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); + if (kd =3D=3D 0)=20 + errx(1, "kvm_openfiles: %s", errbuf); + setgid(getgid()); + =09 + if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { + if (c > 0) { + warnx("undefined symbols:"); + for (c =3D 0; + c < (int)(sizeof(namelist)/sizeof(namelist[0])); + c++) + if (namelist[c].n_type =3D=3D 0) + (void)fprintf(stderr, " %s", + namelist[c].n_name); + (void)fputc('\n', stderr); + } else + warnx("kvm_nlist: %s", kvm_geterr(kd)); + exit(1); + } } =20 if (todo & VMSTAT) { @@ -386,8 +392,26 @@ static time_t now; time_t uptime; =20 - if (boottime.tv_sec =3D=3D 0) + if (boottime.tv_sec =3D=3D 0) { +#ifdef VMSTAT_SYSCTL + int mib[2] =3D { CTL_KERN, KERN_BOOTTIME }; + char *value; + size_t size; + + if (sysctl(mib, 2, NULL, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + if (size < sizeof(boottime)) + errx(1, "sizeof(kern.boottime) < sizeof(timeval)"); + value =3D malloc(size); + if (value =3D=3D NULL) + errx(1, "malloc"); + if (sysctl(mib, 2, value, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + memcpy(&boottime, value, sizeof(boottime)); +#else /* VMSTAT_SYSCTL */ kread(X_BOOTTIME, &boottime, sizeof(boottime)); +#endif /* VMSTAT_SYSCTL */ + } (void)time(&now); uptime =3D now - boottime.tv_sec; if (uptime <=3D 0 || uptime > 60*60*24*365*10) @@ -732,9 +756,42 @@ int i, istrnamlen; size_t clen; char *intrname, *tintrname; +#ifdef VMSTAT_SYSCTL + int *mibcnt, *mibname; + size_t mibcntsize, mibnamesize; +#endif /* VMSTAT_SYSCTL */ =20 uptime =3D getuptime(); - nintr =3D namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; +#ifdef VMSTAT_SYSCTL + /* Fetch the sysctl MIB's */ + if (sysctlnametomib("hw.intrcnt", NULL, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + mibcnt =3D malloc(mibcntsize * sizeof(int)); + if (mibcnt =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrcnt", mibcnt, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + if (sysctlnametomib("hw.intrnames", NULL, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + mibname =3D malloc(mibnamesize * sizeof(int)); + if (mibname =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrnames", mibname, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + + /* Fetch the arrays themselves */ + if (sysctl(mibcnt, mibcntsize, NULL, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + intrcnt =3D malloc((size_t)nintr); + if (sysctl(mibcnt, mibcntsize, intrcnt, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + if (sysctl(mibname, mibnamesize, NULL, &inamlen, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrnames)"); + intrname =3D malloc((size_t)inamlen); + if (sysctl(mibname, mibnamesize, intrname, &inamlen, NULL, NULL) =3D=3D -= 1) + err(1, "sysctl(hw.intrnames)"); +#else /* VMSTAT_SYSCTL */ + intr =3D namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; inamlen =3D namelist[X_EINTRNAMES].n_value - namelist[X_INTRNAMES].n_value; intrcnt =3D malloc((size_t)nintr); @@ -743,6 +800,7 @@ errx(1, "malloc"); kread(X_INTRCNT, intrcnt, (size_t)nintr); kread(X_INTRNAMES, intrname, (size_t)inamlen); +#endif /* VMSTAT_SYSCTL */ nintr /=3D sizeof(u_long); tintrname =3D intrname; istrnamlen =3D strlen("interrupt"); @@ -756,7 +814,7 @@ "rate"); inttotal =3D 0; while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -829,7 +887,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --f5QefDQHtn8hx44O Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="vmstat-sysctl-intr-RELENG_4.patch" Content-Transfer-Encoding: quoted-printable Index: src/usr.bin/vmstat/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/Makefile,v retrieving revision 1.5.6.1 diff -u -r1.5.6.1 Makefile --- src/usr.bin/vmstat/Makefile 25 Apr 2001 11:29:44 -0000 1.5.6.1 +++ src/usr.bin/vmstat/Makefile 20 Nov 2003 15:07:45 -0000 @@ -3,6 +3,7 @@ =20 PROG=3D vmstat MAN=3D vmstat.8 +CFLAGS+=3D-DVMSTAT_SYSCTL CFLAGS+=3D-I${.CURDIR}/../../sys BINGRP=3D kmem BINMODE=3D2555 Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.16.2.5 diff -u -r1.16.2.5 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 16 Aug 2001 13:17:13 -0000 1.16.2.5 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 12:21:23 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl imsz +.Op Fl aimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -61,6 +61,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.38.2.5 diff -u -r1.38.2.5 vmstat.c --- src/usr.bin/vmstat/vmstat.c 20 Sep 2003 19:10:01 -0000 1.38.2.5 +++ src/usr.bin/vmstat/vmstat.c 20 Nov 2003 15:16:01 -0000 @@ -135,6 +135,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -169,8 +170,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -238,22 +242,25 @@ if (nlistf !=3D NULL || memf !=3D NULL) setgid(getgid()); =20 - kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - if (kd =3D=3D 0)=20 - errx(1, "kvm_openfiles: %s", errbuf); - - if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { - if (c > 0) { - warnx("undefined symbols:"); - for (c =3D 0; - c < sizeof(namelist)/sizeof(namelist[0]); c++) - if (namelist[c].n_type =3D=3D 0) - fprintf(stderr, " %s", - namelist[c].n_name); - (void)fputc('\n', stderr); - } else - warnx("kvm_nlist: %s", kvm_geterr(kd)); - exit(1); + if (todo & ~INTRSTAT) { + kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); + if (kd =3D=3D 0)=20 + errx(1, "kvm_openfiles: %s", errbuf); + =09 + if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { + if (c > 0) { + warnx("undefined symbols:"); + for (c =3D 0; + c < sizeof(namelist)/sizeof(namelist[0]); + c++) + if (namelist[c].n_type =3D=3D 0) + fprintf(stderr, " %s", + namelist[c].n_name); + (void)fputc('\n', stderr); + } else + warnx("kvm_nlist: %s", kvm_geterr(kd)); + exit(1); + } } =20 if (todo & VMSTAT) { @@ -385,8 +392,26 @@ static time_t now, boottime; time_t uptime; =20 - if (boottime =3D=3D 0) + if (boottime =3D=3D 0) { +#ifdef VMSTAT_SYSCTL + int mib[2] =3D { CTL_KERN, KERN_BOOTTIME }; + char *value; + size_t size; + + if (sysctl(mib, 2, NULL, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + if (size < sizeof(boottime)) + errx(1, "sizeof(kern.boottime) < sizeof(time_t)"); + value =3D malloc(size); + if (value =3D=3D NULL) + errx(1, "malloc"); + if (sysctl(mib, 2, value, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + memcpy(&boottime, value, sizeof(boottime)); +#else /* VMSTAT_SYSCTL */ kread(X_BOOTTIME, &boottime, sizeof(boottime)); +#endif /* VMSTAT_SYSCTL */ + } (void)time(&now); uptime =3D now - boottime; if (uptime <=3D 0 || uptime > 60*60*24*365*10) @@ -722,10 +747,43 @@ { register u_long *intrcnt, uptime; register u_int64_t inttotal; - register int nintr, inamlen; + int nintr, inamlen; register char *intrname; +#ifdef VMSTAT_SYSCTL + int *mibcnt, *mibname; + size_t mibcntsize, mibnamesize; +#endif /* VMSTAT_SYSCTL */ =20 uptime =3D getuptime(); +#ifdef VMSTAT_SYSCTL + /* Fetch the sysctl MIB's */ + if (sysctlnametomib("hw.intrcnt", NULL, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + mibcnt =3D malloc(mibcntsize * sizeof(int)); + if (mibcnt =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrcnt", mibcnt, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + if (sysctlnametomib("hw.intrnames", NULL, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + mibname =3D malloc(mibnamesize * sizeof(int)); + if (mibname =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrnames", mibname, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + + /* Fetch the arrays themselves */ + if (sysctl(mibcnt, mibcntsize, NULL, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + intrcnt =3D malloc((size_t)nintr); + if (sysctl(mibcnt, mibcntsize, intrcnt, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + if (sysctl(mibname, mibnamesize, NULL, &inamlen, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrnames)"); + intrname =3D malloc((size_t)inamlen); + if (sysctl(mibname, mibnamesize, intrname, &inamlen, NULL, NULL) =3D=3D -= 1) + err(1, "sysctl(hw.intrnames)"); +#else /* VMSTAT_SYSCTL */ nintr =3D namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; inamlen =3D namelist[X_EINTRNAMES].n_value - namelist[X_INTRNAMES].n_value; @@ -735,11 +793,12 @@ errx(1, "malloc"); kread(X_INTRCNT, intrcnt, (size_t)nintr); kread(X_INTRNAMES, intrname, (size_t)inamlen); +#endif /* VMSTAT_SYSCTL */ (void)printf("interrupt total rate\n"); inttotal =3D 0; nintr /=3D sizeof(long); while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-12s %20lu %10lu\n", intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -917,7 +976,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --f5QefDQHtn8hx44O-- --h3LYUU6HlUDSAOzy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vN+X7Ri2jRYZRVMRAk3gAJ99iCMqz1wC5BT6+MYi2o170klTHgCfTtNI zdHQBoYAClDMTR11tz5o/6c= =ATcu -----END PGP SIGNATURE----- --h3LYUU6HlUDSAOzy-- From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 07:55: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 685FC16A4CF for ; Thu, 20 Nov 2003 07:55:02 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 621BE43F75 for ; Thu, 20 Nov 2003 07:55:00 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 23226 invoked from network); 20 Nov 2003 15:53:28 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 20 Nov 2003 15:53:28 -0000 Received: (qmail 95181 invoked by uid 1000); 20 Nov 2003 15:54:55 -0000 Date: Thu, 20 Nov 2003 17:54:55 +0200 From: Peter Pentchev To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org Message-ID: <20031120155455.GJ300@straylight.m.ringlet.net> Mail-Followup-To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mFHiwr52TKrxpkjc" Content-Disposition: inline In-Reply-To: <20031120153655.GI300@straylight.m.ringlet.net> User-Agent: Mutt/1.5.5.1i Subject: Re: interrupt statistics 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: Thu, 20 Nov 2003 15:55:02 -0000 --mFHiwr52TKrxpkjc Content-Type: multipart/mixed; boundary="MPkR1dXiUZqK+927" Content-Disposition: inline --MPkR1dXiUZqK+927 Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2003 at 05:36:55PM +0200, Peter Pentchev wrote: > On Thu, Nov 20, 2003 at 02:59:55PM +0100, Dag-Erling Sm?rgrav wrote: > > Peter Pentchev writes: > > > This is easily fixed, e.g. by the attached. Note that I've only test= ed > > > the RELENG_4 patch, my 5.x machine is out of commission for the next = few > > > days :( (and no, I couldn't test it on ref5 for obvious reasons rela= ted > > > to /dev/mem ;) > >=20 > > Hmm, vmstat should uses sysctls, not /dev/mem. Perhaps you can make a > > patch for that too? :) >=20 > Awwighty, attached is a patch that converts getuptime() and dointr() to > use sysctl, and then adds the -a option to display all interrupts. > This one was tested on both RELENG_4 and HEAD (ref5) :) Oops; a little buglet (deleted one character too many) in the HEAD patch for the !VMSTAT_SYSCTL case. New HEAD patch attached. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 because I didn't think of a good beginning of it. --MPkR1dXiUZqK+927 Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="vmstat-sysctl-intr-HEAD.patch" Content-Transfer-Encoding: quoted-printable Index: src/usr.bin/vmstat/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/Makefile,v retrieving revision 1.9 diff -u -r1.9 Makefile --- src/usr.bin/vmstat/Makefile 8 Feb 2002 23:07:36 -0000 1.9 +++ src/usr.bin/vmstat/Makefile 20 Nov 2003 15:51:53 -0000 @@ -3,6 +3,7 @@ =20 PROG=3D vmstat MAN=3D vmstat.8 +CFLAGS+=3D-DVMSTAT_SYSCTL BINGRP=3D kmem BINMODE=3D2555 DPADD=3D ${LIBKVM} ${LIBDEVSTAT} Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.25 diff -u -r1.25 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 14 Apr 2003 07:22:25 -0000 1.25 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 15:51:53 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl fimsz +.Op Fl afimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -62,6 +62,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.69 diff -u -r1.69 vmstat.c --- src/usr.bin/vmstat/vmstat.c 9 Nov 2003 20:39:56 -0000 1.69 +++ src/usr.bin/vmstat/vmstat.c 20 Nov 2003 15:53:00 -0000 @@ -129,6 +129,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -174,8 +175,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -239,24 +243,26 @@ if (nlistf !=3D NULL || memf !=3D NULL) setgid(getgid()); =20 - kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - if (kd =3D=3D 0)=20 - errx(1, "kvm_openfiles: %s", errbuf); - setgid(getgid()); - - if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { - if (c > 0) { - warnx("undefined symbols:"); - for (c =3D 0; - c < (int)(sizeof(namelist)/sizeof(namelist[0])); - c++) - if (namelist[c].n_type =3D=3D 0) - (void)fprintf(stderr, " %s", - namelist[c].n_name); - (void)fputc('\n', stderr); - } else - warnx("kvm_nlist: %s", kvm_geterr(kd)); - exit(1); + if (todo & ~INTRSTAT) { + kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); + if (kd =3D=3D 0)=20 + errx(1, "kvm_openfiles: %s", errbuf); + setgid(getgid()); + =09 + if ((c =3D kvm_nlist(kd, namelist)) !=3D 0) { + if (c > 0) { + warnx("undefined symbols:"); + for (c =3D 0; + c < (int)(sizeof(namelist)/sizeof(namelist[0])); + c++) + if (namelist[c].n_type =3D=3D 0) + (void)fprintf(stderr, " %s", + namelist[c].n_name); + (void)fputc('\n', stderr); + } else + warnx("kvm_nlist: %s", kvm_geterr(kd)); + exit(1); + } } =20 if (todo & VMSTAT) { @@ -386,8 +392,26 @@ static time_t now; time_t uptime; =20 - if (boottime.tv_sec =3D=3D 0) + if (boottime.tv_sec =3D=3D 0) { +#ifdef VMSTAT_SYSCTL + int mib[2] =3D { CTL_KERN, KERN_BOOTTIME }; + char *value; + size_t size; + + if (sysctl(mib, 2, NULL, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + if (size < sizeof(boottime)) + errx(1, "sizeof(kern.boottime) < sizeof(timeval)"); + value =3D malloc(size); + if (value =3D=3D NULL) + errx(1, "malloc"); + if (sysctl(mib, 2, value, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + memcpy(&boottime, value, sizeof(boottime)); +#else /* VMSTAT_SYSCTL */ kread(X_BOOTTIME, &boottime, sizeof(boottime)); +#endif /* VMSTAT_SYSCTL */ + } (void)time(&now); uptime =3D now - boottime.tv_sec; if (uptime <=3D 0 || uptime > 60*60*24*365*10) @@ -732,8 +756,41 @@ int i, istrnamlen; size_t clen; char *intrname, *tintrname; +#ifdef VMSTAT_SYSCTL + int *mibcnt, *mibname; + size_t mibcntsize, mibnamesize; +#endif /* VMSTAT_SYSCTL */ =20 uptime =3D getuptime(); +#ifdef VMSTAT_SYSCTL + /* Fetch the sysctl MIB's */ + if (sysctlnametomib("hw.intrcnt", NULL, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + mibcnt =3D malloc(mibcntsize * sizeof(int)); + if (mibcnt =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrcnt", mibcnt, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + if (sysctlnametomib("hw.intrnames", NULL, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + mibname =3D malloc(mibnamesize * sizeof(int)); + if (mibname =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrnames", mibname, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + + /* Fetch the arrays themselves */ + if (sysctl(mibcnt, mibcntsize, NULL, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + intrcnt =3D malloc((size_t)nintr); + if (sysctl(mibcnt, mibcntsize, intrcnt, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + if (sysctl(mibname, mibnamesize, NULL, &inamlen, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrnames)"); + intrname =3D malloc((size_t)inamlen); + if (sysctl(mibname, mibnamesize, intrname, &inamlen, NULL, NULL) =3D=3D -= 1) + err(1, "sysctl(hw.intrnames)"); +#else /* VMSTAT_SYSCTL */ nintr =3D namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; inamlen =3D namelist[X_EINTRNAMES].n_value - namelist[X_INTRNAMES].n_value; @@ -743,6 +800,7 @@ errx(1, "malloc"); kread(X_INTRCNT, intrcnt, (size_t)nintr); kread(X_INTRNAMES, intrname, (size_t)inamlen); +#endif /* VMSTAT_SYSCTL */ nintr /=3D sizeof(u_long); tintrname =3D intrname; istrnamlen =3D strlen("interrupt"); @@ -756,7 +814,7 @@ "rate"); inttotal =3D 0; while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -829,7 +887,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --MPkR1dXiUZqK+927-- --mFHiwr52TKrxpkjc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vOPP7Ri2jRYZRVMRAglfAKC90p9ZPQCA0rkilETTR0ttOyG5aACfQJrV g+49vcD5jqdPZo48RKBv7ls= =xUHz -----END PGP SIGNATURE----- --mFHiwr52TKrxpkjc-- From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 07:58:26 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 399AD16A4CE; Thu, 20 Nov 2003 07:58:26 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BD1F43FE5; Thu, 20 Nov 2003 07:58:25 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id hAKFu8Mg020618; Thu, 20 Nov 2003 10:56:08 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)hAKFu8fj020615; Thu, 20 Nov 2003 10:56:08 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 20 Nov 2003 10:56:08 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Len Sassaman In-Reply-To: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Thu, 20 Nov 2003 15:58:26 -0000 On Wed, 19 Nov 2003, Len Sassaman wrote: > It is my intuition from this behavior that the sshd master process > listening for connections is unable to spawn a new process to complete > the authentication step, and thus the connection is being dropped. There > is no information of use in dmesg, nor in the system logs. (I've cranked > up LogLevel to DEBUG3 in sshd_config). > > I have a RedHat Linux server running the 2.4.18-3smp kernel on a dual > Athlon MP 1800+ and 2048MB RAM that is known to handle 1000 users > without issue -- so I have to believe the FreeBSD box, though not as > beefy hardware-wise, should be able to do better than a few hundred > users. I believe this to be some sort of resource limit issue, but I > have addressed everything I could think of. Hmm. Well, it certainly sounds like a resource limit to me, especially if it's a nice round number like "150" or "300". However, I'm also having a bit of trouble seeing, off the top of my head, which limit it might be. It sounds like you've got the ones I would think of. A quick skim of sshd.c suggests that it is pretty careful to document various failure modes in debugging output. There are one or two failures where it does not log, and they include the call to pipe() in the server loop -- if that fails, it bails without an error, which is a little surprising. Could you post server debug output for the first connection to the server that fails? This would let us "see how far it got"... In particular, whether it did spawn a child process, etc. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 08:41:18 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 EBA5116A4CE; Thu, 20 Nov 2003 08:41:17 -0800 (PST) Received: from electra.cse.Buffalo.EDU (electra.cse.Buffalo.EDU [128.205.32.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AA4043FE1; Thu, 20 Nov 2003 08:41:16 -0800 (PST) (envelope-from kensmith@cse.Buffalo.EDU) Received: from electra.cse.Buffalo.EDU (kensmith@localhost [127.0.0.1]) hAKGfCus001746; Thu, 20 Nov 2003 11:41:12 -0500 (EST) Received: (from kensmith@localhost) by electra.cse.Buffalo.EDU (8.12.10/8.12.9/Submit) id hAKGfCnB001744; Thu, 20 Nov 2003 11:41:12 -0500 (EST) Date: Thu, 20 Nov 2003 11:41:12 -0500 From: Ken Smith To: Robert Watson Message-ID: <20031120164112.GF29560@electra.cse.Buffalo.EDU> References: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org cc: Len Sassaman Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Thu, 20 Nov 2003 16:41:18 -0000 On Thu, Nov 20, 2003 at 10:56:08AM -0500, Robert Watson wrote: > Hmm. Well, it certainly sounds like a resource limit to me, especially if > it's a nice round number like "150" or "300". One possibility might be running out of pseudo-terminals to support the login sessions. pty's are created as needed I think, and the code that handles it is in sys/kern/tty_pty.c. The limits on it appear to be 256 ptys: /* * This function creates and initializes a pts/ptc pair * * pts == /dev/tty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv] * ptc == /dev/pty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv] * * XXX: define and add mapping of upper minor bits to allow more * than 256 ptys. */ I don't know if simply changing the : static char *names = "pqrsPQRS"; to something longer is all that would be required or if there are other factors involved. -- Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 08:45: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 88DCE16A4CE; Thu, 20 Nov 2003 08:45:02 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81E3B43FF3; Thu, 20 Nov 2003 08:45:01 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id hAKGglMg021108; Thu, 20 Nov 2003 11:42:47 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)hAKGgl8J021105; Thu, 20 Nov 2003 11:42:47 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 20 Nov 2003 11:42:47 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Ken Smith In-Reply-To: <20031120164112.GF29560@electra.cse.Buffalo.EDU> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org cc: Len Sassaman Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Thu, 20 Nov 2003 16:45:02 -0000 On Thu, 20 Nov 2003, Ken Smith wrote: > On Thu, Nov 20, 2003 at 10:56:08AM -0500, Robert Watson wrote: > > > Hmm. Well, it certainly sounds like a resource limit to me, especially if > > it's a nice round number like "150" or "300". > > One possibility might be running out of pseudo-terminals to support the > login sessions. pty's are created as needed I think, and the code that > handles it is in sys/kern/tty_pty.c. The limits on it appear to be 256 > ptys: I thought about that, but the submitter indicated that pty's were not being allocated. However, that would be a really good thing to verify, since the numbers come out right... I should really clean up and commit my pty cleanup at some point, as well as support for forkpty()/openpty()/etc that avoid the sort of code found below. Presumably that would be a 5.3 thing. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories > > /* > * This function creates and initializes a pts/ptc pair > * > * pts == /dev/tty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv] > * ptc == /dev/pty[pqrsPQRS][0123456789abcdefghijklmnopqrstuv] > * > * XXX: define and add mapping of upper minor bits to allow more > * than 256 ptys. > */ > > I don't know if simply changing the : > > static char *names = "pqrsPQRS"; > > to something longer is all that would be required or if there are > other factors involved. > > -- > Ken Smith > - From there to here, from here to | kensmith@cse.buffalo.edu > there, funny things are everywhere. | > - Theodore Geisel | > From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 09:13: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 C4E3B16A4CE for ; Thu, 20 Nov 2003 09:13:47 -0800 (PST) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DA2343F75 for ; Thu, 20 Nov 2003 09:13:46 -0800 (PST) (envelope-from A.J.Caines@halplant.com) Received: from mail.halplant.com ([68.100.200.14]) by lakemtao04.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20031120171346.QWPL19895.lakemtao04.cox.net@mail.halplant.com>; Thu, 20 Nov 2003 12:13:46 -0500 Received: by mail.halplant.com (Postfix, from userid 1001) id 19F03C; Thu, 20 Nov 2003 12:13:46 -0500 (EST) Date: Thu, 20 Nov 2003 12:13:46 -0500 From: Sgt William Kilgore To: David Bennett Message-ID: <20031120171345.GF21059@hal9000.halplant.com> Mail-Followup-To: David Bennett , freebsd-hackers@FreeBSD.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: H.A.L. Plant X-PGP-Fingerprint: C59A 2F74 1139 9432 B457 0B61 DDF2 AA61 67C3 18A1 X-Powered-by: FreeBSD 4.9-STABLE X-URL: http://halplant.com:88/ X-Yahoo-Profile: AJ_Z0 X-ICQ: 283813972 Importance: Normal User-Agent: Mutt/1.5.5.1i cc: freebsd-hackers@FreeBSD.org Subject: Re: sign me up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrew J Caines List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2003 17:13:47 -0000 David, Welcome to the FreeBSD light infantry. Please report to your local recruiting office, from where you will be transported to base, equipped with uniform, weapons, ammunition and CD-ROMs. After a brief period of basic training in OS warfare you will be deployed on the front line, possibly the microsoft.* Usenet newsgroups, Slashdot or the Lunix kernel mailing list. Mailing list subscription specialists should make sure to visit the instructions[1] before reporting. [1] http://lists.freebsd.org/mailman/listinfo/freebsd-hackers Sgt. Bill Killgore, FCKM From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 09:34: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 E8BB516A4CF for ; Thu, 20 Nov 2003 09:34:58 -0800 (PST) Received: from pear.silverwraith.com (66-214-182-79.la-cbi.charterpipeline.net [66.214.182.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D40D43F3F for ; Thu, 20 Nov 2003 09:34:58 -0800 (PST) (envelope-from avleen@pear.silverwraith.com) Received: from avleen by pear.silverwraith.com with local (Exim 4.24; FreeBSD) id 1AMshl-000HNj-83 for freebsd-hackers@freebsd.org; Thu, 20 Nov 2003 09:34:57 -0800 Date: Thu, 20 Nov 2003 09:34:57 -0800 From: Avleen Vig To: freebsd-hackers@freebsd.org Message-ID: <20031120173457.GE33548@silverwraith.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Sender: Avleen Vig Subject: Device polling, with SMP? 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: Thu, 20 Nov 2003 17:34:59 -0000 Has anyone here used DEVICE_POLLING on an SMP box? I have one server which does recieve ~130kpps at times on an interface, but I cannot enable DEVICE_POLLING because hte system locks up under load from interrupts. In this case I'm not sure which is better, disabling one of the CPU's, or trying to make DECIVE_POLLING work with SMP. I read Luigi's paper at info.iet.unipi.it/~luigi/polling/ which at the end implies that DEVICE_POLLING on an SMP box might not make sense - but right now for me it would make sense as both CPU's are locked: One tries to handle interrupts The other tries to manage the application I could try forcing DEVICE_POLLING to compile as is suggested in that URL but I wanted to see if anyone had tried this before. The interface is an FXP. Thanks :) -- Avleen Vig Systems Administrator Personal: www.silverwraith.com EFnet: irc.mindspring.com (Earthlink user access only) From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 09:59:04 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 1122016A4CE for ; Thu, 20 Nov 2003 09:59:04 -0800 (PST) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3342843FDF for ; Thu, 20 Nov 2003 09:59:03 -0800 (PST) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2657.72) id ; Thu, 20 Nov 2003 12:59:02 -0500 Message-ID: From: Don Bowman To: 'Avleen Vig' , freebsd-hackers@freebsd.org Date: Thu, 20 Nov 2003 12:58:58 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Device polling, with SMP? 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: Thu, 20 Nov 2003 17:59:04 -0000 From: Avleen Vig [mailto:lists-freebsd@silverwraith.com] > > Has anyone here used DEVICE_POLLING on an SMP box? > I have one server which does recieve ~130kpps at times on an > interface, > but I cannot enable DEVICE_POLLING because hte system locks up under > load from interrupts. > > In this case I'm not sure which is better, disabling one of the CPU's, > or trying to make DECIVE_POLLING work with SMP. > > I read Luigi's paper at info.iet.unipi.it/~luigi/polling/ which at the > end implies that DEVICE_POLLING on an SMP box might not make > sense - but > right now for me it would make sense as both CPU's are locked: > One tries to handle interrupts > The other tries to manage the application > > I could try forcing DEVICE_POLLING to compile as is suggested in that > URL but I wanted to see if anyone had tried this before. > > The interface is an FXP. We use it on em. I just commented out the #error line that says you can't do it. device polling in idle doesn't work, and the user/system time calculation isn't correct, but it works well otherwise. --don From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 11:50: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 1865816A4CE for ; Thu, 20 Nov 2003 11:50:42 -0800 (PST) Received: from pear.silverwraith.com (66-214-182-79.la-cbi.charterpipeline.net [66.214.182.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CBDC43FA3 for ; Thu, 20 Nov 2003 11:50:41 -0800 (PST) (envelope-from avleen@pear.silverwraith.com) Received: from avleen by pear.silverwraith.com with local (Exim 4.24; FreeBSD) id 1AMup6-000HyU-Nv; Thu, 20 Nov 2003 11:50:40 -0800 Date: Thu, 20 Nov 2003 11:50:40 -0800 From: Avleen Vig To: Don Bowman Message-ID: <20031120195040.GH33548@silverwraith.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i Sender: Avleen Vig cc: freebsd-hackers@freebsd.org Subject: Re: Device polling, with SMP? 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: Thu, 20 Nov 2003 19:50:42 -0000 On Thu, Nov 20, 2003 at 12:58:58PM -0500, Don Bowman wrote: > > I read Luigi's paper at info.iet.unipi.it/~luigi/polling/ which at the > > end implies that DEVICE_POLLING on an SMP box might not make > > sense - but > > right now for me it would make sense as both CPU's are locked: > > One tries to handle interrupts > > The other tries to manage the application > > > > I could try forcing DEVICE_POLLING to compile as is suggested in that > > URL but I wanted to see if anyone had tried this before. > > The interface is an FXP. > > We use it on em. I just commented out the #error line that > says you can't do it. > device polling in idle doesn't work, and the user/system time > calculation isn't correct, but it works well otherwise. This is pretty much what I wanted to confirm thanks! In which way is the system/user time incorrect? Always, or only under high load? what about it is incorrect? My skills are limited but I might take a stab at fixing that. -- Avleen Vig Systems Administrator Personal: www.silverwraith.com EFnet: irc.mindspring.com (Earthlink user access only) From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 13:15: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 0B63E16A4CF for ; Thu, 20 Nov 2003 13:15:32 -0800 (PST) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C7A943F3F for ; Thu, 20 Nov 2003 13:15:31 -0800 (PST) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2657.72) id ; Thu, 20 Nov 2003 16:15:29 -0500 Message-ID: From: Don Bowman To: 'Avleen Vig' , Don Bowman Date: Thu, 20 Nov 2003 16:15:19 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" cc: freebsd-hackers@freebsd.org Subject: RE: Device polling, with SMP? 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: Thu, 20 Nov 2003 21:15:32 -0000 From: Avleen Vig [mailto:lists-freebsd@silverwraith.com] > On Thu, Nov 20, 2003 at 12:58:58PM -0500, Don Bowman wrote: > > > I read Luigi's paper at info.iet.unipi.it/~luigi/polling/ > which at the > > > end implies that DEVICE_POLLING on an SMP box might not make > > > sense - but > > > right now for me it would make sense as both CPU's are locked: > > > One tries to handle interrupts > > > The other tries to manage the application > > > > > > I could try forcing DEVICE_POLLING to compile as is > suggested in that > > > URL but I wanted to see if anyone had tried this before. > > > The interface is an FXP. > > > > We use it on em. I just commented out the #error line that > > says you can't do it. > > device polling in idle doesn't work, and the user/system time > > calculation isn't correct, but it works well otherwise. > > This is pretty much what I wanted to confirm thanks! > In which way is the system/user time incorrect? Always, or only under > high load? what about it is incorrect? My skills are limited > but I might > take a stab at fixing that. Well, on -STABLE, there can be only one CPU active in the kernel. Thus on a 2-way HTT system, the system thinks there are 4 processors, but there is no way to get 'system' cpu to exceed 25%. So in polling, the 'user frac' and 'kernel frac' are very difficult to understand. --don From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 13:27: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 9C39516A4CE for ; Thu, 20 Nov 2003 13:27:42 -0800 (PST) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id CACAE43FD7 for ; Thu, 20 Nov 2003 13:27:41 -0800 (PST) (envelope-from wes@softweyr.com) Received: from salty.rapid.stbernard.com (corp-2.ipinc.com [199.245.188.2]) by smtp-relay.omnis.com (Postfix) with ESMTP id C1E7072DFD; Thu, 20 Nov 2003 13:26:46 -0800 (PST) From: Wes Peters Organization: Softweyr.com To: Rayson Ho , freebsd-hackers@freebsd.org Date: Thu, 20 Nov 2003 13:27:29 -0800 User-Agent: KMail/1.5.2 References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> In-Reply-To: <20031119003133.18473.qmail@web11404.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311201327.29226.wes@softweyr.com> Subject: Re: "secure" file flag? 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: Thu, 20 Nov 2003 21:27:42 -0000 On Tuesday 18 November 2003 16:31, Rayson Ho wrote: > I am wondering if it is useful to have a "secure" file flag?? > > The secure file flag will be set for files that contain sensitive > data. Then the OS will take special care when operating on those > "secure" files. > > e.g. when deleting a "secure" file, the OS will overwrite the file > with random data. Better to overwrite it with a more "secure" pattern. See ports/ sysutils/obliterate for references. It has been mentioned before that this could be done on in the kernel, obliterating blocks in the VM rather than zeroing them. I hadn't thought of applying at the file or filesystem level. > One advantage would be to have "secure" files in the same filesystem > as other normal files. > > Any one knows if FreeBSD has already implemented this?? The closest we have is the 'rm -P' command and the above-mentioned obliterate command. The overwrite pattern used in 'rm -P' is not likely to be effective against a dedicated inspection of the disk; the one in obliterate somewhat more so. This sounds like an interesting file flag. Would you expect the process to block on the unlink(2) call while the overwrite takes place, or for this to happen in a kernel thread? The former seems pretty straight- forward, hacking at ffs_blkfree. The latter I really wouldn't know how to begin without (a lot) more study. -- "Where am I, and what am I doing in this handbasket?" Wes Peters wes@softweyr.com From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 15:38:35 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 559D016A4E2; Thu, 20 Nov 2003 15:38:34 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05DCE43FE3; Thu, 20 Nov 2003 15:38:33 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id hAKNcRkX031061; Thu, 20 Nov 2003 15:38:27 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <3FBD5072.7030603@acm.org> Date: Thu, 20 Nov 2003 15:38:26 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Len Sassaman References: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> In-Reply-To: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2003 23:38:35 -0000 Len Sassaman wrote: > The problem is that after about 150 users log in (300ish sshd sessions, > since I am using privsep), incoming connections start getting dropped. That number (150) sounds awfully familiar; I feel like I've seen it somewhere recently. Hmmmm.... Try an 'fstat' when connections start getting dropped. I wonder if something (PAM module, maybe?) is opening a file on each connection and you're running out of per-process file descriptors. Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 16:57: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 C71DA16A4CE; Thu, 20 Nov 2003 16:57:11 -0800 (PST) Received: from monkeyflinger.anonymizer.com (monkeyflinger.anonymizer.com [168.143.113.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1B8E43FDD; Thu, 20 Nov 2003 16:57:10 -0800 (PST) (envelope-from rabbi@anonymizer.com) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Len Sassaman Date: Thu, 20 Nov 2003 16:57:10 -0800 To: Robert Watson X-Mailer: Apple Mail (2.606) cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Fri, 21 Nov 2003 00:57:11 -0000 > Hmm. Well, it certainly sounds like a resource limit to me, > especially if > it's a nice round number like "150" or "300". However, I'm also > having a > bit of trouble seeing, off the top of my head, which limit it might be. > It sounds like you've got the ones I would think of. A quick skim of > sshd.c suggests that it is pretty careful to document various failure > modes in debugging output. There are one or two failures where it does > not log, and they include the call to pipe() in the server loop -- if > that > fails, it bails without an error, which is a little surprising. Could > you > post server debug output for the first connection to the server that > fails? This would let us "see how far it got"... In particular, > whether > it did spawn a child process, etc. > I have never gotten this to fail when sshd is running in debug mode (i.e., sshd -ddd). However, given that it doesn't fork when run with -d, that still doesn't tell us too much. When I set LogLevel DEBUG3, this is as much info as I am given in the auth.log: Nov 20 16:39:19 clyde sshd[63993]: Failed none for rabbi from 127.0.0.1 port 62701 ssh2 And this is the debug output for the connection, as seen from the client: bash-2.05b# ssh -vvv -l rabbi localhost OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Rhosts Authentication disabled, originating port will not be trusted. debug2: ssh_connect: needpriv 0 debug1: Connecting to localhost [::1] port 22. socket: Protocol not supported debug1: Connecting to localhost [127.0.0.1] port 22. debug1: Connection established. debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host This can't be a system-wide process related resource issue, I don't think, because once a user connects and authenticates, there are no problems of note. I'm leaning toward a socket related limit or user-level limit. However, since sysctl tells me: kern.ipc.maxsockbuf: 262144 kern.ipc.somaxconn: 16384 kern.ipc.numopensockets: 2201 kern.ipc.maxsockets: 49312 I tend to not believe the former, and why the latter would be occurring escapes me as well. From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 17:19:27 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 1141416A4CE; Thu, 20 Nov 2003 17:19:27 -0800 (PST) Received: from moof.zeroth.org (moof.zeroth.org [203.117.131.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E98943FCB; Thu, 20 Nov 2003 17:19:25 -0800 (PST) (envelope-from jclark@metaparadigm.com) Received: from metaparadigm.com (neon.zeroth.org [203.117.131.24]) (authenticated bits=0) by moof.zeroth.org (8.12.9/8.12.9) with ESMTP id hAL1J8nc022160; Fri, 21 Nov 2003 09:19:08 +0800 (SGT) (envelope-from jclark@metaparadigm.com) Message-ID: <3FBD6806.2000108@metaparadigm.com> Date: Fri, 21 Nov 2003 09:19:02 +0800 From: Jamie Clark User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: kientzle@acm.org References: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> <3FBD5072.7030603@acm.org> In-Reply-To: <3FBD5072.7030603@acm.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org cc: Len Sassaman Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Fri, 21 Nov 2003 01:19:27 -0000 Tim Kientzle wrote: > Try an 'fstat' when connections start getting dropped. > I wonder if something (PAM module, maybe?) is opening a > file on each connection and you're running out of per-process > file descriptors. A similar thing happened here - although it wasn't sshd at fault. Len mentioned using ldap authentication. nss_ldap and/or pam_ldap are use TCP connections to connect to the LDAP server. In my case there was another big consumer of persistent ldap connections that caused slapd to reach its default 1024 descriptor limit (which required a compile-time adjustment). Found this by tracing the master slapd process. -Jamie From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 20:39:10 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 33F8916A4CE for ; Thu, 20 Nov 2003 20:39:10 -0800 (PST) Received: from monster.schulte.org (monster.schulte.org [209.134.156.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 364DC43FA3 for ; Thu, 20 Nov 2003 20:39:07 -0800 (PST) (envelope-from liew@jaysern.org) Received: from localhost (localhost [127.0.0.1]) by monster.schulte.org (Postfix) with ESMTP id D53991FB2C for ; Thu, 20 Nov 2003 22:39:05 -0600 (CST) Received: from pinnacle.schulte.org (pinnacle.schulte.org [209.134.156.220]) by monster.schulte.org (Postfix) with ESMTP id F31E21FB28 for ; Thu, 20 Nov 2003 22:39:04 -0600 (CST) Received: from localhost (dude@localhost)hAL4d5sP061319 for ; Thu, 20 Nov 2003 22:39:05 -0600 (CST) (envelope-from liew@jaysern.org) X-Authentication-Warning: pinnacle.schulte.org: dude owned process doing -bs Date: Thu, 20 Nov 2003 22:39:05 -0600 (CST) From: Jay Sern Liew X-X-Sender: dude@pinnacle.schulte.org To: freebsd-hackers@freebsd.org Message-ID: <20031120223816.G61303@pinnacle.schulte.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS 0.3.12pre8 on monster.schulte.org Subject: integer and long max/min values 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: Fri, 21 Nov 2003 04:39:10 -0000 how do I find out the maximum (and minimum) value a long and int will hold in C? (before it overflows or underflows) if it's compiler-dependent, then does anyone know where I can find the GCC documentation for stuff like that? thanks. ________________________________________________________________________ Jay Sern Liew jaysern@{acm,ieee}.org gpg --keyserver pgp.mit.edu --recv-keys 0xA115A33F pub 1024D/A115A33F 2003-01-02 Jay Sern Liew Key fingerprint = B08E 2481 B4CE 284A C0DE E359 8646 7B7E A115 A33F sub 1024g/7504C197 2003-01-02 [expires: 2003-12-31] From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 20:51:06 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 6AA3316A4CE for ; Thu, 20 Nov 2003 20:51:06 -0800 (PST) Received: from smtp.sw.oz.au (alt.aurema.com [203.217.18.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19ECB43F3F for ; Thu, 20 Nov 2003 20:51:05 -0800 (PST) (envelope-from vance@aurema.com) Received: from smtp.sw.oz.au (localhost [127.0.0.1]) by smtp.sw.oz.au with ESMTP id hAL4p3BA028246; Fri, 21 Nov 2003 15:51:03 +1100 (EST) Received: (from vance@localhost) by smtp.sw.oz.au id hAL4p2bs028222; Fri, 21 Nov 2003 15:51:02 +1100 (EST) Date: Fri, 21 Nov 2003 15:51:02 +1100 From: Christopher Vance To: Jay Sern Liew Message-ID: <20031121045102.GL12532@aurema.com> References: <20031120223816.G61303@pinnacle.schulte.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20031120223816.G61303@pinnacle.schulte.org> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.38 cc: freebsd-hackers@freebsd.org Subject: Re: integer and long max/min values 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: Fri, 21 Nov 2003 04:51:06 -0000 On Thu, Nov 20, 2003 at 10:39:05PM -0600, Jay Sern Liew wrote: >how do I find out the maximum (and minimum) value a long and int will hold >in C? (before it overflows or underflows) > >if it's compiler-dependent, then does anyone know where I can find the GCC >documentation for stuff like that? Wrong mailing list - if you don't already know really basic C, you ain't a hacker. Try . -- Christopher Vance From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 21:35:18 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 DCBF516A4CE for ; Thu, 20 Nov 2003 21:35:18 -0800 (PST) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3644543F75 for ; Thu, 20 Nov 2003 21:35:18 -0800 (PST) (envelope-from ibrahim@mind.daemon.sh) Received: from sdn-ap-024dcwashp0157.dialsprint.net ([63.191.176.157]) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1AN3wr-0005Yz-00 for freebsd-hackers@freebsd.org; Thu, 20 Nov 2003 21:35:17 -0800 From: Ibrahim Abdullah To: freebsd-hackers@freebsd.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-sLziJly6ik/axa9cpnIz" Organization: Message-Id: <1069392953.40138.5.camel@mind.daemon.sh> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 21 Nov 2003 00:35:54 -0500 Subject: Submitting changes that add an option 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: Fri, 21 Nov 2003 05:35:19 -0000 --=-sLziJly6ik/axa9cpnIz Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I've added an option to the from command so that it can also display the subject header. For instance: $ from =46rom owner-freebsd-questions@freebsd.org Thu Nov 20 23:44:57 2003 =46rom owner-freebsd-questions@freebsd.org Thu Nov 20 23:50:59 2003 $ from -S =46rom owner-freebsd-questions@freebsd.org Thu Nov 20 23:44:57 2003 Subject: How can I set a password from STDIN? =46rom owner-freebsd-questions@freebsd.org Thu Nov 20 23:50:59 2003 Subject: Binary port question Is this something I could submit to be added to the freebsd source tree, or would this not be of interest? Should I use the send_pr command (even though it isn't a problem report)? I have created a diff for from.c and the man page from.1. Thanks, --=20 -Ibrahim Abdullah --=-sLziJly6ik/axa9cpnIz Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/vaQ5cKjrFl+oo1MRAl5SAJ4q1KWQUuejwB+chxnvF6FokSOgQACcDqwG UQ/+//pIE9ryEVW8TPjRHgA= =8XnA -----END PGP SIGNATURE----- --=-sLziJly6ik/axa9cpnIz-- From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 23:05:54 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 5F67416A4CE; Thu, 20 Nov 2003 23:05:54 -0800 (PST) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id D23FE43FD7; Thu, 20 Nov 2003 23:05:52 -0800 (PST) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])hAL75Sf1067513; Fri, 21 Nov 2003 18:05:34 +1100 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost)hAL75MWx067512; Fri, 21 Nov 2003 18:05:22 +1100 (EST) (envelope-from jeremyp) Date: Fri, 21 Nov 2003 18:05:22 +1100 From: Peter Jeremy To: Len Sassaman Message-ID: <20031121070522.GF39616@cirb503493.alcatel.com.au> References: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0C8643E8-1B1A-11D8-B160-000A959E7C72@anonymizer.com> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: Help request: problems with a 5.1 server and large numbers of ssh users. 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: Fri, 21 Nov 2003 07:05:54 -0000 On Wed, Nov 19, 2003 at 09:26:10PM -0800, Len Sassaman wrote: >It is my intuition from this behavior that the sshd master process >listening for connections is unable to spawn a new process to complete >the authentication step, and thus the connection is being dropped. >There is no information of use in dmesg, nor in the system logs. (I've >cranked up LogLevel to DEBUG3 in sshd_config). I don't have a solution but a couple of suggestions for further investigation: With 150 users logged in (so that no more can log in), what happens if you start another sshd on a different port (or kill the master sshd and start another one on port 22). What happens if you "ktrace -i" sshd and compare the results when the 150th client logs in to the results when the 151st client fails to log in. Some doctoring of PIDs with sed or similar will allow you to diff the output without getting buried in non-differences. I presume that the clients are attempting to connect from more than one host (ie it's not a resource problem in the client). Peter From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 23:38: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 77CF416A4CE for ; Thu, 20 Nov 2003 23:38:03 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AECA43FE0 for ; Thu, 20 Nov 2003 23:38:01 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 439765309; Fri, 21 Nov 2003 08:38:00 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id D2EEB5308; Fri, 21 Nov 2003 08:37:51 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 5E8C733C86; Fri, 21 Nov 2003 08:37:51 +0100 (CET) To: Mike Tancsa References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 08:37:51 +0100 In-Reply-To: <20031120153655.GI300@straylight.m.ringlet.net> (Peter Pentchev's message of "Thu, 20 Nov 2003 17:36:55 +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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 07:38:03 -0000 Peter Pentchev writes: > Awwighty, attached is a patch that converts getuptime() and dointr() to > use sysctl, and then adds the -a option to display all interrupts. > This one was tested on both RELENG_4 and HEAD (ref5) :) Hmm, I don't like the fact that it displays a "stray" entry for each IRQ. Perhaps it should skip stray entries unless the count is non-zero or a different option (-A perhaps) was specified. Also, why do I get a ??? entry at the top of the list? des@dwp /usr/src/usr.bin/vmstat% vmstat -ai interrupt total rate ??? 0 0 irq1: atkbd0 76236 0 stray irq1 0 0 irq3: sio1 1 0 stray irq3 0 0 [...] DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 23:50:10 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 E6CE716A4CE for ; Thu, 20 Nov 2003 23:50:10 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF67C43FA3 for ; Thu, 20 Nov 2003 23:50:09 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 56D39530A; Fri, 21 Nov 2003 08:50:08 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 14E995309; Fri, 21 Nov 2003 08:49:53 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id BF94133C86; Fri, 21 Nov 2003 08:49:52 +0100 (CET) To: Mike Tancsa References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 08:49:52 +0100 In-Reply-To: (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "Fri, 21 Nov 2003 08:37:51 +0100") 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 07:50:11 -0000 des@des.no (Dag-Erling Sm=F8rgrav) writes: > Peter Pentchev writes: >> Awwighty, attached is a patch that converts getuptime() and dointr() to >> use sysctl, and then adds the -a option to display all interrupts. >> This one was tested on both RELENG_4 and HEAD (ref5) :) > [...] Why don't you use sysctlbyname(3) instead of juggling with numeric names? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 00:24:06 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 589A016A4CE for ; Fri, 21 Nov 2003 00:24:06 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A9ED43FBF for ; Fri, 21 Nov 2003 00:24:05 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id hAL8O4kX032781; Fri, 21 Nov 2003 00:24:05 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <3FBDCBA3.3080100@acm.org> Date: Fri, 21 Nov 2003 00:24:03 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jay Sern Liew References: <20031120223816.G61303@pinnacle.schulte.org> In-Reply-To: <20031120223816.G61303@pinnacle.schulte.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: integer and long max/min values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 08:24:06 -0000 Jay Sern Liew wrote: > how do I find out the maximum (and minimum) value a long and int will hold > in C? (before it overflows or underflows) #include INT_MAX and INT_MIN are the max/min values for an int LONG_MAX and LONG_MIN are the max/min values for long. Also, see stdint.h, which is defined in C99. Also, buy a good C reference book. ;-) Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 00:53: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 3344116A4CE for ; Fri, 21 Nov 2003 00:53:07 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 3515343F85 for ; Fri, 21 Nov 2003 00:53:05 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 16016 invoked from network); 21 Nov 2003 08:51:32 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 21 Nov 2003 08:51:32 -0000 Received: (qmail 18753 invoked by uid 1000); 21 Nov 2003 08:53:00 -0000 Date: Fri, 21 Nov 2003 10:53:00 +0200 From: Peter Pentchev To: Dag-Erling Sm?rgrav Message-ID: <20031121085300.GP300@straylight.m.ringlet.net> Mail-Followup-To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/+CTqSGWdiRg+8j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1i cc: hackers@freebsd.org cc: Mike Tancsa Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 08:53:07 -0000 --W/+CTqSGWdiRg+8j Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2003 at 08:49:52AM +0100, Dag-Erling Sm?rgrav wrote: > des@des.no (Dag-Erling Sm?rgrav) writes: > > Peter Pentchev writes: > >> Awwighty, attached is a patch that converts getuptime() and dointr() to > >> use sysctl, and then adds the -a option to display all interrupts. > >> This one was tested on both RELENG_4 and HEAD (ref5) :) > > [...] >=20 > Why don't you use sysctlbyname(3) instead of juggling with numeric > names? Point taken. I was going to attach a patch that uses sysctlbyname(3), fixes another buglet in the !VMSTAT_SYSCTL case (and is less intrusive), and removes the intrcnt/intrnames-related namelist definitions for the VMSTAT_SYSCTL case. However, it seems to have "issues" on 64-bit platforms, or at least beast. I'm working on it. I'll send a separate reply to your other message about the '???' and stray irq's. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence claims to be an Epimenides paradox, but it is lying. --W/+CTqSGWdiRg+8j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vdJs7Ri2jRYZRVMRApaLAJ91rHmzQ7ZEfHSyH2X/7l0p7rJYzACgp0eD Kz1RPed0XJxqqHHd84RaQ50= =rfCd -----END PGP SIGNATURE----- --W/+CTqSGWdiRg+8j-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 00:56: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 1B70A16A4CE for ; Fri, 21 Nov 2003 00:56:51 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E68E43FA3 for ; Fri, 21 Nov 2003 00:56:49 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 404085309; Fri, 21 Nov 2003 09:56:48 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id EAF145308; Fri, 21 Nov 2003 09:56:40 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 9301E33C86; Fri, 21 Nov 2003 09:56:40 +0100 (CET) To: Mike Tancsa References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> <20031121085300.GP300@straylight.m.ringlet.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 09:56:40 +0100 In-Reply-To: <20031121085300.GP300@straylight.m.ringlet.net> (Peter Pentchev's message of "Fri, 21 Nov 2003 10:53:00 +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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 08:56:51 -0000 Peter Pentchev writes: > Point taken. I was going to attach a patch that uses sysctlbyname(3), > fixes another buglet in the !VMSTAT_SYSCTL case (and is less intrusive), > and removes the intrcnt/intrnames-related namelist definitions for the > VMSTAT_SYSCTL case. However, it seems to have "issues" on 64-bit > platforms, or at least beast. I'm working on it. Never mind, I'll take it from here. I've been working on it for the past hour and have a ton of additional patches. There are other issues to address such as the fact that your patch breaks post-mortem use, and the desirability of removing vmstat's setgid bit. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 01:24:16 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 3278916A4CE for ; Fri, 21 Nov 2003 01:24:16 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 941A443FFB for ; Fri, 21 Nov 2003 01:24:12 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 22105 invoked from network); 21 Nov 2003 09:22:38 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 21 Nov 2003 09:22:38 -0000 Received: (qmail 22389 invoked by uid 1000); 21 Nov 2003 09:24:06 -0000 Date: Fri, 21 Nov 2003 11:24:06 +0200 From: Peter Pentchev To: Dag-Erling Sm?rgrav Message-ID: <20031121092406.GR300@straylight.m.ringlet.net> Mail-Followup-To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> <20031121085300.GP300@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xtx0sNU5lZ46KfgK" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1i cc: hackers@freebsd.org cc: Mike Tancsa Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 09:24:16 -0000 --xtx0sNU5lZ46KfgK Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2003 at 09:56:40AM +0100, Dag-Erling Sm?rgrav wrote: > Peter Pentchev writes: > > Point taken. I was going to attach a patch that uses sysctlbyname(3), > > fixes another buglet in the !VMSTAT_SYSCTL case (and is less intrusive), > > and removes the intrcnt/intrnames-related namelist definitions for the > > VMSTAT_SYSCTL case. However, it seems to have "issues" on 64-bit > > platforms, or at least beast. I'm working on it. >=20 > Never mind, I'll take it from here. I've been working on it for the > past hour and have a ton of additional patches. There are other > issues to address such as the fact that your patch breaks post-mortem > use, and the desirability of removing vmstat's setgid bit. I was thinking about the setgid bit too, but it can only be removed when all of vmstat's functionality, not just dointr(), is converted to use sysctl. That was the next item on my todo list :) Still, here's the updated patch I was speaking of, just to show you what I meant about the !VMSTAT_SYSCTL buglet and it being less intrusive; kvm_openfiles() was not invoked even in the !VMSTAT_SYSCTL case, meaning dointr() wouldn't work at all then. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Thit sentence is not self-referential because "thit" is not a word. Index: src/usr.bin/vmstat/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/Makefile,v retrieving revision 1.9 diff -u -r1.9 Makefile --- src/usr.bin/vmstat/Makefile 8 Feb 2002 23:07:36 -0000 1.9 +++ src/usr.bin/vmstat/Makefile 20 Nov 2003 15:51:53 -0000 @@ -3,6 +3,7 @@ =20 PROG=3D vmstat MAN=3D vmstat.8 +CFLAGS+=3D-DVMSTAT_SYSCTL BINGRP=3D kmem BINMODE=3D2555 DPADD=3D ${LIBKVM} ${LIBDEVSTAT} Index: src/usr.bin/vmstat/vmstat.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v retrieving revision 1.25 diff -u -r1.25 vmstat.8 --- src/usr.bin/vmstat/vmstat.8 14 Apr 2003 07:22:25 -0000 1.25 +++ src/usr.bin/vmstat/vmstat.8 20 Nov 2003 15:51:53 -0000 @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .\" .Op Fl fimst -.Op Fl fimsz +.Op Fl afimsz .Op Fl c Ar count .Op Fl M Ar core .Op Fl N Ar system @@ -62,6 +62,10 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +When used with +.Fl i , +include statistics about interrupts that have never been generated. .It Fl c Repeat the display .Ar count Index: src/usr.bin/vmstat/vmstat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v retrieving revision 1.69 diff -u -r1.69 vmstat.c --- src/usr.bin/vmstat/vmstat.c 9 Nov 2003 20:39:56 -0000 1.69 +++ src/usr.bin/vmstat/vmstat.c 21 Nov 2003 08:24:52 -0000 @@ -129,6 +129,7 @@ struct vmmeter sum, osum; =20 int winlines =3D 20; +int aflag =3D 0; int nflag =3D 0; =20 kvm_t *kd; @@ -174,8 +175,11 @@ memf =3D nlistf =3D NULL; interval =3D reps =3D todo =3D 0; maxshowdevs =3D 2; - while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) { + while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) { switch (c) { + case 'a': + aflag++; + break; case 'c': reps =3D atoi(optarg); break; @@ -239,6 +243,9 @@ if (nlistf !=3D NULL || memf !=3D NULL) setgid(getgid()); =20 +#ifdef VMSTAT_SYSCTL + if (todo & ~INTRSTAT) { +#endif /* VMSTAT_SYSCTL */ kd =3D kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); if (kd =3D=3D 0)=20 errx(1, "kvm_openfiles: %s", errbuf); @@ -258,6 +265,9 @@ warnx("kvm_nlist: %s", kvm_geterr(kd)); exit(1); } +#ifdef VMSTAT_SYSCTL + } +#endif /* VMSTAT_SYSCTL */ =20 if (todo & VMSTAT) { struct winsize winsize; @@ -386,8 +396,26 @@ static time_t now; time_t uptime; =20 - if (boottime.tv_sec =3D=3D 0) + if (boottime.tv_sec =3D=3D 0) { +#ifdef VMSTAT_SYSCTL + int mib[2] =3D { CTL_KERN, KERN_BOOTTIME }; + char *value; + size_t size; + + if (sysctl(mib, 2, NULL, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + if (size < sizeof(boottime)) + errx(1, "sizeof(kern.boottime) < sizeof(timeval)"); + value =3D malloc(size); + if (value =3D=3D NULL) + errx(1, "malloc"); + if (sysctl(mib, 2, value, &size, NULL, NULL) =3D=3D -1) + err(1, "sysctl(kern.boottime)"); + memcpy(&boottime, value, sizeof(boottime)); +#else /* VMSTAT_SYSCTL */ kread(X_BOOTTIME, &boottime, sizeof(boottime)); +#endif /* VMSTAT_SYSCTL */ + } (void)time(&now); uptime =3D now - boottime.tv_sec; if (uptime <=3D 0 || uptime > 60*60*24*365*10) @@ -732,8 +760,41 @@ int i, istrnamlen; size_t clen; char *intrname, *tintrname; +#ifdef VMSTAT_SYSCTL + int *mibcnt, *mibname; + size_t mibcntsize, mibnamesize; +#endif /* VMSTAT_SYSCTL */ =20 uptime =3D getuptime(); +#ifdef VMSTAT_SYSCTL + /* Fetch the sysctl MIB's */ + if (sysctlnametomib("hw.intrcnt", NULL, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + mibcnt =3D malloc(mibcntsize * sizeof(int)); + if (mibcnt =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrcnt", mibcnt, &mibcntsize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrcnt sysctl"); + if (sysctlnametomib("hw.intrnames", NULL, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + mibname =3D malloc(mibnamesize * sizeof(int)); + if (mibname =3D=3D NULL) + errx(1, "malloc"); + if (sysctlnametomib("hw.intrnames", mibname, &mibnamesize) =3D=3D -1) + err(1, "fetching the MIB for the hw.intrnames sysctl"); + + /* Fetch the arrays themselves */ + if (sysctl(mibcnt, mibcntsize, NULL, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + intrcnt =3D malloc((size_t)nintr); + if (sysctl(mibcnt, mibcntsize, intrcnt, &nintr, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrcnt)"); + if (sysctl(mibname, mibnamesize, NULL, &inamlen, NULL, NULL) =3D=3D -1) + err(1, "sysctl(hw.intrnames)"); + intrname =3D malloc((size_t)inamlen); + if (sysctl(mibname, mibnamesize, intrname, &inamlen, NULL, NULL) =3D=3D -= 1) + err(1, "sysctl(hw.intrnames)"); +#else /* VMSTAT_SYSCTL */ nintr =3D namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; inamlen =3D namelist[X_EINTRNAMES].n_value - namelist[X_INTRNAMES].n_value; @@ -743,6 +804,7 @@ errx(1, "malloc"); kread(X_INTRCNT, intrcnt, (size_t)nintr); kread(X_INTRNAMES, intrname, (size_t)inamlen); +#endif /* VMSTAT_SYSCTL */ nintr /=3D sizeof(u_long); tintrname =3D intrname; istrnamlen =3D strlen("interrupt"); @@ -756,7 +818,7 @@ "rate"); inttotal =3D 0; while (--nintr >=3D 0) { - if (*intrcnt) + if (*intrcnt || (aflag && intrname[0])) (void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname, *intrcnt, *intrcnt / uptime); intrname +=3D strlen(intrname) + 1; @@ -829,7 +891,7 @@ usage() { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", + "usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n", " [-n devs] [disks]\n"); exit(1); } --xtx0sNU5lZ46KfgK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vdm27Ri2jRYZRVMRAr+MAJ9cTo49Ql6Rq+GsH5EKrYRgqOQ+oACfbLCY H+LdM96ec4qJiKNC8s98lLY= =2Rhd -----END PGP SIGNATURE----- --xtx0sNU5lZ46KfgK-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 02:01: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 89E0E16A4CE; Fri, 21 Nov 2003 02:01:03 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8147643FDD; Fri, 21 Nov 2003 02:01:00 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 431D13ABB35; Fri, 21 Nov 2003 10:59:40 +0100 (CET) Date: Fri, 21 Nov 2003 10:59:40 +0100 From: Pawel Jakub Dawidek To: Wes Peters Message-ID: <20031121095939.GS511@garage.freebsd.pl> References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <200311201327.29226.wes@softweyr.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="4WCFFtl4AQpQKunj" Content-Disposition: inline In-Reply-To: <200311201327.29226.wes@softweyr.com> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: freebsd-hackers@freebsd.org cc: phk@freebsd.org cc: Rayson Ho Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 10:01:03 -0000 --4WCFFtl4AQpQKunj Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2003 at 01:27:29PM -0800, Wes Peters wrote: +> On Tuesday 18 November 2003 16:31, Rayson Ho wrote: +> > I am wondering if it is useful to have a "secure" file flag?? +> > +> > The secure file flag will be set for files that contain sensitive +> > data. Then the OS will take special care when operating on those +> > "secure" files. +> > +> > e.g. when deleting a "secure" file, the OS will overwrite the file +> > with random data. +>=20 +> Better to overwrite it with a more "secure" pattern. See ports/=20 +> sysutils/obliterate for references. It has been mentioned before that= =20 +> this could be done on in the kernel, obliterating blocks in the VM=20 +> rather than zeroing them. I hadn't thought of applying at the file or= =20 +> filesystem level. +>=20 +> > One advantage would be to have "secure" files in the same filesystem +> > as other normal files. +> > +> > Any one knows if FreeBSD has already implemented this?? +>=20 +> The closest we have is the 'rm -P' command and the above-mentioned=20 +> obliterate command. The overwrite pattern used in 'rm -P' is not=20 +> likely to be effective against a dedicated inspection of the disk; the= =20 +> one in obliterate somewhat more so. +>=20 +> This sounds like an interesting file flag. Would you expect the process= =20 +> to block on the unlink(2) call while the overwrite takes place, or for= =20 +> this to happen in a kernel thread? The former seems pretty straight-=20 +> forward, hacking at ffs_blkfree. The latter I really wouldn't know how= =20 +> to begin without (a lot) more study. If this operation is able to fail (and of course it is) it should block on unlink(2). User has to be informed about status of operation like this one to give user a chance to do something else, performace isn't high-priority here, IMHO. Creating hard links to such file should be also forbiden (maybe only for non-owners). Another usefull thing will be posibility to pass flag to unlink(2) syscall to force "secure" removal (or "secure" removal in non-blocking mode as well). This will be more intuitive for programms that operate on many temporary files with sensitive data AND/OR allow setting this flag for directories. BTW. Poul-Henning Kamp proposed in his junior-kernel-hacker-todo-list mechanism that will provide zeroing all pages freed by 'special' process. This could be also implemented as file-flag (no modifications of source needed and this could be also used with close-source applications). Such "secure" flag for running process could be also implemented with multiple meanings: 1. All freed pages have to be zeroed. 2. All removed files have to be overwritten. 3. Umask for newly created files should be 0077. 4. "secure" flag for newly created files should be forced? 5. ... :) While phk is no more reading this list I'm CCing this mail to him. --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --4WCFFtl4AQpQKunj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP73iCz/PhmMH/Mf1AQFlzwP+OU4obkTdCHcCKGL+fEWQPai8pnWZENI6 IGR274IL68GRwQRwcb4d3nTF1hUa4WhRRR+75SzWvMNwZ6zYDaRkDBK7Fz9Jn+qF fhAf6HpTWcBVvyZL3CAszHtRMkASu2y7BVhgEgIRD6vXGAfo30lR2DmKRQP1Wvck 7Kwq5l0xswE= =YyW8 -----END PGP SIGNATURE----- --4WCFFtl4AQpQKunj-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 03:13:16 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 8618C16A4CE; Fri, 21 Nov 2003 03:13:16 -0800 (PST) Received: from server.vk2pj.dyndns.org (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B46743FDD; Fri, 21 Nov 2003 03:13:15 -0800 (PST) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])hALBDDJD071602; Fri, 21 Nov 2003 22:13:13 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.12.9p1/8.12.9/Submit) id hALBDDMo071601; Fri, 21 Nov 2003 22:13:13 +1100 (EST) (envelope-from peter) Date: Fri, 21 Nov 2003 22:13:13 +1100 From: Peter Jeremy To: Pawel Jakub Dawidek Message-ID: <20031121111313.GA71265@server.vk2pj.dyndns.org> References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <200311201327.29226.wes@softweyr.com> <20031121095939.GS511@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031121095939.GS511@garage.freebsd.pl> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org cc: phk@freebsd.org Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 11:13:16 -0000 On Fri, Nov 21, 2003 at 10:59:40AM +0100, Pawel Jakub Dawidek wrote: >Such "secure" flag for running process could be also implemented with >multiple meanings: Is the "secure" flag intended to protect the process image from the invoking user as well as other users? >1. All freed pages have to be zeroed. >2. All removed files have to be overwritten. >3. Umask for newly created files should be 0077. >4. "secure" flag for newly created files should be forced? >5. ... 5. Modified pages can't be written to swap (unless swap is encrypted). 6. Process get setuid-type treatment of core-dumps and rtld environment etc ... Peter From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 03:13: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 C451D16A4CE for ; Fri, 21 Nov 2003 03:13:57 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43C1043FD7 for ; Fri, 21 Nov 2003 03:13:56 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id F10535309; Fri, 21 Nov 2003 12:13:54 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 71A9A5308; Fri, 21 Nov 2003 12:13:47 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id E4B8833C86; Fri, 21 Nov 2003 12:13:46 +0100 (CET) To: Mike Tancsa References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> <20031121085300.GP300@straylight.m.ringlet.net> <20031121092406.GR300@straylight.m.ringlet.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 12:13:46 +0100 In-Reply-To: <20031121092406.GR300@straylight.m.ringlet.net> (Peter Pentchev's message of "Fri, 21 Nov 2003 11:24:06 +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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: hackers@freebsd.org Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 11:13:57 -0000 Peter Pentchev writes: > I was thinking about the setgid bit too, but it can only be removed when > all of vmstat's functionality, not just dointr(), is converted to use > sysctl. I know; I'm working on it, and am more than half done. > Still, here's the updated patch I was speaking of, just to show you what > I meant about the !VMSTAT_SYSCTL buglet and it being less intrusive; > kvm_openfiles() was not invoked even in the !VMSTAT_SYSCTL case, meaning > dointr() wouldn't work at all then. VMSTAT_SYSCTL is a mistake; vmstat must decide at runtime whether to use sysctl (live system) or libkvm (postmortem). DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 03:31: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 1EA9116A4CE for ; Fri, 21 Nov 2003 03:31:32 -0800 (PST) Received: from cs.huji.ac.il (cs.huji.ac.il [132.65.16.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53D4B43FB1 for ; Fri, 21 Nov 2003 03:31:31 -0800 (PST) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32] ident=danny) by cs.huji.ac.il with esmtp id 1AN9VX-000C0F-DO for freebsd-hackers@freebsd.org; Fri, 21 Nov 2003 13:31:27 +0200 X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: freebsd-hackers@freebsd.org In-reply-to: Your message of Mon, 10 Nov 2003 12:34:07 +0200 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 21 Nov 2003 13:31:27 +0200 From: Danny Braniss Message-Id: Subject: Help needed with QLogic 2300/FibreChannel 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: Fri, 21 Nov 2003 11:31:32 -0000 this card worked fine the first time, now, after some fiddling with the EMC/Clariion, the disks disappeared! BTW, windows sees them ok. enabling debugging i get ... isp0: Target 0 (Loop 0x0) Port ID 0xef (role Target) Arrived Port WWN 0x50060160006003b4 Node WWN 0x50060160806003b4 isp0: port unavailable for target 1 isp0: Firmware State Waiting for AL_PA> isp0: LIP Received isp0: Firmware State Wait Login> isp0: Port Database Changed isp0: Firmware State Ready> isp0: Loop ID 1, AL_PA 0xe8, Port ID 0xe8, Loop State 0x2, Topology 'Private Loop' isp0: Target 1 (Loop 0x1) Port ID 0xe8 (role Target/Initiator) Arrived Port WWN 0x210000e08b100101 Node WWN 0x200000e08b100101 isp0: Retaining Loop ID 0x0 for Target 0 (Port 0xef) ... but no target device is availabel! thnaks, danny From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 03:41:15 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 6494B16A4CE; Fri, 21 Nov 2003 03:41:15 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 582BC43FE1; Fri, 21 Nov 2003 03:41:14 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 542955309; Fri, 21 Nov 2003 12:41:13 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 0C61A5308; Fri, 21 Nov 2003 12:41:06 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id E9F6F33C86; Fri, 21 Nov 2003 12:41:05 +0100 (CET) To: Pawel Jakub Dawidek References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <200311201327.29226.wes@softweyr.com> <20031121095939.GS511@garage.freebsd.pl> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 12:41:05 +0100 In-Reply-To: <20031121095939.GS511@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Fri, 21 Nov 2003 10:59:40 +0100") 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 11:41:15 -0000 Pawel Jakub Dawidek writes: > If this operation is able to fail (and of course it is) it should block > on unlink(2). FreeBSD is not DOS; unlink(2) does not actually remove the file. It is removed by the filesystem if the link count is zero when the vnode is released, which may be immediately after the unlink(2) call, or an indefinite amount of time later if the file was open at the time. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 04:45:26 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 78C1816A4CE; Fri, 21 Nov 2003 04:45:26 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B27B43F85; Fri, 21 Nov 2003 04:45:22 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 106433ABB4E; Fri, 21 Nov 2003 13:43:51 +0100 (CET) Date: Fri, 21 Nov 2003 13:43:50 +0100 From: Pawel Jakub Dawidek To: Dag-Erling Sm?rgrav Message-ID: <20031121124350.GT511@garage.freebsd.pl> References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <200311201327.29226.wes@softweyr.com> <20031121095939.GS511@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="FZIkiClxIZ9JeWSb" Content-Disposition: inline In-Reply-To: X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 12:45:26 -0000 --FZIkiClxIZ9JeWSb Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2003 at 12:41:05PM +0100, Dag-Erling Sm?rgrav wrote: +> > If this operation is able to fail (and of course it is) it should block +> > on unlink(2). +>=20 +> FreeBSD is not DOS; unlink(2) does not actually remove the file. It +> is removed by the filesystem if the link count is zero when the vnode +> is released, which may be immediately after the unlink(2) call, or an +> indefinite amount of time later if the file was open at the time. I'm aware of this, but what we want to think over here is something like in-kernel 'rm -P'. So file will be overwriten even if it is opened and/or link count is grater than 0. That's why allowing link(2) operation for such files don't make much sens (the problem exists when there are hardlinks before "secure" flag is set). --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --FZIkiClxIZ9JeWSb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP74Ihj/PhmMH/Mf1AQEXZAP/Y2x+EpADzKuQoJktUo7k+rXYYJY4izp6 p6XUXH01dMGZyLbQ06cGFa/klGQyb4aN6VtnPrnDrbil/yjvf5e6Xl0uM2yL5fD4 k5r4m3R30zESQSXJdA2cVr4iXtRKpLEe91VU8oDb7WEtQDhDJe5RX+eEqyxAhznQ 96scgU0CvAo= =5F+K -----END PGP SIGNATURE----- --FZIkiClxIZ9JeWSb-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 05:30: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 A8F3716A4CE; Fri, 21 Nov 2003 05:30:24 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A81943F75; Fri, 21 Nov 2003 05:30:19 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 0BE115309; Fri, 21 Nov 2003 14:30:18 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 167695308; Fri, 21 Nov 2003 14:30:08 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 9BD0933C86; Fri, 21 Nov 2003 14:30:08 +0100 (CET) To: Pawel Jakub Dawidek References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <200311201327.29226.wes@softweyr.com> <20031121095939.GS511@garage.freebsd.pl> <20031121124350.GT511@garage.freebsd.pl> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 21 Nov 2003 14:30:08 +0100 In-Reply-To: <20031121124350.GT511@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Fri, 21 Nov 2003 13:43:50 +0100") 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 13:30:25 -0000 Pawel Jakub Dawidek writes: > I'm aware of this, but what we want to think over here is something like > in-kernel 'rm -P'. So file will be overwriten even if it is opened > and/or link count is grater than 0. That is not acceptable. First of all, it breaks a lot of assumptions in the filesystem code. Second, it is incompatible with the common technique of unlinking a temporary file immediately after opening it to avoid having it stick around if the process that created it dies prematurely. Your proposed change would thus reduce security rather than enhance it. Besides, overwriting the contents of a file when it is removed from the file system is not enough. You also need to overwrite every block or fragment which is released any time the file shrinks. Fortunately, ufs always truncates a file to length 0 when it is removed, so you only need to modify ffs_truncate() to implement both aspects (truncation and removal). You should also take care to overwrite the file's extended attributes if it has any. Finally, I think a filesystem flag is much better for this purpose than a file flag; and in either case, file removal and truncation performance will be awful. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 06:19:44 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 81DB116A4CE; Fri, 21 Nov 2003 06:19:44 -0800 (PST) Received: from f19.mail.ru (f19.mail.ru [194.67.57.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id 924D943FBF; Fri, 21 Nov 2003 06:19:43 -0800 (PST) (envelope-from dd1968@mail.ru) Received: from mail by f19.mail.ru with local id 1ANC8M-000KZE-00; Fri, 21 Nov 2003 17:19:42 +0300 Received: from [194.186.29.253] by win.mail.ru with HTTP; Fri, 21 Nov 2003 17:19:42 +0300 From: =?koi8-r?Q?=22?=dd dd=?koi8-r?Q?=22=20?= To: freebsd-hackers@freebsd.org Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [194.186.29.253] Date: Fri, 21 Nov 2003 17:19:42 +0300 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: cc: freebsd-hardware@freebsd.org Subject: 5.1 hangs on large file transfers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: =?koi8-r?Q?=22?=dd dd=?koi8-r?Q?=22=20?= List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 14:19:44 -0000 HI Fellows, sorry bothering you. There is probably an inssue with 5.1-RELEASE. I got 2 hdd attached to separate cables/controllers. At the boot time I can see something like: ad0: 9732MB [19774/16/63] at ata0-master UDMA100 ad2: 76351MB [155127/16/63] at ata1-master UDMA100 ad2: UDMA ICRC error cmd=read fsbn 0 of 0-3 retrying last message repeated 2 times ad2: UDMA ICRC error cmd=read fsbn 0 of 0-3 falling back to PIO mode last message repeated 2 times Then system runs and looks alive and kicky. Buut when I'm trying to perform large file transfers from one disc to another, the system freezes with no diagnostics. Even when I press something like CapsLock led does not blink. I read some posts concerning this issue. So, I turned off any NFSs and changed cables, stripped kernel to minimum functionality (however still running natd). Still got this problem. When I do any transfers on the same hdd -- everything looks fine. The same disks with 4.7 installed work with no problems. Can this be motherboard/samsung incompatibility or just software tricks? Thanks in advance, Dmitry. P.S. please reply to me directly cause I do not read the list. From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 06:39: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 0307C16A4CF for ; Fri, 21 Nov 2003 06:39:47 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 7556843FE5 for ; Fri, 21 Nov 2003 06:39:43 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 21703 invoked from network); 21 Nov 2003 14:38:09 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 21 Nov 2003 14:38:09 -0000 Received: (qmail 68526 invoked by uid 1000); 21 Nov 2003 14:39:36 -0000 Date: Fri, 21 Nov 2003 16:39:36 +0200 From: Peter Pentchev To: Dag-Erling Sm?rgrav Message-ID: <20031121143936.GV300@straylight.m.ringlet.net> Mail-Followup-To: Dag-Erling Sm?rgrav , Mike Tancsa , hackers@freebsd.org References: <20031120044945.GA44933@falcon.midgard.homeip.net> <20031120131903.GG300@straylight.m.ringlet.net> <20031120153655.GI300@straylight.m.ringlet.net> <20031121085300.GP300@straylight.m.ringlet.net> <20031121092406.GR300@straylight.m.ringlet.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rUztinBX/EQDJOOk" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1i cc: hackers@freebsd.org cc: Mike Tancsa Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 14:39:47 -0000 --rUztinBX/EQDJOOk Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2003 at 12:13:46PM +0100, Dag-Erling Sm?rgrav wrote: > Peter Pentchev writes: > > I was thinking about the setgid bit too, but it can only be removed when > > all of vmstat's functionality, not just dointr(), is converted to use > > sysctl. >=20 > I know; I'm working on it, and am more than half done. >=20 > > Still, here's the updated patch I was speaking of, just to show you what > > I meant about the !VMSTAT_SYSCTL buglet and it being less intrusive; > > kvm_openfiles() was not invoked even in the !VMSTAT_SYSCTL case, meaning > > dointr() wouldn't work at all then. >=20 > VMSTAT_SYSCTL is a mistake; vmstat must decide at runtime whether to > use sysctl (live system) or libkvm (postmortem). Oh; right. Sorry. Should have picked that up from your last message about the postmortem analysis. By the way, the '???' comes directly from i386/isa/mp_machdep.c, the update_intrname() routine; looks like there has never been a device driver or anything that has claimed interrupt 0 :) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If there were no counterfactuals, this sentence would not have been paradox= ical. --rUztinBX/EQDJOOk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/viOo7Ri2jRYZRVMRAif3AKC5hdTQbc6gjWjyexy+G5vtrPRvygCePW6L JAGCgVO3QkUI1uGbcG2+leY= =A1YA -----END PGP SIGNATURE----- --rUztinBX/EQDJOOk-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 07:16:35 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 1B71C16A4CE for ; Fri, 21 Nov 2003 07:16:35 -0800 (PST) Received: from razorbill.mail.pas.earthlink.net (razorbill.mail.pas.earthlink.net [207.217.121.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id DABED43FE5 for ; Fri, 21 Nov 2003 07:16:33 -0800 (PST) (envelope-from richardcoleman@mindspring.com) Received: from titan.criticalmagic.com ([68.213.16.23] helo=mindspring.com) by razorbill.mail.pas.earthlink.net with asmtp (Exim 3.33 #1) id 1AND1M-0006A7-00; Fri, 21 Nov 2003 07:16:32 -0800 Message-ID: <3FBE2C57.6070200@mindspring.com> Date: Fri, 21 Nov 2003 10:16:39 -0500 From: Richard Coleman Organization: Critical Magic, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jay Sern Liew References: <20031120223816.G61303@pinnacle.schulte.org> In-Reply-To: <20031120223816.G61303@pinnacle.schulte.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: 1ee258965991efcb0865379cdb43356e5e89bb4777695beb702e37df12b9c9ef67d076f66eb4ed2e5a50595281111ef7350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: integer and long max/min values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: richardcoleman@mindspring.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 15:16:35 -0000 Jay Sern Liew wrote: > how do I find out the maximum (and minimum) value a long and int will hold > in C? (before it overflows or underflows) > > if it's compiler-dependent, then does anyone know where I can find the GCC > documentation for stuff like that? It will be architecture dependent (32 or 64 bit machines?). I doubt the GCC docs talk about this. You might check Richard Steven's book on "Advanced Unix Programming". It covers lots of information about standard machine limits and how to discover them. Richard Coleman richardcoleman@mindspring.com From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 07:28:37 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 27BE316A4CE; Fri, 21 Nov 2003 07:28:37 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-63-207-60-234.dsl.lsan03.pacbell.net [63.207.60.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 670E743FE5; Fri, 21 Nov 2003 07:28:36 -0800 (PST) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 08BD766C55; Fri, 21 Nov 2003 07:28:35 -0800 (PST) Date: Fri, 21 Nov 2003 07:28:35 -0800 From: Kris Kennaway To: dd dd Message-ID: <20031121152835.GA1117@xor.obsecurity.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org cc: freebsd-hardware@freebsd.org Subject: Re: 5.1 hangs on large file transfers 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: Fri, 21 Nov 2003 15:28:37 -0000 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 21, 2003 at 05:19:42PM +0300, "dd dd" wrote: > HI Fellows, > sorry bothering you. > There is probably an inssue with 5.1-RELEASE. Does it persist with 5.1-CURRENT, which has a new ata driver? Kris --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vi8jWry0BWjoQKURArJCAJwLfFHjGIF9FVs8GggYs7BYg59irACfZFWv LRqM54Dsi86rBydrVo5RhLc= =Tl1z -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 08:47:19 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 4EEC816A4CE for ; Fri, 21 Nov 2003 08:47:19 -0800 (PST) Received: from quelrod.quelrod.net (cs24243230-109.austin.rr.com [24.243.230.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F4B643FA3 for ; Fri, 21 Nov 2003 08:47:18 -0800 (PST) (envelope-from quel@quelrod.net) Received: from quelrod.net (quelrod.net [127.0.0.1]) by quelrod.quelrod.net (8.12.9/8.12.9) with ESMTP id hALGlZm2008014 for ; Fri, 21 Nov 2003 10:47:35 -0600 (CST) Received: from localhost (quel@localhost) by quelrod.net (8.12.9/8.12.9/Submit) with ESMTP id hALGlZuG025166 for ; Fri, 21 Nov 2003 10:47:35 -0600 (CST) Date: Fri, 21 Nov 2003 10:47:35 -0600 (CST) From: quel@quelrod.net To: freebsd-hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 16:47:19 -0000 I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s transfers. According to dmesg fbsd is only doing 1.0: usb0: on uhci0 usb0: USB revision 1.0 usb1: on uhci1 usb1: USB revision 1.0 usb2: on uhci2 usb2: USB revision 1.0 (Yes i double checked my laptop does indeed have usb 2.0) I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I suppose it's too late to get this into 5.2 -RELEASE. -James From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 09:53:59 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 0816B16A4CE for ; Fri, 21 Nov 2003 09:53:59 -0800 (PST) Received: from mgw-x1.nokia.com (mgw-x1.nokia.com [131.228.20.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F01143FA3 for ; Fri, 21 Nov 2003 09:53:56 -0800 (PST) (envelope-from Vijay.Singh@nokia.com) Received: from esvir05nok.ntc.nokia.com (esvir05nokt.ntc.nokia.com [172.21.143.37])hALHrsA27806 for ; Fri, 21 Nov 2003 19:53:54 +0200 (EET) Received: from daebh001.NOE.Nokia.com (unverified) by esvir05nok.ntc.nokia.com ; Fri, 21 Nov 2003 19:53:53 +0200 Received: from mvebe001.NOE.Nokia.com ([172.18.140.37]) by daebh001.NOE.Nokia.com with Microsoft SMTPSVC(5.0.2195.6747); Fri, 21 Nov 2003 09:53:51 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Nov 2003 09:53:50 -0800 Message-ID: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: integer and long max/min values Thread-Index: AcOwCP5XbFH4bGSAQQCayauJ4ckLsgAT1YQg From: To: , X-OriginalArrivalTime: 21 Nov 2003 17:53:51.0071 (UTC) FILETIME=[6BEB76F0:01C3B058] cc: freebsd-hackers@freebsd.org Subject: RE: integer and long max/min values 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: Fri, 21 Nov 2003 17:53:59 -0000 Write a simple C program to ++ an int or long variable and see when it = overflows. > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org > [mailto:owner-freebsd-hackers@freebsd.org]On Behalf Of ext=20 > Tim Kientzle > Sent: Friday, November 21, 2003 12:24 AM > To: Jay Sern Liew > Cc: freebsd-hackers@freebsd.org > Subject: Re: integer and long max/min values >=20 >=20 > Jay Sern Liew wrote: > > how do I find out the maximum (and minimum) value a long=20 > and int will hold > > in C? (before it overflows or underflows) >=20 > #include >=20 > INT_MAX and INT_MIN are the max/min values for an int > LONG_MAX and LONG_MIN are the max/min values for long. >=20 > Also, see stdint.h, which is defined in C99. >=20 > Also, buy a good C reference book. ;-) >=20 > Tim Kientzle >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to=20 > "freebsd-hackers-unsubscribe@freebsd.org" >=20 From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 10:08: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 4B1A816A4CE for ; Fri, 21 Nov 2003 10:08:05 -0800 (PST) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB4843FBF for ; Fri, 21 Nov 2003 10:08:02 -0800 (PST) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id hALI592M044142 for freebsd-hackers@freebsd.org.checked; (8.12.8/vak/2.1) Fri, 21 Nov 2003 21:05:09 +0300 (MSK) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id hALI2Avk044030; (8.12.8/vak/2.1) Fri, 21 Nov 2003 21:02:10 +0300 (MSK) (envelope-from rik@cronyx.ru) Message-ID: <3FBE53DC.6020208@cronyx.ru> Date: Fri, 21 Nov 2003 21:05:16 +0300 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030401 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: MAJOR number #2 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: Fri, 21 Nov 2003 18:08:05 -0000 Hi, Daniel Eischen wrote: >On Mon, 17 Nov 2003, Roman Kurakin wrote: > > >>Hi, >> >>I need a new MAJOR number for our new device. >>How can I get it? >> >>I've read that FreeBSD doesn't use them any more. >>But we may need it to not interfere with other device >>drivers in previous releases of FreeBSD. >> >>??? ce Cronyx Tau-32 E1 adapter >> >> > >You don't need them in -current. > >You might want to send this to -stable or -arch if >noone responds. > Thank you for reply. Best regards, Roman Kurakin > > > From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 10:37:28 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 24C2B16A4CF for ; Fri, 21 Nov 2003 10:37:28 -0800 (PST) Received: from mail.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EE1743F93 for ; Fri, 21 Nov 2003 10:37:27 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 7384 invoked from network); 21 Nov 2003 18:37:24 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 21 Nov 2003 18:37:24 -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 hALIawFn037322; Fri, 21 Nov 2003 13:37:04 -0500 (EST) (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: <1069392953.40138.5.camel@mind.daemon.sh> Date: Fri, 21 Nov 2003 13:36:57 -0500 (EST) From: John Baldwin To: Ibrahim Abdullah X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-hackers@freebsd.org Subject: RE: Submitting changes that add an option 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: Fri, 21 Nov 2003 18:37:28 -0000 On 21-Nov-2003 Ibrahim Abdullah wrote: > I've added an option to the from command so that it can also display the > subject header. For instance: > > $ from > From owner-freebsd-questions@freebsd.org Thu Nov 20 23:44:57 2003 > From owner-freebsd-questions@freebsd.org Thu Nov 20 23:50:59 2003 > > $ from -S > From owner-freebsd-questions@freebsd.org Thu Nov 20 23:44:57 2003 > Subject: How can I set a password from STDIN? > From owner-freebsd-questions@freebsd.org Thu Nov 20 23:50:59 2003 > Subject: Binary port question > > Is this something I could submit to be added to the freebsd source tree, > or would this not be of interest? > > Should I use the send_pr command (even though it isn't a problem > report)? I have created a diff for from.c and the man page from.1. Yes, send_pr is an excellent way to submit patches for new features as well as bugfixes. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 10:38: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 3EC1416A4CE for ; Fri, 21 Nov 2003 10:38:51 -0800 (PST) Received: from mail.speakeasy.net (mail8.speakeasy.net [216.254.0.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C69A43FE1 for ; Fri, 21 Nov 2003 10:38:49 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 18562 invoked from network); 21 Nov 2003 18:38:47 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 21 Nov 2003 18:38:47 -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 hALIcSFn037338; Fri, 21 Nov 2003 13:38:30 -0500 (EST) (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: <20031121143936.GV300@straylight.m.ringlet.net> Date: Fri, 21 Nov 2003 13:38:29 -0500 (EST) From: John Baldwin To: Peter Pentchev X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: Dag-Erling Sm?rgrav cc: hackers@freebsd.org cc: Mike Tancsa Subject: Re: interrupt statistics 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: Fri, 21 Nov 2003 18:38:51 -0000 On 21-Nov-2003 Peter Pentchev wrote: > On Fri, Nov 21, 2003 at 12:13:46PM +0100, Dag-Erling Sm?rgrav wrote: >> Peter Pentchev writes: >> > I was thinking about the setgid bit too, but it can only be removed when >> > all of vmstat's functionality, not just dointr(), is converted to use >> > sysctl. >> >> I know; I'm working on it, and am more than half done. >> >> > Still, here's the updated patch I was speaking of, just to show you what >> > I meant about the !VMSTAT_SYSCTL buglet and it being less intrusive; >> > kvm_openfiles() was not invoked even in the !VMSTAT_SYSCTL case, meaning >> > dointr() wouldn't work at all then. >> >> VMSTAT_SYSCTL is a mistake; vmstat must decide at runtime whether to >> use sysctl (live system) or libkvm (postmortem). > > Oh; right. Sorry. Should have picked that up from your last message > about the postmortem analysis. > > By the way, the '???' comes directly from i386/isa/mp_machdep.c, the > update_intrname() routine; looks like there has never been a device > driver or anything that has claimed interrupt 0 :) No, it exists for histerical raisins. In the older code (such as in 4.x), the ??? entry was used for any interrupt handler that was registered with an empty name. Current no longer will send any interrupts to the ??? bucket as all interrupt sources have names now. So, it could conceivably be dropped from current I guess. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 10:48: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 121A616A4CE for ; Fri, 21 Nov 2003 10:48:55 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 11A1F43FBD for ; Fri, 21 Nov 2003 10:48:53 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 27830 invoked from network); 21 Nov 2003 18:47:20 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 21 Nov 2003 18:47:20 -0000 Received: (qmail 78911 invoked by uid 1000); 21 Nov 2003 18:31:54 -0000 Date: Fri, 21 Nov 2003 20:31:54 +0200 From: Peter Pentchev To: Vijay.Singh@nokia.com Message-ID: <20031121183154.GC74629@straylight.m.ringlet.net> Mail-Followup-To: Vijay.Singh@nokia.com, kientzle@acm.org, liew@jaysern.org, freebsd-hackers@freebsd.org References: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZwgA9U+XZDXt4+m+" Content-Disposition: inline In-Reply-To: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> User-Agent: Mutt/1.5.5.1i cc: liew@jaysern.org cc: freebsd-hackers@freebsd.org cc: kientzle@acm.org Subject: Re: integer and long max/min values 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: Fri, 21 Nov 2003 18:48:55 -0000 --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2003 at 09:53:50AM -0800, Vijay.Singh@nokia.com wrote: [format recovered; Tim Kientzle wrote:] > > Jay Sern Liew wrote: > > > how do I find out the maximum (and minimum) value a long=20 > > and int will hold > > > in C? (before it overflows or underflows) > >=20 > > #include > >=20 > > INT_MAX and INT_MIN are the max/min values for an int > > LONG_MAX and LONG_MIN are the max/min values for long. > >=20 > > Also, see stdint.h, which is defined in C99. > >=20 > > Also, buy a good C reference book. ;-) > >=20 > > Tim Kientzle [..and Vijay Singh wrote:] >=20 > Write a simple C program to ++ an int or long variable and see when it > overflows. Why, after Tim actually quoted the exact header file to include and the exact constants to use? G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 You have, of course, just begun reading the sentence that you have just fin= ished reading. --ZwgA9U+XZDXt4+m+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/vloa7Ri2jRYZRVMRAl72AKDGCKzTnSF6z12N6N+zBzd+BuzfwQCgoVXH 7NSGIvkBuGaiSy3KQqvNE6Q= =zyOP -----END PGP SIGNATURE----- --ZwgA9U+XZDXt4+m+-- From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 11:30: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 BC81516A4CE for ; Fri, 21 Nov 2003 11:30:52 -0800 (PST) Received: from episec.com (episec.com [198.78.65.141]) by mx1.FreeBSD.org (Postfix) with SMTP id 0F0C743FE9 for ; Fri, 21 Nov 2003 11:30:52 -0800 (PST) (envelope-from edelkind-freebsd-hackers@episec.com) Received: (qmail 95872 invoked by uid 1024); 21 Nov 2003 19:30:33 -0000 Date: Fri, 21 Nov 2003 14:30:33 -0500 From: ari To: freebsd-hackers@freebsd.org Message-ID: <20031121193033.GM58437@episec.com> Mail-Followup-To: ari , freebsd-hackers@freebsd.org References: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> Subject: Re: integer and long max/min values 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: Fri, 21 Nov 2003 19:30:52 -0000 'Tis a bit of a waste of cpu time there. On a two's complement system, which is probably all you'll come by, you can find UINT_MAX by setting an unsigned integer to -1: unsigned int i_max = -1; A slightly more architecturally independent way of finding UINT_MAX would be to set an unsigned integer to the complement of its zero: unsigned int i_max = ~(unsigned int)0; Either way, you can find the positive signed maximum by dividing your result by two (discarding the remainder). Try the following: #include #include ... assert ((unsigned int)-1 == UINT_MAX); assert (~(unsigned int)0 == UINT_MAX); assert (((unsigned int)-1)/2 == INT_MAX); assert ((~(unsigned int)0)/2 == INT_MAX); ... Some may argue against this method, but using an unsigned complement of zero should hold at least the portability of assuming NULL to be false. The *_MAX macros, of course, should still be used whenever possible. ari Vijay.Singh@nokia.com said this stuff: > Write a simple C program to ++ an int or long variable and see when it overflows. > > > -----Original Message----- > > From: owner-freebsd-hackers@freebsd.org > > [mailto:owner-freebsd-hackers@freebsd.org]On Behalf Of ext > > Tim Kientzle > > Sent: Friday, November 21, 2003 12:24 AM > > To: Jay Sern Liew > > Cc: freebsd-hackers@freebsd.org > > Subject: Re: integer and long max/min values > > > > > > Jay Sern Liew wrote: > > > how do I find out the maximum (and minimum) value a long > > and int will hold > > > in C? (before it overflows or underflows) > > > > #include > > > > INT_MAX and INT_MIN are the max/min values for an int > > LONG_MAX and LONG_MIN are the max/min values for long. > > > > Also, see stdint.h, which is defined in C99. > > > > Also, buy a good C reference book. ;-) > > > > Tim Kientzle > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to > > "freebsd-hackers-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 12:07:19 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 98D4816A4CE for ; Fri, 21 Nov 2003 12:07:19 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC5CA43FAF for ; Fri, 21 Nov 2003 12:07:16 -0800 (PST) (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) hALK78vq067974 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 21 Nov 2003 21:07:10 +0100 (CET) (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.10/8.12.10) with ESMTP id hALK77ER023863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Nov 2003 21:07:07 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id hALK762u010811; Fri, 21 Nov 2003 21:07:06 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id hALK7375010810; Fri, 21 Nov 2003 21:07:03 +0100 (CET) (envelope-from ticso) Date: Fri, 21 Nov 2003 21:07:03 +0100 From: Bernd Walter To: quel@quelrod.net Message-ID: <20031121200702.GD74178@cicely12.cicely.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 20:07:19 -0000 On Fri, Nov 21, 2003 at 10:47:35AM -0600, quel@quelrod.net wrote: > I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s > transfers. According to dmesg fbsd is only doing 1.0: > usb0: on uhci0 > usb0: USB revision 1.0 > usb1: on uhci1 > usb1: USB revision 1.0 > usb2: on uhci2 > usb2: USB revision 1.0 > > (Yes i double checked my laptop does indeed have usb 2.0) > > I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I > suppose it's too late to get this into 5.2 -RELEASE. uhci is strictly an usb1.x controller. Build a kernel with ehci support if you have a high speed capable controller. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 13:10: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 14B6D16A4CF for ; Fri, 21 Nov 2003 13:10:05 -0800 (PST) Received: from quelrod.quelrod.net (cs24243230-109.austin.rr.com [24.243.230.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAD6A43FF3 for ; Fri, 21 Nov 2003 13:10:02 -0800 (PST) (envelope-from quel@quelrod.net) Received: from quelrod.net (quelrod.net [127.0.0.1]) by quelrod.quelrod.net (8.12.9/8.12.9) with ESMTP id hALLABm2027031; Fri, 21 Nov 2003 15:10:11 -0600 (CST) Received: from localhost (quel@localhost) by quelrod.net (8.12.9/8.12.9/Submit) with ESMTP id hALLAB30015233; Fri, 21 Nov 2003 15:10:11 -0600 (CST) Date: Fri, 21 Nov 2003 15:10:10 -0600 (CST) From: quel@quelrod.net To: ticso@cicely.de In-Reply-To: <20031121200702.GD74178@cicely12.cicely.de> Message-ID: References: <20031121200702.GD74178@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 21:10:05 -0000 Should device ehci be a default in GENERIC, then? -James On Fri, 21 Nov 2003, Bernd Walter wrote: > On Fri, Nov 21, 2003 at 10:47:35AM -0600, quel@quelrod.net wrote: > > I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s > > transfers. According to dmesg fbsd is only doing 1.0: > > usb0: on uhci0 > > usb0: USB revision 1.0 > > usb1: on uhci1 > > usb1: USB revision 1.0 > > usb2: on uhci2 > > usb2: USB revision 1.0 > > > > (Yes i double checked my laptop does indeed have usb 2.0) > > > > I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I > > suppose it's too late to get this into 5.2 -RELEASE. > > uhci is strictly an usb1.x controller. > Build a kernel with ehci support if you have a high speed capable > controller. > > -- > B.Walter BWCT http://www.bwct.de > ticso@bwct.de info@bwct.de > > From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 13:16:38 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 3D3CD16A4CE for ; Fri, 21 Nov 2003 13:16:38 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECA9243FA3 for ; Fri, 21 Nov 2003 13:16:35 -0800 (PST) (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) hALLGVvq068897 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 21 Nov 2003 22:16:33 +0100 (CET) (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.10/8.12.10) with ESMTP id hALLGTER024288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Nov 2003 22:16:30 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id hALLGT2u011006; Fri, 21 Nov 2003 22:16:29 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id hALLGSmY011005; Fri, 21 Nov 2003 22:16:28 +0100 (CET) (envelope-from ticso) Date: Fri, 21 Nov 2003 22:16:28 +0100 From: Bernd Walter To: quel@quelrod.net Message-ID: <20031121211627.GF74178@cicely12.cicely.de> References: <20031121200702.GD74178@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 21:16:38 -0000 On Fri, Nov 21, 2003 at 03:10:10PM -0600, quel@quelrod.net wrote: > Should device ehci be a default in GENERIC, then? It is intentionally not in GENERIC. > On Fri, 21 Nov 2003, Bernd Walter wrote: > > > On Fri, Nov 21, 2003 at 10:47:35AM -0600, quel@quelrod.net wrote: > > > I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s > > > transfers. According to dmesg fbsd is only doing 1.0: > > > usb0: on uhci0 > > > usb0: USB revision 1.0 > > > usb1: on uhci1 > > > usb1: USB revision 1.0 > > > usb2: on uhci2 > > > usb2: USB revision 1.0 > > > > > > (Yes i double checked my laptop does indeed have usb 2.0) > > > > > > I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I > > > suppose it's too late to get this into 5.2 -RELEASE. > > > > uhci is strictly an usb1.x controller. > > Build a kernel with ehci support if you have a high speed capable > > controller. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 13:35:14 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 B468916A4CE for ; Fri, 21 Nov 2003 13:35:14 -0800 (PST) Received: from pgh.nepinc.com (pgh.nepinc.com [66.207.129.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA7C643FBD for ; Fri, 21 Nov 2003 13:35:13 -0800 (PST) (envelope-from jimd@nepinc.com) Received: from jimslaptop.pitt.nepinc.com (jimslaptop.pitt.nepinc.com [192.100.100.107]) (authenticated bits=0) by pgh.nepinc.com (8.12.8p2/8.12.8) with ESMTP id hALLZCif024664 for ; Fri, 21 Nov 2003 16:35:12 -0500 (EST) (envelope-from jimd@nepinc.com) From: Jim Durham Organization: NEP Supershooters To: freebsd-hackers@freebsd.org Date: Fri, 21 Nov 2003 16:35:10 -0500 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311211635.10353.jimd@nepinc.com> Subject: Library libgcc_pic.a missing on 5.1? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jim.durham@nepinc.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 21:35:14 -0000 Is liibgcc_a not supposed to be on 5.1? Are the functions in some other library? Sorry to bother, but Google is silent! Thanks, -- Jim Durham From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 13:37: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 653CD16A4CE for ; Fri, 21 Nov 2003 13:37:02 -0800 (PST) Received: from quelrod.quelrod.net (cs24243230-109.austin.rr.com [24.243.230.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0208443FB1 for ; Fri, 21 Nov 2003 13:36:59 -0800 (PST) (envelope-from quel@quelrod.net) Received: from quelrod.net (quelrod.net [127.0.0.1]) by quelrod.quelrod.net (8.12.9/8.12.9) with ESMTP id hALLbAm2001193; Fri, 21 Nov 2003 15:37:10 -0600 (CST) Received: from localhost (quel@localhost) by quelrod.net (8.12.9/8.12.9/Submit) with ESMTP id hALLbAWs027221; Fri, 21 Nov 2003 15:37:10 -0600 (CST) Date: Fri, 21 Nov 2003 15:37:10 -0600 (CST) From: quel@quelrod.net To: ticso@cicely.de In-Reply-To: <20031121211627.GF74178@cicely12.cicely.de> Message-ID: References: <20031121211627.GF74178@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 21:37:02 -0000 Could you point me to information as to why it is not in GENERIC? -James On Fri, 21 Nov 2003, Bernd Walter wrote: > On Fri, Nov 21, 2003 at 03:10:10PM -0600, quel@quelrod.net wrote: > > Should device ehci be a default in GENERIC, then? > > It is intentionally not in GENERIC. > > > On Fri, 21 Nov 2003, Bernd Walter wrote: > > > > > On Fri, Nov 21, 2003 at 10:47:35AM -0600, quel@quelrod.net wrote: > > > > I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s > > > > transfers. According to dmesg fbsd is only doing 1.0: > > > > usb0: on uhci0 > > > > usb0: USB revision 1.0 > > > > usb1: on uhci1 > > > > usb1: USB revision 1.0 > > > > usb2: on uhci2 > > > > usb2: USB revision 1.0 > > > > > > > > (Yes i double checked my laptop does indeed have usb 2.0) > > > > > > > > I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I > > > > suppose it's too late to get this into 5.2 -RELEASE. > > > > > > uhci is strictly an usb1.x controller. > > > Build a kernel with ehci support if you have a high speed capable > > > controller. > > -- > B.Walter BWCT http://www.bwct.de > ticso@bwct.de info@bwct.de > > From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 13:40:16 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 8B03A16A4CE for ; Fri, 21 Nov 2003 13:40:16 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 964F243F85 for ; Fri, 21 Nov 2003 13:40:14 -0800 (PST) (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) hALLe8vq069233 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 21 Nov 2003 22:40:11 +0100 (CET) (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.10/8.12.10) with ESMTP id hALLe5ER024400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Nov 2003 22:40:06 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id hALLe52u011087; Fri, 21 Nov 2003 22:40:05 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id hALLe4Pb011086; Fri, 21 Nov 2003 22:40:04 +0100 (CET) (envelope-from ticso) Date: Fri, 21 Nov 2003 22:40:04 +0100 From: Bernd Walter To: quel@quelrod.net Message-ID: <20031121214003.GG74178@cicely12.cicely.de> References: <20031121200702.GD74178@cicely12.cicely.de> <20031121211627.GF74178@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: usb 2.0 dell inspirion 8500 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: Fri, 21 Nov 2003 21:40:16 -0000 On Fri, Nov 21, 2003 at 03:37:10PM -0600, quel@quelrod.net wrote: > Could you point me to information as to why it is not in GENERIC? Because it is not requireds for device to work, but on the other hand in some cases doesn't work with ehci, such as hubs and interrupt transfers. Adding ehci is more speed with less functionality. > On Fri, 21 Nov 2003, Bernd Walter wrote: > > > On Fri, Nov 21, 2003 at 03:10:10PM -0600, quel@quelrod.net wrote: > > > Should device ehci be a default in GENERIC, then? > > > > It is intentionally not in GENERIC. > > > > > On Fri, 21 Nov 2003, Bernd Walter wrote: > > > > > > > On Fri, Nov 21, 2003 at 10:47:35AM -0600, quel@quelrod.net wrote: > > > > > I recently got a usb 2.0 hard drive to which I painfully wait for 1MB/s > > > > > transfers. According to dmesg fbsd is only doing 1.0: > > > > > usb0: on uhci0 > > > > > usb0: USB revision 1.0 > > > > > usb1: on uhci1 > > > > > usb1: USB revision 1.0 > > > > > usb2: on uhci2 > > > > > usb2: USB revision 1.0 > > > > > > > > > > (Yes i double checked my laptop does indeed have usb 2.0) > > > > > > > > > > I saw that ehci had usb 2.0 support comitted. Is this coming for uhci? I > > > > > suppose it's too late to get this into 5.2 -RELEASE. > > > > > > > > uhci is strictly an usb1.x controller. > > > > Build a kernel with ehci support if you have a high speed capable > > > > controller. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 14:09: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 7922016A4CE; Fri, 21 Nov 2003 14:09:32 -0800 (PST) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id A249043FBD; Fri, 21 Nov 2003 14:09:31 -0800 (PST) (envelope-from wes@softweyr.com) Received: from salty.rapid.stbernard.com (corp-2.ipinc.com [199.245.188.2]) by smtp-relay.omnis.com (Postfix) with ESMTP id D26195B697; Fri, 21 Nov 2003 14:08:26 -0800 (PST) From: Wes Peters Organization: Softweyr.com To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=), Pawel Jakub Dawidek Date: Fri, 21 Nov 2003 14:09:18 -0800 User-Agent: KMail/1.5.2 References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <20031121124350.GT511@garage.freebsd.pl> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200311211333.39520.wes@softweyr.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable cc: freebsd-hackers@freebsd.org cc: phk@freebsd.org cc: Rayson Ho Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 22:09:32 -0000 On Friday 21 November 2003 05:30, Dag-Erling Sm=F8rgrav wrote: > Pawel Jakub Dawidek writes: > > I'm aware of this, but what we want to think over here is something > > like in-kernel 'rm -P'. So file will be overwriten even if it is > > opened and/or link count is grater than 0. > > That is not acceptable. First of all, it breaks a lot of assumptions > in the filesystem code. Second, it is incompatible with the common > technique of unlinking a temporary file immediately after opening it > to avoid having it stick around if the process that created it dies > prematurely. Your proposed change would thus reduce security rather > than enhance it. Right. The idea of restricting a file marked "secure" to not be able to=20 link to it, and refusing to set the flag if the file has a link count=20 greater than 1, is easy to do. I'm not sure it makes sense, though. > Besides, overwriting the contents of a file when it is removed from > the file system is not enough. You also need to overwrite every > block or fragment which is released any time the file shrinks. > > Fortunately, ufs always truncates a file to length 0 when it is > removed, so you only need to modify ffs_truncate() to implement both > aspects (truncation and removal). You should also take care to > overwrite the file's extended attributes if it has any. =46or ffs, I believe it would be as simple as providing this behavior in=20 ffs_blkfree. Both the vnode and fs are passed to ffs_blkfree, so the=20 code should be able to check filesystem flags and/or file flags to=20 determine if the block should be erased before freed. This simplistic=20 approach would forgo some potentially very helpful optimizations,=20 though. > Finally, I think a filesystem flag is much better for this purpose > than a file flag; and in either case, file removal and truncation > performance will be awful. The filesystem flag is no more or less difficult to do; I can see doing=20 both for completeness sake. As for performance, you really need to flush the on-device cache on each=20 pass to make sure the bit patterns get written to the platter in proper=20 order. I don't see any clever way to coalesce the writing of the=20 various patterns to multiple blocks short of a kernel thread, either,=20 so performance would be abysmal. Imagine removing a large file,=20 overwriting each block in 37 (IIRC) passes, syncing all the way through=20 the on-disk cache after *every block.* Disk encryption suddenly doesn't look so bad, does it? =2D-=20 "Where am I, and what am I doing in this handbasket?" Wes Peters wes@softweyr.com From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 15:56:16 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 023BB16A4CE; Fri, 21 Nov 2003 15:56:16 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70EB043FD7; Fri, 21 Nov 2003 15:56:11 -0800 (PST) (envelope-from se@freebsd.org) Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng2.kundenserver.de with esmtp (Exim 3.35 #1) id 1ANL8D-0006od-00; Sat, 22 Nov 2003 00:56:09 +0100 Received: from [80.132.230.159] (helo=Gatekeeper.FreeBSD.org) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1ANL8D-0005z6-00; Sat, 22 Nov 2003 00:56:09 +0100 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id 6C45E5F18; Sat, 22 Nov 2003 00:56:07 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 2100A20F8; Sat, 22 Nov 2003 00:56:07 +0100 (CET) Date: Sat, 22 Nov 2003 00:56:07 +0100 From: Stefan =?iso-8859-1?Q?E=DFer?= To: Wes Peters Message-ID: <20031121235607.GB16700@StefanEsser.FreeBSD.org> References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <20031121124350.GT511@garage.freebsd.pl> <200311211333.39520.wes@softweyr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200311211333.39520.wes@softweyr.com> User-Agent: Mutt/1.5.5.1i X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:fa3fae9b6ca38d745862a668565919f6 cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Fri, 21 Nov 2003 23:56:16 -0000 On 2003-11-21 14:09 -0800, Wes Peters wrote: > As for performance, you really need to flush the on-device cache on each > pass to make sure the bit patterns get written to the platter in proper > order. I don't see any clever way to coalesce the writing of the > various patterns to multiple blocks short of a kernel thread, either, > so performance would be abysmal. Imagine removing a large file, > overwriting each block in 37 (IIRC) passes, syncing all the way through > the on-disk cache after *every block.* I may be way off, but I do not think, that a special thread or a cache flush after each block is required: A simple algorithm could just mark each buffer with a special kind of dirty flag and a counter for the pass number (in fact, the existing dirty flag could be used, and a counter set to the number of passes required, with 0 indicating that the buffer is to be flushed to disk "as is" in the normal way). All blocks belonging to the file must be read from disk, if not already present in some buffer, for the erasure process to start. (See below for large files.) In preparation of the first pass, the data in the buffer could be complemented and then written back to disk as in a normal dirty buffer flush. After some block has been written, its counter will be updated and the block will still be marked dirty, until the number of passes required to consider the data irrecoverable has been reached. (Blocks that had the counter set to 0 at the start of the flush are normal writes and need not be considered, here.) On successive passes, the block can be overwritten with specific bit patterns or random data according to some procedures for secure erasure of data from magnetic media. On each turn of the elavator algorithm, a cache flush is initiated, if the previous path included at least one buffer with the "secure erase" flag set. (Any number of unrelated reads or writes could have been executed during this path of the elevator.) After the specified number of iterations, the individual block will be marked as free and can be put into the free list. Until then, it can not be accessed or reclaimed. That way, the normal operation of the disk would not be impacted. On each pass of the elevator algorithm, each buffer flagged to be securely erased will be written once and its state will be updated. No special cleaner thread is required, just a byte for the counter. The biggest problem could be the first step of the algorithm (to read all file blocks into buffers that are marked dirty and get the number of the first erasure pass assigned). But I guess, that the erasure of long files could be broken in several parts, that each fit into the RAM available for buffers. Only this case would require that the unlink or process exit be delayed until the last part of the file has been read in and marked dirty and to be overwritten. Regards, STefan From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 17:59: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 81B2616A4CE for ; Fri, 21 Nov 2003 17:59:48 -0800 (PST) Received: from smtp2.monroe.net (smtp2.monroe.net [63.117.144.14]) by mx1.FreeBSD.org (Postfix) with SMTP id 8AEF143FE5 for ; Fri, 21 Nov 2003 17:59:43 -0800 (PST) (envelope-from dhh@monroe.net) Received: from mx1.monroe.net (mx1.monroe.net [63.117.144.20]) by smtp2.monroe.net (8.12.8/8.12.5) with ESMTP id hAM1qbdG007816; Fri, 21 Nov 2003 17:52:37 -0800 Received: from chevy.androcles.com (63-117-146-58.monroe.net [63.117.146.58]) by mx1.monroe.net (8.11.6/8.11.2) with ESMTP id hAM21kC15224; Fri, 21 Nov 2003 18:01:46 -0800 Message-Id: <200311220201.hAM21kC15224@mx1.monroe.net> X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit MIME-Version: 1.0 In-Reply-To: <3FBE2C57.6070200@mindspring.com> Date: Fri, 21 Nov 2003 17:59:30 -0800 (PST) From: "Duane H. Hesser" To: Richard Coleman cc: freebsd-hackers@freebsd.org cc: Jay Sern Liew Subject: Re: integer and long max/min values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dhh@monroe.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2003 01:59:48 -0000 On 21-Nov-2003 Richard Coleman wrote: > Jay Sern Liew wrote: > >> how do I find out the maximum (and minimum) value a long and int will hold >> in C? (before it overflows or underflows) >> >> if it's compiler-dependent, then does anyone know where I can find the GCC >> documentation for stuff like that? > > It will be architecture dependent (32 or 64 bit machines?). I doubt the > GCC docs talk about this. You might check Richard Steven's book on > "Advanced Unix Programming". It covers lots of information about > standard machine limits and how to discover them. > > Richard Coleman > richardcoleman@mindspring.com > > As a point of interest, there is a file /usr/src/contrib/gcc/enquire.c in the distributed sources which, when compiled and run, will report the max and min values of short, long, int, float, etc. along with various sizes and alignments. -- ---------------------------------- Just be glad Microsoft doesn't make passenger airplanes. Duane H. Hesser ---------------------------------- From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 22 02:04: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 2285D16A4CE; Sat, 22 Nov 2003 02:04:45 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9051543FA3; Sat, 22 Nov 2003 02:04:43 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 5051F530A; Sat, 22 Nov 2003 11:04:42 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 3763F5309; Sat, 22 Nov 2003 11:04:33 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id E5F1B33C86; Sat, 22 Nov 2003 11:04:32 +0100 (CET) To: Stefan =?iso-8859-1?q?E=DFer?= References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <20031121124350.GT511@garage.freebsd.pl> <200311211333.39520.wes@softweyr.com> <20031121235607.GB16700@StefanEsser.FreeBSD.org> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sat, 22 Nov 2003 11:04:32 +0100 In-Reply-To: <20031121235607.GB16700@StefanEsser.FreeBSD.org> (Stefan =?iso-8859-1?q?E=DFer's?= message of "Sat, 22 Nov 2003 00:56:07 +0100") 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-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.5 required=5.0 tests=RCVD_IN_DYNABLOCK autolearn=no version=2.60 cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Sat, 22 Nov 2003 10:04:45 -0000 Stefan E=DFer writes: > I may be way off, but I do not think, that a special thread or=20 > a cache flush after each block is required: [...] What happens if you yank the power cord? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 22 02:54:08 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 4E51316A4CE; Sat, 22 Nov 2003 02:54:08 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC29943F85; Sat, 22 Nov 2003 02:54:06 -0800 (PST) (envelope-from se@freebsd.org) Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng1.kundenserver.de with esmtp (Exim 3.35 #1) id 1ANVOu-0002lt-00; Sat, 22 Nov 2003 11:54:04 +0100 Received: from [80.132.228.43] (helo=Gatekeeper.FreeBSD.org) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1ANVOu-0006qy-00; Sat, 22 Nov 2003 11:54:04 +0100 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id C168B5F18; Sat, 22 Nov 2003 11:54:00 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 6CDE61EBC; Sat, 22 Nov 2003 11:54:00 +0100 (CET) Date: Sat, 22 Nov 2003 11:54:00 +0100 From: Stefan =?iso-8859-1?Q?E=DFer?= To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20031122105400.GA4506@StefanEsser.FreeBSD.org> References: <20031119003133.18473.qmail@web11404.mail.yahoo.com> <20031121124350.GT511@garage.freebsd.pl> <200311211333.39520.wes@softweyr.com> <20031121235607.GB16700@StefanEsser.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1i Content-Transfer-Encoding: quoted-printable X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:fa3fae9b6ca38d745862a668565919f6 cc: Rayson Ho cc: phk@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: "secure" file flag? 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: Sat, 22 Nov 2003 10:54:08 -0000 On 2003-11-22 11:04 +0100, Dag-Erling Sm=F8rgrav wrote: > Stefan E=DFer writes: > > I may be way off, but I do not think, that a special thread or=20 > > a cache flush after each block is required: [...] >=20 > What happens if you yank the power cord? Worst case: The same thing that happened, if the you lost power a fraction of a second earlier, just before the unlink or loss of last reference to the file ... Nothing short of a self-destruct mechanism will do any better ;-) (You could provide an internal UPS and try to prevent unauthorized access to hardware components by sealing the components in a special enclosing, but I guess we are getting carried away. Better protect against unauthorized access to the computer and have it emergency shutdown (with secure deletion of critical information) in case of a (physical :) access violation. Back to the subject of this thread: You could write a special flag "needs to be securely removed" to the inode. That way, an interrupted overwrite process could be=20 continued after next reboot (for example initiated by fsck). This is meant to protect against traces of sensible data being left on the disk for a long time after a crash. But such an inode would also indicate to an attacker the disk blocks that where considered needing protection and may make an attack at the magnetic residue practical=20 at all ... But the real problem appears to be, when to mark the blocks and=20 inode as free. Normally, the blocks are returned to the free block=20 map when an inode is invalidated. File system blocks may not be=20 reused, before the overwrite procedure has completed. Again, this requires that the inode is only removed after the last=20 file block has been processed. But I'm not sure whether there is=20 a mechanism that allows invalidating the inode after the last=20 associated buffer has been flushed ... Regards, STefan