From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 03:54:30 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B8EDE16A4DF for ; Sun, 13 Aug 2006 03:54:30 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail.asahi-net.or.jp (mail1.asahi-net.or.jp [202.224.39.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23B4343D46 for ; Sun, 13 Aug 2006 03:54:29 +0000 (GMT) (envelope-from ota@j.email.ne.jp) Received: from dynabook-freebsd.advok.com (unknown [141.151.86.147]) by mail.asahi-net.or.jp (Postfix) with ESMTP id 48663DFD7 for ; Sun, 13 Aug 2006 12:54:27 +0900 (JST) Date: Sat, 12 Aug 2006 23:54:23 -0500 From: Yoshihiro Ota To: freebsd-hackers@freebsd.org Message-Id: <20060812235423.af71b566.ota@j.email.ne.jp> In-Reply-To: References: X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.20; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: UTF-8 <-> UTF-16BE Converter in Kernel Needs Test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 03:54:30 -0000 You may try these patches, first. http://people.freebsd.org/~imura/kiconv/ It sounds like these patches implement better supports. Hiro On Sun, 13 Aug 2006 01:28:17 +0800 "Intron" wrote: > I'm sorry that I send my experimental patch set here to call for test. > But if I send it to freebsd-i18n@, I wonder no one will respond to me. > > Download: http://ftp.intron.ac/tmp/kiconv_utf8_20060813.tar.bz2 > > My patch set implements a UTF-8 <-> UTF-16BE converter for iconv in > kernel. It doesn't need kiconv(3) to send unnecessary UTF-8 <-> UTF-16BE > conversion tables to kernel. And it doesn't require the help of GNU > libiconv, which kiconv(3) depends on. > > With my patch set, if you mount FAT/NTFS/ISO9660 file system, less > resource will be occupied than before: > > mount_msdosfs -L ll_NN.UTF-8 /dev/md0s1 /mnt > > See my "readme.txt" for installation guide. > > ************ ATTENTION !!! ************ > > 1. Do NOT test my patch set upon your CRITICAL FAT/NTFS partition !!! > > 2. Limited by BUGGY FreeBSD modules msdosfs/ntfs/cd9660, whether you > use my patch set or not, only 1/2-byte UTF-8 character (up to 0x7ff) > is supported, which means only a few languages are supported. > > I will try to patch those modules to support all languages (up to > 6-byte UTF-8 character) included in current Unicode step by step. > > ------------------------------------------------------------------------ > From Beijing, China > > _______________________________________________ > 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 Sun Aug 13 09:53:34 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 C52EE16A4DF; Sun, 13 Aug 2006 09:53:34 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2277743D58; Sun, 13 Aug 2006 09:53:29 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Sun, 13 Aug 2006 17:53:27 +0800 id 00102DF1.44DEF697.00014988 References: <20060812235423.af71b566.ota@j.email.ne.jp> In-Reply-To: <20060812235423.af71b566.ota@j.email.ne.jp> From: "Intron" To: Yoshihiro Ota Date: Sun, 13 Aug 2006 17:53:27 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org, imura@FreeBSD.org Subject: Re: UTF-8 <-> UTF-16BE Converter in Kernel Needs Test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 09:53:35 -0000 Yoshihiro Ota wrote: > You may try these patches, first. > http://people.freebsd.org/~imura/kiconv/ > > It sounds like these patches implement better supports. > > Hiro > > On Sun, 13 Aug 2006 01:28:17 +0800 > "Intron" wrote: > >> I'm sorry that I send my experimental patch set here to call for test. >> But if I send it to freebsd-i18n@, I wonder no one will respond to me. >> >> Download: http://ftp.intron.ac/tmp/kiconv_utf8_20060813.tar.bz2 >> >> My patch set implements a UTF-8 <-> UTF-16BE converter for iconv in >> kernel. It doesn't need kiconv(3) to send unnecessary UTF-8 <-> UTF-16BE >> conversion tables to kernel. And it doesn't require the help of GNU >> libiconv, which kiconv(3) depends on. >> >> With my patch set, if you mount FAT/NTFS/ISO9660 file system, less >> resource will be occupied than before: >> >> mount_msdosfs -L ll_NN.UTF-8 /dev/md0s1 /mnt >> >> See my "readme.txt" for installation guide. >> >> ************ ATTENTION !!! ************ >> >> 1. Do NOT test my patch set upon your CRITICAL FAT/NTFS partition !!! >> >> 2. Limited by BUGGY FreeBSD modules msdosfs/ntfs/cd9660, whether you >> use my patch set or not, only 1/2-byte UTF-8 character (up to 0x7ff) >> is supported, which means only a few languages are supported. >> >> I will try to patch those modules to support all languages (up to >> 6-byte UTF-8 character) included in current Unicode step by step. >> >> ------------------------------------------------------------------------ >> From Beijing, China >> >> _______________________________________________ >> 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" I have looked in his patch set. Some essential problems: 1. I don't know why the author takes the concept of Microsoft's 16-bit wchar_t as UTF-16BE (the macro ENCODING_UNICODE in /sys/sys/iconv.h). 16-bit wchar_t is only enough for UCS-2 BE/LE (Unicode BMP) while real UTF-16 includes 4-byte formation. 2. Actually, kernel iconv is prepared only for Microsoft (FAT32, NTFS, Joliet extension to ISO 9660, SambaFS) so far. It should be a minimum function set just fit for Microsoft. Above all, it is not a complete implementation of UNIX98 iconv and should be as simple as possible. 3. In fact, UNIX98 iconv(3) handles any character set as char array. The usage of wchar_t is not of a good style in modules msdosfs/ cd9660/ntfs. String function such as memcpy() should be used instead. If 5/6-byte UTF-8 sequence (Annex D of ISO/IEC 10646-1:2000) or other special encoding is allowed, handling by char array will be still robust. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 12:27:14 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG 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 D092716A4DF; Sun, 13 Aug 2006 12:27:14 +0000 (UTC) (envelope-from imura@FreeBSD.ORG) Received: from userg502.nifty.com (userg502.nifty.com [202.248.238.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BC5943D53; Sun, 13 Aug 2006 12:27:14 +0000 (GMT) (envelope-from imura@FreeBSD.ORG) Received: from [192.168.11.3] (nttkyo300142.tkyo.nt.ftth.ppp.infoweb.ne.jp [58.0.118.142])by userg502.nifty.com with ESMTP id k7DCQmLt007016; Sun, 13 Aug 2006 21:26:49 +0900 Message-ID: <44DF1A88.9070504@FreeBSD.ORG> Date: Sun, 13 Aug 2006 21:26:48 +0900 From: "R. Imura" User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: Intron References: <20060812235423.af71b566.ota@j.email.ne.jp> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Yoshihiro Ota , freebsd-hackers@FreeBSD.ORG, imura@FreeBSD.ORG Subject: Re: UTF-8 <-> UTF-16BE Converter in Kernel Needs Test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 12:27:15 -0000 Hi, Intron, - iconv(9), aka kiconv, is not implementation of POSIX iconv(3). - UDF is another kiconv user. - kiconv is not a present for Microsoft. - UCS-2 is not enough for explaining full GB18030. I'd like to know how Microsoft controls GB18030. > 1. I don't know why the author takes the concept of Microsoft's 16-bit > wchar_t as UTF-16BE (the macro ENCODING_UNICODE in /sys/sys/iconv.h). You can see why it's UTF-16BE via cvs logs. - R. Imura Intron wrote: > Yoshihiro Ota wrote: > >> You may try these patches, first. >> http://people.freebsd.org/~imura/kiconv/ >> >> It sounds like these patches implement better supports. >> >> Hiro >> >> On Sun, 13 Aug 2006 01:28:17 +0800 >> "Intron" wrote: >> >>> I'm sorry that I send my experimental patch set here to call for test. >>> But if I send it to freebsd-i18n@, I wonder no one will respond to me. >>> >>> Download: http://ftp.intron.ac/tmp/kiconv_utf8_20060813.tar.bz2 >>> >>> My patch set implements a UTF-8 <-> UTF-16BE converter for iconv in >>> kernel. It doesn't need kiconv(3) to send unnecessary UTF-8 <-> UTF-16BE >>> conversion tables to kernel. And it doesn't require the help of GNU >>> libiconv, which kiconv(3) depends on. >>> >>> With my patch set, if you mount FAT/NTFS/ISO9660 file system, less >>> resource will be occupied than before: >>> >>> mount_msdosfs -L ll_NN.UTF-8 /dev/md0s1 /mnt >>> >>> See my "readme.txt" for installation guide. >>> >>> ************ ATTENTION !!! ************ >>> >>> 1. Do NOT test my patch set upon your CRITICAL FAT/NTFS partition !!! >>> >>> 2. Limited by BUGGY FreeBSD modules msdosfs/ntfs/cd9660, whether you >>> use my patch set or not, only 1/2-byte UTF-8 character (up to 0x7ff) >>> is supported, which means only a few languages are supported. >>> >>> I will try to patch those modules to support all languages (up to >>> 6-byte UTF-8 character) included in current Unicode step by step. >>> >>> ------------------------------------------------------------------------ >>> From Beijing, China >>> >>> _______________________________________________ >>> 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" > > I have looked in his patch set. Some essential problems: > > 1. I don't know why the author takes the concept of Microsoft's 16-bit > wchar_t as UTF-16BE (the macro ENCODING_UNICODE in /sys/sys/iconv.h). > 16-bit wchar_t is only enough for UCS-2 BE/LE (Unicode BMP) while > real UTF-16 includes 4-byte formation. > > 2. Actually, kernel iconv is prepared only for Microsoft (FAT32, NTFS, > Joliet extension to ISO 9660, SambaFS) so far. It should be a minimum > function set just fit for Microsoft. Above all, it is not a complete > implementation of UNIX98 iconv and should be as simple as possible. > > 3. In fact, UNIX98 iconv(3) handles any character set as char array. > The usage of wchar_t is not of a good style in modules msdosfs/ > cd9660/ntfs. String function such as memcpy() should be used instead. > If 5/6-byte UTF-8 sequence (Annex D of ISO/IEC 10646-1:2000) or other > special encoding is allowed, handling by char array will be still > robust. > > ------------------------------------------------------------------------ > From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 16:30:52 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 0A99F16A4DA for ; Sun, 13 Aug 2006 16:30:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9705643D49 for ; Sun, 13 Aug 2006 16:30:51 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id C7C4C46C96; Sun, 13 Aug 2006 12:30:50 -0400 (EDT) Date: Sun, 13 Aug 2006 17:30:50 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: mal content In-Reply-To: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> Message-ID: <20060813171432.C45647@fledge.watson.org> References: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Packet filtering on tap interfaces X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 16:30:52 -0000 On Sat, 12 Aug 2006, mal content wrote: > Can tap interfaces reliably be filtered? Max has provided a detailed answer, but I wanted to answer a more general question here: a tap interface plugs into the normal kernel network interface and ethernet layers, and as such, packets sent and received over tap interfaces are processed entirely normally with respect to firewall services, etc. In general, if a network service, such as IPSEC or a firewall, would work for a physical interface, it will work for a tap interface. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 21:04:16 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A890E16A4E1 for ; Sun, 13 Aug 2006 21:04:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3742C43D45 for ; Sun, 13 Aug 2006 21:04:16 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k7DL3c07044827; Sun, 13 Aug 2006 15:03:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 13 Aug 2006 15:03:48 -0600 (MDT) Message-Id: <20060813.150348.535841747.imp@bsdimp.com> To: nike_d@cytexbg.com From: "M. Warner Losh" In-Reply-To: <200608071735.43462.nike_d@cytexbg.com> References: <44D735E5.4030809@FreeBSD.org> <200608071628.15316.nike_d@cytexbg.com> <200608071735.43462.nike_d@cytexbg.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 13 Aug 2006 15:03:38 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: linux ioremap equivalent on freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 21:04:16 -0000 In message: <200608071735.43462.nike_d@cytexbg.com> Niki Denev writes: : On Monday 07 August 2006 16:28, Niki Denev wrote: : > On Monday 07 August 2006 15:45, Suleiman Souhlal wrote: : > > : > > I think the equivalent of linux's ioremap() in FreeBSD is pmap_mapdev(). : > > : > > -- Suleiman : > : > Thanks! : > : > Is there a reason that there is no manual page about pmap_mapdev, and it's : > not mentioned in the other pmap_* man pages? : > : : As far as i understand, there is no need for pmap_mapdev to be used for : reading memory from pci device, because it returns the same address as : pmap_get_virtual() ? (at least here :) ) Is this right? Unless you are mapping very large areas, bus_alloc_resource + rman_get_virtual is the right answer here. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 21:04:18 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7650E16A4DA for ; Sun, 13 Aug 2006 21:04:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id D834C43D45 for ; Sun, 13 Aug 2006 21:04:17 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k7DL2aHh044826; Sun, 13 Aug 2006 15:02:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 13 Aug 2006 15:02:47 -0600 (MDT) Message-Id: <20060813.150247.2140534343.imp@bsdimp.com> To: gurney_j@resnet.uoregon.edu From: "M. Warner Losh" In-Reply-To: <20060807194337.GD99774@funkthat.com> References: <20060807183406.GB99774@funkthat.com> <200608072203.56320.nike_d@cytexbg.com> <20060807194337.GD99774@funkthat.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 13 Aug 2006 15:02:37 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: linux ioremap equivalent on freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 21:04:18 -0000 In message: <20060807194337.GD99774@funkthat.com> John-Mark Gurney writes: : Niki Denev wrote this message on Mon, Aug 07, 2006 at 22:03 +0300: : > On Monday 07 August 2006 21:34, John-Mark Gurney wrote: : > > Because for the most part it is only suppose to be used by MD code... : > > : > > The correct way to get device's memory is to use bus_alloc_resource_any... : > > Make sure you review the handbook on device driver writing: : > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/devicedriver : > >s.html : > > : > > I did a presentation at BSDcan on writing devices drivers: : > > http://people.freebsd.org/~jmg/drivers/ : > > : > > The handout is a cheat sheet of useful functions for writing a device : > > driver... : > : > I'm looking at this right now :) Looks very useful, thanks! : > : > Just one more question to clear a little confusion on my side, : > the device that i'm trying to write/port driver for is a cardbus device. : > Do i have to do something specific about this, or can i get away with : > accessing/using it as a plain PCI device? (yes, it appears as pci device to : > the system, and is shown in pciconf) : : The only thing special that I believe you have to do is provide an : additional DRIVER_MODULE line to attach to cardbus in addition to (or : instead of) pci... For example: : DRIVER_MODULE(re, pci, re_driver, re_devclass, 0, 0); : DRIVER_MODULE(re, cardbus, re_driver, re_devclass, 0, 0); : : Warner is the expert on cardbus, so, if you have any questions, you : could drop him an email.... cardbus and pci are the same, unless you need to dig information out of the CIS. The only reason we still have both pci and cardbus lines is due to an obscure bug deep in the heart of newbus that prevents kldload'd drivers from properly probing when it is absent. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 22:08:45 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 9CA2516A4DA for ; Sun, 13 Aug 2006 22:08:45 +0000 (UTC) (envelope-from bryants@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EA3243D45 for ; Sun, 13 Aug 2006 22:08:45 +0000 (GMT) (envelope-from bryants@gmail.com) Received: by py-out-1112.google.com with SMTP id w49so1192524pyg for ; Sun, 13 Aug 2006 15:08:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=hrqx4nq6GxAjJGWRiQJkyMwNIUH9etJvCKqYiFQP+NIe7XH9+3/0sj38ba+iv1zkq8d7ICdD8VCaBZHLIjMYt7SFzOzXWxI+FzmVPLxJT59UbWv3ssYsfOdUlyNgGNu+rRtvdK7Tiznv8AeKmQpSqKwrGtNmD4Xx0CyBZxAaiI8= Received: by 10.64.179.11 with SMTP id b11mr6208430qbf; Sun, 13 Aug 2006 15:08:44 -0700 (PDT) Received: by 10.65.20.2 with HTTP; Sun, 13 Aug 2006 15:08:44 -0700 (PDT) Message-ID: Date: Sun, 13 Aug 2006 18:08:44 -0400 From: "Sean Bryant" To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 22:08:45 -0000 I'm writing some cd buring software using burncd as a reference. I was wondering if its possible to detect opening and closing of the doors. I don't see it very often in unix. i wrote a media detection routine but it'd be nice to detect when the door is opened and when its closed so I'm not polling and praying. Excuse my ignorance in advanced. I've been looking I just can't seem to find any information on obtaining this kind of information. -- Sean Bryant From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 13 23:03:00 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7B21D16A4DD for ; Sun, 13 Aug 2006 23:03:00 +0000 (UTC) (envelope-from reed@scit.us) Received: from uni08mr.unity.ncsu.edu (uni08mr.unity.ncsu.edu [152.1.224.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CD5843D46 for ; Sun, 13 Aug 2006 23:02:59 +0000 (GMT) (envelope-from reed@scit.us) Received: from [152.14.14.202] (reedcartwright.statgen.ncsu.edu [152.14.14.202]) by uni08mr.unity.ncsu.edu (8.13.7/8.13.4/Nv5.2006.0214) with ESMTP id k7DN2vWm009785 for ; Sun, 13 Aug 2006 19:02:58 -0400 (EDT) Message-ID: <44DFE7E0.5010801@scit.us> Date: Sun, 13 Aug 2006 23:02:56 -0400 From: "Reed A. Cartwright" User-Agent: Thunderbird 1.5.0.5 (X11/20060813) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.2.0.264296, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2006.8.13.154433 X-Spam-Status: No, Hits=47% X-Spam-Level: XXXXIIIIIII Subject: Patch for Intel 5000X hardware (ata and ichsmb) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 23:03:00 -0000 Freebsd wouldn't recognize my hard drive contoler, so I modified a patch I found on the "stable" list, adding all the device ids I found in Intel's documentation. Please add this to the stable or current branch. Below is the patch, I made with respect to 6.1-Release-p3. It works with both i386 and amd64. Index: sys/dev/ata/ata-chipset.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v retrieving revision 1.126.2.11 diff -u -r1.126.2.11 ata-chipset.c --- sys/dev/ata/ata-chipset.c 16 Mar 2006 21:28:51 -0000 1.126.2.11 +++ sys/dev/ata/ata-chipset.c 9 Aug 2006 20:28:30 -0000 @@ -1595,6 +1595,11 @@ { ATA_I82801GB_R1, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, { ATA_I82801GB_M, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, { ATA_I82801GB_AH, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, + { ATA_I631xESB, 0, 0, 0x00, ATA_UDMA5, "631xESB" }, + { ATA_I631xESB_C1, 0, 0, 0x00, ATA_UDMA5, "631xESB" }, + { ATA_I631xESB_S1, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, + { ATA_I631xESB_R1, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, + { ATA_I631xESB_R2, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, { ATA_I31244, 0, 0, 0x00, ATA_SA150, "31244" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; Index: sys/dev/ata/ata-pci.h =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v retrieving revision 1.49.2.8 diff -u -r1.49.2.8 ata-pci.h --- sys/dev/ata/ata-pci.h 16 Mar 2006 21:28:51 -0000 1.49.2.8 +++ sys/dev/ata/ata-pci.h 9 Aug 2006 20:28:30 -0000 @@ -148,6 +148,11 @@ #define ATA_I82801FB_S1 0x26518086 #define ATA_I82801FB_R1 0x26528086 #define ATA_I82801FB_M 0x26538086 +#define ATA_I631xESB_C1 0x26808086 +#define ATA_I631xESB_S1 0x26818086 +#define ATA_I631xESB_R1 0x26828086 +#define ATA_I631xESB_R2 0x26838086 +#define ATA_I631xESB 0x269e8086 #define ATA_I82801GB 0x27df8086 #define ATA_I82801GB_S1 0x27c08086 #define ATA_I82801GB_R1 0x27c38086 Index: sys/dev/ichsmb/ichsmb_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ichsmb/ichsmb_pci.c,v retrieving revision 1.16.2.1 diff -u -r1.16.2.1 ichsmb_pci.c --- sys/dev/ichsmb/ichsmb_pci.c 19 Aug 2005 18:38:55 -0000 1.16.2.1 +++ sys/dev/ichsmb/ichsmb_pci.c 9 Aug 2006 20:28:31 -0000 @@ -74,6 +74,7 @@ #define ID_82801DC 0x24C38086 #define ID_82801EB 0x24D38086 #define ID_6300ESB 0x25a48086 +#define ID_631xESB 0x269b8086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -146,6 +147,9 @@ case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; + case ID_631xESB: + device_set_desc(dev, "Intel 631xESB (ESB2) SMBus controller"); + break; default: if (pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS -- ********************************************************* Reed A. Cartwright, PhD http://scit.us/ Postdoctoral Researcher http://www.dererumnatura.us/ Department of Genetics http://www.pandasthumb.org/ Bioinformatics Research Center North Carolina State University Campus Box 7566 Raleigh, NC 27695-7566 Cuiusvis hominis est errare, nullius nisi insipientis in errore perserverare. --Cicero From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 00:24:02 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 42D9416A4DA for ; Mon, 14 Aug 2006 00:24:02 +0000 (UTC) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id B517F43D45 for ; Mon, 14 Aug 2006 00:23:59 +0000 (GMT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 699809BDA7; Mon, 14 Aug 2006 09:53:58 +0930 (CST) Date: Mon, 14 Aug 2006 09:53:58 +0930 From: Greg 'groggy' Lehey To: "Reed A. Cartwright" Message-ID: <20060814002358.GF63783@wantadilla.lemis.com> References: <44DFE7E0.5010801@scit.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4VrXvz3cwkc87Wze" Content-Disposition: inline In-Reply-To: <44DFE7E0.5010801@scit.us> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-hackers@freebsd.org Subject: Re: Patch for Intel 5000X hardware (ata and ichsmb) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 00:24:02 -0000 --4VrXvz3cwkc87Wze Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sunday, 13 August 2006 at 23:02:56 -0400, Reed A. Cartwright wrote: > Freebsd wouldn't recognize my hard drive contoler, so I modified a patch > I found on the "stable" list, adding all the device ids I found in > Intel's documentation. Please add this to the stable or current branch. > > Below is the patch, I made with respect to 6.1-Release-p3. It works > with both i386 and amd64. Thanks for the patch. To ensure that it doesn't get lost between here and the source tree, can you please enter it as a PR? Greg -- See complete headers for address and phone numbers. --4VrXvz3cwkc87Wze Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE38KeIubykFB6QiMRAuIRAJ9k1/ieqPJENja3smk5FqobJ5IjRgCeIt82 kDpC0/wM1D/bBqXBOjI4v7Y= =y9n6 -----END PGP SIGNATURE----- --4VrXvz3cwkc87Wze-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 05:59:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 ACFAC16A4E1 for ; Mon, 14 Aug 2006 05:59:10 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E12C43D4C for ; Mon, 14 Aug 2006 05:59:10 +0000 (GMT) (envelope-from sos@freebsd.org) Received: from [194.192.25.130] (sos.deepcore.dk [194.192.25.130]) by spider.deepcore.dk (8.13.6/8.13.4) with ESMTP id k7E5x8g4034075; Mon, 14 Aug 2006 07:59:09 +0200 (CEST) (envelope-from sos@freebsd.org) Message-ID: <44E0112D.3030104@freebsd.org> Date: Mon, 14 Aug 2006 07:59:09 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Thunderbird 1.5.0.2 (X11/20060531) MIME-Version: 1.0 To: "Reed A. Cartwright" References: <44DFE7E0.5010801@scit.us> In-Reply-To: <44DFE7E0.5010801@scit.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-mail-scanned: by DeepCore Virus & Spam killer v1.16 Cc: freebsd-hackers@freebsd.org Subject: Re: Patch for Intel 5000X hardware (ata and ichsmb) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 05:59:10 -0000 Reed A. Cartwright wrote: > Freebsd wouldn't recognize my hard drive contoler, so I modified a > patch I found on the "stable" list, adding all the device ids I found > in Intel's documentation. Please add this to the stable or current > branch. > > Below is the patch, I made with respect to 6.1-Release-p3. It works > with both i386 and amd64. I have a bunch of new Intel ID's including this ESB2 and the new PATA-less ICH8, to appear shortly in -current.. -Søren > > Index: sys/dev/ata/ata-chipset.c > =================================================================== > RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v > retrieving revision 1.126.2.11 > diff -u -r1.126.2.11 ata-chipset.c > --- sys/dev/ata/ata-chipset.c 16 Mar 2006 21:28:51 -0000 1.126.2.11 > +++ sys/dev/ata/ata-chipset.c 9 Aug 2006 20:28:30 -0000 > @@ -1595,6 +1595,11 @@ > { ATA_I82801GB_R1, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, > { ATA_I82801GB_M, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, > { ATA_I82801GB_AH, 0, AHCI, 0x00, ATA_SA300, "ICH7" }, > + { ATA_I631xESB, 0, 0, 0x00, ATA_UDMA5, "631xESB" }, > + { ATA_I631xESB_C1, 0, 0, 0x00, ATA_UDMA5, "631xESB" }, > + { ATA_I631xESB_S1, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, > + { ATA_I631xESB_R1, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, > + { ATA_I631xESB_R2, 0, AHCI, 0x00, ATA_SA300, "631xESB" }, > { ATA_I31244, 0, 0, 0x00, ATA_SA150, "31244" }, > { 0, 0, 0, 0, 0, 0}}; > char buffer[64]; > Index: sys/dev/ata/ata-pci.h > =================================================================== > RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v > retrieving revision 1.49.2.8 > diff -u -r1.49.2.8 ata-pci.h > --- sys/dev/ata/ata-pci.h 16 Mar 2006 21:28:51 -0000 1.49.2.8 > +++ sys/dev/ata/ata-pci.h 9 Aug 2006 20:28:30 -0000 > @@ -148,6 +148,11 @@ > #define ATA_I82801FB_S1 0x26518086 > #define ATA_I82801FB_R1 0x26528086 > #define ATA_I82801FB_M 0x26538086 > +#define ATA_I631xESB_C1 0x26808086 > +#define ATA_I631xESB_S1 0x26818086 > +#define ATA_I631xESB_R1 0x26828086 > +#define ATA_I631xESB_R2 0x26838086 > +#define ATA_I631xESB 0x269e8086 > #define ATA_I82801GB 0x27df8086 > #define ATA_I82801GB_S1 0x27c08086 > #define ATA_I82801GB_R1 0x27c38086 > Index: sys/dev/ichsmb/ichsmb_pci.c > =================================================================== > RCS file: /home/ncvs/src/sys/dev/ichsmb/ichsmb_pci.c,v > retrieving revision 1.16.2.1 > diff -u -r1.16.2.1 ichsmb_pci.c > --- sys/dev/ichsmb/ichsmb_pci.c 19 Aug 2005 18:38:55 -0000 1.16.2.1 > +++ sys/dev/ichsmb/ichsmb_pci.c 9 Aug 2006 20:28:31 -0000 > @@ -74,6 +74,7 @@ > #define ID_82801DC 0x24C38086 > #define ID_82801EB 0x24D38086 > #define ID_6300ESB 0x25a48086 > +#define ID_631xESB 0x269b8086 > > #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 > > @@ -146,6 +147,9 @@ > case ID_6300ESB: > device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); > break; > + case ID_631xESB: > + device_set_desc(dev, "Intel 631xESB (ESB2) SMBus controller"); > + break; > default: > if (pci_get_class(dev) == PCIC_SERIALBUS > && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS > From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 06:08:54 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 CEC3616A4E2 for ; Mon, 14 Aug 2006 06:08:54 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id A338243D5C for ; Mon, 14 Aug 2006 06:08:42 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 7E5152085; Mon, 14 Aug 2006 08:08:37 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 704A92084; Mon, 14 Aug 2006 08:08:37 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 465F133C24; Mon, 14 Aug 2006 08:08:37 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Sean Bryant" References: Date: Mon, 14 Aug 2006 08:08:37 +0200 In-Reply-To: (Sean Bryant's message of "Sun, 13 Aug 2006 18:08:44 -0400") Message-ID: <86bqqnyhlm.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 06:08:54 -0000 "Sean Bryant" writes: > I'm writing some cd buring software using burncd as a reference. I was > wondering if its possible to detect opening and closing of the doors. Unfortunately, no. The drive may not even have a door. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 06:49:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1B35616A4DE for ; Mon, 14 Aug 2006 06:49:14 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CE8143D45 for ; Mon, 14 Aug 2006 06:49:12 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Mon, 14 Aug 2006 14:49:10 +0800 id 00102C04.44E01CE6.0000088A References: <86bqqnyhlm.fsf@xps.des.no> In-Reply-To: <86bqqnyhlm.fsf@xps.des.no> From: "Intron" To: des@des.no Date: Mon, 14 Aug 2006 14:49:10 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 06:49:14 -0000 Dag-Erling [iso-8859-1] Smo/rgrav wrote: > "Sean Bryant" writes: >> I'm writing some cd buring software using burncd as a reference. I was >> wondering if its possible to detect opening and closing of the doors. > > Unfortunately, no. The drive may not even have a door. > > DES > -- > Dag-Erling Smo/rgrav - des@des.no > _______________________________________________ > 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" Mr. smo/rgrav loves playing joke very much. But most of CD/DVD drives have a door, though generally speaking, software cannot detect the open/close status of a door directly. However, software can command the drive to open/close its door. please see the source of cdcontrol(1): /usr/src/usr.sbin/cdcontrol/cdcontrol.c In the function "int run (int cmd, char *arg)": case CMD_CLOSE: ... case CMD_EJECT: ... ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 07:32:09 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 DF01216A4DA for ; Mon, 14 Aug 2006 07:32:09 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BE2843D8E for ; Mon, 14 Aug 2006 07:30:55 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id B29DE20A9; Mon, 14 Aug 2006 09:30:47 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id A14B420A7; Mon, 14 Aug 2006 09:30:47 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 161C133C24; Mon, 14 Aug 2006 09:30:47 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Intron" References: <86bqqnyhlm.fsf@xps.des.no> Date: Mon, 14 Aug 2006 09:30:46 +0200 In-Reply-To: (mag@intron.ac's message of "Mon, 14 Aug 2006 14:49:10 +0800") Message-ID: <86psf3wz89.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 07:32:10 -0000 "Intron" writes: > "Dag-Erling Sm=F8rgrav" writes: > > "Sean Bryant" writes: > > > I'm writing some cd buring software using burncd as a reference. > > > I was wondering if its possible to detect opening and closing of > > > the doors. > > Unfortunately, no. The drive may not even have a door. > Mr. smo/rgrav loves playing joke very much. No. Unlike you, I know what I'm talking about. > But most of CD/DVD drives have a door, though generally speaking, > software cannot detect the open/close status of a door directly. http://www.plextor.com/english/products/716AL.htm > However, software can command the drive to open/close its door. This is not what Sean wants. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 08:02:39 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 5441616A4E7 for ; Mon, 14 Aug 2006 08:02:39 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0517C43D73 for ; Mon, 14 Aug 2006 08:02:33 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Mon, 14 Aug 2006 16:02:32 +0800 id 00102E1E.44E02E18.00001263 References: <86bqqnyhlm.fsf@xps.des.no> <86psf3wz89.fsf@xps.des.no> In-Reply-To: <86psf3wz89.fsf@xps.des.no> From: "Intron" To: des@des.no Date: Mon, 14 Aug 2006 16:02:32 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 08:02:39 -0000 Dag-Erling [iso-8859-1] Smo/rgrav wrote: > "Intron" writes: >> "Dag-Erling Smo/rgrav" writes: >> > "Sean Bryant" writes: >> > > I'm writing some cd buring software using burncd as a reference. >> > > I was wondering if its possible to detect opening and closing of >> > > the doors. >> > Unfortunately, no. The drive may not even have a door. >> Mr. smo/rgrav loves playing joke very much. > > No. Unlike you, I know what I'm talking about. > >> But most of CD/DVD drives have a door, though generally speaking, >> software cannot detect the open/close status of a door directly. > > http://www.plextor.com/english/products/716AL.htm What I said is "most of". This kind of drive may do harm to your CD/DVD disc if you fail to operate carefully enough. > >> However, software can command the drive to open/close its door. > > This is not what Sean wants. I want to tell Sean that he is not worth spending time in finding how to detect the open/close status of a drive door. If his program can open/close/lock/unlock the door and detect whether recording medium (CD/DVD) is present in drive or not and whether the drive is locked or not, that's enough, just as Nero (www.nero.com) can do. > > DES > -- > Dag-Erling Smo/rgrav - des@des.no ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 08:11:18 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 D1EA016A4DA for ; Mon, 14 Aug 2006 08:11:18 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D50A43D4C for ; Mon, 14 Aug 2006 08:11:18 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 8073420A5; Mon, 14 Aug 2006 10:11:14 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 09E242085; Mon, 14 Aug 2006 10:11:14 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id E771E33C24; Mon, 14 Aug 2006 10:11:13 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Intron" References: <86bqqnyhlm.fsf@xps.des.no> <86psf3wz89.fsf@xps.des.no> Date: Mon, 14 Aug 2006 10:11:13 +0200 In-Reply-To: (mag@intron.ac's message of "Mon, 14 Aug 2006 16:02:32 +0800") Message-ID: <86lkprwxcu.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 08:11:18 -0000 "Intron" writes: > "Dag-Erling Sm=F8rgrav" writes: > > "Intron" writes: > > > However, software can command the drive to open/close its door. > > This is not what Sean wants. > I want to tell Sean that he is not worth spending time in finding > how to detect the open/close status of a drive door. I told him that in my first message, which you found so laughable. How does ridiculing me help Sean? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 08:24:35 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 F0B5C16A4DD for ; Mon, 14 Aug 2006 08:24:35 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id B498843D4C for ; Mon, 14 Aug 2006 08:24:34 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Mon, 14 Aug 2006 16:24:33 +0800 id 00102E1E.44E03341.0000147F References: <86bqqnyhlm.fsf@xps.des.no> <86psf3wz89.fsf@xps.des.no> <86lkprwxcu.fsf@xps.des.no> In-Reply-To: <86lkprwxcu.fsf@xps.des.no> From: "Intron" To: des@des.no Date: Mon, 14 Aug 2006 16:24:33 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 08:24:36 -0000 Dag-Erling [iso-8859-1] Smo/rgrav wrote: > "Intron" writes: >> "Dag-Erling Smo/rgrav" writes: >> > "Intron" writes: >> > > However, software can command the drive to open/close its door. >> > This is not what Sean wants. >> I want to tell Sean that he is not worth spending time in finding >> how to detect the open/close status of a drive door. > > I told him that in my first message, which you found so laughable. > How does ridiculing me help Sean? > > DES > -- > Dag-Erling Smo/rgrav - des@des.no Can your unilateral judgement give real help to Sean? Actually, in the view of software programmer, that kind of no-drawer drive has the same control mode as drawer drive. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 08:47:52 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 4DE8916A4DE for ; Mon, 14 Aug 2006 08:47:52 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 722DB43D76 for ; Mon, 14 Aug 2006 08:47:42 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GCY6k-0006wk-LV for freebsd-hackers@freebsd.org; Mon, 14 Aug 2006 12:47:41 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 7F36612C7B for ; Mon, 14 Aug 2006 12:46:59 +0600 (YEKST) Date: Mon, 14 Aug 2006 12:46:58 +0600 From: Stanislav Sedov To: freebsd-hackers@freebsd.org Message-ID: <20060814124658.1d416cbe@localhost> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_qWUgz/_QkiiVYFs+zVAkzMV"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Subject: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 08:47:52 -0000 --Sig_qWUgz/_QkiiVYFs+zVAkzMV Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi! I'm trying to write kernel code where exceptions are unavoidable. To clarify , I need to recover after GP (general protection) exception on i386 cpu and return an error in that case. Unfortunately, looking in trap.c kernel code I can't find any exception handling mechanism except inserting hooks into trap.c. So, the question is: how can one recover after exception in kernel code? AFAIK, linux build special exception table from various __ex_table sections to allow placing recover code into .fixup section. Does any such mechanism exists in freebsd? Thanks! --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_qWUgz/_QkiiVYFs+zVAkzMV Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE4BxiK/VZk+smlYERAqtQAKCBB1d6EBzBonTD4GTWJAJAny+dWwCfQO59 2ORTEWbOE8+8ilrTHjsTgIY= =M2BB -----END PGP SIGNATURE----- --Sig_qWUgz/_QkiiVYFs+zVAkzMV-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 08:55:16 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 D2BF916A4DD for ; Mon, 14 Aug 2006 08:55:16 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id D635A43D66 for ; Mon, 14 Aug 2006 08:55:08 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 159752085; Mon, 14 Aug 2006 10:55:02 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 059E62084; Mon, 14 Aug 2006 10:55:01 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 765CD33C24; Mon, 14 Aug 2006 10:55:01 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Intron" References: <86bqqnyhlm.fsf@xps.des.no> <86psf3wz89.fsf@xps.des.no> <86lkprwxcu.fsf@xps.des.no> Date: Mon, 14 Aug 2006 10:55:01 +0200 In-Reply-To: (mag@intron.ac's message of "Mon, 14 Aug 2006 16:24:33 +0800") Message-ID: <86hd0fwvbu.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Sean Bryant Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 08:55:16 -0000 "Intron" writes: > "Dag-Erling Smo/rgrav" writes: > > How does ridiculing me help Sean? > Can your unilateral judgement give real help to Sean? Welcome to my kill file. Enjoy your stay. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 09:22:44 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 270AA16A4DD for ; Mon, 14 Aug 2006 09:22:44 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 7F81243D45 for ; Mon, 14 Aug 2006 09:22:41 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 71035 invoked by uid 0); 14 Aug 2006 09:22:39 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 14 Aug 2006 09:22:39 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7E9MNv8032973; Mon, 14 Aug 2006 17:22:23 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E040CF.9080205@alphaque.com> Date: Mon, 14 Aug 2006 17:22:23 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: freebsd-hardware@freebsd.org, freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 09:22:44 -0000 i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE working on them, but the realtek NICs just don't seem to want to work. booting up led to a kernel trap with the following, rlphy0: on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re0: Ethernet address: 00:60:e0:e1:21:d7 re0: diagnostic failed, failed to receive packet in loopback mode re0: attach aborted due to hardware diag failure kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode fault virtual address = 0x74 fault code = supervisor read, page not present instruction pointer = 0x20:0xc0625d45 stack pointer = 0x28:0xc2420a50 frame pointer = 0x28:0xc2420a54 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 (swapper) trap number = 12 panic: page fault Uptime: 1s looking through /usr/src/sys/dev/re/if_re.c, and reading this thread, http://lists.freebsd.org/pipermail/freebsd-current/2004-June/029373.html, i've patched if_re.c to skip the re_diag() routine if the NIC is not a Realtek 8169. the patch follows, ----- CUT HERE ----- --- if_re.c.orig Mon Aug 14 14:43:05 2006 +++ if_re.c Mon Aug 14 14:42:16 2006 @@ -1235,12 +1235,14 @@ ether_ifattach(ifp, eaddr); /* Perform hardware diagnostic. */ - error = re_diag(sc); + if (sc->rl_type == RL_8169) { + error = re_diag(sc); - if (error) { - device_printf(dev, "attach aborted due to hardware diag failure\n"); - ether_ifdetach(ifp); - goto fail; + if (error) { + device_printf(dev, "attach aborted due to hardware diag failure\n"); + ether_ifdetach(ifp); + goto fail; + } } /* Hook interrupt last to avoid having to lock softc */ ----- CUT HERE ----- with the patch applied, the kernel trap goes away and the box boots up. however, though the link light comes on, the device is effectively unuseable for ethernet traffic. nothing seems to go in or out of the device with ping and other tcp/udp traffic failing. note the media state and the missing status line from the ifconfig output. any clue as to what's happenning here or to pointers/patches to fix this would be much appreciated. i've got the box sitting beside me, so testing patches et al would be highly possible. dmesg, ifconfig and pciconf outputs are as follows: re0: port 0xe300-0xe3ff mem 0xed800000-0xed8000ff irq 5 at device 16.0 on pci0 miibus0: on re0 rlphy0: on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re0: Ethernet address: 00:60:e0:e1:21:d7 re1: port 0xe400-0xe4ff mem 0xed801000-0xed8010ff irq 12 at device 17.0 on pci0 miibus1: on re1 rlphy1: on miibus1 rlphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re1: Ethernet address: 00:60:e0:e1:21:d6 re2: port 0xe500-0xe5ff mem 0xed802000-0xed8020ff irq 10 at device 18.0 on pci0 miibus2: on re2 rlphy2: on miibus2 rlphy2: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re2: Ethernet address: 00:60:e0:e1:21:d5 re3: port 0xe600-0xe6ff mem 0xed803000-0xed8030ff irq 11 at device 19.0 on pci0 miibus3: on re3 rlphy3: on miibus3 rlphy3: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto re3: Ethernet address: 00:60:e0:e1:21:d4 # ifconfig -a re0: flags=8843 mtu 1500 options=18 inet 192.168.1.141 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:60:e0:e1:21:d7 media: Ethernet autoselect (none) re1: flags=8843 mtu 1500 options=18 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 ether 00:60:e0:e1:21:d6 media: Ethernet autoselect (none) re2: flags=8802 mtu 1500 options=18 ether 00:60:e0:e1:21:d5 media: Ethernet autoselect (none) re3: flags=8802 mtu 1500 options=18 ether 00:60:e0:e1:21:d4 media: Ethernet autoselect (none) # pciconf -l -v re0@pci0:16:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re1@pci0:17:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re2@pci0:18:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet re3@pci0:19:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 class = network subclass = ethernet -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 10:08:42 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A0AB516A4DE for ; Mon, 14 Aug 2006 10:08:42 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7D0443D45 for ; Mon, 14 Aug 2006 10:08:41 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Mon, 14 Aug 2006 18:08:36 +0800 id 00102E2D.44E04BA4.00001BD8 References: <86bqqnyhlm.fsf@xps.des.no> <86psf3wz89.fsf@xps.des.no> <86lkprwxcu.fsf@xps.des.no> <86hd0fwvbu.fsf@xps.des.no> In-Reply-To: <86hd0fwvbu.fsf@xps.des.no> From: "Intron" To: des@des.no Date: Mon, 14 Aug 2006 18:08:36 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 10:08:42 -0000 Dag-Erling [iso-8859-1] Smo/rgrav wrote: > "Intron" writes: >> "Dag-Erling Smo/rgrav" writes: >> > How does ridiculing me help Sean? >> Can your unilateral judgement give real help to Sean? > > Welcome to my kill file. Enjoy your stay. > > DES > -- > Dag-Erling Smo/rgrav - des@des.no > _______________________________________________ > 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" That's your own freedom to configure your own spam filter. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 10:38:24 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 48E5E16A4E0 for ; Mon, 14 Aug 2006 10:38:24 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38BE343D5E for ; Mon, 14 Aug 2006 10:38:19 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so1184162pyc for ; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=VnwN8kTWpzeJbnnj/cZ70W4TIXjJJaW7jilkkHM/lTii0g7d/CFWpZAKuNXEvIn36l3iAQgNCpH2YdO8/Oe0x05haVTUstrRETVprHUF84k1mcohnGIu6Cw6oPBbMCyYLzdbTcvbVRPUU0gaFh549SAp3pCpRXzq/mm2uAVbso4= Received: by 10.64.204.3 with SMTP id b3mr6621135qbg; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 34sm111867nza.2006.08.14.03.38.16; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7EAdmcV038520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Aug 2006 19:39:48 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7EAdkGZ038519; Mon, 14 Aug 2006 19:39:46 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 14 Aug 2006 19:39:46 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060814103946.GC36904@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E040CF.9080205@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 10:38:24 -0000 On Mon, Aug 14, 2006 at 05:22:23PM +0800, Dinesh Nair wrote: > > i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 > onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE > working on them, but the realtek NICs just don't seem to want to work. > booting up led to a kernel trap with the following, > > rlphy0: on miibus0 > rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto > re0: Ethernet address: 00:60:e0:e1:21:d7 > re0: diagnostic failed, failed to receive packet in loopback mode > re0: attach aborted due to hardware diag failure > kernel trap 12 with interrupts disabled > > Fatal trap 12: page fault while in kernel mode > fault virtual address = 0x74 > fault code = supervisor read, page not present > instruction pointer = 0x20:0xc0625d45 > stack pointer = 0x28:0xc2420a50 > frame pointer = 0x28:0xc2420a54 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 > processor eflags = resume, IOPL = 0 > current process = 0 (swapper) > trap number = 12 > panic: page fault > Uptime: 1s > > looking through /usr/src/sys/dev/re/if_re.c, and reading this thread, > http://lists.freebsd.org/pipermail/freebsd-current/2004-June/029373.html, > i've patched if_re.c to skip the re_diag() routine if the NIC is not a > Realtek 8169. the patch follows, > > ----- CUT HERE ----- > --- if_re.c.orig Mon Aug 14 14:43:05 2006 > +++ if_re.c Mon Aug 14 14:42:16 2006 > @@ -1235,12 +1235,14 @@ > ether_ifattach(ifp, eaddr); > > /* Perform hardware diagnostic. */ > - error = re_diag(sc); > + if (sc->rl_type == RL_8169) { > + error = re_diag(sc); > > - if (error) { > - device_printf(dev, "attach aborted due to hardware diag > failure\n"); > - ether_ifdetach(ifp); > - goto fail; > + if (error) { > + device_printf(dev, "attach aborted due to hardware > diag failure\n"); > + ether_ifdetach(ifp); > + goto fail; > + } > } > > /* Hook interrupt last to avoid having to lock softc */ > ----- CUT HERE ----- > > with the patch applied, the kernel trap goes away and the box boots up. > however, though the link light comes on, the device is effectively > unuseable for ethernet traffic. nothing seems to go in or out of the device > with ping and other tcp/udp traffic failing. note the media state and the > missing status line from the ifconfig output. > > any clue as to what's happenning here or to pointers/patches to fix this > would be much appreciated. i've got the box sitting beside me, so testing > patches et al would be highly possible. > Recent changes from wpaul disabled re_diag() routine by default so it wouldn't trigger the panic you've seen anymore. However I've seen one user reported re(4) breakage on stable. http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html Please try latest stable and show your results. If it still does not work please let us know. I don't have 8139C+ based NICs so it would be difficult for me to fix the issue. :-( -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 10:56:18 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 53B6B16A4DD for ; Mon, 14 Aug 2006 10:56:18 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 0983143D5A for ; Mon, 14 Aug 2006 10:56:16 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 72865 invoked by uid 0); 14 Aug 2006 10:56:15 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 14 Aug 2006 10:56:15 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7EAp5Fr054646; Mon, 14 Aug 2006 18:51:05 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E05598.20004@alphaque.com> Date: Mon, 14 Aug 2006 18:51:04 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: freebsd-hardware@freebsd.org References: <44E040CF.9080205@alphaque.com> In-Reply-To: <44E040CF.9080205@alphaque.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 10:56:18 -0000 On 08/14/06 17:22 Dinesh Nair said the following: > > i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 > onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE > working on them, but the realtek NICs just don't seem to want to work. > booting up led to a kernel trap with the following, based on a pointer from luigi rizzo, i disabled the check for the 8139C+ in /usr/src/sys/pci/if_rl.c to force the rl driver to bind to the card, and that seemed to do the trick in getting it to work. ifconfig still shows that the media is set to 'none' and a missing status line, but the box is pingable at the least. -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 10:56:20 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 E4F0216A50B for ; Mon, 14 Aug 2006 10:56:20 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 267C543D58 for ; Mon, 14 Aug 2006 10:56:18 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 72874 invoked by uid 0); 14 Aug 2006 10:56:17 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 14 Aug 2006 10:56:17 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7EAtwSW055867; Mon, 14 Aug 2006 18:55:59 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E056BE.4080104@alphaque.com> Date: Mon, 14 Aug 2006 18:55:58 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: pyunyh@gmail.com References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> In-Reply-To: <20060814103946.GC36904@cdnetworks.co.kr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 10:56:21 -0000 On 08/14/06 18:39 Pyun YongHyeon said the following: > Recent changes from wpaul disabled re_diag() routine by default so it i disabled re_diag() in /usr/src/sys/dev/if_re.c, and that caused the kernel trap to go away, as per my original email. also, see my followup email (to myself) in which i disabled the check for the 8139C+, forcing it to be recognized by the rl driver and this seems to make it work. > However I've seen one user reported re(4) breakage on stable. > http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html that seems to be exactly the problem i initially observed as well. > Please try latest stable and show your results. If it still does not > work please let us know. I don't have 8139C+ based NICs so it would be i am on a recent stable, circa two weeks ago as well. have there been significant changes to the re driver since ? -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 11:08:40 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 BC38516A4E5 for ; Mon, 14 Aug 2006 11:08:40 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FA9943D67 for ; Mon, 14 Aug 2006 11:08:30 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so1195764pyc for ; Mon, 14 Aug 2006 04:08:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=fT2roDkjDiJSnK3jGNsvtmEYKJtXh6LIDHjkIsqW4jmOMWjiCK+BFb59lX/i9WCufRg2R4wAjOSHWIQt+j0oBgXUIqIdghpQFt9HgUORQV4FdrFNe2t9UL5O4pHtCosEtuMm1garjh9dpryJFNE2JpQsWwTAR9AK3MkCpXTOiRs= Received: by 10.35.108.12 with SMTP id k12mr13049650pym; Mon, 14 Aug 2006 04:08:29 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 38sm848227nza.2006.08.14.04.08.27; Mon, 14 Aug 2006 04:08:29 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7EB9xLL038688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Aug 2006 20:09:59 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7EB9x0c038687; Mon, 14 Aug 2006 20:09:59 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 14 Aug 2006 20:09:59 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060814110959.GD36904@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> <44E056BE.4080104@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E056BE.4080104@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 11:08:40 -0000 On Mon, Aug 14, 2006 at 06:55:58PM +0800, Dinesh Nair wrote: > > On 08/14/06 18:39 Pyun YongHyeon said the following: > >Recent changes from wpaul disabled re_diag() routine by default so it > > i disabled re_diag() in /usr/src/sys/dev/if_re.c, and that caused the > kernel trap to go away, as per my original email. also, see my followup > email (to myself) in which i disabled the check for the 8139C+, forcing it > to be recognized by the rl driver and this seems to make it work. > AFAIK 8139C+ provides 8139 compatible mode which doesn't use descriptor based transfer mechanism. As you know this mode really sucks and need much more CPU power to saturate the link. So I don't think it's good idea to make rl(4) serve 8139C+. > >However I've seen one user reported re(4) breakage on stable. > >http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html > > that seems to be exactly the problem i initially observed as well. > > >Please try latest stable and show your results. If it still does not > >work please let us know. I don't have 8139C+ based NICs so it would be > > i am on a recent stable, circa two weeks ago as well. have there been > significant changes to the re driver since ? > Yes. What `ident /boot/kernel/if_re.ko` shows? -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 12:06:23 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1A62E16A4DF for ; Mon, 14 Aug 2006 12:06:23 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 7EE8443D69 for ; Mon, 14 Aug 2006 12:06:18 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 74391 invoked by uid 0); 14 Aug 2006 12:06:17 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 14 Aug 2006 12:06:17 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7EC3aS7072508; Mon, 14 Aug 2006 20:03:36 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E06697.4090507@alphaque.com> Date: Mon, 14 Aug 2006 20:03:35 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: pyunyh@gmail.com References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> <44E056BE.4080104@alphaque.com> <20060814110959.GD36904@cdnetworks.co.kr> In-Reply-To: <20060814110959.GD36904@cdnetworks.co.kr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 12:06:23 -0000 On 08/14/06 19:09 Pyun YongHyeon said the following: > really sucks and need much more CPU power to saturate the link. > So I don't think it's good idea to make rl(4) serve 8139C+. perhaps, but re(4) doesn't work at the moment on this chipset, and i'd rather have something which works, albeit a little poorly, than something which doesn't. > Yes. What `ident /boot/kernel/if_re.ko` shows? $FreeBSD: src/sys/dev/re/if_re.c,v 1.46.2.19 2006/08/07 02:38:07 yongari Exp $ and the latest if_rlreg.c which i pulled down shows, $FreeBSD: src/sys/pci/if_rlreg.h,v 1.51.2.7 2006/08/01 17:36:50 wpaul Exp $ i'm not using the loadable modules though, and am building the re(4) device into the kernel directly. the symptoms remain the same, i.e. IP traffic doesn't flow at all, though 'arp -an' does show the ethernet address of the other box attempting to ping this. the OP at http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html mentioned that it was working fine before breakage was introduced relatively recently (~ 2 weeks ago), and thus something's changed in the interim which is causing this to happen. -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 12:34:57 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 70D3516A4DE; Mon, 14 Aug 2006 12:34:57 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA17B43D45; Mon, 14 Aug 2006 12:34:56 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id CAF492085; Mon, 14 Aug 2006 14:34:52 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id B8CC42084; Mon, 14 Aug 2006 14:34:52 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 9BF7533C24; Mon, 14 Aug 2006 14:34:52 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Dinesh Nair References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> <44E056BE.4080104@alphaque.com> <20060814110959.GD36904@cdnetworks.co.kr> <44E06697.4090507@alphaque.com> Date: Mon, 14 Aug 2006 14:34:52 +0200 In-Reply-To: <44E06697.4090507@alphaque.com> (Dinesh Nair's message of "Mon, 14 Aug 2006 20:03:35 +0800") Message-ID: <86fyfzv6kz.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: pyunyh@gmail.com, freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 12:34:57 -0000 Dinesh Nair writes: > the symptoms remain the same, i.e. IP traffic doesn't flow at all, > though 'arp -an' does show the ethernet address of the other box > attempting to ping this. 'tcpdump -n -e -i re0' shows nothing? have you tried disabling rx / tx checksum offloading? ('ifconfig re0 -rxcsum -txcsum') DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 12:41:36 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A092016A4E1 for ; Mon, 14 Aug 2006 12:41:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F7FA43D90 for ; Mon, 14 Aug 2006 12:41:02 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so144898wra for ; Mon, 14 Aug 2006 05:41:01 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=DZi7dh/YfcV5IfcVAygtOQchUw411AhzyIra3X4OF7AMKCLa51eHuGlkaaWBbBHqFoZmvepD4TtjUsRYy8mV3pdb4PcraVHChwzTc7rS7jR4zGhVZ/kTNU4KoM1wMv08wjPAXYeEMXIiV9ytmGDeNqLFxNXsQPv/vGGpXfVf3w8= Received: by 10.65.240.17 with SMTP id s17mr6854832qbr; Mon, 14 Aug 2006 05:41:01 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 20sm2071523nzp.2006.08.14.05.40.59; Mon, 14 Aug 2006 05:41:01 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7ECgXvm038978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Aug 2006 21:42:33 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7ECgWba038977; Mon, 14 Aug 2006 21:42:32 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 14 Aug 2006 21:42:32 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060814124232.GF36904@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> <44E056BE.4080104@alphaque.com> <20060814110959.GD36904@cdnetworks.co.kr> <44E06697.4090507@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E06697.4090507@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 12:41:36 -0000 On Mon, Aug 14, 2006 at 08:03:35PM +0800, Dinesh Nair wrote: > > > On 08/14/06 19:09 Pyun YongHyeon said the following: > >really sucks and need much more CPU power to saturate the link. > >So I don't think it's good idea to make rl(4) serve 8139C+. > > perhaps, but re(4) doesn't work at the moment on this chipset, and i'd > rather have something which works, albeit a little poorly, than something > which doesn't. > Ok. > >Yes. What `ident /boot/kernel/if_re.ko` shows? > > $FreeBSD: src/sys/dev/re/if_re.c,v 1.46.2.19 2006/08/07 02:38:07 yongari > Exp $ > > and the latest if_rlreg.c which i pulled down shows, > > $FreeBSD: src/sys/pci/if_rlreg.h,v 1.51.2.7 2006/08/01 17:36:50 wpaul Exp $ > > i'm not using the loadable modules though, and am building the re(4) device > into the kernel directly. > > the symptoms remain the same, i.e. IP traffic doesn't flow at all, though > 'arp -an' does show the ethernet address of the other box attempting to > ping this. > Ok, this is important thing. It means Rx part works as expected. Can you see tcpdump output on Tx side while ping command is in progress? > the OP at > http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html > mentioned that it was working fine before breakage was introduced > relatively recently (~ 2 weeks ago), and thus something's changed in the > interim which is causing this to happen. > -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 14:17:09 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 D66BA16A4DA for ; Mon, 14 Aug 2006 14:17:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEF1643D5C for ; Mon, 14 Aug 2006 14:17:02 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7EEGn9k013497; Mon, 14 Aug 2006 10:17:00 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 14 Aug 2006 09:32:57 -0400 User-Agent: KMail/1.9.1 References: <20060814124658.1d416cbe@localhost> In-Reply-To: <20060814124658.1d416cbe@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608140932.57875.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Mon, 14 Aug 2006 10:17:01 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1659/Mon Aug 14 04:44:22 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Stanislav Sedov Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 14:17:09 -0000 On Monday 14 August 2006 02:46, Stanislav Sedov wrote: > Hi! > > I'm trying to write kernel code where exceptions are unavoidable. > To clarify , I need to recover after GP (general protection) exception > on i386 cpu and return an error in that case. > Unfortunately, looking in trap.c kernel code I can't find any exception > handling mechanism except inserting hooks into trap.c. > > So, the question is: how can one recover after exception in kernel > code? AFAIK, linux build special exception table from various __ex_table > sections to allow placing recover code into .fixup section. Does any such > mechanism exists in freebsd? > > Thanks! You can make use of pcb_onfault to recover from a page fault, but that's about it. Kernel code is expected to not generate exceptions. :) -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 14:17:11 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1E5C616A4DD for ; Mon, 14 Aug 2006 14:17:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6DE643D72 for ; Mon, 14 Aug 2006 14:17:00 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7EEGn9j013497; Mon, 14 Aug 2006 10:16:58 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 14 Aug 2006 09:29:53 -0400 User-Agent: KMail/1.9.1 References: <17630.8773.656653.169665@bhuda.mired.org> In-Reply-To: <17630.8773.656653.169665@bhuda.mired.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608140929.53373.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Mon, 14 Aug 2006 10:16:59 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1659/Mon Aug 14 04:44:22 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Mike Meyer Subject: Re: amd64 port on Prescott 2M? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 14:17:11 -0000 On Saturday 12 August 2006 14:47, Mike Meyer wrote: > I just got a Prescott 2M core. While it's marketed as a P4, it's got > all the features of the Xeon Nocona core enabled (except for MP > support, of course): MMX, SSE, SSE2, SSE3, HT, EM64T, EIST and XD. > > The question is whether or not the AMD64 build of FreeBSD - which runs > on Nocona - will run on this. If someone knows for sure it won't run, > they'll save me the time of trying it. If it has EM64T it should run FreeBSD/amd64. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 15:48:13 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1A05116A4DA; Mon, 14 Aug 2006 15:48:13 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94B1243D45; Mon, 14 Aug 2006 15:48:12 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GCefh-0003MZ-2K; Mon, 14 Aug 2006 19:48:11 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 3EA5812D6B; Mon, 14 Aug 2006 19:47:30 +0600 (YEKST) Date: Mon, 14 Aug 2006 19:47:29 +0600 From: Stanislav Sedov To: John Baldwin Message-ID: <20060814194729.436fc453@localhost> In-Reply-To: <200608140932.57875.jhb@freebsd.org> References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_b.L.Jt9PH9ACZ_7KA7TBXjx; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Cc: freebsd-hackers@freebsd.org Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 15:48:13 -0000 --Sig_b.L.Jt9PH9ACZ_7KA7TBXjx Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Mon, 14 Aug 2006 09:32:57 -0400 John Baldwin mentioned: >=20 > You can make use of pcb_onfault to recover from a page fault, but that's > about it. Kernel code is expected to not generate exceptions. :) >=20 Thanks a lot! I'll try it. To clarify: I've implemented driver to allow user-level code to read MSRs (Model specific registers) (like linux's /dev/cpu/msr). It's required for some programs like x86info. As long as not all MSRs documented and reading/writing unexistent MSR leads to GP fault, I need to recover in that case. --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_b.L.Jt9PH9ACZ_7KA7TBXjx Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE4H7yK/VZk+smlYERAuGmAJ9uqkIjcl1Ez/wxO7KjY6KZyxzN4gCeNgbI B/Ef4ghJlt4dcm014Z76gXE= =ztsz -----END PGP SIGNATURE----- --Sig_b.L.Jt9PH9ACZ_7KA7TBXjx-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 16:07:21 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 9CA5F16A4E0 for ; Mon, 14 Aug 2006 16:07:21 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 6F7D443D78 for ; Mon, 14 Aug 2006 16:07:18 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 25444 invoked by uid 1001); 14 Aug 2006 16:07:11 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Mon, 14 Aug 2006 12:07:10 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17632.40878.89491.84898@bhuda.mired.org> Date: Mon, 14 Aug 2006 12:07:10 -0400 To: John Baldwin In-Reply-To: <200608140929.53373.jhb@freebsd.org> References: <17630.8773.656653.169665@bhuda.mired.org> <200608140929.53373.jhb@freebsd.org> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer Cc: freebsd-hackers@freebsd.org Subject: Re: amd64 port on Prescott 2M? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 16:07:21 -0000 In <200608140929.53373.jhb@freebsd.org>, John Baldwin typed: > On Saturday 12 August 2006 14:47, Mike Meyer wrote: > > I just got a Prescott 2M core. While it's marketed as a P4, it's got > > all the features of the Xeon Nocona core enabled (except for MP > > support, of course): MMX, SSE, SSE2, SSE3, HT, EM64T, EIST and XD. > > > > The question is whether or not the AMD64 build of FreeBSD - which runs > > on Nocona - will run on this. If someone knows for sure it won't run, > > they'll save me the time of trying it. > If it has EM64T it should run FreeBSD/amd64. That's what I would expect, but that's not what the online docs I found said. I could have sworn it just talked about the Xeon nocona, but I can't find it now :-(. The HARDWARE.TXT file on the distribution does, but it's not accurate (it says the 5xx series Prescott's don't have EM64T, but Intel docs some of the 5x1's as having EM64T). It doesn't talk about the Cedar Mill P4 core or the Pentium D's at all. I'll look into submitting a doc PR to change this. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 16:17:08 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 190FE16A4E0 for ; Mon, 14 Aug 2006 16:17:08 +0000 (UTC) (envelope-from bryants@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 408CE43D49 for ; Mon, 14 Aug 2006 16:16:58 +0000 (GMT) (envelope-from bryants@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so401966nzn for ; Mon, 14 Aug 2006 09:16:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m1kHX4EuN9AvSrHo9Vfc80exPaZujpQI4LYoCPKxQ61NBnbtMj7Na3ALlAqiNb/HcosF1UAGgose2rxZSO0FTaWMvZcH28nG1A2kAvgoUOQtQwkaHGT+79PQN9DwIqk6LQjiYSAYLSxptz36RxaeIgJGoHAREbEyvo/MsxbvJ3w= Received: by 10.65.114.11 with SMTP id r11mr2839187qbm; Mon, 14 Aug 2006 09:16:58 -0700 (PDT) Received: by 10.65.20.2 with HTTP; Mon, 14 Aug 2006 09:16:58 -0700 (PDT) Message-ID: Date: Mon, 14 Aug 2006 12:16:58 -0400 From: "Sean Bryant" To: "=?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?=" In-Reply-To: <86bqqnyhlm.fsf@xps.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 Content-Disposition: inline References: <86bqqnyhlm.fsf@xps.des.no> Cc: hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 16:17:08 -0000 VGhhbmtzLiBXYXMganVzdCBjaGVja2luZy4KT24gOC8xNC8wNiwgRGFnLUVybGluZyBTbcO4cmdy YXYgPGRlc0BkZXMubm8+IHdyb3RlOgo+ICJTZWFuIEJyeWFudCIgPGJyeWFudHNAZ21haWwuY29t PiB3cml0ZXM6Cj4gPiBJJ20gd3JpdGluZyBzb21lIGNkIGJ1cmluZyBzb2Z0d2FyZSB1c2luZyBi dXJuY2QgYXMgYSByZWZlcmVuY2UuIEkgd2FzCj4gPiB3b25kZXJpbmcgaWYgaXRzIHBvc3NpYmxl IHRvIGRldGVjdCBvcGVuaW5nIGFuZCBjbG9zaW5nIG9mIHRoZSBkb29ycy4KPgo+IFVuZm9ydHVu YXRlbHksIG5vLiAgVGhlIGRyaXZlIG1heSBub3QgZXZlbiBoYXZlIGEgZG9vci4KPgo+IERFUwo+ IC0tCj4gRGFnLUVybGluZyBTbcO4cmdyYXYgLSBkZXNAZGVzLm5vCj4KCgotLSAKU2VhbiBCcnlh bnQK From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 17:10:46 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 2155516A4DF for ; Mon, 14 Aug 2006 17:10:46 +0000 (UTC) (envelope-from bryants@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id A895A43D45 for ; Mon, 14 Aug 2006 17:10:45 +0000 (GMT) (envelope-from bryants@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so413125nzn for ; Mon, 14 Aug 2006 10:10:45 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bHY556VFxhwlauSh+V6AdtpOMUgCGXBHXcpqptsGH0bhMbJxsM1QMO0TtuLsQYR8MUPRCJcY9ekG5ARjKUllQPnONF83/72iLOkz0jYzxtAgog8B9rfQhJx6k8sXAAmcJNCXnaa79lJaTtTDbhyHzZG1CeBoiycckLwJkGezwW4= Received: by 10.64.179.11 with SMTP id b11mr7290020qbf; Mon, 14 Aug 2006 10:10:44 -0700 (PDT) Received: by 10.65.20.2 with HTTP; Mon, 14 Aug 2006 10:10:43 -0700 (PDT) Message-ID: Date: Mon, 14 Aug 2006 13:10:43 -0400 From: "Sean Bryant" To: "=?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?=" In-Reply-To: <86bqqnyhlm.fsf@xps.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 Content-Disposition: inline References: <86bqqnyhlm.fsf@xps.des.no> Cc: hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 17:10:46 -0000 SG93IGFib3V0IHdoZW4gbWVkaWEgaXMgbG9hZGVkLiBJIGhhdmUgYSBkZXRlY3Rpb24gcm91dGlu ZSB0aGF0J2xsIGFzawpmb3IgbWVkaWEsIGJ1dCB3aGF0IGFib3V0IHdoZW4gYW55IG1lZGlhIGlz IGxvYWRlZD8gSXMgdGhlcmUgc29tZSBraW5kCm9mIGV2ZW50IG9yIHNvbWUgd2F5IEkgY2FuIGJl IG5vdGlmaWVkLgpPbiA4LzE0LzA2LCBEYWctRXJsaW5nIFNtw7hyZ3JhdiA8ZGVzQGRlcy5ubz4g d3JvdGU6Cj4gIlNlYW4gQnJ5YW50IiA8YnJ5YW50c0BnbWFpbC5jb20+IHdyaXRlczoKPiA+IEkn bSB3cml0aW5nIHNvbWUgY2QgYnVyaW5nIHNvZnR3YXJlIHVzaW5nIGJ1cm5jZCBhcyBhIHJlZmVy ZW5jZS4gSSB3YXMKPiA+IHdvbmRlcmluZyBpZiBpdHMgcG9zc2libGUgdG8gZGV0ZWN0IG9wZW5p bmcgYW5kIGNsb3Npbmcgb2YgdGhlIGRvb3JzLgo+Cj4gVW5mb3J0dW5hdGVseSwgbm8uICBUaGUg ZHJpdmUgbWF5IG5vdCBldmVuIGhhdmUgYSBkb29yLgo+Cj4gREVTCj4gLS0KPiBEYWctRXJsaW5n IFNtw7hyZ3JhdiAtIGRlc0BkZXMubm8KPgoKCi0tIApTZWFuIEJyeWFudAo= From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 18:15:28 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 8494F16A4DA; Mon, 14 Aug 2006 18:15:28 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11AE043D49; Mon, 14 Aug 2006 18:15:27 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gk8mi9vrn6htew7x@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k7EIFRMF018940; Mon, 14 Aug 2006 11:15:27 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k7EIFMlt018938; Mon, 14 Aug 2006 11:15:22 -0700 (PDT) (envelope-from jmg) Date: Mon, 14 Aug 2006 11:15:22 -0700 From: John-Mark Gurney To: Stanislav Sedov Message-ID: <20060814181521.GQ99774@funkthat.com> Mail-Followup-To: Stanislav Sedov , John Baldwin , freebsd-hackers@freebsd.org References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060814194729.436fc453@localhost> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 18:15:28 -0000 Stanislav Sedov wrote this message on Mon, Aug 14, 2006 at 19:47 +0600: > I've implemented driver to allow user-level code to read MSRs (Model > specific registers) (like linux's /dev/cpu/msr). It's required for > some programs like x86info. > > As long as not all MSRs documented and reading/writing unexistent MSR > leads to GP fault, I need to recover in that case. You should make a MD API for reading these out (if one doesn't already exist) that handle the faulting for you, and then have your driver hook into this api... I had to do something similar for accessing PCI config registers that don't exist and cause a fault... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 18:49:43 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 24B6D16A4DF for ; Mon, 14 Aug 2006 18:49:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EAFC43D46 for ; Mon, 14 Aug 2006 18:49:42 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7EInZ09016552; Mon, 14 Aug 2006 14:49:38 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Stanislav Sedov Date: Mon, 14 Aug 2006 13:17:57 -0400 User-Agent: KMail/1.9.1 References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> In-Reply-To: <20060814194729.436fc453@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608141317.58034.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 14 Aug 2006 14:49:38 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1660/Mon Aug 14 11:42:28 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 18:49:43 -0000 On Monday 14 August 2006 09:47, Stanislav Sedov wrote: > On Mon, 14 Aug 2006 09:32:57 -0400 > John Baldwin mentioned: > > > > You can make use of pcb_onfault to recover from a page fault, but that's > > about it. Kernel code is expected to not generate exceptions. :) > > > > Thanks a lot! I'll try it. > > To clarify: > > I've implemented driver to allow user-level code to read MSRs (Model > specific registers) (like linux's /dev/cpu/msr). It's required for > some programs like x86info. > > As long as not all MSRs documented and reading/writing unexistent MSR > leads to GP fault, I need to recover in that case. Hmm pcb_onfault won't help with this (it does PF#, not GP#). You will have to hack trap() to provide some sort of fallback for your case. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 19:13:21 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B078B16A4DF; Mon, 14 Aug 2006 19:13:21 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3B2E43D7C; Mon, 14 Aug 2006 19:13:18 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GChs9-0006jU-9C; Mon, 14 Aug 2006 23:13:15 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id A272F12030; Mon, 14 Aug 2006 23:12:29 +0600 (YEKST) Date: Mon, 14 Aug 2006 23:12:23 +0600 From: Stanislav Sedov To: John-Mark Gurney Message-ID: <20060814231223.3c7f1930@localhost> In-Reply-To: <20060814181521.GQ99774@funkthat.com> References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> <20060814181521.GQ99774@funkthat.com> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_91Gx87dqCaWFF/y.=3HJu=i"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Cc: freebsd-hackers@freebsd.org Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 19:13:21 -0000 --Sig_91Gx87dqCaWFF/y.=3HJu=i Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Mon, 14 Aug 2006 11:15:22 -0700 John-Mark Gurney mentioned: >=20 > You should make a MD API for reading these out (if one doesn't already > exist) that handle the faulting for you, and then have your driver hook > into this api... >=20 > I had to do something similar for accessing PCI config registers > that don't exist and cause a fault... > =20 Do you know some examples to look at? The problem is that i can't make modifications in trap.c or anywhere else in src tree as such driver isn't likely to become a part of FreeBSD kernel. Thanks! --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_91Gx87dqCaWFF/y.=3HJu=i Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE4K75K/VZk+smlYERAlZEAJ0YlhhPsoGZUxrGE7wJfhxMnEcjzQCeJnes xSCxpVWFYx/HTKY9cZVYmUE= =W+ED -----END PGP SIGNATURE----- --Sig_91Gx87dqCaWFF/y.=3HJu=i-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 19:19:48 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 D8CD916A4DF for ; Mon, 14 Aug 2006 19:19:48 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6631C43D58 for ; Mon, 14 Aug 2006 19:19:48 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 7B6B420A5; Mon, 14 Aug 2006 21:19:43 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 5FD0C2084; Mon, 14 Aug 2006 21:19:43 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 1D3F833C24; Mon, 14 Aug 2006 21:19:43 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Sean Bryant" References: <86bqqnyhlm.fsf@xps.des.no> Date: Mon, 14 Aug 2006 21:19:42 +0200 In-Reply-To: (Sean Bryant's message of "Mon, 14 Aug 2006 13:10:43 -0400") Message-ID: <861wrjjfap.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 19:19:48 -0000 "Sean Bryant" writes: > How about when media is loaded. I have a detection routine that'll ask > for media, but what about when any media is loaded? Is there some kind > of event or some way I can be notified. Sorry, no. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 19:47:59 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 F24C816A4DA for ; Mon, 14 Aug 2006 19:47:59 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from gidgate.gid.co.uk (gid.co.uk [194.32.164.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3802A43D6A for ; Mon, 14 Aug 2006 19:47:58 +0000 (GMT) (envelope-from rb@gid.co.uk) Received: (from rb@localhost) by gidgate.gid.co.uk (8.11.7/8.11.6) id k7EJlud76541; Mon, 14 Aug 2006 20:47:56 +0100 (BST) (envelope-from rb) Message-Id: <7.0.1.0.2.20060814204530.07989a10@gid.co.uk> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Mon, 14 Aug 2006 20:47:52 +0100 To: hackers@freebsd.org From: Bob Bishop Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: Subject: Intel S5000PAL server board X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 19:48:00 -0000 Hi, Is anyone here running 6.1 on Intel S5000PAL with dual-core Xeons? -- Bob Bishop +44 (0)118 940 1243 rb@gid.co.uk fax +44 (0)118 940 1295 From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 20:39:43 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 AC68216A4DA for ; Mon, 14 Aug 2006 20:39:43 +0000 (UTC) (envelope-from bryants@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A11243D49 for ; Mon, 14 Aug 2006 20:39:43 +0000 (GMT) (envelope-from bryants@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so449238nzn for ; Mon, 14 Aug 2006 13:39:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=f1OIaj6SjeGiYabL8gnvJbHF9l7U2t3kM7jaLmYeLk0cjiQbKSYRLKFxOKGhp4L6aX7nil3l16ktHh4/vSL2SNGI+5P0Wtz5usldUS6AA1GJwpZk9MDSNrPST4MIxNDdNaeW87dz56XR1vlUNhyjNNI7YYbH0Lws63PUf6tJJEQ= Received: by 10.65.251.1 with SMTP id d1mr7659929qbs; Mon, 14 Aug 2006 13:39:42 -0700 (PDT) Received: by 10.65.20.2 with HTTP; Mon, 14 Aug 2006 13:39:42 -0700 (PDT) Message-ID: Date: Mon, 14 Aug 2006 16:39:42 -0400 From: "Sean Bryant" To: "=?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?=" In-Reply-To: <861wrjjfap.fsf@xps.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 Content-Disposition: inline References: <86bqqnyhlm.fsf@xps.des.no> <861wrjjfap.fsf@xps.des.no> Cc: hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 20:39:43 -0000 VGhhbmtzIGFueXdheSA6KApPbiA4LzE0LzA2LCBEYWctRXJsaW5nIFNtw7hyZ3JhdiA8ZGVzQGRl cy5ubz4gd3JvdGU6Cj4gIlNlYW4gQnJ5YW50IiA8YnJ5YW50c0BnbWFpbC5jb20+IHdyaXRlczoK PiA+IEhvdyBhYm91dCB3aGVuIG1lZGlhIGlzIGxvYWRlZC4gSSBoYXZlIGEgZGV0ZWN0aW9uIHJv dXRpbmUgdGhhdCdsbCBhc2sKPiA+IGZvciBtZWRpYSwgYnV0IHdoYXQgYWJvdXQgd2hlbiBhbnkg bWVkaWEgaXMgbG9hZGVkPyBJcyB0aGVyZSBzb21lIGtpbmQKPiA+IG9mIGV2ZW50IG9yIHNvbWUg d2F5IEkgY2FuIGJlIG5vdGlmaWVkLgo+Cj4gU29ycnksIG5vLgo+Cj4gREVTCj4gLS0KPiBEYWct RXJsaW5nIFNtw7hyZ3JhdiAtIGRlc0BkZXMubm8KPgoKCi0tIApTZWFuIEJyeWFudAo= From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 20:42:37 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 D3F5216A4DA; Mon, 14 Aug 2006 20:42:37 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A79343D55; Mon, 14 Aug 2006 20:42:37 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (ozdlzc5qemdjlwzt@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k7EKgaN0021476; Mon, 14 Aug 2006 13:42:36 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k7EKgW2s021475; Mon, 14 Aug 2006 13:42:32 -0700 (PDT) (envelope-from jmg) Date: Mon, 14 Aug 2006 13:42:32 -0700 From: John-Mark Gurney To: Stanislav Sedov Message-ID: <20060814204232.GR99774@funkthat.com> Mail-Followup-To: Stanislav Sedov , John Baldwin , freebsd-hackers@freebsd.org References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> <20060814181521.GQ99774@funkthat.com> <20060814231223.3c7f1930@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060814231223.3c7f1930@localhost> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 20:42:37 -0000 Stanislav Sedov wrote this message on Mon, Aug 14, 2006 at 23:12 +0600: > On Mon, 14 Aug 2006 11:15:22 -0700 > John-Mark Gurney mentioned: > > > > You should make a MD API for reading these out (if one doesn't already > > exist) that handle the faulting for you, and then have your driver hook > > into this api... > > > > I had to do something similar for accessing PCI config registers > > that don't exist and cause a fault... > > Do you know some examples to look at? The problem is that i can't make > modifications in trap.c or anywhere else in src tree as such driver > isn't likely to become a part of FreeBSD kernel. That will be very difficult to do then.... The work I did for accessing PCI config registers had to be merged into the tree... Maybe introducing a method for adding a MD callback to the trap handler for other modules that need this? Short of modifing the function in real time to point to your code, I don't have any suggestions... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 21:18:21 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 699AB16A4DF for ; Mon, 14 Aug 2006 21:18:21 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id D586343D5C for ; Mon, 14 Aug 2006 21:18:18 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Tue, 15 Aug 2006 05:18:17 +0800 id 00102C05.44E0E899.00004676 References: <86bqqnyhlm.fsf@xps.des.no> <861wrjjfap.fsf@xps.des.no> In-Reply-To: From: "Intron" To: "Sean Bryant" Date: Tue, 15 Aug 2006 05:18:17 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 21:18:21 -0000 The section 4.11.1 "Removable Media Status Notification feature set" of ATA/ATAPI-7 (http://t13.org/docs2004/d1532v1r4b-ATA-ATAPI-7.pdf) reads, d) Host system periodically checks media status using the GET MEDIA STATUS command to determine if any of the following events occurred: - no media is present in the device (NM). - media was changed since the last command (MC). - a media change request has occurred (MCR). - media is write protected (WP). ------------------------------------------------------------------------ From Beijing, China Sean Bryant wrote: > Thanks anyway :( > On 8/14/06, Dag-Erling Smo/rgrav wrote: >> "Sean Bryant" writes: >> > How about when media is loaded. I have a detection routine that'll ask >> > for media, but what about when any media is loaded? Is there some kind >> > of event or some way I can be notified. >> >> Sorry, no. >> >> DES >> -- >> Dag-Erling Smo/rgrav - des@des.no >> > > > -- > Sean Bryant From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 21:57:46 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 32C6C16A4DD for ; Mon, 14 Aug 2006 21:57:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9821943D49 for ; Mon, 14 Aug 2006 21:57:45 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k7ELuqpi017365; Mon, 14 Aug 2006 15:56:53 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 14 Aug 2006 15:56:52 -0600 (MDT) Message-Id: <20060814.155652.1573371768.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <861wrjjfap.fsf@xps.des.no> References: <86bqqnyhlm.fsf@xps.des.no> <861wrjjfap.fsf@xps.des.no> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 14 Aug 2006 15:56:53 -0600 (MDT) Cc: hackers@freebsd.org, bryants@gmail.com Subject: Re: Questions about devices and input. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 21:57:46 -0000 In message: <861wrjjfap.fsf@xps.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : "Sean Bryant" writes: : > How about when media is loaded. I have a detection routine that'll = ask : > for media, but what about when any media is loaded? Is there some k= ind : > of event or some way I can be notified. : = : Sorry, no. The only way is to poll the device from time to time :-( Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 23:10:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 BDF7E16A4DE for ; Mon, 14 Aug 2006 23:10:49 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 309EC43D45 for ; Mon, 14 Aug 2006 23:10:49 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Tue, 15 Aug 2006 07:10:47 +0800 id 00102E1E.44E102F7.00004C34 From: "Intron" To: freebsd-hackers@freebsd.org Date: Tue, 15 Aug 2006 07:10:47 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Subject: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 23:10:49 -0000 One day, a friend told me that his program was 3 times slower under FreeBSD 6.1 than under GNU/Linux (from Redhat 7.2 to Fedora Core 5). I was astonished by the real repeatable performance difference on AMD Athlon XP 2500+ (1.8GHz, 512KB L2 Cache). After hacking, I found that the problem is nested in malloc(3) of FreeBSD libc. Download the testing program: http://ftp.intron.ac/tmp/fdtd.tar.bz2 You may try to compile the program WITHOUT the macro "MY_MALLOC" defined (in Makefile) to use malloc(3) provided by FreeBSD 6.1. Then, time the running of the binary (on Athlon XP 2500+): #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 165.24 real 164.19 user 0.02 sys Please try to recompile the program (Remember to "make clean") WITH the macro "MY_MALLOC" defined (in Makefile) to use my own simple implementation of malloc(3) (i.e. my_malloc() in cal.c). And time the running again: #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 50.41 real 49.95 user 0.04 sys You may repeat this testing again and again. I guess this kind of performance difference comes from: 1. His program uses malloc(3) to obtain so many small memory blocks. 2. In this case, FreeBSD malloc(3) obtains small memory blocks from kernel and pass them to application. But malloc(3) of GNU libc obtains large memory blocks from kernel and splits & reallocates them in small blocks to application. You may verify my judgement with truss(1). 3. The way of FreeBSD malloc(3) makes VM page mapping too chaotic, which reduces the efficiency of CPU L2 Cache. In contrast, my my_malloc() simulates the behavior of GNU libc malloc(3) partially and avoids the over-chaos. Callgrind is broken under FreeBSD, or I will verify my guess with it. I have also verified the program on Intel Pentium 4 511 (2.8GHz, 1MB L2 cache, running FreeBSD 6.1 i386 though this CPU supports EM64T) >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 185.30 real 184.28 user 0.02 sys >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 36.31 real 35.94 user 0.03 sys NOTE: you probably cannot see the performance difference on CPU with small L2 cache such as Intel Celeron 1.7GHz with 128 KB L2 Cache. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 23:15:12 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 41C6816A4DD for ; Mon, 14 Aug 2006 23:15:12 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc92.asp.att.net (sccmmhc92.asp.att.net [204.127.203.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA1AF43D58 for ; Mon, 14 Aug 2006 23:15:09 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc92.asp.att.net (sccmmhc92) with ESMTP id <20060814231508m92002ta2se>; Mon, 14 Aug 2006 23:15:08 +0000 Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.6/8.13.6) with ESMTP id k7ENF5Ni069530; Mon, 14 Aug 2006 18:15:05 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.6/8.13.6/Submit) id k7ENF4Pb069529; Mon, 14 Aug 2006 18:15:04 -0500 (CDT) (envelope-from brooks) Date: Mon, 14 Aug 2006 18:15:04 -0500 From: Brooks Davis To: Intron Message-ID: <20060814231504.GB69362@lor.one-eyed-alien.net> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O5XBE6gyVG5Rl6Rj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 23:15:12 -0000 --O5XBE6gyVG5Rl6Rj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 15, 2006 at 07:10:47AM +0800, Intron wrote: > One day, a friend told me that his program was 3 times slower under > FreeBSD 6.1 than under GNU/Linux (from Redhat 7.2 to Fedora Core 5). > I was astonished by the real repeatable performance difference on > AMD Athlon XP 2500+ (1.8GHz, 512KB L2 Cache). >=20 > After hacking, I found that the problem is nested in malloc(3) of > FreeBSD libc. >=20 > Download the testing program: http://ftp.intron.ac/tmp/fdtd.tar.bz2 >=20 > You may try to compile the program WITHOUT the macro "MY_MALLOC" > defined (in Makefile) to use malloc(3) provided by FreeBSD 6.1. > Then, time the running of the binary (on Athlon XP 2500+): >=20 > #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 165.24 real 164.19 user 0.02 sys >=20 > Please try to recompile the program (Remember to "make clean") > WITH the macro "MY_MALLOC" defined (in Makefile) to use my own > simple implementation of malloc(3) (i.e. my_malloc() in cal.c). > And time the running again: >=20 > #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 50.41 real 49.95 user 0.04 sys >=20 > You may repeat this testing again and again. >=20 > I guess this kind of performance difference comes from: >=20 > 1. His program uses malloc(3) to obtain so many small memory blocks. >=20 > 2. In this case, FreeBSD malloc(3) obtains small memory blocks from > kernel and pass them to application.=20 >=20 > But malloc(3) of GNU libc obtains large memory blocks from kernel > and splits & reallocates them in small blocks to application. >=20 > You may verify my judgement with truss(1). >=20 > 3. The way of FreeBSD malloc(3) makes VM page mapping too chaotic, which > reduces the efficiency of CPU L2 Cache. In contrast, my my_malloc() > simulates the behavior of GNU libc malloc(3) partially and avoids > the over-chaos. >=20 > Callgrind is broken under FreeBSD, or I will verify my guess with it. >=20 > I have also verified the program on Intel Pentium 4 511 (2.8GHz, 1MB > L2 cache, running FreeBSD 6.1 i386 though this CPU supports EM64T) >=20 > >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 185.30 real 184.28 user 0.02 sys >=20 > >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 36.31 real 35.94 user 0.03 sys >=20 > NOTE: you probably cannot see the performance difference on CPU with > small L2 cache such as Intel Celeron 1.7GHz with 128 KB L2 Cache. In CURRENT we've replaced phkmalloc with jemalloc. It would be useful to see how this benchmark performs with that. I believe it does similar things. -- Brooke --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFE4QP3XY6L6fI4GtQRApTQAJ4ulfigKoy9VnIBF3Gm+PhNlLZirACg5WsD AkcR18o0JYhMLbuUSeyZAfE= =Dydt -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 23:38:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 6764916A4DF for ; Mon, 14 Aug 2006 23:38:14 +0000 (UTC) (envelope-from vkushnir@i.kiev.ua) Received: from horse.iptelecom.net.ua (horse.iptelecom.net.ua [212.9.224.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9CC443D45 for ; Mon, 14 Aug 2006 23:38:13 +0000 (GMT) (envelope-from vkushnir@i.kiev.ua) Received: from h99.243.159.dialup.iptcom.net ([213.159.243.99]:44013 "EHLO kushnir1.kiev.ua" ident: "SOCKFAULT1" whoson: "vkushnir") by horse.iptelecom.net.ua with ESMTP id S1220795AbWHNXiM (INRCPT ); Tue, 15 Aug 2006 02:38:12 +0300 Received: from kushnir1.kiev.ua (kushnir1.kiev.ua [10.0.0.1]) by kushnir1.kiev.ua (8.13.7/8.13.6) with ESMTP id k7ENc6NV000880; Tue, 15 Aug 2006 02:38:06 +0300 (EEST) (envelope-from vkushnir@i.kiev.ua) Date: Tue, 15 Aug 2006 02:38:06 +0300 (EEST) From: Vladimir Kushnir X-X-Sender: vkushnir@kushnir1.kiev.ua To: Brooks Davis In-Reply-To: <20060814231504.GB69362@lor.one-eyed-alien.net> Message-ID: <20060815023505.N1988@kushnir1.kiev.ua> References: <20060814231504.GB69362@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Intron Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 23:38:14 -0000 Sorry for intrusion. On Mon, 14 Aug 2006, Brooks Davis wrote: > On Tue, Aug 15, 2006 at 07:10:47AM +0800, Intron wrote: >> One day, a friend told me that his program was 3 times slower under >> FreeBSD 6.1 than under GNU/Linux (from Redhat 7.2 to Fedora Core 5). >> I was astonished by the real repeatable performance difference on >> AMD Athlon XP 2500+ (1.8GHz, 512KB L2 Cache). >> >> After hacking, I found that the problem is nested in malloc(3) of >> FreeBSD libc. >> >> Download the testing program: http://ftp.intron.ac/tmp/fdtd.tar.bz2 >> >> You may try to compile the program WITHOUT the macro "MY_MALLOC" >> defined (in Makefile) to use malloc(3) provided by FreeBSD 6.1. >> Then, time the running of the binary (on Athlon XP 2500+): >> >> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 165.24 real 164.19 user 0.02 sys >> >> Please try to recompile the program (Remember to "make clean") >> WITH the macro "MY_MALLOC" defined (in Makefile) to use my own >> simple implementation of malloc(3) (i.e. my_malloc() in cal.c). >> And time the running again: >> >> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 50.41 real 49.95 user 0.04 sys >> >> You may repeat this testing again and again. >> >> I guess this kind of performance difference comes from: >> >> 1. His program uses malloc(3) to obtain so many small memory blocks. >> >> 2. In this case, FreeBSD malloc(3) obtains small memory blocks from >> kernel and pass them to application. >> >> But malloc(3) of GNU libc obtains large memory blocks from kernel >> and splits & reallocates them in small blocks to application. >> >> You may verify my judgement with truss(1). >> >> 3. The way of FreeBSD malloc(3) makes VM page mapping too chaotic, which >> reduces the efficiency of CPU L2 Cache. In contrast, my my_malloc() >> simulates the behavior of GNU libc malloc(3) partially and avoids >> the over-chaos. >> >> Callgrind is broken under FreeBSD, or I will verify my guess with it. >> >> I have also verified the program on Intel Pentium 4 511 (2.8GHz, 1MB >> L2 cache, running FreeBSD 6.1 i386 though this CPU supports EM64T) >> >>> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 185.30 real 184.28 user 0.02 sys >> >>> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 36.31 real 35.94 user 0.03 sys >> >> NOTE: you probably cannot see the performance difference on CPU with >> small L2 cache such as Intel Celeron 1.7GHz with 128 KB L2 Cache. > > In CURRENT we've replaced phkmalloc with jemalloc. It would be useful > to see how this benchmark performs with that. I believe it does similar > things. > > -- Brooke > On -CURENT amd64 (Athlon64 3000+, 512k L2 cache): With jemalloc (without MY_MALLOS): ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 116.34 real 113.69 user 0.00 sys With MY_MALLOC: ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 ... 45.30 real 44.29 user 0.00 sys Regards, Vladimir From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 02:34:45 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 C101016A4DD for ; Tue, 15 Aug 2006 02:34:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id E42C743D6D for ; Tue, 15 Aug 2006 02:34:34 +0000 (GMT) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id 6B88EEB0A66; Tue, 15 Aug 2006 10:34:30 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id A2yEJD6L779E; Tue, 15 Aug 2006 10:34:28 +0800 (CST) Received: from [10.217.12.217] (sina152-194.staff.sina.com.cn [61.135.152.194]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 65496EB2DED; Tue, 15 Aug 2006 10:34:28 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=subject:from:to:cc:in-reply-to:references:content-type: organization:date:message-id:mime-version:x-mailer; b=v23eWMy06AnRODkoy8C737kC+pWcBTWxDpZhBuRsbfwBHH3k/Gm+DLKatXoHO2eDk oM1VcYurvSOtfw7+4v0Tg== From: =?UTF-8?Q?=E6=9D=8E=E9=91=AB?= "(LI Xin)" To: Vladimir Kushnir In-Reply-To: <20060815023505.N1988@kushnir1.kiev.ua> References: <20060814231504.GB69362@lor.one-eyed-alien.net> <20060815023505.N1988@kushnir1.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-h4pQSxCz2RlHzvJUoXpR" Organization: The FreeBSD Project Date: Tue, 15 Aug 2006 10:34:16 +0800 Message-Id: <1155609256.930.12.camel@spirit> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 FreeBSD GNOME Team Port Cc: freebsd-hackers@freebsd.org, Intron Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 02:34:45 -0000 --=-h4pQSxCz2RlHzvJUoXpR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A8 2006-08-15=E4=BA=8C=E7=9A=84 02:38 +0300=EF=BC=8CVladimir Kushnir= =E5=86=99=E9=81=93=EF=BC=9A > On -CURENT amd64 (Athlon64 3000+, 512k L2 cache): >=20 > With jemalloc (without MY_MALLOS): > ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 116.34 real 113.69 user 0.00 sys >=20 > With MY_MALLOC: > ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 45.30 real 44.29 user 0.00 sys Have you turned off the debugging options, i.e. ln -sf 'aj' /etc/malloc.conf? Cheers, --=20 Xin LI http://www.delphij.net/ --=-h4pQSxCz2RlHzvJUoXpR Content-Type: application/pgp-signature; name=signature.asc Content-Description: =?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?= =?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8=E5=88=86?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBE4TKohcUczkLqiksRAs/tAKCZkajQrAiQxhvrUbmwyPzdwmf42wCeIRVj tOh5x4sK1dcJlPDohMGqQU8= =g7AL -----END PGP SIGNATURE----- --=-h4pQSxCz2RlHzvJUoXpR-- From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 04:16:32 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 716FF16A4E0 for ; Tue, 15 Aug 2006 04:16:32 +0000 (UTC) (envelope-from j_guojun@lbl.gov) Received: from smtp110.sbc.mail.mud.yahoo.com (smtp110.sbc.mail.mud.yahoo.com [68.142.198.209]) by mx1.FreeBSD.org (Postfix) with SMTP id 96B9343D5F for ; Tue, 15 Aug 2006 04:16:26 +0000 (GMT) (envelope-from j_guojun@lbl.gov) Received: (qmail 12870 invoked from network); 15 Aug 2006 04:16:25 -0000 Received: from unknown (HELO ?192.168.2.8?) (jinmtb@sbcglobal.net@68.127.183.0 with plain) by smtp110.sbc.mail.mud.yahoo.com with SMTP; 15 Aug 2006 04:16:25 -0000 Message-ID: <44E14AFD.3040900@lbl.gov> Date: Mon, 14 Aug 2006 21:18:05 -0700 From: "Jin Guojun [VFFS]" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050108 X-Accept-Language: en, zh, zh-CN MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 15 Aug 2006 05:05:55 +0000 Subject: diff should not follow sym-link X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 04:16:32 -0000 I do not know what is the historical reason for program "diff" to follow a symbolic link during the recursive diff (-r), but it seems not to be a proper implementation. If both compared directories contains a sym-link, which point to a same file or directory, it obviously no need to compare it (not them). If both compared directories contains a sym-link, which point to a duplicated file or directory, and files or directories are duplicated in the same tree level, these files or directories will be compared any way during the recursive diff. So there is no need to follow the sym-link to compare them (just waste time by doing so). The only case that I can see that diff may follow the sym-link in recursive comparison is if the symlink is pointing to a duplicated directory/file in very different locations, which may probably rarely be created. If this is probably the only case "diff -r" needs to follow the sym-link, an option -L or something similar in other commands, such as ls, should be add for such purpose. Otherwise, diff -r can be loop forever on large file systems if there is some symlinks point forth and back between some directories, users may create them for easy to traversal around file systems. Then the process of "diff -r" a backup file system and a live file system will take a day to finish till maximum symlink number is reached, and many redundant diff information is created. See simple example below. So, we need to either disable recursive diff to follow the symlink, or we need a switch (option) to enable following symlink feature in recursive comparison of diff when a user real needs it. Any comment? -Jin ------------- example of looping on recursive diff ------------------------ % create a simple test structure % dir -R test # show tree structure, in real case a and b will be a large tree total 8 drwxr-xr-x 3 jin wheel 512 Aug 14 20:25 a/ drwxr-xr-x 2 jin wheel 512 Aug 14 20:32 b/ -rw-r--r-- 1 jin wheel 4 Aug 14 20:23 x -rw-r--r-- 1 jin wheel 4 Aug 14 20:25 y test/a: total 2 drwxr-xr-x 2 jin wheel 512 Aug 14 20:25 a1/ lrwxr-xr-x 1 jin wheel 4 Aug 14 20:25 x@ -> ../x test/a/a1: total 0 lrwxr-xr-x 1 jin wheel 10 Aug 14 20:24 a1@ -> ../../b/a1 test/b: total 0 lrwxr-xr-x 1 jin wheel 4 Aug 14 20:32 a1@ -> ../a lrwxr-xr-x 1 jin wheel 4 Aug 14 20:25 x@ -> ../y % mkdir test1 % cd test % tar -cf - . | ( cd ../test1 ; tar -xf - ) % cd .. ; diff -r test test1 diff: test/a/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1: Too many levels of symbolic links diff: test1/a/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1: Too many levels of symbolic links diff: test/a/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/x: Too many levels of symbolic links diff: test1/a/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/x: Too many levels of symbolic links diff: test/b/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1: Too many levels of symbolic links diff: test1/b/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1/a1: Too many levels of symbolic links From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 07:43:17 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 BC1F016A4DD for ; Tue, 15 Aug 2006 07:43:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id C482943D45 for ; Tue, 15 Aug 2006 07:43:16 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k7F7h9Nh001494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Aug 2006 10:43:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6) with ESMTP id k7F7h9tO041687; Tue, 15 Aug 2006 10:43:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6/Submit) id k7F7h8q7041686; Tue, 15 Aug 2006 10:43:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Aug 2006 10:43:08 +0300 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20060815074308.GN25753@deviant.kiev.zoral.com.ua> References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> <20060814181521.GQ99774@funkthat.com> <20060814231223.3c7f1930@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3rMDlCEgcaHQQFB+" Content-Disposition: inline In-Reply-To: <20060814231223.3c7f1930@localhost> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.9 required=5.0 tests=DNS_FROM_RFC_ABUSE, SPF_NEUTRAL,UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua Cc: freebsd-hackers@freebsd.org, John-Mark Gurney Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 07:43:17 -0000 --3rMDlCEgcaHQQFB+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 14, 2006 at 11:12:23PM +0600, Stanislav Sedov wrote: > On Mon, 14 Aug 2006 11:15:22 -0700 > John-Mark Gurney mentioned: > >=20 > > You should make a MD API for reading these out (if one doesn't already > > exist) that handle the faulting for you, and then have your driver hook > > into this api... > >=20 > > I had to do something similar for accessing PCI config registers > > that don't exist and cause a fault... > > > =20 > Do you know some examples to look at? The problem is that i can't make > modifications in trap.c or anywhere else in src tree as such driver > isn't likely to become a part of FreeBSD kernel. Hmm, I think that jhb@ somewhat misguided your. For kernel-mode faults on i386, GPF and Segment not Present faults both results in calling of pcb_onfault handler. This is true for both STABLE and CURRENT. And this is true for amd64 as well. Look at the code at the //trap.c, for arch in i386, amd64. --3rMDlCEgcaHQQFB+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE4XsLC3+MBN1Mb4gRAmWOAJ0fpyVyGPaOVIfh+Pa0BC0JoaieXwCgiOB1 5EOq4yCIeWhmYoydu5LgqeQ= =T3aO -----END PGP SIGNATURE----- --3rMDlCEgcaHQQFB+-- From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 08:04:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 EC86516A4DD for ; Tue, 15 Aug 2006 08:04:08 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D62243D46 for ; Tue, 15 Aug 2006 08:04:07 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Tue, 15 Aug 2006 16:04:00 +0800 id 00102C04.44E17FF0.00006B85 References: <20060814231504.GB69362@lor.one-eyed-alien.net> In-Reply-To: <20060814231504.GB69362@lor.one-eyed-alien.net> From: "Intron" To: Brooks Davis Date: Tue, 15 Aug 2006 16:04:00 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 08:04:09 -0000 Brooks Davis wrote: > On Tue, Aug 15, 2006 at 07:10:47AM +0800, Intron wrote: >> One day, a friend told me that his program was 3 times slower under >> FreeBSD 6.1 than under GNU/Linux (from Redhat 7.2 to Fedora Core 5). >> I was astonished by the real repeatable performance difference on >> AMD Athlon XP 2500+ (1.8GHz, 512KB L2 Cache). >> >> After hacking, I found that the problem is nested in malloc(3) of >> FreeBSD libc. >> >> Download the testing program: http://ftp.intron.ac/tmp/fdtd.tar.bz2 >> >> You may try to compile the program WITHOUT the macro "MY_MALLOC" >> defined (in Makefile) to use malloc(3) provided by FreeBSD 6.1. >> Then, time the running of the binary (on Athlon XP 2500+): >> >> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 165.24 real 164.19 user 0.02 sys >> >> Please try to recompile the program (Remember to "make clean") >> WITH the macro "MY_MALLOC" defined (in Makefile) to use my own >> simple implementation of malloc(3) (i.e. my_malloc() in cal.c). >> And time the running again: >> >> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 50.41 real 49.95 user 0.04 sys >> >> You may repeat this testing again and again. >> >> I guess this kind of performance difference comes from: >> >> 1. His program uses malloc(3) to obtain so many small memory blocks. >> >> 2. In this case, FreeBSD malloc(3) obtains small memory blocks from >> kernel and pass them to application. >> >> But malloc(3) of GNU libc obtains large memory blocks from kernel >> and splits & reallocates them in small blocks to application. >> >> You may verify my judgement with truss(1). >> >> 3. The way of FreeBSD malloc(3) makes VM page mapping too chaotic, which >> reduces the efficiency of CPU L2 Cache. In contrast, my my_malloc() >> simulates the behavior of GNU libc malloc(3) partially and avoids >> the over-chaos. >> >> Callgrind is broken under FreeBSD, or I will verify my guess with it. >> >> I have also verified the program on Intel Pentium 4 511 (2.8GHz, 1MB >> L2 cache, running FreeBSD 6.1 i386 though this CPU supports EM64T) >> >> >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 185.30 real 184.28 user 0.02 sys >> >> >/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 36.31 real 35.94 user 0.03 sys >> >> NOTE: you probably cannot see the performance difference on CPU with >> small L2 cache such as Intel Celeron 1.7GHz with 128 KB L2 Cache. > > In CURRENT we've replaced phkmalloc with jemalloc. It would be useful > to see how this benchmark performs with that. I believe it does similar > things. > > -- Brooke You're right. Now with truss(1) I can see that malloc(3) on 7.0-CURRENT (4 days ago) calls brk(2) to obtain 2MB each time. I will continue my testing. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 08:21:20 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 E2BAB16A4DA for ; Tue, 15 Aug 2006 08:21:19 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8E9F43D46 for ; Tue, 15 Aug 2006 08:21:18 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Tue, 15 Aug 2006 16:21:17 +0800 id 00102C05.44E183FD.00006C81 References: <20060814231504.GB69362@lor.one-eyed-alien.net> <20060815023505.N1988@kushnir1.kiev.ua> In-Reply-To: <20060815023505.N1988@kushnir1.kiev.ua> From: "Intron" To: Vladimir Kushnir Date: Tue, 15 Aug 2006 16:21:17 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 08:21:20 -0000 Vladimir Kushnir wrote: > Sorry for intrusion. > > On Mon, 14 Aug 2006, Brooks Davis wrote: > >> On Tue, Aug 15, 2006 at 07:10:47AM +0800, Intron wrote: >>> One day, a friend told me that his program was 3 times slower under >>> FreeBSD 6.1 than under GNU/Linux (from Redhat 7.2 to Fedora Core 5). >>> I was astonished by the real repeatable performance difference on >>> AMD Athlon XP 2500+ (1.8GHz, 512KB L2 Cache). >>> >>> After hacking, I found that the problem is nested in malloc(3) of >>> FreeBSD libc. >>> >>> Download the testing program: http://ftp.intron.ac/tmp/fdtd.tar.bz2 >>> >>> You may try to compile the program WITHOUT the macro "MY_MALLOC" >>> defined (in Makefile) to use malloc(3) provided by FreeBSD 6.1. >>> Then, time the running of the binary (on Athlon XP 2500+): >>> >>> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 165.24 real 164.19 user 0.02 sys >>> >>> Please try to recompile the program (Remember to "make clean") >>> WITH the macro "MY_MALLOC" defined (in Makefile) to use my own >>> simple implementation of malloc(3) (i.e. my_malloc() in cal.c). >>> And time the running again: >>> >>> #/usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 50.41 real 49.95 user 0.04 sys >>> >>> You may repeat this testing again and again. >>> >>> I guess this kind of performance difference comes from: >>> >>> 1. His program uses malloc(3) to obtain so many small memory blocks. >>> >>> 2. In this case, FreeBSD malloc(3) obtains small memory blocks from >>> kernel and pass them to application. >>> >>> But malloc(3) of GNU libc obtains large memory blocks from kernel >>> and splits & reallocates them in small blocks to application. >>> >>> You may verify my judgement with truss(1). >>> >>> 3. The way of FreeBSD malloc(3) makes VM page mapping too chaotic, which >>> reduces the efficiency of CPU L2 Cache. In contrast, my my_malloc() >>> simulates the behavior of GNU libc malloc(3) partially and avoids >>> the over-chaos. >>> >>> Callgrind is broken under FreeBSD, or I will verify my guess with it. >>> >>> I have also verified the program on Intel Pentium 4 511 (2.8GHz, 1MB >>> L2 cache, running FreeBSD 6.1 i386 though this CPU supports EM64T) >>> >>>> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 185.30 real 184.28 user 0.02 sys >>> >>>> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 36.31 real 35.94 user 0.03 sys >>> >>> NOTE: you probably cannot see the performance difference on CPU with >>> small L2 cache such as Intel Celeron 1.7GHz with 128 KB L2 Cache. >> >> In CURRENT we've replaced phkmalloc with jemalloc. It would be useful >> to see how this benchmark performs with that. I believe it does similar >> things. >> >> -- Brooke >> > On -CURENT amd64 (Athlon64 3000+, 512k L2 cache): > > With jemalloc (without MY_MALLOS): > ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 116.34 real 113.69 user 0.00 sys > > With MY_MALLOC: > ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 > ... > 45.30 real 44.29 user 0.00 sys > > Regards, > Vladimir > _______________________________________________ > 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" How long has it been since you CVSup-ed your source tree last time? These days the source tree is broken in building frequently, which makes 7.0-CURRENT binaries on some users' computers out of date. ------------------------------------------------------------------------ From Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 12:16:35 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 EAA3B16A61F for ; Tue, 15 Aug 2006 12:16:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BEE843D90 for ; Tue, 15 Aug 2006 12:16:06 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7FCFxWn026881; Tue, 15 Aug 2006 08:16:03 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 15 Aug 2006 08:00:43 -0400 User-Agent: KMail/1.9.1 References: <20060814124658.1d416cbe@localhost> <20060814231223.3c7f1930@localhost> <20060815074308.GN25753@deviant.kiev.zoral.com.ua> In-Reply-To: <20060815074308.GN25753@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608150800.44403.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Tue, 15 Aug 2006 08:16:05 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1662/Tue Aug 15 04:29:25 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Kostik Belousov , John-Mark Gurney , Stanislav Sedov Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 12:16:36 -0000 On Tuesday 15 August 2006 03:43, Kostik Belousov wrote: > On Mon, Aug 14, 2006 at 11:12:23PM +0600, Stanislav Sedov wrote: > > On Mon, 14 Aug 2006 11:15:22 -0700 > > John-Mark Gurney mentioned: > > > > > > You should make a MD API for reading these out (if one doesn't already > > > exist) that handle the faulting for you, and then have your driver hook > > > into this api... > > > > > > I had to do something similar for accessing PCI config registers > > > that don't exist and cause a fault... > > > > > > > Do you know some examples to look at? The problem is that i can't make > > modifications in trap.c or anywhere else in src tree as such driver > > isn't likely to become a part of FreeBSD kernel. > > Hmm, I think that jhb@ somewhat misguided your. For kernel-mode faults > on i386, GPF and Segment not Present faults both results in calling > of pcb_onfault handler. This is true for both STABLE and CURRENT. > > And this is true for amd64 as well. > > Look at the code at the //trap.c, for arch in i386, amd64. Hmm, well that's handy then. Learn something new everyday. :) You can see how to use pcb_onfault in some of the routines in i386/i386/support.s. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 17:06:50 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 DD7B516A4E0 for ; Tue, 15 Aug 2006 17:06:50 +0000 (UTC) (envelope-from m.ehinger@ltur.de) Received: from postx.gateway-inter.net (postx.gateway-inter.net [213.144.19.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9340143D7F for ; Tue, 15 Aug 2006 17:06:50 +0000 (GMT) (envelope-from m.ehinger@ltur.de) To: freebsd-hackers@freebsd.org From: m.ehinger@ltur.de MIME-Version: 1.0 Message-ID: Date: Tue, 15 Aug 2006 19:07:03 +0200 Content-type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Tue, 15 Aug 2006 17:50:34 +0000 Subject: nanosecond delay in kernel module X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 17:06:51 -0000 Hi, what is the official way to delay in a kernel module for about 10 nanoseconds (1/1,000,000,000th second). I found DELAY(9), but it uses microseconds (1/1,000,000th second). Any help would be appeciated Maik From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 18:58:34 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7716716A4DF for ; Tue, 15 Aug 2006 18:58:34 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from lh.synack.net (lh.synack.net [204.152.188.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id B72BE43D8A for ; Tue, 15 Aug 2006 18:58:20 +0000 (GMT) (envelope-from jasone@FreeBSD.org) Received: by lh.synack.net (Postfix, from userid 100) id 675175E4AC6; Tue, 15 Aug 2006 11:58:20 -0700 (PDT) Received: from [127.0.0.1] (unknown [129.101.159.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lh.synack.net (Postfix) with ESMTP id C8A8B5E4837; Tue, 15 Aug 2006 11:58:18 -0700 (PDT) Message-ID: <44E2194B.5050400@FreeBSD.org> Date: Tue, 15 Aug 2006 11:58:19 -0700 From: Jason Evans User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: =?UTF-8?B?IuadjumRqyBcIihMSSBYaW4pXCIi?= References: <20060814231504.GB69362@lor.one-eyed-alien.net> <20060815023505.N1988@kushnir1.kiev.ua> <1155609256.930.12.camel@spirit> In-Reply-To: <1155609256.930.12.camel@spirit> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.0.6 (2005-12-07) on lh.synack.net X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed version=3.0.6 Cc: freebsd-hackers@freebsd.org, Intron Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 18:58:34 -0000 李鑫 (LI Xin) wrote: > 圚 2006-08-15二的 02:38 +0300Vladimir Kushnir写道 >> On -CURENT amd64 (Athlon64 3000+, 512k L2 cache): >> >> With jemalloc (without MY_MALLOS): >> ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 116.34 real 113.69 user 0.00 sys >> >> With MY_MALLOC: >> ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >> ... >> 45.30 real 44.29 user 0.00 sys > > Have you turned off the debugging options, i.e. ln -sf > 'aj' /etc/malloc.conf? If you want to do a fair comparison, you will also define NO_MALLOC_EXTRAS when compiling malloc.c, in order to turn off the copious assertions, not to mention the statistics gathering code. Before you do that though, it would be useful to turn statistics reporting on (add MALLOC_OPTIONS=P to your environment when running the test program) and see what malloc says is going on. [I am away from my -current system at the moment, so can't benchmark the program.] If I understand the code correctly (and assuming the command line parameters specified), it starts out by requesting 3517 2000-byte allocations from malloc, and never frees any of those allocations. Both phkmalloc and jemalloc will fit two allocations in each page of memory. phkmalloc will call sbrk() at least 1759 times. jemalloc will call sbrk() approximately 6 times. 2kB allocations are a worst case for some of jemalloc's internal bookkeeping, but this shouldn't be a serious problem. Fragmentation for these 2000-byte allocations should total approximately 6%. malloc certainly incurs more overhead than a specialized sbrk()-based allocator, but I don't see any particular reason that jemalloc should perform suboptimally, as compared to any complete malloc implementation, for fdtd. If you find otherwise, please tell me so that I can look into the issue. Thanks, Jason From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 19:10:42 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 DF1FA16A4DD for ; Tue, 15 Aug 2006 19:10:42 +0000 (UTC) (envelope-from prvs=julian=3755039ab@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4577243DA1 for ; Tue, 15 Aug 2006 19:09:23 +0000 (GMT) (envelope-from prvs=julian=3755039ab@elischer.org) Received: from unknown (HELO [10.251.18.229]) ([10.251.18.229]) by a50.ironport.com with ESMTP; 15 Aug 2006 12:09:22 -0700 Message-ID: <44E21BE1.5070004@elischer.org> Date: Tue, 15 Aug 2006 12:09:21 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: m.ehinger@ltur.de References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: nanosecond delay in kernel module X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 19:10:43 -0000 m.ehinger@ltur.de wrote: >Hi, > >what is the official way to delay in a kernel module for about 10 nanoseconds (1/1,000,000,000th second). > >I found DELAY(9), but it uses microseconds (1/1,000,000th second). > > at this time there is none. maybe you can write one? You probably need to find some machine instructions with a known delay >Any help would be appeciated > >Maik > >_______________________________________________ >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 Tue Aug 15 20:23:47 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A52EE16A4DE for ; Tue, 15 Aug 2006 20:23:47 +0000 (UTC) (envelope-from rik@inse.ru) Received: from mail.inse.ru (inse.ru [144.206.128.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4214E43D45 for ; Tue, 15 Aug 2006 20:23:46 +0000 (GMT) (envelope-from rik@inse.ru) Received: from [127.0.0.1] (www.inse.ru [144.206.128.1]) by mail.inse.ru (Postfix) with ESMTP id 390F833C46; Wed, 16 Aug 2006 00:23:43 +0400 (MSD) Message-ID: <44E22F00.6090102@inse.ru> Date: Wed, 16 Aug 2006 00:30:56 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.7.12) Gecko/20060103 ASPLinux/1.7.12-1.5.1.1asp X-Accept-Language: ru-ru, ru MIME-Version: 1.0 To: Julian Elischer References: <44E21BE1.5070004@elischer.org> In-Reply-To: <44E21BE1.5070004@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, m.ehinger@ltur.de Subject: Re: nanosecond delay in kernel module X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 20:23:47 -0000 Hi, Julian Elischer: > m.ehinger@ltur.de wrote: > >> Hi, >> >> what is the official way to delay in a kernel module for about 10 >> nanoseconds (1/1,000,000,000th second). >> >> I found DELAY(9), but it uses microseconds (1/1,000,000th second). >> >> > > at this time there is none. maybe you can write one? > You probably need to find some machine instructions with a known delay Probably PCI read/write ... rik > >> Any help would be appeciated >> >> Maik >> >> _______________________________________________ >> 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 Tue Aug 15 23:59:33 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 07C4816A4DD for ; Tue, 15 Aug 2006 23:59:33 +0000 (UTC) (envelope-from dgilbert@daveg.ca) Received: from ox.eicat.ca (ox.eicat.ca [66.96.30.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id A592043D66 for ; Tue, 15 Aug 2006 23:59:32 +0000 (GMT) (envelope-from dgilbert@daveg.ca) Received: by ox.eicat.ca (Postfix, from userid 66) id 3F85D1D9C7; Tue, 15 Aug 2006 19:59:16 -0400 (EDT) Received: by canoe.dclg.ca (Postfix, from userid 101) id EA66D4AC54; Tue, 15 Aug 2006 19:59:18 -0400 (EDT) From: David Gilbert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17634.24534.923726.9912@canoe.dclg.ca> Date: Tue, 15 Aug 2006 19:59:18 -0400 To: freebsd-hackers@freebsd.org X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid Subject: openospfd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 23:59:33 -0000 Is there anyone actively working on openospfd (the port)? There are systemic things like the fact they want to ignore lo0 destined routes (although I know how to patch that), but there are less obvious things that I havn't figured out. Like the fact that our version ignores if_tun and if_gre. This might be fixed in openbsd code, but it seems at least a little non-trivial to make the newer code work here. Dave. -- ============================================================================ |David Gilbert, Independent Contractor. | Two things can be | |Mail: dave@daveg.ca | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 03:25:52 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A22D616A4E5 for ; Wed, 16 Aug 2006 03:25:52 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E3F443D49 for ; Wed, 16 Aug 2006 03:25:51 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.24] (andersonbox4.centtech.com [192.168.42.24]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k7G3Ppiq052350 for ; Tue, 15 Aug 2006 22:25:51 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E29055.3080205@centtech.com> Date: Tue, 15 Aug 2006 22:26:13 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: FreeBSD Hackers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1664/Tue Aug 15 09:28:31 2006 on mh1.centtech.com X-Virus-Status: Clean Subject: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 03:25:52 -0000 Does the ifdef in the struct dirent (pasted in below) make any sense? Seems like regardless of whether the __BSD_VISIBLE is defined or not, the d_name length will always be 255 + 1. Eric struct dirent { __uint32_t d_fileno; /* file number of entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name */ #if __BSD_VISIBLE #define MAXNAMLEN 255 char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ #else char d_name[255 + 1]; /* name must be no longer than this */ #endif }; -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 05:49:43 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 E306816A4DE for ; Wed, 16 Aug 2006 05:49:43 +0000 (UTC) (envelope-from roth@droopy.unibe.ch) Received: from mailhub03.unibe.ch (mailhub.unibe.ch [130.92.9.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66E0D43D46 for ; Wed, 16 Aug 2006 05:49:39 +0000 (GMT) (envelope-from roth@droopy.unibe.ch) Received: from localhost (scanhub03.unibe.ch [130.92.5.63]) by mailhub03.unibe.ch (Postfix) with ESMTP id 6E0FE4B4F2; Wed, 16 Aug 2006 07:49:32 +0200 (CEST) X-Virus-checked: by University of Berne Received: from mailhub03.unibe.ch ([130.92.9.70]) by localhost (scanhub03.unibe.ch [130.92.5.63]) (amavisd-new, port 10024) with LMTP id MTqD7KpSmAY4; Wed, 16 Aug 2006 07:49:30 +0200 (CEST) Received: from asterix.unibe.ch (asterix.unibe.ch [130.92.64.4]) by mailhub03.unibe.ch (Postfix) with ESMTP id F254B4BB89; Wed, 16 Aug 2006 07:49:30 +0200 (CEST) Received: from droopy.unibe.ch (droopy [130.92.64.20]) by asterix.unibe.ch (8.12.10+Sun/8.12.10) with ESMTP id k7G5nUdd012786; Wed, 16 Aug 2006 07:49:30 +0200 (MEST) Received: (from roth@localhost) by droopy.unibe.ch (8.12.10+Sun/8.12.9/Submit) id k7G5nPvM011665; Wed, 16 Aug 2006 07:49:25 +0200 (MEST) Date: Wed, 16 Aug 2006 07:49:25 +0200 From: Tobias Roth To: Eric Anderson Message-ID: <20060816054925.GA11651@droopy.unibe.ch> References: <44E29055.3080205@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E29055.3080205@centtech.com> User-Agent: Mutt/1.4i X-message-flag: Warning! Using Outlook is insecure and promotes virus distribution. Please use a different email client. Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 05:49:44 -0000 On Tue, Aug 15, 2006 at 10:26:13PM -0500, Eric Anderson wrote: > Does the ifdef in the struct dirent (pasted in below) make any sense? > Seems like regardless of whether the __BSD_VISIBLE is defined or not, > the d_name length will always be 255 + 1. > > Eric > > > struct dirent { > __uint32_t d_fileno; /* file number of entry */ > __uint16_t d_reclen; /* length of this record */ > __uint8_t d_type; /* file type, see below */ > __uint8_t d_namlen; /* length of string in d_name */ > #if __BSD_VISIBLE > #define MAXNAMLEN 255 > char d_name[MAXNAMLEN + 1]; /* name must be no longer than > this */ > #else > char d_name[255 + 1]; /* name must be no longer than > this */ > #endif > }; The difference is whether MAXNAMLEN is defined or not, the value of d_name is irrelevant. How far not defining MAXNAMLEN (in the case __BSD_VISIBLE= false) makes sense, I cannot tell. cheers, t. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 10:05:41 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1C35C16A4DE; Wed, 16 Aug 2006 10:05:41 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5306B43D5F; Wed, 16 Aug 2006 10:05:39 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Wed, 16 Aug 2006 18:05:29 +0800 id 00102E30.44E2EDE9.0000F819 References: <20060814231504.GB69362@lor.one-eyed-alien.net> <20060815023505.N1988@kushnir1.kiev.ua> <1155609256.930.12.camel@spirit> <44E2194B.5050400@FreeBSD.org> In-Reply-To: <44E2194B.5050400@FreeBSD.org> From: "Intron is my Internet alias" To: Jason Evans Date: Wed, 16 Aug 2006 18:05:29 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: The optimization of malloc(3): FreeBSD vs GNU libc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 10:05:41 -0000 Jason Evans wrote: > (LI Xin) wrote: >> 2006-08-15 02:38 +0300ladimir Kushnir>>> On -CURENT amd64 (Athlon64 3000+, 512k L2 cache): >>> >>> With jemalloc (without MY_MALLOS): >>> ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 116.34 real 113.69 user 0.00 sys >>> >>> With MY_MALLOC: >>> ~/fdtd> /usr/bin/time ./fdtd.FreeBSD 500 500 1000 >>> ... >>> 45.30 real 44.29 user 0.00 sys >> >> Have you turned off the debugging options, i.e. ln -sf >> 'aj' /etc/malloc.conf? > > If you want to do a fair comparison, you will also define NO_MALLOC_EXTRAS > when compiling malloc.c, in order to turn off the copious assertions, not > to mention the statistics gathering code. > > Before you do that though, it would be useful to turn statistics reporting > on (add MALLOC_OPTIONS=P to your environment when running the test > program) and see what malloc says is going on. > > [I am away from my -current system at the moment, so can't benchmark the > program.] If I understand the code correctly (and assuming the command > line parameters specified), it starts out by requesting 3517 2000-byte > allocations from malloc, and never frees any of those allocations. You're right. My friend's program evaluates an electromagnetic field by Finite-Difference Time-Domain method. > > Both phkmalloc and jemalloc will fit two allocations in each page of > memory. phkmalloc will call sbrk() at least 1759 times. jemalloc will > call sbrk() approximately 6 times. 2kB allocations are a worst case for > some of jemalloc's internal bookkeeping, but this shouldn't be a serious > problem. Fragmentation for these 2000-byte allocations should total > approximately 6%. The same bad case with mmap(2) if mmap(2) is used to obtain small memory block each time. A hierarchical memory management mechanism is required, just like those of GNU libc and your new code. The essence of this problem is that memory management of operating system can affect working efficiency of CPU hardware greatly. Actually, not only my friend's program can cause the problem, but also many applications using strdup(3) frequently. /usr/src/lib/libc/string/strdup.c: char * strdup(str) const char *str; { size_t len; char *copy; len = strlen(str) + 1; if ((copy = malloc(len)) == NULL) return (NULL); memcpy(copy, str, len); return (copy); } > > malloc certainly incurs more overhead than a specialized sbrk()-based > allocator, but I don't see any particular reason that jemalloc should > perform suboptimally, as compared to any complete malloc implementation, > for fdtd. If you find otherwise, please tell me so that I can look into > the issue. > > Thanks, > Jason > _______________________________________________ > 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 Beijing, China From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 12:39:01 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7EF4016A51B for ; Wed, 16 Aug 2006 12:39:01 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CF0D43E01 for ; Wed, 16 Aug 2006 12:35:36 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so278595pyc for ; Wed, 16 Aug 2006 05:35:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=V6TfLfUvIBc7FIioje3/KfoVBXGg8iMlup4g+pE2davbY0Pi4ahNUYTNt/M2yJFd9U4L2VkgbDeVjXxcTCxyfjVnIIJx8NMBdxQxyOKtQDCR1FGCzoz/HV/K+x93j9KOsQaK2wUpVHfPoq452M9NkvLT7qLQZyKX/7b2OnpS82I= Received: by 10.35.41.14 with SMTP id t14mr1309431pyj; Wed, 16 Aug 2006 05:35:35 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 12sm1738985nzn.2006.08.16.05.35.33; Wed, 16 Aug 2006 05:35:35 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7GCbW91047922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Aug 2006 21:37:32 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7GCbVBG047921; Wed, 16 Aug 2006 21:37:31 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 16 Aug 2006 21:37:31 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060816123731.GE45370@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> <44E05598.20004@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E05598.20004@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 12:39:01 -0000 On Mon, Aug 14, 2006 at 06:51:04PM +0800, Dinesh Nair wrote: > > > On 08/14/06 17:22 Dinesh Nair said the following: > > > >i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 > >onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE > >working on them, but the realtek NICs just don't seem to want to work. > >booting up led to a kernel trap with the following, > > based on a pointer from luigi rizzo, i disabled the check for the 8139C+ in > /usr/src/sys/pci/if_rl.c to force the rl driver to bind to the card, and > that seemed to do the trick in getting it to work. ifconfig still shows > that the media is set to 'none' and a missing status line, but the box is > pingable at the least. > If the media is set to 'none' you couldn't send anything from re(4) as recent changes checks whether the link is present(Receiver should work). Does old(working) version also show 'none' for media? Do you use manual media configuration instead of 'auto'? -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 16:31:03 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 2281B16A4DA for ; Wed, 16 Aug 2006 16:31:03 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C18943D4C for ; Wed, 16 Aug 2006 16:30:59 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k7GGUpQr076345; Wed, 16 Aug 2006 11:30:55 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E3484D.8090905@centtech.com> Date: Wed, 16 Aug 2006 11:31:09 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Tobias Roth References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> In-Reply-To: <20060816054925.GA11651@droopy.unibe.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1670/Wed Aug 16 08:49:00 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 16:31:03 -0000 On 08/16/06 00:49, Tobias Roth wrote: > On Tue, Aug 15, 2006 at 10:26:13PM -0500, Eric Anderson wrote: >> Does the ifdef in the struct dirent (pasted in below) make any sense? >> Seems like regardless of whether the __BSD_VISIBLE is defined or not, >> the d_name length will always be 255 + 1. >> >> Eric >> >> >> struct dirent { >> __uint32_t d_fileno; /* file number of entry */ >> __uint16_t d_reclen; /* length of this record */ >> __uint8_t d_type; /* file type, see below */ >> __uint8_t d_namlen; /* length of string in d_name */ >> #if __BSD_VISIBLE >> #define MAXNAMLEN 255 >> char d_name[MAXNAMLEN + 1]; /* name must be no longer than >> this */ >> #else >> char d_name[255 + 1]; /* name must be no longer than >> this */ >> #endif >> }; > > The difference is whether MAXNAMLEN is defined or not, the value of d_name > is irrelevant. How far not defining MAXNAMLEN (in the case __BSD_VISIBLE= > false) makes sense, I cannot tell. > > cheers, t. My point was, that either path you take (if BSD_VISIBLE is defined or not), you end up with d_name having a size of 255 + 1, so what's the point the having it at all? Isn't this the same thing (but easier to read): #if __BSD_VISIBLE #define MAXNAMLEN 255 #endif struct dirent { __uint32_t d_fileno; /* file number of entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name char d_name[255 + 1]; /* name must be no longer than this */ }; -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 18:45:11 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 9EB5816A4E6 for ; Wed, 16 Aug 2006 18:45:11 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp5.server.rpi.edu (smtp5.server.rpi.edu [128.113.2.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id D27EA43D49 for ; Wed, 16 Aug 2006 18:45:10 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp5.server.rpi.edu (8.13.1/8.13.1) with ESMTP id k7GIj6ak024162; Wed, 16 Aug 2006 14:45:07 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <44E3484D.8090905@centtech.com> References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> Date: Wed, 16 Aug 2006 14:45:05 -0400 To: Eric Anderson , Tobias Roth From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 18:45:11 -0000 At 11:31 AM -0500 8/16/06, Eric Anderson wrote: > >My point was, that either path you take (if BSD_VISIBLE is >defined or not), you end up with d_name having a size of >255 + 1, so what's the point the having it at all? To make it clear that d_name is tied to the exact value of MAXNAMLEN (just in case that value ever changes), and it does not just happen to be 255+1 bytes for some reason that is completely unrelated to MAXNAMLEN. So if some programmer is working with the d_name variable, and *if* they actually look at this include file, then they'll immediately realize that any checks that they make should use MAXNAMLEN, and not hard-code in the 255 value. That's my 2-cents worth, at least... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 18:48:05 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 2A92416A4DD for ; Wed, 16 Aug 2006 18:48:05 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5581443D5C for ; Wed, 16 Aug 2006 18:48:01 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k7GIm0ib095899; Wed, 16 Aug 2006 13:48:00 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E36877.30707@centtech.com> Date: Wed, 16 Aug 2006 13:48:23 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Garance A Drosihn References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1671/Wed Aug 16 10:29:02 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers , Tobias Roth Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 18:48:05 -0000 On 08/16/06 13:45, Garance A Drosihn wrote: > At 11:31 AM -0500 8/16/06, Eric Anderson wrote: >> My point was, that either path you take (if BSD_VISIBLE is >> defined or not), you end up with d_name having a size of >> 255 + 1, so what's the point the having it at all? > > To make it clear that d_name is tied to the exact value > of MAXNAMLEN (just in case that value ever changes), and > it does not just happen to be 255+1 bytes for some reason > that is completely unrelated to MAXNAMLEN. > > So if some programmer is working with the d_name variable, > and *if* they actually look at this include file, then > they'll immediately realize that any checks that they make > should use MAXNAMLEN, and not hard-code in the 255 value. > > That's my 2-cents worth, at least... > Then shouldn't both be set to MAXNAMLEN? Of course, it isn't a big deal, I'm just curious what I'm missing in the reasoning for doing such a thing. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 18:51:11 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 948E116A4DA for ; Wed, 16 Aug 2006 18:51:11 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from antivirus.uni-rostock.de (mailrelay1.uni-rostock.de [139.30.8.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B6FA43D7B for ; Wed, 16 Aug 2006 18:50:53 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from antivirus.exch.rz.uni-rostock.de ([127.0.0.1]) by antivirus.uni-rostock.de with Microsoft SMTPSVC(6.0.3790.1830); Wed, 16 Aug 2006 20:50:52 +0200 Received: from antivirus.uni-rostock.de (unverified) by antivirus.exch.rz.uni-rostock.de (Content Technologies SMTPRS 4.3.20) with ESMTP id for ; Wed, 16 Aug 2006 20:50:52 +0200 Received: from mail pickup service by antivirus.uni-rostock.de with Microsoft SMTPSVC; Wed, 16 Aug 2006 20:50:52 +0200 X-SCL: 2 53.38% Received: from mail.uni-rostock.de ([139.30.8.11]) by antivirus.uni-rostock.de with Microsoft SMTPSVC (6.0.3790.1830); Wed, 16 Aug 2006 20:50:51 +0200 Received: from conversion-daemon.mail2.uni-rostock.de by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) id <0J4300401TM4QM@mail.uni-rostock.de> (original mail from joerg@britannica.bec.de) for freebsd-hackers@freebsd.org; Wed, 16 Aug 2006 20:50:51 +0200 (MEST) Received: from britannica.bec.de (storm.stura.uni-rostock.de [139.30.252.72]) by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) with ESMTP id <0J4300F38TORB3@mail.uni-rostock.de> for freebsd-hackers@freebsd.org; Wed, 16 Aug 2006 20:50:51 +0200 (MEST) Received: by britannica.bec.de (Postfix, from userid 1000) id 2AAF06068; Wed, 16 Aug 2006 20:50:23 +0200 (CEST) Date: Wed, 16 Aug 2006 20:50:23 +0200 From: Joerg Sonnenberger In-reply-to: To: freebsd-hackers@freebsd.org Mail-followup-to: freebsd-hackers@freebsd.org Message-id: <20060816185023.GA23879@britannica.bec.de> MIME-version: 1.0 Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> X-OriginalArrivalTime: 16 Aug 2006 18:50:51.0346 (UTC) FILETIME=[E53C4320:01C6C164] Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 18:51:11 -0000 On Wed, Aug 16, 2006 at 02:45:05PM -0400, Garance A Drosihn wrote: > At 11:31 AM -0500 8/16/06, Eric Anderson wrote: > > > >My point was, that either path you take (if BSD_VISIBLE is > >defined or not), you end up with d_name having a size of > >255 + 1, so what's the point the having it at all? > > To make it clear that d_name is tied to the exact value > of MAXNAMLEN (just in case that value ever changes), and > it does not just happen to be 255+1 bytes for some reason > that is completely unrelated to MAXNAMLEN. It should be noted that the standard doesn't say anything about MAXNAMLEN (which is historically a FS specific limit). It also allows two different defitions of d_name: (1) As char[] of arbitrary length. (2) As char[1]. So portable code should always allocate storage for size(struct dirent) + NAME_MAX of the current FS. In that sense the current definition is misleading. Joerg From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 20:35:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 9016516A4DE; Wed, 16 Aug 2006 20:35:10 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57A0E43D5D; Wed, 16 Aug 2006 20:34:58 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GDS6H-0003Ly-Kp; Thu, 17 Aug 2006 00:34:56 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 9772311F48; Thu, 17 Aug 2006 00:34:26 +0600 (YEKST) Date: Thu, 17 Aug 2006 00:34:19 +0600 From: Stanislav Sedov To: John Baldwin Message-ID: <20060817003419.2c8a829f@localhost> In-Reply-To: <200608150800.44403.jhb@freebsd.org> References: <20060814124658.1d416cbe@localhost> <20060814231223.3c7f1930@localhost> <20060815074308.GN25753@deviant.kiev.zoral.com.ua> <200608150800.44403.jhb@freebsd.org> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_3Ofd.76PgSqkToEPs0JLrE3; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Cc: Kostik Belousov , freebsd-hackers@freebsd.org, John-Mark Gurney , Divacky Roman Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 20:35:10 -0000 --Sig_3Ofd.76PgSqkToEPs0JLrE3 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Ok, I've finally done it. The module itself is located at http://mbsd.msk.ru/dist/msr-0.1.tar.bz2 port - http://mbsd.msk.ru/dist/devmsr.tar.bz2 Port PR - ports/102158 Now we can use x86info to get all available information about cpu. I could not test amd64 and smp version, so any information (success/failure) will be very apprecated. Thank to all for help. --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_3Ofd.76PgSqkToEPs0JLrE3 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE42UyK/VZk+smlYERAsjOAJwKrPdN98+wLuZBgId9Bd7Or9llrwCeIXn5 fTXsErqjeYPAsgI0R+SOvmY= =Ji9W -----END PGP SIGNATURE----- --Sig_3Ofd.76PgSqkToEPs0JLrE3-- From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 21:36:39 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7637E16A4DA for ; Wed, 16 Aug 2006 21:36:39 +0000 (UTC) (envelope-from yb@bashibuzuk.net) Received: from a.6f2.net (a.6f2.net [213.189.5.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1852643D46 for ; Wed, 16 Aug 2006 21:36:38 +0000 (GMT) (envelope-from yb@bashibuzuk.net) Received: by a.6f2.net (Postfix, from userid 66) id A78FFBF8D2A; Wed, 16 Aug 2006 23:36:37 +0200 (CEST) Received: by cc.bashibuzuk.net (Postfix, from userid 1001) id 0BB16BD79; Wed, 16 Aug 2006 23:37:37 +0200 (CEST) Date: Wed, 16 Aug 2006 23:37:36 +0200 From: Yann Berthier To: David Gilbert Message-ID: <20060816213736.GB1641@bashibuzuk.net> References: <17634.24534.923726.9912@canoe.dclg.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17634.24534.923726.9912@canoe.dclg.ca> X-Operating-System: FreeBSD 7.0-CURRENT User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org Subject: Re: openospfd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 21:36:39 -0000 Hello, On Tue, 15 Aug 2006, at 19:59, David Gilbert wrote: > Is there anyone actively working on openospfd (the port)? > > There are systemic things like the fact they want to ignore lo0 > destined routes (although I know how to patch that), but there are > less obvious things that I havn't figured out. > > Like the fact that our version ignores if_tun and if_gre. This might > be fixed in openbsd code, but it seems at least a little non-trivial > to make the newer code work here. I asked (privately) the same question some weeks ago - as newer openospf snapshots make use of route labels, i was told that input was needed from some committers heavily involved in the network stack. The question is still open: pf, openbgp and now openospf use route labels, is it a feature worth being ported to FreeBSD ? (no, not by me). I even remember an olllld post by glebius@ where he talked about using route labels to store AS info for ng_netflow I ended up taking a snapshot of openospf at that time and removing all route labels reference to compile it. It was running fine, except that we decided to go for static routes due to routes through an interface deleted as it should upon a link down event, but not reinstalled upon a following link up, with the routing table still insisting on using another interface when the directly connected one was now available. Certainly ? it was my hack's fault being too intrusive, but we where not comfortable with this situation ... Not too much of a problem for the number of routes considered in this part of the infrastructure but still ... regards, - yann From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 22:36:38 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 DBFCF16A4DA for ; Wed, 16 Aug 2006 22:36:37 +0000 (UTC) (envelope-from anthony.maher@uts.edu.au) Received: from gaz.itd.uts.edu.au (gaz.itd.uts.edu.au [138.25.22.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DBEC43D6E for ; Wed, 16 Aug 2006 22:36:32 +0000 (GMT) (envelope-from anthony.maher@uts.edu.au) Received: by gaz.itd.uts.edu.au (Postfix, from userid 1011) id 5458590DDA; Thu, 17 Aug 2006 08:32:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by gaz.itd.uts.edu.au (Postfix/Intermediary) with ESMTP id 4412890DDC; Thu, 17 Aug 2006 08:32:47 +1000 (EST) Received: from vimes (vimes.itd.uts.edu.au [138.25.243.34]) by gaz.itd.uts.edu.au (Postfix/Ingress) with ESMTP id 31CF290DDA; Thu, 17 Aug 2006 08:32:47 +1000 (EST) Received: from [138.25.81.47] by postoffice.uts.edu.au (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTPS id <0J4400HFA44UBS50@postoffice.uts.edu.au>; Thu, 17 Aug 2006 08:36:31 +1000 (EST) Date: Thu, 17 Aug 2006 08:36:28 +1000 From: Tony Maher In-reply-to: <44E3484D.8090905@centtech.com> To: Eric Anderson Message-id: <44E39DEC.1050204@uts.edu.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en X-Enigmail-Version: 0.93.0.0 References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20060511 Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 22:36:38 -0000 Eric Anderson wrote: > On 08/16/06 00:49, Tobias Roth wrote: > >> On Tue, Aug 15, 2006 at 10:26:13PM -0500, Eric Anderson wrote: >> >>> Does the ifdef in the struct dirent (pasted in below) make any sense? >>> Seems like regardless of whether the __BSD_VISIBLE is defined or not, >>> the d_name length will always be 255 + 1. >>> >>> Eric >>> >>> >>> struct dirent { >>> __uint32_t d_fileno; /* file number of entry */ >>> __uint16_t d_reclen; /* length of this record */ >>> __uint8_t d_type; /* file type, see below */ >>> __uint8_t d_namlen; /* length of string in d_name */ >>> #if __BSD_VISIBLE >>> #define MAXNAMLEN 255 >>> char d_name[MAXNAMLEN + 1]; /* name must be no longer >>> than this */ >>> #else >>> char d_name[255 + 1]; /* name must be no longer >>> than this */ >>> #endif >>> }; >> >> >> The difference is whether MAXNAMLEN is defined or not, the value of >> d_name >> is irrelevant. How far not defining MAXNAMLEN (in the case __BSD_VISIBLE= >> false) makes sense, I cannot tell. >> >> cheers, t. > > > > My point was, that either path you take (if BSD_VISIBLE is defined or > not), you end up with d_name having a size of 255 + 1, so what's the > point the having it at all? Isn't this the same thing (but easier to > read): > > #if __BSD_VISIBLE > #define MAXNAMLEN 255 > #endif > > struct dirent { > __uint32_t d_fileno; /* file number of entry */ > __uint16_t d_reclen; /* length of this record */ > __uint8_t d_type; /* file type, see below */ > __uint8_t d_namlen; /* length of string in d_name > char d_name[255 + 1]; /* name must be no longer than > this */ > }; Easier to read and the same provided value of MAXNAMLEN is not changed. If it is changed then you have to change 255 in two places otherwise definition MAXNAMLEN and actual array size will be wrong (where __BSD_VISIBLE defined). In the original code it forces them to be the same. Though the need to change "255" in two places happens in the original code. If you do not change both occurences of "255" you get different aray sizes depending on whether __BSD_VISIBLE is defined. But at least in the __BSD_VISBIBLE case you do keep definition and size correct. Is there no convention to have/allow "private" definitions? e.g. #define __MAXNAMLEN 255 #if __BSD_VISIBLE #define MAXNAMLEN __MAXNAMLEN #endif struct dirent { __uint32_t d_fileno; /* file number of entry */ __uint16_t d_reclen; /* length of this record * __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name char d_name[__MAXNAMLEN + 1]; /* name must be no longer than this */ }; just curious -- tonym From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 22:54:32 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 9786E16A4DA for ; Wed, 16 Aug 2006 22:54:32 +0000 (UTC) (envelope-from micahjon@ywave.com) Received: from relay2.av-mx.com (relay2.av-mx.com [137.118.16.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id C160543D6D for ; Wed, 16 Aug 2006 22:54:29 +0000 (GMT) (envelope-from micahjon@ywave.com) X-Virus-Scan-Time: 0 Received: from [137.118.16.60] (HELO mx2.av-mx.com) by relay2.av-mx.com (CommuniGate Pro SMTP 4.2.10) with SMTP id 360392693 for freebsd-hackers@freebsd.org; Wed, 16 Aug 2006 18:54:29 -0400 Received: (qmail 27384 invoked from network); 16 Aug 2006 22:54:27 -0000 Received: from dsl25232.ywave.com (HELO ?192.168.1.65?) (micahjon@ywave.com@216.227.113.232) by 0 with SMTP; 16 Aug 2006 22:54:27 -0000 X-CLIENT-IP: 216.227.113.232 X-CLIENT-HOST: dsl25232.ywave.com Message-ID: <44E3A221.1070905@ywave.com> Date: Wed, 16 Aug 2006 15:54:25 -0700 From: Micah User-Agent: Thunderbird 1.5.0.5 (X11/20060730) MIME-Version: 1.0 To: Tony Maher References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> <44E39DEC.1050204@uts.edu.au> In-Reply-To: <44E39DEC.1050204@uts.edu.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 22:54:32 -0000 Tony Maher wrote: > Eric Anderson wrote: >> On 08/16/06 00:49, Tobias Roth wrote: >> >>> On Tue, Aug 15, 2006 at 10:26:13PM -0500, Eric Anderson wrote: >>> >>>> Does the ifdef in the struct dirent (pasted in below) make any sense? >>>> Seems like regardless of whether the __BSD_VISIBLE is defined or not, >>>> the d_name length will always be 255 + 1. >>>> >>>> Eric >>>> >>>> >>>> struct dirent { >>>> __uint32_t d_fileno; /* file number of entry */ >>>> __uint16_t d_reclen; /* length of this record */ >>>> __uint8_t d_type; /* file type, see below */ >>>> __uint8_t d_namlen; /* length of string in d_name */ >>>> #if __BSD_VISIBLE >>>> #define MAXNAMLEN 255 >>>> char d_name[MAXNAMLEN + 1]; /* name must be no longer >>>> than this */ >>>> #else >>>> char d_name[255 + 1]; /* name must be no longer >>>> than this */ >>>> #endif >>>> }; >>> >>> The difference is whether MAXNAMLEN is defined or not, the value of >>> d_name >>> is irrelevant. How far not defining MAXNAMLEN (in the case __BSD_VISIBLE= >>> false) makes sense, I cannot tell. >>> >>> cheers, t. >> >> >> My point was, that either path you take (if BSD_VISIBLE is defined or >> not), you end up with d_name having a size of 255 + 1, so what's the >> point the having it at all? Isn't this the same thing (but easier to >> read): >> >> #if __BSD_VISIBLE >> #define MAXNAMLEN 255 >> #endif >> >> struct dirent { >> __uint32_t d_fileno; /* file number of entry */ >> __uint16_t d_reclen; /* length of this record */ >> __uint8_t d_type; /* file type, see below */ >> __uint8_t d_namlen; /* length of string in d_name >> char d_name[255 + 1]; /* name must be no longer than >> this */ >> }; > > Easier to read and the same provided value of MAXNAMLEN is not changed. > If it is changed then you have to change 255 in two places otherwise > definition MAXNAMLEN and actual array size will be wrong (where __BSD_VISIBLE > defined). In the original code it forces them to be the same. > > Though the need to change "255" in two places happens in the original code. > If you do not change both occurences of "255" you get different > aray sizes depending on whether __BSD_VISIBLE is defined. But at least in the > __BSD_VISBIBLE case you do keep definition and size correct. > > Is there no convention to have/allow "private" definitions? > e.g. > > #define __MAXNAMLEN 255 > #if __BSD_VISIBLE > #define MAXNAMLEN __MAXNAMLEN > #endif > > struct dirent { > __uint32_t d_fileno; /* file number of entry */ > __uint16_t d_reclen; /* length of this record * > __uint8_t d_type; /* file type, see below */ > __uint8_t d_namlen; /* length of string in d_name > char d_name[__MAXNAMLEN + 1]; /* name must be no longer than this */ > }; > > just curious > I think you could fake it as follows: struct dirent { __uint32_t d_fileno; /* file number of entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name */ #define MAXNAMLEN 255 char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ #if !__BSD_VISIBLE #undef MAXNAMLEN #endif }; I'm not sure if it's more readable, but it puts 255 in only one location. - Micah From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 23:44:45 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 4CDEB16A4DD; Wed, 16 Aug 2006 23:44:45 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5439A43D45; Wed, 16 Aug 2006 23:44:44 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Thu, 17 Aug 2006 07:44:42 +0800 id 00102DF2.44E3ADEA.00011EC5 References: <1153994127.11460@origin.intron.ac> <20060728093647.GA32168@stud.fit.vutbr.cz> <20060807232055.77a70f8a@Magellan.Leidinger.net> <57663789@serv3.int.kfs.ru> <20060810081651.GA91970@stud.fit.vutbr.cz> In-Reply-To: <20060810081651.GA91970@stud.fit.vutbr.cz> From: "Intron is my alias in the Internet" To: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Date: Thu, 17 Aug 2006 07:44:42 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: Subject: [Updated on 2006-8-17] My Linux AIO Implementation Calling for Test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 23:44:45 -0000 Download: http://ftp.intron.ac/tmp/linux_aio-20060817.tar.bz2 Let my patch set keep up with new Linuxolator. ------------------------------------------------------------------------ From Beijing, China Divacky Roman wrote: > On Wed, Aug 09, 2006 at 10:50:25PM +0800, Intron wrote: >> Boris Samorodov wrote: >> >> >On Wed, 09 Aug 2006 21:08:20 +0800 Intron wrote: >> > From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 02:26:24 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 CCB1E16A4E6 for ; Thu, 17 Aug 2006 02:26:24 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BE9143D58 for ; Thu, 17 Aug 2006 02:26:23 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so565193pyc for ; Wed, 16 Aug 2006 19:26:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=KViYQAkddzWhPYgE9wP0i0UdGfk8Ew06LvLUoXOaiQeOPsEOYoOifkOpf76y9EbEHUcOziLRvmn3ciXYz/y3eQhway0DT+mqwc1OvIwjLtwJMff7ofVp3Ow7zccz18R0AZlXvsZtkVRG/lUY1X6nUQD3OYpWNH9W9uhOn/UOmAc= Received: by 10.35.91.10 with SMTP id t10mr2593240pyl; Wed, 16 Aug 2006 19:26:22 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 15sm3656185nzp.2006.08.16.19.26.20; Wed, 16 Aug 2006 19:26:22 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7H2SGS3051253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Aug 2006 11:28:16 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7H2SFNj051252; Thu, 17 Aug 2006 11:28:15 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 17 Aug 2006 11:28:15 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060817022815.GD49739@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> <20060814103946.GC36904@cdnetworks.co.kr> <44E056BE.4080104@alphaque.com> <20060814110959.GD36904@cdnetworks.co.kr> <44E06697.4090507@alphaque.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9Ek0hoCL9XbhcSqy" Content-Disposition: inline In-Reply-To: <44E06697.4090507@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 02:26:25 -0000 --9Ek0hoCL9XbhcSqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 14, 2006 at 08:03:35PM +0800, Dinesh Nair wrote: > > > On 08/14/06 19:09 Pyun YongHyeon said the following: > >really sucks and need much more CPU power to saturate the link. > >So I don't think it's good idea to make rl(4) serve 8139C+. > > perhaps, but re(4) doesn't work at the moment on this chipset, and i'd > rather have something which works, albeit a little poorly, than something > which doesn't. > > >Yes. What `ident /boot/kernel/if_re.ko` shows? > > $FreeBSD: src/sys/dev/re/if_re.c,v 1.46.2.19 2006/08/07 02:38:07 yongari > Exp $ > > and the latest if_rlreg.c which i pulled down shows, > > $FreeBSD: src/sys/pci/if_rlreg.h,v 1.51.2.7 2006/08/01 17:36:50 wpaul Exp $ > > i'm not using the loadable modules though, and am building the re(4) device > into the kernel directly. > > the symptoms remain the same, i.e. IP traffic doesn't flow at all, though > 'arp -an' does show the ethernet address of the other box attempting to > ping this. > > the OP at > http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html > mentioned that it was working fine before breakage was introduced > relatively recently (~ 2 weeks ago), and thus something's changed in the > interim which is causing this to happen. > Here is guess work(I don't have 8139C+ based NICs). Would you give it a try? -- Regards, Pyun YongHyeon --9Ek0hoCL9XbhcSqy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="re.patch" --- if_re.c.orig Thu Aug 3 09:15:19 2006 +++ if_re.c Thu Aug 17 11:25:31 2006 @@ -541,6 +541,10 @@ return (0); } rval = CSR_READ_2(sc, re8139_reg); + if (sc->rl_type == RL_8139CPLUS && re8139_reg == RL_BMCR) { + /* 8139C+ uses different bit layout */ + rval &= ~(BMCR_LOOP | BMCR_ISO); + } return (rval); } @@ -567,6 +571,10 @@ switch (reg) { case MII_BMCR: re8139_reg = RL_BMCR; + if (sc->rl_type == RL_8139CPLUS) { + /* 8139C+ uses different bit layout */ + data &= ~(BMCR_LOOP | BMCR_ISO); + } break; case MII_BMSR: re8139_reg = RL_BMSR; --9Ek0hoCL9XbhcSqy-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 05:15:26 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 246AA16A509 for ; Thu, 17 Aug 2006 05:15:26 +0000 (UTC) (envelope-from dgilbert@daveg.ca) Received: from ox.eicat.ca (ox.eicat.ca [66.96.30.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FF8843D69 for ; Thu, 17 Aug 2006 05:15:24 +0000 (GMT) (envelope-from dgilbert@daveg.ca) Received: by ox.eicat.ca (Postfix, from userid 66) id 640D41FFD0; Thu, 17 Aug 2006 01:15:21 -0400 (EDT) Received: by canoe.dclg.ca (Postfix, from userid 101) id 077384AC2B; Thu, 17 Aug 2006 01:15:25 -0400 (EDT) From: David Gilbert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17635.64364.933948.598366@canoe.dclg.ca> Date: Thu, 17 Aug 2006 01:15:24 -0400 To: Yann Berthier In-Reply-To: <20060816213736.GB1641@bashibuzuk.net> References: <17634.24534.923726.9912@canoe.dclg.ca> <20060816213736.GB1641@bashibuzuk.net> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid Cc: freebsd-hackers@freebsd.org, David Gilbert Subject: Re: openospfd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 05:15:26 -0000 >>>>> "Yann" == Yann Berthier writes: Yann> On Tue, 15 Aug 2006, at 19:59, David Gilbert wrote: >> Is there anyone actively working on openospfd (the port)? Yann> I ended up taking a snapshot of openospf at that time and Yann> removing all route labels reference to compile it. It was Yann> running fine, except that we decided to go for static routes due Yann> to routes through an interface deleted as it should upon a link Yann> down event, but not reinstalled upon a following link up, with Yann> the routing table still insisting on using another interface Yann> when the directly connected one was now available. Certainly ? Yann> it was my hack's fault being too intrusive, but we where not Yann> comfortable with this situation ... Yann> Not too much of a problem for the number of routes considered Yann> in this part of the infrastructure but still ... Could I possibly have a copy of what you used? It may turn out to be useful to me. Dave. -- ============================================================================ |David Gilbert, Independent Contractor. | Two things can be | |Mail: dave@daveg.ca | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 06:06:29 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B95DF16A4DA for ; Thu, 17 Aug 2006 06:06:29 +0000 (UTC) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 7D3DD43D49 for ; Thu, 17 Aug 2006 06:06:26 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 48145 invoked by uid 0); 17 Aug 2006 06:06:16 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 17 Aug 2006 06:06:16 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.6/8.13.4) with ESMTP id k7H65nMx015640; Thu, 17 Aug 2006 14:05:49 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <44E4073C.9010008@alphaque.com> Date: Thu, 17 Aug 2006 14:05:48 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20060213 MIME-Version: 1.0 To: pyunyh@gmail.com References: <44E040CF.9080205@alphaque.com> <44E05598.20004@alphaque.com> <20060816123731.GE45370@cdnetworks.co.kr> In-Reply-To: <20060816123731.GE45370@cdnetworks.co.kr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 06:06:29 -0000 On 08/16/06 20:37 Pyun YongHyeon said the following: > If the media is set to 'none' you couldn't send anything from re(4) as > recent changes checks whether the link is present(Receiver should work). ifconfig re0 media 10baset or 100baset always returns error, so there doesn't seem to be anyway of forcing the media type. > Does old(working) version also show 'none' for media? > Do you use manual media configuration instead of 'auto'? i never got re(4) working, and the patch i'm currently using forces the use of rl(4) instead of using re(4). using rl(4) still shows media as none, but it works the way it should with packets going in and out. i've yet to try dag-erling's suggestion of disabling rx and tx checksums. i'll also try with the patch you sent it to see if that works. -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.openmalaysiablog.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 06:46:00 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 0795A16A4DD for ; Thu, 17 Aug 2006 06:46:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEE2B43D45 for ; Thu, 17 Aug 2006 06:45:58 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so665685pyc for ; Wed, 16 Aug 2006 23:45:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=nyiAYe9p0L6LNU+8ybQoa+bCxk65vH1StmQEaWGM6WVRvU0M1NhW2UiBWEqdV6fFxpIfY+9aSM0YMmapfisJJ8RSnznF6f8swzvAa3OH06azFbnn+IMLJTNoHyTPzYV9L88gD4hRzFFI2n5XTIo5HFQylbeVI3Ew5UWSMhnb+Wo= Received: by 10.35.121.2 with SMTP id y2mr3049134pym; Wed, 16 Aug 2006 23:45:58 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 38sm362076nza.2006.08.16.23.45.56; Wed, 16 Aug 2006 23:45:57 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7H6m3UL052173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Aug 2006 15:48:03 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7H6m3a7052172; Thu, 17 Aug 2006 15:48:03 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 17 Aug 2006 15:48:03 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060817064803.GH49739@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> <44E05598.20004@alphaque.com> <20060816123731.GE45370@cdnetworks.co.kr> <44E4073C.9010008@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E4073C.9010008@alphaque.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 06:46:00 -0000 On Thu, Aug 17, 2006 at 02:05:48PM +0800, Dinesh Nair wrote: > > > On 08/16/06 20:37 Pyun YongHyeon said the following: > >If the media is set to 'none' you couldn't send anything from re(4) as > >recent changes checks whether the link is present(Receiver should work). > > ifconfig re0 media 10baset or 100baset always returns error, so there > doesn't seem to be anyway of forcing the media type. > > >Does old(working) version also show 'none' for media? > >Do you use manual media configuration instead of 'auto'? > > i never got re(4) working, and the patch i'm currently using forces the use > of rl(4) instead of using re(4). using rl(4) still shows media as none, but > it works the way it should with packets going in and out. i've yet to try > dag-erling's suggestion of disabling rx and tx checksums. i'll also try I think disabling checksum offload wouldn't help either. re(4)/rlphy(4) should be taught to detect link status. > with the patch you sent it to see if that works. > -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 08:40:47 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 143A916A4DD for ; Thu, 17 Aug 2006 08:40:47 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id D413443D4C for ; Thu, 17 Aug 2006 08:40:45 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail02.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k7H8ebZ3022757 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 17 Aug 2006 18:40:43 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k7H8ebdZ001044; Thu, 17 Aug 2006 18:40:37 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k7H8eaKm001043; Thu, 17 Aug 2006 18:40:36 +1000 (EST) (envelope-from peter) Date: Thu, 17 Aug 2006 18:40:36 +1000 From: Peter Jeremy To: Micah Message-ID: <20060817084036.GC845@turion.vk2pj.dyndns.org> References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> <44E39DEC.1050204@uts.edu.au> <44E3A221.1070905@ywave.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6zdv2QT/q3FMhpsV" Content-Disposition: inline In-Reply-To: <44E3A221.1070905@ywave.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.12-2006-07-14 Cc: FreeBSD Hackers Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 08:40:47 -0000 --6zdv2QT/q3FMhpsV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, 2006-Aug-16 15:54:25 -0700, Micah wrote: >I think you could fake it as follows: > >struct dirent { > __uint32_t d_fileno; /* file number of entry */ > __uint16_t d_reclen; /* length of this record */ > __uint8_t d_type; /* file type, see below */ > __uint8_t d_namlen; /* length of string in d_name */ >#define MAXNAMLEN 255 > char d_name[MAXNAMLEN + 1]; /* name must be no longer than=20 >this */ >#if !__BSD_VISIBLE >#undef MAXNAMLEN >#endif >}; Macro definitions don't nest so this isn't safe. Consider some code that does: #define MAXNAMLEN 1024 =2E.. #include =2E.. char mybuffer[MAXNAMLEN]; --=20 Peter Jeremy --6zdv2QT/q3FMhpsV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE5CuE/opHv/APuIcRAmVJAKCq8Fww4zhaASi+MUa5yHob4m8eYwCfT/Yq NKjcZ4AQMoGPOJ+Rgdcarp8= =7TgC -----END PGP SIGNATURE----- --6zdv2QT/q3FMhpsV-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 11:27:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 44AEC16A4DD; Thu, 17 Aug 2006 11:27:14 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id C39CE43D46; Thu, 17 Aug 2006 11:27:13 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 56F5120A5; Thu, 17 Aug 2006 13:27:06 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 443A32084; Thu, 17 Aug 2006 13:27:06 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 1C5E433C24; Thu, 17 Aug 2006 13:27:06 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Dinesh Nair References: <44E040CF.9080205@alphaque.com> <44E05598.20004@alphaque.com> <20060816123731.GE45370@cdnetworks.co.kr> <44E4073C.9010008@alphaque.com> Date: Thu, 17 Aug 2006 13:27:05 +0200 In-Reply-To: <44E4073C.9010008@alphaque.com> (Dinesh Nair's message of "Thu, 17 Aug 2006 14:05:48 +0800") Message-ID: <86sljvli0m.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: pyunyh@gmail.com, freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 11:27:14 -0000 Dinesh Nair writes: > i never got re(4) working, and the patch i'm currently using forces > the use of rl(4) instead of using re(4). using rl(4) still shows > media as none, but it works the way it should with packets going in > and out. i've yet to try dag-erling's suggestion of disabling rx and > tx checksums. i'll also try with the patch you sent it to see if > that works. If you can receive but not transmit (as I understood from other posts in the thread, though you never answered my question about tcpdump), disabling tx checksum offloading should be the *first* thing to try, especially as there is a known bug in some RealTek chipsets which will cause tx checksums to be computed incorrectly for short packets (such as ICMP echo replies, or TCP handshake frames). DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 12:08:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 16EA716A4DA for ; Thu, 17 Aug 2006 12:08:08 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9B7943D45 for ; Thu, 17 Aug 2006 12:08:07 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k7HC86DR063528 for ; Thu, 17 Aug 2006 07:08:07 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E45C3F.6060901@centtech.com> Date: Thu, 17 Aug 2006 07:08:31 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: FreeBSD Hackers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1674/Thu Aug 17 01:40:13 2006 on mh1.centtech.com X-Virus-Status: Clean Subject: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 12:08:08 -0000 I've seen this several times now, but this time I got a dump. Basically, the system comes up after unclean shutdown, throws a bunch of filesystems into the background fsck list, and begins 60 seconds later. After some amount of time, the system will lock up, presumably hung waiting on locks. Here's some info: lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 804) lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid 804)Locked vnodes 0xffffff01c5c9f000: tag ufs, type VREG usecount 1, writecount 0, refcount 13656 mountedhere 0 flags (VV_SYSTEM) v_object 0xffffff01b09542a0 ref 0 pages 1691637 lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pid 804) ino 4, on dev label/vol4 How can I use kgdb to get more debugging information from this? Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 12:25:29 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 8ED4316A4E5 for ; Thu, 17 Aug 2006 12:25:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FDFB43D45 for ; Thu, 17 Aug 2006 12:25:24 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k7HCP4q7082976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Aug 2006 15:25:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6) with ESMTP id k7HCP3px019114; Thu, 17 Aug 2006 15:25:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6/Submit) id k7HCP2xJ019113; Thu, 17 Aug 2006 15:25:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 17 Aug 2006 15:25:02 +0300 From: Kostik Belousov To: Eric Anderson Message-ID: <20060817122502.GF1483@deviant.kiev.zoral.com.ua> References: <44E45C3F.6060901@centtech.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6v9BRtpmy+umdQlo" Content-Disposition: inline In-Reply-To: <44E45C3F.6060901@centtech.com> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL, UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua Cc: FreeBSD Hackers Subject: Re: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 12:25:29 -0000 --6v9BRtpmy+umdQlo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 17, 2006 at 07:08:31AM -0500, Eric Anderson wrote: > I've seen this several times now, but this time I got a dump.=20 > Basically, the system comes up after unclean shutdown, throws a bunch of= =20 > filesystems into the background fsck list, and begins 60 seconds later.= =20 > After some amount of time, the system will lock up, presumably hung=20 > waiting on locks. >=20 > Here's some info: > lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 804)= =20 > lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid=20 > 804)Locked vnodes >=20 > 0xffffff01c5c9f000: tag ufs, type VREG > usecount 1, writecount 0, refcount 13656 mountedhere 0 > flags (VV_SYSTEM) > v_object 0xffffff01b09542a0 ref 0 pages 1691637 > lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pid= =20 > 804) > ino 4, on dev label/vol4 >=20 >=20 >=20 > How can I use kgdb to get more debugging information from this? >=20 Look at the http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kernel= debug-deadlocks.html for instructions for ddb. What is the date of the system checkout ? --6v9BRtpmy+umdQlo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE5GAdC3+MBN1Mb4gRAlDTAJ9Mo0wcfn2xSbjEgZgCNLtsMg87DQCgn4+g sjNTz9gvFphJxyxaeQKM6pA= =GLdy -----END PGP SIGNATURE----- --6v9BRtpmy+umdQlo-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 12:29:40 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1896016A4E2 for ; Thu, 17 Aug 2006 12:29:40 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84C5A43D53 for ; Thu, 17 Aug 2006 12:29:39 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k7HCTd73066254; Thu, 17 Aug 2006 07:29:39 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E4614B.9000902@centtech.com> Date: Thu, 17 Aug 2006 07:30:03 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Kostik Belousov References: <44E45C3F.6060901@centtech.com> <20060817122502.GF1483@deviant.kiev.zoral.com.ua> In-Reply-To: <20060817122502.GF1483@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1674/Thu Aug 17 01:40:13 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers Subject: Re: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 12:29:40 -0000 On 08/17/06 07:25, Kostik Belousov wrote: > On Thu, Aug 17, 2006 at 07:08:31AM -0500, Eric Anderson wrote: >> I've seen this several times now, but this time I got a dump. >> Basically, the system comes up after unclean shutdown, throws a bunch of >> filesystems into the background fsck list, and begins 60 seconds later. >> After some amount of time, the system will lock up, presumably hung >> waiting on locks. >> >> Here's some info: >> lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 804) >> lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid >> 804)Locked vnodes >> >> 0xffffff01c5c9f000: tag ufs, type VREG >> usecount 1, writecount 0, refcount 13656 mountedhere 0 >> flags (VV_SYSTEM) >> v_object 0xffffff01b09542a0 ref 0 pages 1691637 >> lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pid >> 804) >> ino 4, on dev label/vol4 >> >> >> >> How can I use kgdb to get more debugging information from this? >> > Look at the > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html > for instructions for ddb. > > What is the date of the system checkout ? 6-STABLE from ~8/12/06. So there's not much that can be done with the vmcore? I'll add the options to my kernel config (I was missing a few), and I suppose wait for another deadlock. Thanks! Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 13:10:38 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 36F5716A4ED for ; Thu, 17 Aug 2006 13:10:38 +0000 (UTC) (envelope-from shriek.007@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00BEC43EDD for ; Thu, 17 Aug 2006 13:06:30 +0000 (GMT) (envelope-from shriek.007@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so297266nzn for ; Thu, 17 Aug 2006 06:06:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=bi96EcZUL84uuRg7ji/jJZtbycJvK1QanFkXa0tImL5is6DCwXJwlsm3JtJWU3KyqLBXqCU8JD2aQf6WvCNJ8SXT8F4UKvx8uo0dsKG+uSM7Gpvf0n7Oby/k9ucJLfrMlte/dqMb7+Ztm34du/mAXSivH80GD1ZagPzRihHOTyc= Received: by 10.65.97.18 with SMTP id z18mr2127592qbl; Thu, 17 Aug 2006 06:06:23 -0700 (PDT) Received: by 10.64.3.15 with HTTP; Thu, 17 Aug 2006 06:06:23 -0700 (PDT) Message-ID: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> Date: Thu, 17 Aug 2006 18:36:23 +0530 From: Shriek To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Is it possible to trace the routing socket messages going from the kernel to a particular daemon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 13:10:38 -0000 Is it possible that we can add some loadable module into the kernel to get a pid of a daemon-process and then somehow trace routing socket messages coming in / going out from the kernel to that particular daemon ? The thing why I am in need of this is that there are two daemons , one daemon is responsible for configuring the interfaces ...and the second is actually awaiting the updates from the kernel ( that it should send in case it sees that there is a change in the ifstate for the interface ---IFD update) ... any resources / material would be of great help.Thanks and regards. From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 13:25:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B78AB16A4DD for ; Thu, 17 Aug 2006 13:25:14 +0000 (UTC) (envelope-from joseph.koshy@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16E8043D45 for ; Thu, 17 Aug 2006 13:25:13 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by nf-out-0910.google.com with SMTP id n29so1096987nfc for ; Thu, 17 Aug 2006 06:25:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IcUvqeQNFWBmgZQQoJvirV4TynewpSnO0ZFGQJDm9JAvB+ajetr6nZFZPCE2JK8GBuFfZkHFRd1Q1l1v17FInmDef393CaDCKU+VTycOilUNCk9DAJxhw9a+P5/Eac+ZKXfH08yGD+x5Eo8POZTAXHjnYPuckLK34pyppaNVbIc= Received: by 10.49.55.13 with SMTP id h13mr2236649nfk; Thu, 17 Aug 2006 06:25:12 -0700 (PDT) Received: by 10.78.50.6 with HTTP; Thu, 17 Aug 2006 06:25:12 -0700 (PDT) Message-ID: <84dead720608170625r1bd8e1a6r647330c90023bd0a@mail.gmail.com> Date: Thu, 17 Aug 2006 18:55:12 +0530 From: "Joseph Koshy" To: Shriek In-Reply-To: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Is it possible to trace the routing socket messages going from the kernel to a particular daemon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 13:25:14 -0000 > get a pid of a daemon-process and then somehow trace routing > socket messages coming in / going out from the kernel to that > particular daemon ? `ktrace -p DAEMON-PID` might be what you want. -- FreeBSD Volunteer, http://people.freebsd.org/~jkoshy From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 14:53:06 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 7C5C516A4E0 for ; Thu, 17 Aug 2006 14:53:06 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E979743D55 for ; Thu, 17 Aug 2006 14:53:05 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k7HEr4L2089114; Thu, 17 Aug 2006 09:53:05 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E482E8.50509@centtech.com> Date: Thu, 17 Aug 2006 09:53:28 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Kostik Belousov References: <44E45C3F.6060901@centtech.com> <20060817122502.GF1483@deviant.kiev.zoral.com.ua> <44E4614B.9000902@centtech.com> In-Reply-To: <44E4614B.9000902@centtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1677/Thu Aug 17 08:56:09 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers Subject: Re: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 14:53:06 -0000 On 08/17/06 07:30, Eric Anderson wrote: > On 08/17/06 07:25, Kostik Belousov wrote: >> On Thu, Aug 17, 2006 at 07:08:31AM -0500, Eric Anderson wrote: >>> I've seen this several times now, but this time I got a dump. >>> Basically, the system comes up after unclean shutdown, throws a bunch of >>> filesystems into the background fsck list, and begins 60 seconds later. >>> After some amount of time, the system will lock up, presumably hung >>> waiting on locks. >>> >>> Here's some info: >>> lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 804) >>> lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid >>> 804)Locked vnodes >>> >>> 0xffffff01c5c9f000: tag ufs, type VREG >>> usecount 1, writecount 0, refcount 13656 mountedhere 0 >>> flags (VV_SYSTEM) >>> v_object 0xffffff01b09542a0 ref 0 pages 1691637 >>> lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pid >>> 804) >>> ino 4, on dev label/vol4 >>> >>> >>> >>> How can I use kgdb to get more debugging information from this? >>> >> Look at the >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html >> for instructions for ddb. >> >> What is the date of the system checkout ? > > > 6-STABLE from ~8/12/06. > > So there's not much that can be done with the vmcore? > > I'll add the options to my kernel config (I was missing a few), and I > suppose wait for another deadlock. Ok, had another one. Here are screenshots: http://www.googlebit.com/freebsd/snapshots/ Is it the sysctl that is triggering it? Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 15:04:53 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 3306416A4DA; Thu, 17 Aug 2006 15:04:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7300543D7B; Thu, 17 Aug 2006 15:04:39 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k7HF4Nc4087187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Aug 2006 18:04:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6) with ESMTP id k7HF4Nbd022480; Thu, 17 Aug 2006 18:04:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6/Submit) id k7HF4NET022479; Thu, 17 Aug 2006 18:04:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 17 Aug 2006 18:04:23 +0300 From: Kostik Belousov To: Eric Anderson Message-ID: <20060817150423.GA20768@deviant.kiev.zoral.com.ua> References: <44E45C3F.6060901@centtech.com> <20060817122502.GF1483@deviant.kiev.zoral.com.ua> <44E4614B.9000902@centtech.com> <44E482E8.50509@centtech.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <44E482E8.50509@centtech.com> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.9 required=5.0 tests=DNS_FROM_RFC_ABUSE, SPF_NEUTRAL,UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua Cc: FreeBSD Hackers , pjd@freebsd.org Subject: Re: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 15:04:53 -0000 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 17, 2006 at 09:53:28AM -0500, Eric Anderson wrote: > On 08/17/06 07:30, Eric Anderson wrote: > >On 08/17/06 07:25, Kostik Belousov wrote: > >>On Thu, Aug 17, 2006 at 07:08:31AM -0500, Eric Anderson wrote: > >>>I've seen this several times now, but this time I got a dump.=20 > >>>Basically, the system comes up after unclean shutdown, throws a bunch = of=20 > >>>filesystems into the background fsck list, and begins 60 seconds later= .=20 > >>> After some amount of time, the system will lock up, presumably hung= =20 > >>>waiting on locks. > >>> > >>>Here's some info: > >>>lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 80= 4)=20 > >>>lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid=20 > >>>804)Locked vnodes > >>> > >>>0xffffff01c5c9f000: tag ufs, type VREG > >>> usecount 1, writecount 0, refcount 13656 mountedhere 0 > >>> flags (VV_SYSTEM) > >>> v_object 0xffffff01b09542a0 ref 0 pages 1691637 > >>> lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pi= d=20 > >>>804) > >>> ino 4, on dev label/vol4 > >>> > >>> > >>> > >>>How can I use kgdb to get more debugging information from this? > >>> > >>Look at the > >>http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/ke= rneldebug-deadlocks.html > >>for instructions for ddb. > >> > >>What is the date of the system checkout ? > > > > > >6-STABLE from ~8/12/06. > > > >So there's not much that can be done with the vmcore? > > > >I'll add the options to my kernel config (I was missing a few), and I=20 > >suppose wait for another deadlock. >=20 > Ok, had another one. Here are screenshots: >=20 > http://www.googlebit.com/freebsd/snapshots/ >=20 > Is it the sysctl that is triggering it? Hmm, unbelievable. It would be much simpler for you to set up serial console. Anyway, you use g_journal, and the problem seems to be related to some geom locking. pjd@ is the right person to contact. I added him to the Cc:. --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE5IV2C3+MBN1Mb4gRAg9dAKC+mhKmGK3nLzND+eALWzuEUtoxogCg97x2 r4saVVAdTfti3PjGlqyfZ1E= =E/Gr -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 15:06:42 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 839B916A4E7; Thu, 17 Aug 2006 15:06:42 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99FC143D7B; Thu, 17 Aug 2006 15:06:32 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k7HF6WWH092470; Thu, 17 Aug 2006 10:06:32 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E48610.3000407@centtech.com> Date: Thu, 17 Aug 2006 10:06:56 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Kostik Belousov References: <44E45C3F.6060901@centtech.com> <20060817122502.GF1483@deviant.kiev.zoral.com.ua> <44E4614B.9000902@centtech.com> <44E482E8.50509@centtech.com> <20060817150423.GA20768@deviant.kiev.zoral.com.ua> In-Reply-To: <20060817150423.GA20768@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1677/Thu Aug 17 08:56:09 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers , pjd@freebsd.org Subject: Re: 6-STABLE snapshot (background fsck) lock-up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 15:06:42 -0000 On 08/17/06 10:04, Kostik Belousov wrote: > On Thu, Aug 17, 2006 at 09:53:28AM -0500, Eric Anderson wrote: >> On 08/17/06 07:30, Eric Anderson wrote: >>> On 08/17/06 07:25, Kostik Belousov wrote: >>>> On Thu, Aug 17, 2006 at 07:08:31AM -0500, Eric Anderson wrote: >>>>> I've seen this several times now, but this time I got a dump. >>>>> Basically, the system comes up after unclean shutdown, throws a bunch of >>>>> filesystems into the background fsck list, and begins 60 seconds later. >>>>> After some amount of time, the system will lock up, presumably hung >>>>> waiting on locks. >>>>> >>>>> Here's some info: >>>>> lock type bufwait: EXCL (count 1) by thread 0xffffff0128812980 (pid 804) >>>>> lock type getblk: EXCL (count 1) by thread 0xffffff0128812980 (pid >>>>> 804)Locked vnodes >>>>> >>>>> 0xffffff01c5c9f000: tag ufs, type VREG >>>>> usecount 1, writecount 0, refcount 13656 mountedhere 0 >>>>> flags (VV_SYSTEM) >>>>> v_object 0xffffff01b09542a0 ref 0 pages 1691637 >>>>> lock type snaplk: EXCL (count 1) by thread 0xffffff0128812980 (pid >>>>> 804) >>>>> ino 4, on dev label/vol4 >>>>> >>>>> >>>>> >>>>> How can I use kgdb to get more debugging information from this? >>>>> >>>> Look at the >>>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html >>>> for instructions for ddb. >>>> >>>> What is the date of the system checkout ? >>> >>> 6-STABLE from ~8/12/06. >>> >>> So there's not much that can be done with the vmcore? >>> >>> I'll add the options to my kernel config (I was missing a few), and I >>> suppose wait for another deadlock. >> Ok, had another one. Here are screenshots: >> >> http://www.googlebit.com/freebsd/snapshots/ >> >> Is it the sysctl that is triggering it? > > Hmm, unbelievable. It would be much simpler for you to set up serial > console. Not really, at least right now. I'm doing this remotely, so it'll be some time before I can do that. > Anyway, you use g_journal, and the problem seems to be related to some > geom locking. pjd@ is the right person to contact. I added him to the Cc:. Ahah. Ok. Thank you! Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 19:05:23 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 5A41316A4DD for ; Thu, 17 Aug 2006 19:05:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id C315343D4C for ; Thu, 17 Aug 2006 19:05:22 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 6814746CFB; Thu, 17 Aug 2006 15:05:21 -0400 (EDT) Date: Thu, 17 Aug 2006 20:05:21 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Shriek In-Reply-To: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> Message-ID: <20060817200357.C45647@fledge.watson.org> References: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Is it possible to trace the routing socket messages going from the kernel to a particular daemon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 19:05:23 -0000 On Thu, 17 Aug 2006, Shriek wrote: > Is it possible that we can add some loadable module into the kernel to get a > pid of a daemon-process and then somehow trace routing socket messages > coming in / going out from the kernel to that particular daemon ? The thing > why I am in need of this is that there are two daemons , one daemon is > responsible for configuring the interfaces ...and the second is actually > awaiting the updates from the kernel ( that it should send in case it sees > that there is a change in the ifstate for the interface ---IFD update) ... > any resources / material would be of great help.Thanks and regards. This won't give you exactly what you want, but if you don't know about it already, you probably will find it useful. "route monitor" monitors routing socket messages generated by the kernel, and includes the pid of the process they are destined for. It doesn't include messages sent to the kernel. As an exampl: TTY 1: peppercorn# route monitor got message of size 200 on Thu Aug 17 20:03:20 2006 RTM_GET: Report Metrics: len 200, pid: 784, seq 1, errno 0, flags: locks: inits: sockaddrs: default 192.168.100.1 default fxp0:0.3.47.d3.46.47 192.168.100.198 TTY 2 after running route monitor on the first tty: peppercorn:~> route -n get www.watson.org route to: 209.31.154.41 destination: default mask: default gateway: 192.168.100.1 interface: fxp0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 03:13:13 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 8F66E16A4DA for ; Fri, 18 Aug 2006 03:13:13 +0000 (UTC) (envelope-from devon.odell@coyotepoint.com) Received: from host50a.simplicato.com (www.ultinet.net [207.99.47.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3077D43D45 for ; Fri, 18 Aug 2006 03:13:12 +0000 (GMT) (envelope-from devon.odell@coyotepoint.com) Received: from localhost (localhost.simplicato.com [127.0.0.1]) by host50a.simplicato.com (Postfix) with ESMTP id 957006AE830 for ; Thu, 17 Aug 2006 23:13:05 -0400 (EDT) Received: from host50a.simplicato.com ([127.0.0.1]) by localhost (host50a.simplicato.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16201-05 for ; Thu, 17 Aug 2006 23:13:05 -0400 (EDT) Received: from mail.simplicato.com (localhost.simplicato.com [127.0.0.1]) by host50a.simplicato.com (Postfix) with SMTP id 58CBA6AE80F for ; Thu, 17 Aug 2006 23:13:05 -0400 (EDT) Received: from 24.239.186.61 (SquirrelMail authenticated user devon.odell@coyotepoint.com) by mail50a.simplicato.com with HTTP; Thu, 17 Aug 2006 23:13:05 -0400 (EDT) Message-ID: <2169.24.239.186.61.1155870785.squirrel@mail50a.simplicato.com> Date: Thu, 17 Aug 2006 23:13:05 -0400 (EDT) From: devon.odell@coyotepoint.com To: freebsd-hackers@freebsd.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at simplicato.com X-Mailman-Approved-At: Fri, 18 Aug 2006 03:37:17 +0000 Subject: Minidumps in FreeBSD 4 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 03:13:13 -0000 Hi all, I'm sort of curious as to how many people might be interested in this. I'm aware that there are still other companies who also have embedded products / appliances based on FreeBSD 4, and I suppose that's probably the only interest for such a patch. It's available at: http://databits.net/~dho/minidumps.patch.bz2 It's ~100KB uncompressed; 26KB otherwise. There are some dump-related changes that were made to e.g. disk drivers -- so there may be some bugs. Please let me know if you're able to use it successfully, if there are other things you'd like to see it do, and whatnot. It's pretty much a straight backport from Peter Wemm's minidumps which were recently MFCed to FreeBSD 6. I only had to make a couple changes to a few things, and figure out how to get gdb to read things correctly (which was basically a couple lines of obvious code and bringing some extra bits from the libkvm changes over, since gdb in 4.x doesn't use libkvm for kernel debugging). If there's any significant interest, maybe somebody can be convinced to commit it to RELENG_4 (ha ha ha). Huge thanks to Peter who helped me out with understanding some of the more hairy things towards the end. --Devon From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 08:05:41 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 E911416A508; Fri, 18 Aug 2006 08:05:41 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3525D43D7F; Fri, 18 Aug 2006 08:05:40 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from atlantis.dp.ua (localhost [127.0.0.1]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k7I85aEk010242; Fri, 18 Aug 2006 11:05:36 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Received: from localhost (dmitry@localhost) by atlantis.dp.ua (8.13.1/8.13.1/Submit) with ESMTP id k7I85axH010238; Fri, 18 Aug 2006 11:05:36 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Date: Fri, 18 Aug 2006 11:05:36 +0300 (EEST) From: Dmitry Pryanishnikov To: Robert Watson In-Reply-To: <20060817200357.C45647@fledge.watson.org> Message-ID: <20060818105840.B87144@atlantis.atlantis.dp.ua> References: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> <20060817200357.C45647@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: RTM_LOSING (Re: Is it possible to trace the routing socket messages) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 08:05:42 -0000 Hello! On Thu, 17 Aug 2006, Robert Watson wrote: > This won't give you exactly what you want, but if you don't know about it > already, you probably will find it useful. "route monitor" monitors routing > socket messages generated by the kernel, and includes the pid of the process > they are destined for. It doesn't include messages sent to the kernel. As I've got related question. On one of RELENG_4-based routers I observe pretty frequent route socket messages of the type RTM_LOSING: got message of size 124 on Fri Aug 18 10:57:46 2006 RTM_LOSING: Kernel Suspects Partitioning: len 124, pid: 0, seq 0, errno 0, flags: locks: inits: sockaddrs: 205.158.62.177 193.108.47.54 I can't find proper documentation about this particular message. What is the kernel trying to say to the userland with this message? The router functions normally, but the message is worrying. Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 06:37:53 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org 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 B481016A4DA; Fri, 18 Aug 2006 06:37:53 +0000 (UTC) (envelope-from jhiver@ykoz.net) Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2207043D45; Fri, 18 Aug 2006 06:37:52 +0000 (GMT) (envelope-from jhiver@ykoz.net) Received: from smtp-msa-out19.orange.fr (mwinf1923 [172.22.129.123]) by mwinf1920.orange.fr (SMTP Server) with ESMTP id 581991C02037; Fri, 18 Aug 2006 08:37:47 +0200 (CEST) Received: from [192.168.1.200] (LReunion-151-2-164.w193-253.abo.wanadoo.fr [193.253.97.164]) by mwinf1923.orange.fr (SMTP Server) with ESMTP id 15F7F1C000A2; Fri, 18 Aug 2006 08:37:44 +0200 (CEST) X-ME-UUID: 20060818063745900.15F7F1C000A2@mwinf1923.orange.fr Message-ID: <44E56037.3060605@ykoz.net> Date: Fri, 18 Aug 2006 10:37:43 +0400 From: Jean-Michel Hiver User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: fr, en MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 18 Aug 2006 11:31:43 +0000 Cc: sobomax@FreeBSD.org Subject: SER Core Dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 06:37:53 -0000 Hi, FreeBSD's SER port core dumps when I start it with 'fork=yes' in the config file. The OS is freebsd 6.1, the platform is: CPU: AMD Opteron(tm) Processor 146 (2010.31-MHz K8-class CPU) It says something like this on the command line: 0(65519) TOTAL: 44 free fragments = 1003912 free bytes 0(65519) ----------------------------- 0(65519) Memory status (shm): 0(65519) fm_status (0x801134000): 0(65519) heap size= 33554432 0(65519) dumping free list: 0(65519) hash = 1 fragments no.: 6, unused: 0 bucket size: 8 - 8 (first 8) 0(65519) hash = 2 fragments no.: 2, unused: 0 bucket size: 16 - 16 (first 16) 0(65519) hash = 4 fragments no.: 3, unused: 0 bucket size: 32 - 32 (first 32) 0(65519) hash = 8 fragments no.: 2, unused: 0 bucket size: 64 - 64 (first 64) 0(65519) hash = 10 fragments no.: 1, unused: 0 bucket size: 80 - 80 (first 80) 0(65519) hash = 28 fragments no.: 3, unused: 0 bucket size: 224 - 224 (first 224) 0(65519) hash = 80 fragments no.: 2, unused: 0 bucket size: 640 - 640 (first 640) 0(65519) hash = 490 fragments no.: 1, unused: 0 bucket size: 3920 - 3920 (first 3920) 0(65519) hash = 557 fragments no.: 1, unused: 0 bucket size: 4456 - 4456 (first 4456) 0(65519) hash = 580 fragments no.: 1, unused: 0 bucket size: 4640 - 4640 (first 4640) 0(65519) hash = 586 fragments no.: 1, unused: 0 bucket size: 4688 - 4688 (first 4688) 0(65519) hash = 1024 fragments no.: 2, unused: 0 bucket size: 8192 - 8192 (first 8192) 0(65519) hash = 2048 fragments no.: 2, unused: 0 bucket size: 16384 - 16384 (first 16384) 0(65519) hash = 2056 fragments no.: 1, unused: 0 bucket size: 2097152 - 4194304 (first 3145728) 0(65519) hash = 2059 fragments no.: 1, unused: 0 bucket size: 16777216 - 33554432 (first 30305416) 0(65519) TOTAL: 29 free fragments = 33520336 free bytes 0(65519) ----------------------------- 0(65519) shm_mem_destroy 0(65519) destroying the shared memory lock 0(65519) terminating due to SIGCHLD From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 07:41:38 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 A372116A4E2 for ; Fri, 18 Aug 2006 07:41:38 +0000 (UTC) (envelope-from martin.eugen@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 861F943D53 for ; Fri, 18 Aug 2006 07:41:37 +0000 (GMT) (envelope-from martin.eugen@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so842652uge for ; Fri, 18 Aug 2006 00:41:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=IuVGOfkcj9NRK5hWDWxis5KpbB7mvWVvqboLM1haaFJyFSo+VgPSPHC/peF3fbB5I2n+Lu/14jq3pnybcW7jYMOy0s+FtFSkUG9v7kcpbQonaRep2ZVwWJJXhLegRHYqPYQh80eyE5dcI0TVtYEMgHN32XvOcgwmCPa37oidNtA= Received: by 10.66.224.19 with SMTP id w19mr1537290ugg; Fri, 18 Aug 2006 00:41:36 -0700 (PDT) Received: by 10.66.251.17 with HTTP; Fri, 18 Aug 2006 00:41:36 -0700 (PDT) Message-ID: <966ba91e0608180041v3cfd9dcfh80ef89aab5404f48@mail.gmail.com> Date: Fri, 18 Aug 2006 10:41:36 +0300 From: "Martin Eugen" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 18 Aug 2006 11:32:03 +0000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: SOCK_DGRAM optimization needed... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 07:41:38 -0000 Hello there, I have a simple application, that deals with lots of dgram sockets (UDP). Thousands of them. Basically, its purpose is to maintain pairs of sockets and when data is received on one of the sockets it peeks through it (doing some simple statistic calculations) and then forwards it to the other socket. Because of the hudge number of reads and writes (probably about a 10 packets per second per socket pair) it generates a significant load on the system, that I would like to minimize. I'm currently evaluating if it would be possible to add simple 'routing' functionality in the socket layer in the kernel, because frankly I'm not able to think of anything else. Any ideas? Martin P.S. I'm not subscribed to the list so please CC. From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 11:37:31 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org 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 0793416A4E9; Fri, 18 Aug 2006 11:37:31 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26C7743DB2; Fri, 18 Aug 2006 11:36:48 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 744021A4DC6; Fri, 18 Aug 2006 04:36:47 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id B431D53A2C; Fri, 18 Aug 2006 07:36:44 -0400 (EDT) Date: Fri, 18 Aug 2006 07:36:44 -0400 From: Kris Kennaway To: Jean-Michel Hiver Message-ID: <20060818113644.GA32163@xor.obsecurity.org> References: <44E56037.3060605@ykoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E56037.3060605@ykoz.net> User-Agent: Mutt/1.4.2.2i Cc: freebsd-hackers@FreeBSD.org, sobomax@FreeBSD.org Subject: Re: SER Core Dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 11:37:31 -0000 On Fri, Aug 18, 2006 at 10:37:43AM +0400, Jean-Michel Hiver wrote: > Hi, > > > FreeBSD's SER port core dumps when I start it with 'fork=yes' in the > config file. The OS is freebsd 6.1, the platform is: Typically this is something to take up with the software authors. Kris From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 13:06:29 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 24EEE16A4DA for ; Fri, 18 Aug 2006 13:06:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id C49B843D53 for ; Fri, 18 Aug 2006 13:06:28 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 65DF246D61; Fri, 18 Aug 2006 09:06:28 -0400 (EDT) Date: Fri, 18 Aug 2006 14:06:28 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Martin Eugen In-Reply-To: <966ba91e0608180041v3cfd9dcfh80ef89aab5404f48@mail.gmail.com> Message-ID: <20060818140316.J45647@fledge.watson.org> References: <966ba91e0608180041v3cfd9dcfh80ef89aab5404f48@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: SOCK_DGRAM optimization needed... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 13:06:29 -0000 On Fri, 18 Aug 2006, Martin Eugen wrote: > I have a simple application, that deals with lots of dgram sockets (UDP). > Thousands of them. Basically, its purpose is to maintain pairs of sockets > and when data is received on one of the sockets it peeks through it (doing > some simple statistic calculations) and then forwards it to the other > socket. Because of the hudge number of reads and writes (probably about a 10 > packets per second per socket pair) it generates a significant load on the > system, that I would like to minimize. I'm currently evaluating if it would > be possible to add simple 'routing' functionality in the socket layer in the > kernel, because frankly I'm not able to think of anything else. There are some SOCK_DGRAM optimizations present in 7.x for fast UDP send not currently present in 6.x that may be relevant, as they reduce the overhead associated with socket send on a pure datagram socket, as well as contention if simultaneous sends occur on the same socket. How to manage events and context switches is presumably also critical -- using kqueue() instead of poll() or select() may make a big difference, and you want to avoid force context switches per packet, so using an event based model rather than a threaded model makes a great deal of sense (if it meets other security and architectural requirements), as for small amounts of calculation, context switch cost will out-weight the benefits of concurrency unless concurrency is designed into the system very carefully. However, if performance is really a critical issue here, it sounds like you might want to think about pushing this into the kernel. When you say SOCK_DGRAM, do you mean UNIX domain sockets or UDP sockets? (Or something else, for that matter)? Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 13:47:31 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 149D316A4DF for ; Fri, 18 Aug 2006 13:47:31 +0000 (UTC) (envelope-from devon.odell@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D31943D53 for ; Fri, 18 Aug 2006 13:47:30 +0000 (GMT) (envelope-from devon.odell@gmail.com) Received: by nf-out-0910.google.com with SMTP id n29so1432633nfc for ; Fri, 18 Aug 2006 06:47:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SCaB4Mq2m5YTQjTL8MH124EA9iVRM9ar31ZD8sbxWz6ZA4F+uKvAXX5IEcaDkN3fKcuP8mp9QH3uFejg6Ngr/q+s1gwq3PM/icnLRcdl6Ju5Tpbj9zX/Pia0L+L4zpsIIT8+EZwTmvBE8fmUyrsG5hG6t1dKkdf0Mz/xBsU7Zm4= Received: by 10.49.8.1 with SMTP id l1mr4071631nfi; Fri, 18 Aug 2006 06:47:29 -0700 (PDT) Received: by 10.49.9.14 with HTTP; Fri, 18 Aug 2006 06:47:28 -0700 (PDT) Message-ID: <9ab217670608180647r518037ayb9be2c8ef7d9a9df@mail.gmail.com> Date: Fri, 18 Aug 2006 09:47:28 -0400 From: "Devon H. O'Dell" To: "devon.odell@coyotepoint.com" In-Reply-To: <2169.24.239.186.61.1155870785.squirrel@mail50a.simplicato.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2169.24.239.186.61.1155870785.squirrel@mail50a.simplicato.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Minidumps in FreeBSD 4 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 13:47:31 -0000 And my apologies to those of you who found out that this file didn't exist on the server yesterday -- it should be there now. --Devon From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 13:52:05 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG 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 4B43616A4DE for ; Fri, 18 Aug 2006 13:52:05 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 497BD43D5C for ; Fri, 18 Aug 2006 13:52:04 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ovsjiv@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k7IDpuM4017150; Fri, 18 Aug 2006 15:52:02 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k7IDpubO017149; Fri, 18 Aug 2006 15:51:56 +0200 (CEST) (envelope-from olli) Date: Fri, 18 Aug 2006 15:51:56 +0200 (CEST) Message-Id: <200608181351.k7IDpubO017149@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, martin.eugen@gmail.com In-Reply-To: <966ba91e0608180041v3cfd9dcfh80ef89aab5404f48@mail.gmail.com> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 18 Aug 2006 15:52:02 +0200 (CEST) X-Mailman-Approved-At: Fri, 18 Aug 2006 14:02:49 +0000 Cc: Subject: Re: SOCK_DGRAM optimization needed... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, martin.eugen@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 13:52:05 -0000 Martin Eugen wrote: > I have a simple application, that deals with lots of dgram sockets (UDP). > Thousands of them. Basically, its purpose is to > maintain pairs of sockets and when data is received on one of the sockets it > peeks through it (doing some simple > statistic calculations) and then forwards it to the other socket. > Because of the hudge number of reads and writes (probably about a 10 packets > per second per socket pair) it generates a significant load > on the system, that I would like to minimize. I'm currently evaluating if it > would be possible to add simple 'routing' functionality in the socket layer > in the kernel, because frankly I'm not able to think of anything else. You should consider using kqueue(2) instead of select(2) or poll(2), because it's more efficient for large numbers of descriptors. Squid (from the ports collection) has grown kqueue support on FreeBSD some time ago, and it's definitely a win. You can look at the squid sources to see how it's done; it's not difficult. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "I started using PostgreSQL around a month ago, and the feeling is similar to the switch from Linux to FreeBSD in '96 -- 'wow!'." -- Oddbjorn Steffensen From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 14:23:19 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org 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 24FC916A4E0; Fri, 18 Aug 2006 14:23:19 +0000 (UTC) (envelope-from jhiver@ykoz.net) Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8264743D76; Fri, 18 Aug 2006 14:23:18 +0000 (GMT) (envelope-from jhiver@ykoz.net) Received: from smtp-msa-out19.orange.fr (mwinf1917 [172.22.129.117]) by mwinf1910.orange.fr (SMTP Server) with ESMTP id BEE731C05211; Fri, 18 Aug 2006 16:23:17 +0200 (CEST) Received: from [192.168.1.200] (LReunion-151-2-164.w193-253.abo.wanadoo.fr [193.253.97.164]) by mwinf1917.orange.fr (SMTP Server) with ESMTP id AF4621C00087; Fri, 18 Aug 2006 16:23:15 +0200 (CEST) X-ME-UUID: 20060818142315717.AF4621C00087@mwinf1917.orange.fr Message-ID: <44E5CD50.9030300@ykoz.net> Date: Fri, 18 Aug 2006 18:23:12 +0400 From: Jean-Michel Hiver User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: fr, en MIME-Version: 1.0 To: Kris Kennaway References: <44E56037.3060605@ykoz.net> <20060818113644.GA32163@xor.obsecurity.org> In-Reply-To: <20060818113644.GA32163@xor.obsecurity.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 18 Aug 2006 14:38:22 +0000 Cc: freebsd-hackers@FreeBSD.org, sobomax@FreeBSD.org Subject: Re: SER Core Dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 14:23:19 -0000 Kris Kennaway a écrit : >On Fri, Aug 18, 2006 at 10:37:43AM +0400, Jean-Michel Hiver wrote: > > >>Hi, >> >> >>FreeBSD's SER port core dumps when I start it with 'fork=yes' in the >>config file. The OS is freebsd 6.1, the platform is: >> >> > >Typically this is something to take up with the software authors. > >Kris > > Well, it doesn't seem to do so under Linux / Debian, and people on the #ser IRC channel have sent me to FreeBSD's maintainers :( Thanks for the reply anyway. Cheers, Jean-Michel. From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 15:33:28 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 798ED16A4DE; Fri, 18 Aug 2006 15:33:28 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CBF743D45; Fri, 18 Aug 2006 15:33:28 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.6) id k7IFXRSG080204; Fri, 18 Aug 2006 10:33:27 -0500 (CDT) (envelope-from dan) Date: Fri, 18 Aug 2006 10:33:27 -0500 From: Dan Nelson To: Jean-Michel Hiver Message-ID: <20060818153327.GB74158@dan.emsphone.com> References: <44E56037.3060605@ykoz.net> <20060818113644.GA32163@xor.obsecurity.org> <44E5CD50.9030300@ykoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44E5CD50.9030300@ykoz.net> X-OS: FreeBSD 6.1-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.12-2006-07-14 Cc: sobomax@freebsd.org, freebsd-hackers@freebsd.org, Kris Kennaway Subject: Re: SER Core Dumps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 15:33:28 -0000 In the last episode (Aug 18), Jean-Michel Hiver said: > Kris Kennaway a écrit : > >On Fri, Aug 18, 2006 at 10:37:43AM +0400, Jean-Michel Hiver wrote: > >>FreeBSD's SER port core dumps when I start it with 'fork=yes' in > >>the config file. The OS is freebsd 6.1, the platform is: > > > >Typically this is something to take up with the software authors. > > Well, it doesn't seem to do so under Linux / Debian, and people on the > #ser IRC channel have sent me to FreeBSD's maintainers :( They probably meant the maintainer of that particular port, which in net/ser's case is sobomax@FreeBSD.org . -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 17:39:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 5336716A4E5 for ; Fri, 18 Aug 2006 17:39:49 +0000 (UTC) (envelope-from mitchell@cloudynwuk.force9.co.uk) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCC1043D70 for ; Fri, 18 Aug 2006 17:39:48 +0000 (GMT) (envelope-from mitchell@cloudynwuk.force9.co.uk) Received: from [81.174.214.211] (helo=[81.174.214.211]) by ptb-relay02.plus.net with esmtp (Exim) id 1GE8Ju-0005NV-Jl for freebsd-hackers@freebsd.org; Fri, 18 Aug 2006 18:39:47 +0100 Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.3/423]); Fri, 18 Aug 2006 18:39:45 +0100 Message-ID: <000001c6c2ed$4b32dca0$d3d6ae51@hal> From: "Frank Mitchell" To: Date: Fri, 18 Aug 2006 17:38:33 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 Subject: Diff & Symlinks X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 17:39:49 -0000 Diff with Symlinks happens to be very convenient for me. The implementation is probably a consequence of how some standard Unix Systems Command works. But obviously it would be an idea to switch it off by default, while leaving the user with the existing option. Another issue would be getting Recursive diff to work for Non-Root users without being needlessly obstructed by Permissions. Faictz Ce Que Vouldras: Frank Mitchell ================================================ Jin Guojun wrote: I do not know what is the historical reason for program "diff" to follow a symbolic link during the recursive diff (-r), but it seems not to be a proper implementation. So, we need to either disable recursive diff to follow the symlink, or we need a switch (option) to enable following symlink feature in recursive comparison of diff when a user real needs it. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 18/08/2006 From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 18 19:28:16 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 49BE316A4DE for ; Fri, 18 Aug 2006 19:28:16 +0000 (UTC) (envelope-from unledev@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A28A43D64 for ; Fri, 18 Aug 2006 19:28:09 +0000 (GMT) (envelope-from unledev@gmail.com) Received: by qb-out-0506.google.com with SMTP id a10so383185qbd for ; Fri, 18 Aug 2006 12:28:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=dxHVxX63/wZyCI+TaMDt/6vLihb+2mjaNzFBK+ujJapUvf+3jOFSG96DUpznZ1k/tfMHLne8s1+pbPumLqPCfr9oj6Nco82BXjcDs1GARWpEM2n6k56QHxMUO+Dx3TtWslzfxjvDV8mlj76wbUKxTgpA1Ey70BLggTUtiAPOX7M= Received: by 10.49.41.18 with SMTP id t18mr4452610nfj; Fri, 18 Aug 2006 12:26:26 -0700 (PDT) Received: by 10.78.134.10 with HTTP; Fri, 18 Aug 2006 12:26:26 -0700 (PDT) Message-ID: <5e4707340608181226u131be51ak547c5912a35cfcec@mail.gmail.com> Date: Fri, 18 Aug 2006 19:26:26 +0000 From: "Alex Unleashed" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: devfs deadlock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 19:28:16 -0000 Hello, Before anything else I'd like to say I'm working on a SoC project for Gentoo for which I have to port a sandbox-like application wrapper (in userspace) to FreeBSD, which deals with the building and installing of software so that nothing gets screwed in the filesystem. It's finished, but unfortunately it gets frozen at random points, preventing the system from launching new programs or saving to disk, which suggested a kernel bug, as was later confirmed looking at the waitchannels and debugging. I know there is someone working out issues in devfs code in 6.x, so this might also be interesting to him. I've been able to reproduce both in 6.1-RELEASE-p3 and 6-STABLE (snapshot from August 16th ~01:00 GMT) a deadlock in devfs code which leaves the system unable to access the disk. I've come up with some interesting debugging info, and it looks to me like there are vnode problems while a sx lock is being held. My take at it is that the deadlock occurs when a process gets a lock on a vnode (tagged "devfs") and another process xlocks an sx lock ("devfsmount"). For some reason the one holding the sx lock wants to get the lock on the vnode through devfs_allocv(), and the other process wants to get the sx lock through devfs_lookup(). From this point on, pretty much anything wanting to touch the filesystem waits forever on devfs_root() for another vnode flagged as VV_ROOT and locked by the process holding the sx lock. Patching the devfs code with fixes from -CURRENT didn't work out. Here's some info from a DDB session after the deadlock had just occurred: db> ps pid proc uid ppid pgrp flag stat wmesg wchan cmd 17072 c4145624 0 17070 1071 0004002 [SLPQ piperd 0xc39904c8][SLP] gawk-3.1.5 17071 c4149c48 0 17070 1071 0000002 [SLPQ devfs 0xc41435c8][SLP] sh 17070 c4145830 0 17068 1071 0000002 [SLPQ wait 0xc4145830][SLP] sh 17069 c414920c 0 17067 1071 0004002 [SLPQ devfsmount 0xc396d540][SLP] xgcc <> db> trace 17069 Tracing pid 17069 tid 100071 td 0xc4146600 sched_switch(c4146600,0,1,c09545dc,c4146600) at sched_switch+0x2ea mi_switch(1,0,c0955f54,1ba,c091b594) at mi_switch+0x425 sleepq_switch(c396d540,0,c0955f54,20c,dad529f0) at sleepq_switch+0x110 sleepq_wait(c396d540,c0a36da0,c0918064,1,c09c1b6c) at sleepq_wait+0x65 cv_wait(c396d540,c0a36da0,c094f9cd,23f,dad52ad4) at cv_wait+0x1e6 _sx_xlock(c396d510,c094f9c4,23f,c09b8d80,dad52ad4) at _sx_xlock+0x99 devfs_lookup(dad52ad4,c092ddcb,37,c096da3c,c4143570) at devfs_lookup+0x36 VOP_LOOKUP_APV(c09b8d80,dad52ad4,c4146600,c4146600,0) at VOP_LOOKUP_APV+0xa4 lookup(dad52b80,0,c09204ab,b6,c070487d) at lookup+0x4ed namei(dad52b80,c091c646,275,c09550c4,c4146600) at namei+0x43c kern_lstat(c4146600,807a800,0,dad52c54,c091b47f) at kern_lstat+0x4f lstat(c4146600,dad52d04,3c4,c096ba20,c4146600) at lstat+0x2f syscall(3b,3b,3b,28232cb2,bfbfa2c1) at syscall+0x31f Xint0x80_syscall() at Xint0x80_syscall+0x1f --- syscall (190, FreeBSD ELF32, lstat), eip = 0x282251bb, esp = 0xbfbf9e7c, ebp = 0xbfbfab38 --- db> trace 17071 Tracing pid 17071 tid 100076 td 0xc394cd80 sched_switch(c394cd80,0,1,c09545dc,c394cd80) at sched_switch+0x2ea mi_switch(1,0,c0955f54,1ba,c091b594) at mi_switch+0x425 sleepq_switch(c41435c8,0,c0955f54,20c,d9bb6768) at sleepq_switch+0x110 sleepq_wait(c41435c8,0,c091bebc,c8,c394cd80) at sleepq_wait+0x65 msleep(c41435c8,c0a3743c,50,c0917eb4,0) at msleep+0x342 acquire(d9bb6840,80,60000,b1,0) at acquire+0x11c lockmgr(c41435c8,2002,c4143638,c394cd80,d9bb6888) at lockmgr+0x576 vop_stdlock(d9bb68b0,c08f40c3,42af,c091d728,1) at vop_stdlock+0x32 VOP_LOCK_APV(c09b8d80,d9bb68b0,c4143638,8,c0920936) at VOP_LOCK_APV+0xa4 vn_lock(c4143570,2002,c394cd80,7a7,2) at vn_lock+0xd2 vget(c4143570,2,c394cd80,c3972005,c396c460) at vget+0xf0 devfs_allocv(c396c400,c3889800,d9bb6b94,c394cd80,d9bb6988) at devfs_allocv+0x43 devfs_lookupx(d9bb6ad4,c094f9c4,23f,c09b8d80,d9bb6ad4) at devfs_lookupx+0x5f5 devfs_lookup(d9bb6ad4,c092ddcb,37,c096dac3,c3971000) at devfs_lookupx+0x3e VOP_LOOKUP_APV(c09b8d80,d9bb6ad4,c394cd80,c394cd80,0) at VOP_LOOKUP_APV+0xa4 lookup(d9bb6b80,0,c09204ab,b6,c0a82d70) at lookup+0x4ed namei(d9bb6b80,c091c646,275,c09550c4,c394cd80) at namei+0x43c kern_lstat(c394cd80,806d800,0,d9bb6c54,c091b47f) at kern_lstat+0x4f lstat(c394cd80,d9bb6d04,3c4,c096ba20,c394cd80) at lstat+0x2f syscall(3b,3b,3b,281b2cb2,bfbf9731) at syscall+0x31f Xint0x80_syscall() at Xint0x80_syscall+0x1f --- syscall (190, FreeBSD ELF32, lstat), eip = 0x281a51bb, esp = 0xbfbf92ec, ebp = 0xbfbf9fa8 --- db> show alllocks Process 17071 (sh) thread 0xc394cd80 (100076) exclusive sx devfsmount r = 0 (0xc396d510) locked @ fs/devfs/devfs_vnops:575 Process 34 (irq1: atkbd0) thread 0xc3687a80 (100031) exclusive sleep mutex Giant r = 0 (0xc0a37ac0) locked @ kern/kern_intr.c:683 db> show lock 0xc396d510 class: sx name: devfsmount state: XLOCK: 0xc394cd80 (tid 100076, pid 17071, "sh") waiters: 0 shared, 1 exclusive db> show lockedvnods Locked vnodes 0xc3971000: tag devfs, type VDIR usecount 3, writecount 0, refcount 3 mountedhere 0 flags (VV_ROOT) lock type devfs: EXCL (count 1) by thread 0xc394cd80 (pid 17071) #0 0xc06903a1 at lockmgr+0x621 #1 0xc06f98db at vop_stdlock+0x32 #2 0xc08e18fb at VOP_LOCK_APV+0xa4 #3 0xc0712460 at vn_lock+0xd2 #4 0xc07040ff at vget+0xf0 #5 0xc0645702 at devfs_allocv+0x43 #6 0xc064550e at devfs_root+0x2c #7 0xc06fc023 at lookup+0x829 #8 0xc06fb521 at namei+0x43c #9 0xc070ba21 at kern_lstat+0x4f #10 0xc070b9ad at lstat+0x2f #11 0xc08cbb89 at syscall+0x31f #12 0xc08b890f at Xint0x80_syscall+0x1f 0xc4143570: tag devfs, type VDIR usecount 1, writecount 0, refcount 2 mountedhere 0 flags () lock type devfs: EXCL (count 1) by thread 0xc4146600 (pid 17069) with 1 pending #0 0xc06903a1 at lockmgr+0x621 #1 0xc06f98db at vop_stdlock+0x32 #2 0xc08e18fb at VOP_LOCK_APV+0xa4 #3 0xc0712460 at vn_lock+0xd2 #4 0xc07040ff at vget+0xf0 #5 0xc0645702 at devfs_allocv+0x43 #6 0xc064680e at devfs_lookupx+0x5f5 #7 0xc064685b at devfs_lookup+0x3e #8 0xc08dea25 at VOP_LOOKUP_APV+0xa4 #9 0xc06fbce7 at lookup+0x4ed #10 0xc06fb521 at namei+0x43c #11 0xc070ba21 at kern_lstat+0x4f #12 0xc070b9ad at lstat+0x2f #13 0xc08cbb89 at syscall+0x31f #14 0xc08b890f at Xint0x80_syscall+0x1f After this the system still works, but it's unable to perform operations on the filesystem, like launching a new process. When this happens, the new process calls at some point a syscall (like open or chflags, for example) which ends up at devfs_root() and the vnode with the VV_ROOT flag gets its refcount and pending status incremented, having the process waiting there forever. And that's what there is to it. Unfortunately I am not experienced enough with the kernel to propose a patch, but I can reproduce this and perform whatever you'd want me to in order to fix it. Thanks, Alex From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 12:27:51 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 C6AE216A4DD for ; Sat, 19 Aug 2006 12:27:51 +0000 (UTC) (envelope-from artifact.one@googlemail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E73F43D53 for ; Sat, 19 Aug 2006 12:27:50 +0000 (GMT) (envelope-from artifact.one@googlemail.com) Received: by nf-out-0910.google.com with SMTP id n15so1686748nfc for ; Sat, 19 Aug 2006 05:27:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=JQ/TEZ0bww/FYG4SiQ3C2oKjkx/F3yY+7yLxUyaQPgaSekNqk4ZqEB2V0w992sfFsMwuqnjGoNYWqftQBWqU1+st0ZpJSTFcTiP8xQWPJ2d10l1KLMxxF6DWv1pRCVYdlaLZvMLXkUGpeybgF/Nl+EtgaycBAbJponZVxAWv5cw= Received: by 10.49.41.18 with SMTP id t18mr5209888nfj; Sat, 19 Aug 2006 05:27:49 -0700 (PDT) Received: by 10.49.54.3 with HTTP; Sat, 19 Aug 2006 05:27:49 -0700 (PDT) Message-ID: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> Date: Sat, 19 Aug 2006 13:27:49 +0100 From: "mal content" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Path transformation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 12:27:51 -0000 Hello. Is there any code in the tree that does general path transformation or 'optimisation'? For example, this path corresponds to the current working directory: "dir1/dir2/dir3/../../../" So I'd like to be able to pass that to a function and get the optimised result of: "." And so on for paths such as: "dir1/dir2/dir3/../../../../" (Which obviously becomes ".."). "dir1/dir2/dir3/../../../dir1" (Optimised to "dir1"). "dir1/dir2/dir3/../../../dir1/file.txt" ("dir1/file.txt") It's giving me a real headache trying to work out the algorithm to do this. thanks, MC From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 12:54:05 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 6639516A4DA for ; Sat, 19 Aug 2006 12:54:05 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from antivirus.uni-rostock.de (mailrelay1.uni-rostock.de [139.30.8.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D8BB43D49 for ; Sat, 19 Aug 2006 12:54:04 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from antivirus.exch.rz.uni-rostock.de ([127.0.0.1]) by antivirus.uni-rostock.de with Microsoft SMTPSVC(6.0.3790.1830); Sat, 19 Aug 2006 14:54:03 +0200 Received: from antivirus.uni-rostock.de (unverified) by antivirus.exch.rz.uni-rostock.de (Content Technologies SMTPRS 4.3.20) with ESMTP id for ; Sat, 19 Aug 2006 14:54:02 +0200 Received: from mail pickup service by antivirus.uni-rostock.de with Microsoft SMTPSVC; Sat, 19 Aug 2006 14:54:02 +0200 X-SCL: 3 59.52% Received: from mail.uni-rostock.de ([139.30.8.11]) by antivirus.uni-rostock.de with Microsoft SMTPSVC (6.0.3790.1830); Sat, 19 Aug 2006 14:53:56 +0200 Received: from conversion-daemon.mail2.uni-rostock.de by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) id <0J4800201W5N4I@mail.uni-rostock.de> (original mail from joerg@britannica.bec.de) for freebsd-hackers@freebsd.org; Sat, 19 Aug 2006 14:53:56 +0200 (MEST) Received: from britannica.bec.de (storm.stura.uni-rostock.de [139.30.252.72]) by mail2.uni-rostock.de (iPlanet Messaging Server 5.2 HotFix 2.09 (built Nov 18 2005)) with ESMTP id <0J48008XIX5LXA@mail.uni-rostock.de> for freebsd-hackers@freebsd.org; Sat, 19 Aug 2006 14:53:45 +0200 (MEST) Received: by britannica.bec.de (Postfix, from userid 1000) id 7B17A63D1; Sat, 19 Aug 2006 14:53:15 +0200 (CEST) Date: Sat, 19 Aug 2006 14:53:15 +0200 From: Joerg Sonnenberger In-reply-to: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> To: freebsd-hackers@freebsd.org Mail-followup-to: freebsd-hackers@freebsd.org Message-id: <20060819125315.GC192@britannica.bec.de> MIME-version: 1.0 Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 References: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> X-OriginalArrivalTime: 19 Aug 2006 12:53:56.0233 (UTC) FILETIME=[88129790:01C6C38E] Subject: Re: Path transformation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 12:54:05 -0000 On Sat, Aug 19, 2006 at 01:27:49PM +0100, mal content wrote: > Is there any code in the tree that does general path transformation > or 'optimisation'? > > For example, this path corresponds to the current working directory: > > "dir1/dir2/dir3/../../../" It might or might not. E.g. dir2 could be a symlink. Check realpath(3) and maybe the implementation of that as well. Joerg From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 12:59:23 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 2063716A4DE for ; Sat, 19 Aug 2006 12:59:23 +0000 (UTC) (envelope-from artifact.one@googlemail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4CD343D72 for ; Sat, 19 Aug 2006 12:59:18 +0000 (GMT) (envelope-from artifact.one@googlemail.com) Received: by nf-out-0910.google.com with SMTP id n15so1692127nfc for ; Sat, 19 Aug 2006 05:59:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=b81kXhwD/3foLj3kGxfLedKhzsCjcu2UUminlvOkaqw8RhrYVI7NRaTJMz062JHdvvAOUFipaGzIcGm30d0qlynrZS3NcftB8W7Mur1sj823gENE8NaHb7pECbSf/cIMGuC9EmMCxSoZtOc6t2sE1PqIknw5P5xS3cT2HrWHgzo= Received: by 10.49.29.2 with SMTP id g2mr5260847nfj; Sat, 19 Aug 2006 05:59:17 -0700 (PDT) Received: by 10.49.54.3 with HTTP; Sat, 19 Aug 2006 05:59:17 -0700 (PDT) Message-ID: <8e96a0b90608190559x1b573455wf84fe039afc7fb3e@mail.gmail.com> Date: Sat, 19 Aug 2006 13:59:17 +0100 From: "mal content" To: freebsd-hackers@freebsd.org In-Reply-To: <20060819125315.GC192@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> <20060819125315.GC192@britannica.bec.de> Subject: Re: Path transformation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 12:59:23 -0000 On 19/08/06, Joerg Sonnenberger wrote: > On Sat, Aug 19, 2006 at 01:27:49PM +0100, mal content wrote: > > Is there any code in the tree that does general path transformation > > or 'optimisation'? > > > > For example, this path corresponds to the current working directory: > > > > "dir1/dir2/dir3/../../../" > > It might or might not. E.g. dir2 could be a symlink. > Check realpath(3) and maybe the implementation of that as well. > > Joerg Ah, yes, didn't think of that. realpath() seems to be exactly what I'm looking for though, thanks! MC From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 13:09:37 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 93B6C16A4E1 for ; Sat, 19 Aug 2006 13:09:37 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 865C243D5C for ; Sat, 19 Aug 2006 13:09:36 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1GEQZt-000148-JV for freebsd-hackers@freebsd.org; Sat, 19 Aug 2006 17:09:31 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id ACE5E1146F for ; Sat, 19 Aug 2006 17:09:01 +0600 (YEKST) Date: Sat, 19 Aug 2006 17:09:01 +0600 From: Stanislav Sedov To: freebsd-hackers@freebsd.org Message-ID: <20060819170901.58da3103@localhost> In-Reply-To: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> References: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_MOrSvoo3Gs7QMds9gQcfB.9; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Subject: Re: Path transformation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 13:09:37 -0000 --Sig_MOrSvoo3Gs7QMds9gQcfB.9 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sat, 19 Aug 2006 13:27:49 +0100 "mal content" mentioned: > Hello. >=20 > Is there any code in the tree that does general path transformation > or 'optimisation'? >=20 realpath(3) --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_MOrSvoo3Gs7QMds9gQcfB.9 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE5vFNK/VZk+smlYERAt1lAJ96BAt/ox1srpXlafJ5Va6szEdClwCfa3re DbI+1gHP0u7N92bD267fhfw= =7hGW -----END PGP SIGNATURE----- --Sig_MOrSvoo3Gs7QMds9gQcfB.9-- From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 16:07:32 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 0DF6116A4E5 for ; Sat, 19 Aug 2006 16:07:32 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 4EB5E43D55 for ; Sat, 19 Aug 2006 16:07:31 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 38554 invoked by uid 1001); 19 Aug 2006 16:07:22 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Sat, 19 Aug 2006 12:07:22 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17639.14138.471768.271459@bhuda.mired.org> Date: Sat, 19 Aug 2006 12:07:22 -0400 To: "mal content" In-Reply-To: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> References: <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer Cc: freebsd-hackers@freebsd.org Subject: Re: Path transformation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 16:07:32 -0000 In <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com>, mal content typed: > For example, this path corresponds to the current working directory: > > "dir1/dir2/dir3/../../../" > > So I'd like to be able to pass that to a function and get the optimised > result of: > > "." > > It's giving me a real headache trying to work out the algorithm > to do this. If you just want the algorithm, the python distribution has one in posixpath.py: the normpath function. Heed the warning about symbolic links. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 20:51:55 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 09CAA16A4DF for ; Sat, 19 Aug 2006 20:51:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F95B43D4C for ; Sat, 19 Aug 2006 20:51:54 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k7JKoMZW032664; Sat, 19 Aug 2006 14:50:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 19 Aug 2006 14:50:27 -0600 (MDT) Message-Id: <20060819.145027.-1573946361.imp@bsdimp.com> To: micahjon@ywave.com From: "M. Warner Losh" In-Reply-To: <44E3A221.1070905@ywave.com> References: <44E3484D.8090905@centtech.com> <44E39DEC.1050204@uts.edu.au> <44E3A221.1070905@ywave.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 19 Aug 2006 14:50:23 -0600 (MDT) Cc: freebsd-hackers@freebsd.org, anthony.maher@uts.edu.au Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 20:51:55 -0000 In message: <44E3A221.1070905@ywave.com> Micah writes: : #define MAXNAMLEN 255 : char d_name[MAXNAMLEN + 1]; /* name must be no longer than : this */ : #if !__BSD_VISIBLE : #undef MAXNAMLEN : #endif : }; : I'm not sure if it's more readable, but it puts 255 in only one location. And if I defined MAXNAMLEN before I included this file? You can't do it that way :-( Warner From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 21:33:55 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 980F516A4E0 for ; Sat, 19 Aug 2006 21:33:55 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from frontmail.ipactive.de (frontmail.ipactive.de [85.214.39.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2F7B43D7F for ; Sat, 19 Aug 2006 21:33:52 +0000 (GMT) (envelope-from volker@vwsoft.com) Received: from mail.vtec.ipme.de (gprs-pool-1-019.eplus-online.de [212.23.126.19]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by frontmail.ipactive.de (Postfix) with ESMTP id 3992A33D21 for ; Sat, 19 Aug 2006 23:33:47 +0200 (CEST) Received: from [127.0.0.1] (unknown [192.168.18.3]) by mail.vtec.ipme.de (Postfix) with ESMTP id 0140F2E517 for ; Sat, 19 Aug 2006 23:33:34 +0200 (CEST) Message-ID: <44E783BA.8020700@vwsoft.com> Date: Sat, 19 Aug 2006 23:33:46 +0200 From: Volker User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: hackers@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-VWSoft-MailScanner: Found to be clean X-MailScanner-From: volker@vwsoft.com X-ipactive-MailScanner-Information: Please contact the ISP for more information X-ipactive-MailScanner: Found to be clean X-ipactive-MailScanner-From: volker@vwsoft.com Cc: Subject: ASIX Ax88772 anybody? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 21:33:55 -0000 Hi hackers, is anybody working on an Asix Ax88772 implementation? As far as I've seen at some oBsd hacks this chip is close (but not exactly identical) to the already supported Ax88172 axe(4) chip but a few hacks are needed. I'm wondering if somebody already has this on his/her todo list? If not I'll try to do an axe rewrite. I do have a Linksys USB200M v2 ethernet NIC (USB 2.0, 10/100M) which is using this chip. Greetings, Volker From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 23:10:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 6F97216A500 for ; Sat, 19 Aug 2006 23:10:10 +0000 (UTC) (envelope-from micahjon@ywave.com) Received: from relay1.av-mx.com (relay1.av-mx.com [137.118.16.126]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8FFD43D45 for ; Sat, 19 Aug 2006 23:10:09 +0000 (GMT) (envelope-from micahjon@ywave.com) X-Virus-Scan-Time: 0 Received: from [137.118.16.61] (HELO mx0.av-mx.com) by relay1.av-mx.com (CommuniGate Pro SMTP 4.2.10) with SMTP id 355687590 for freebsd-hackers@freebsd.org; Sat, 19 Aug 2006 19:10:09 -0400 Received: (qmail 2235 invoked from network); 19 Aug 2006 23:10:07 -0000 Received: from dsl25232.ywave.com (HELO ?192.168.1.65?) (micahjon@ywave.com@216.227.113.232) by 0 with SMTP; 19 Aug 2006 23:10:07 -0000 X-CLIENT-IP: 216.227.113.232 X-CLIENT-HOST: dsl25232.ywave.com Message-ID: <44E79A4B.8050607@ywave.com> Date: Sat, 19 Aug 2006 16:10:03 -0700 From: Micah User-Agent: Thunderbird 1.5.0.5 (X11/20060730) MIME-Version: 1.0 To: "M. Warner Losh" References: <44E3484D.8090905@centtech.com> <44E39DEC.1050204@uts.edu.au> <44E3A221.1070905@ywave.com> <20060819.145027.-1573946361.imp@bsdimp.com> In-Reply-To: <20060819.145027.-1573946361.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, anthony.maher@uts.edu.au Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 23:10:10 -0000 M. Warner Losh wrote: > In message: <44E3A221.1070905@ywave.com> > Micah writes: > : #define MAXNAMLEN 255 > : char d_name[MAXNAMLEN + 1]; /* name must be no longer than > : this */ > : #if !__BSD_VISIBLE > : #undef MAXNAMLEN > : #endif > : }; > : I'm not sure if it's more readable, but it puts 255 in only one location. > > And if I defined MAXNAMLEN before I included this file? You can't do > it that way :-( > > Warner I stand corrected. I assumed that since any defined MAXNAMLEN's get clobbered if __BSD_VISIBLE is set there was no desire to have a MAXNAMLEN defined when __BSD_VISIBLE was cleared. Seems like the current way might lead to unexpected behavior if you're trying to define a custom MAXNAMLEN. But I haven't really hacked much kernel code yet, I just hang out here to learn. - Micah