From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 6 14:59: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 80E7916A4E0 for ; Sun, 6 Aug 2006 14:59:55 +0000 (UTC) (envelope-from amdmi3@mail.ru) Received: from mx27.mail.ru (mx27.mail.ru [194.67.23.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4033443D49 for ; Sun, 6 Aug 2006 14:59:54 +0000 (GMT) (envelope-from amdmi3@mail.ru) Received: from [213.148.29.33] (port=22671 helo=nexii.panopticon) by mx27.mail.ru with esmtp id 1G9k6a-000EdF-00; Sun, 06 Aug 2006 18:59:53 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.2]) by nexii.panopticon (Postfix) with ESMTP id 5432217041; Sun, 6 Aug 2006 18:59:40 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 92DA6433F; Sun, 6 Aug 2006 18:59:54 +0400 (MSD) Date: Sun, 6 Aug 2006 18:59:54 +0400 From: Dmitry Marakasov To: Dag-Erling Sm?rgrav Message-ID: <20060806145954.GC907@hades.panopticon> Mail-Followup-To: Dag-Erling Sm?rgrav , freebsd-hackers@freebsd.org References: <20060731203213.GA75233@hades.panopticon> <864pwtoorp.fsf@xps.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <864pwtoorp.fsf@xps.des.no> User-Agent: Mutt/1.5.12-2006-07-14 Cc: freebsd-hackers@freebsd.org Subject: Re: absolute vs. relative offsets in disklabel 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, 06 Aug 2006 14:59:55 -0000 * Dag-Erling Sm?rgrav (des@des.no) wrote: > > Recent `disklabel differences FreeBSD, DragonFly' thread gave me a > > thought - why do we have absolute offsets in disklabel? > We don't, AFAIK. Since the transition to GEOM, the offsets are > relative to the start of the containing provider. It has nothing to do with GEOM, it's ondisk format of disklabel. I've confirmed, there are global offsets. -- Best regards, Dmitry mailto:amdmi3@mail.ru From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 6 15:08: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 409F516A4DA for ; Sun, 6 Aug 2006 15:08:39 +0000 (UTC) (envelope-from shadow@psoft.net) Received: from mail.sevcity.net (ns.sevcity.net [193.47.166.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD73A43D4C for ; Sun, 6 Aug 2006 15:08:38 +0000 (GMT) (envelope-from shadow@psoft.net) Received: from mail.sevcity.net (service.sevcity [127.0.0.1]) by mail.sevcity.net (Postfix) with ESMTP id 8BBD9170036; Sun, 6 Aug 2006 18:08:42 +0300 (EEST) Received: from berloga.shadowland (umka.sevcity.net [193.47.166.138]) by mail.sevcity.net (Postfix) with ESMTP id 64196170034; Sun, 6 Aug 2006 18:08:42 +0300 (EEST) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.11.20060308/8.12.11) with ESMTP id k76F8b8f005542; Sun, 6 Aug 2006 18:08:37 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.11.20060308/8.12.11/Submit) id k76F8aLp005540; Sun, 6 Aug 2006 18:08:36 +0300 From: Alex Lyashkov To: Chris Jones In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Positive Software Message-Id: <1154876916.5303.7.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-17) Date: Sun, 06 Aug 2006 18:08:36 +0300 X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Jail Memory Limits 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, 06 Aug 2006 15:08:39 -0000 I read you patch and see you start N kernel threads for control memory/CPU usage, when each thread in loop count total memory usage. What are reason why not create memory limit similar limit(1)? for this need add pointer to prison structure at each VMA struct and add few checks at same points when LIMIT_VMEM and LIMIT_RSS checks. > > I'm expecting patches for jail scheduling to be coming down the pipe > soon. > > Cheers, > > Chris > > > > > ______________________________________________________________________ > _______________________________________________ > 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" -- FreeVPS Developers Team http://www.freevps.com From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 6 23:30: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 F26BE16A4DA; Sun, 6 Aug 2006 23:29:59 +0000 (UTC) (envelope-from duane@dwpc.dwlabs.ca) Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F61843D45; Sun, 6 Aug 2006 23:29:57 +0000 (GMT) (envelope-from duane@dwpc.dwlabs.ca) Received: from ip02.eastlink.ca ([24.222.10.10]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0J3L00MGUNYYDFR0@mta01.eastlink.ca>; Sun, 06 Aug 2006 20:30:34 -0300 (ADT) Received: from blk-224-199-230.eastlink.ca (HELO dwpc.dwlabs.ca) ([24.224.199.230]) by ip02.eastlink.ca with ESMTP; Sun, 06 Aug 2006 20:29:56 -0300 Received: from dwpc.dwlabs.ca (localhost [127.0.0.1]) by dwpc.dwlabs.ca (8.13.6/8.13.6) with ESMTP id k76NQjbE053328; Sun, 06 Aug 2006 20:26:45 -0300 (ADT envelope-from duane@dwpc.dwlabs.ca) Received: (from duane@localhost) by dwpc.dwlabs.ca (8.13.6/8.13.6/Submit) id k76NQj24053327; Sun, 06 Aug 2006 20:26:45 -0300 (ADT envelope-from duane) Date: Sun, 06 Aug 2006 20:26:45 -0300 From: Duane Whitty In-reply-to: <200606270851.47508.jhb@freebsd.org> To: John Baldwin Message-id: <20060806232645.GB39488@dwpc.dwlabs.ca> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAQAAA+k= References: <2f3a439f0606260653j602e083blf872bef5b94be5a@mail.gmail.com> <200606270851.47508.jhb@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, freebsd-platforms@freebsd.org Subject: Re: New architecture support 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, 06 Aug 2006 23:30:00 -0000 On Tue, Jun 27, 2006 at 08:51:47AM -0400, John Baldwin wrote: > On Monday 26 June 2006 09:53, Aditya Godbole wrote: > > Hi, > > > > If I have to add support for a new architecture, how do I start? I > > guess I need to get the build system and 'config' utility in place? > > How do I go about it? > > Well, you'll need a toolchain. :) Then you can start working on building > a minimal kernel filling in missing bits in sys/ as you go. > > -- > John Baldwin Hi, Chiming in very late... I'm somewhat interested in this as well. Towards that end would it be correct for me to believe the process is easier if the architecture already has a UNIX(tm) style operating system installed and operating and if there are GNU tools available for this architecture already (assembler, compiler, linker)? What I am thinking about is HP's HP 9000 PA-II RISC architecture. Seems to me that if the above mentioned tools are available that about 85% of the work is already done, but then I only have limited experience in this area. I really like the HP 9000 platform and I would love to see FreeBSD on it. Used HP 9000 hardware is quite inexpensive and HP has definitely started using more "off-the-shelf" hardware these days. Heh, sorry I guess this belongs more on platforms@ but the thread caught my attention and I've been thinking about this for a while... Best Regards, Duane Whitty From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 08:35: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 619C116A4DA; Mon, 7 Aug 2006 08:35:42 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail19.syd.optusnet.com.au (mail19.syd.optusnet.com.au [211.29.132.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44D4443D5E; Mon, 7 Aug 2006 08:35:40 +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 mail19.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k778Z657028164 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 7 Aug 2006 18:35:11 +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 k778Z6VF001105; Mon, 7 Aug 2006 18:35:06 +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 k778YtUQ001101; Mon, 7 Aug 2006 18:34:55 +1000 (EST) (envelope-from peter) Date: Mon, 7 Aug 2006 18:34:55 +1000 From: Peter Jeremy To: Duane Whitty Message-ID: <20060807083455.GA752@turion.vk2pj.dyndns.org> References: <2f3a439f0606260653j602e083blf872bef5b94be5a@mail.gmail.com> <200606270851.47508.jhb@freebsd.org> <20060806232645.GB39488@dwpc.dwlabs.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <20060806232645.GB39488@dwpc.dwlabs.ca> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org, freebsd-platforms@freebsd.org Subject: Re: New architecture support 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, 07 Aug 2006 08:35:42 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 2006-Aug-06 20:26:45 -0300, Duane Whitty wrote: >I'm somewhat interested in this as well. Towards that end would it be >correct for me to believe the process is easier if the architecture >already has a UNIX(tm) style operating system installed and operating and >if there are GNU tools available for this architecture already (assembler, >compiler, linker)? The Un*x-like OS is not especially critical but a working toolchain is. >What I am thinking about is HP's HP 9000 PA-II RISC architecture. Seems to >me that if the above mentioned tools are available that about 85% of the >work is already done, but then I only have limited experience in this area. Maybe 85% of the total effort (starting from nothing). The other critical item is access to the system programming information for the system - and I'm not sure how readily available this is for the HP-PA. Currently FreeBSD has support for 6 platforms. There is a total of 10MB or 304KLOC in the MD-trees - this is about 50KLOC per CPU. Whilst you may be able to leverage off existing MD code (especially the NetBSD HP-PA port), a port to a new architecture is a non-trivial undertaking. >I really like the HP 9000 platform and I would love to see FreeBSD on it. The HP 9000 is really more NetBSD territory than FreeBSD territory. Unless you can get a critical mass of developers who are interested, the port is a non-starter. The Alpha port died because there wasn't sufficient interest to keep it going - and much of the loss of interest was a result of Compaq killing the Alpha. I suspect that a HP 9000 port would be starting from a much smaller base. --=20 Peter Jeremy --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE1vsv/opHv/APuIcRAnlBAJ9immrqu+1CphOiaOtS0o1vVONI9gCgs9Q5 UL7A/7tR4OsksSqdZ9OWwrY= =49fv -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 12:45: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 56FE116A4DE for ; Mon, 7 Aug 2006 12:45:42 +0000 (UTC) (envelope-from ssouhlal@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F82643D4C for ; Mon, 7 Aug 2006 12:45:41 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [172.30.10.225] (unknown [216.239.55.7]) by elvis.mu.org (Postfix) with ESMTP id DEFD91A3C2B; Mon, 7 Aug 2006 05:45:40 -0700 (PDT) Message-ID: <44D735E5.4030809@FreeBSD.org> Date: Mon, 07 Aug 2006 14:45:25 +0200 From: Suleiman Souhlal User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051204) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Niki Denev References: <44D3C333.3030702@cytexbg.com> In-Reply-To: <44D3C333.3030702@cytexbg.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Mon, 07 Aug 2006 12:45:42 -0000 Niki Denev wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I'm in the middle of a struggle to port the linux > nozomi(Option GloberTrotter 3G+ HSDPA cardbus adapter) driver to freebsd. > And given the fact that i have very little previous kernel coding experience i > can't find what i can use in freebsd as equivalent of linux's ioremap(). > > Any ideas are appreciated. Thanks! I think the equivalent of linux's ioremap() in FreeBSD is pmap_mapdev(). -- Suleiman From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 13:31: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 D7B9E16A4E5 for ; Mon, 7 Aug 2006 13:31:45 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id DC78343D7E for ; Mon, 7 Aug 2006 13:31:31 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 32459 invoked by uid 1026); 7 Aug 2006 13:33:25 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 0.157043 secs); 07 Aug 2006 13:33:25 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 7 Aug 2006 13:33:25 -0000 From: Niki Denev To: Suleiman Souhlal Date: Mon, 7 Aug 2006 16:28:15 +0300 User-Agent: KMail/1.9.3 References: <44D3C333.3030702@cytexbg.com> <44D735E5.4030809@FreeBSD.org> In-Reply-To: <44D735E5.4030809@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608071628.15316.nike_d@cytexbg.com> 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: Mon, 07 Aug 2006 13:31:45 -0000 On Monday 07 August 2006 15:45, Suleiman Souhlal wrote: > Niki Denev wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hi, > > > > I'm in the middle of a struggle to port the linux > > nozomi(Option GloberTrotter 3G+ HSDPA cardbus adapter) driver to freebsd. > > And given the fact that i have very little previous kernel coding > > experience i can't find what i can use in freebsd as equivalent of > > linux's ioremap(). > > > > Any ideas are appreciated. Thanks! > > 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? Regards, Niki Denev From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 14:39: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 179B016A4DA for ; Mon, 7 Aug 2006 14:39:09 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 20DD043D46 for ; Mon, 7 Aug 2006 14:39:07 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 47669 invoked by uid 1026); 7 Aug 2006 14:41:02 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 7.719504 secs); 07 Aug 2006 14:41:02 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 7 Aug 2006 14:40:54 -0000 From: Niki Denev To: freebsd-hackers@freebsd.org Date: Mon, 7 Aug 2006 17:35:43 +0300 User-Agent: KMail/1.9.3 References: <44D3C333.3030702@cytexbg.com> <44D735E5.4030809@FreeBSD.org> <200608071628.15316.nike_d@cytexbg.com> In-Reply-To: <200608071628.15316.nike_d@cytexbg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608071735.43462.nike_d@cytexbg.com> 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: Mon, 07 Aug 2006 14:39:09 -0000 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? From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 17:50: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 A6BB616A4DF for ; Mon, 7 Aug 2006 17:50:29 +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 96E7143D49 for ; Mon, 7 Aug 2006 17:50:23 +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 k77HoL7R014101 for ; Mon, 7 Aug 2006 12:50:22 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D77D70.1030508@centtech.com> Date: Mon, 07 Aug 2006 12:50:40 -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/1639/Mon Aug 7 08:34:09 2006 on mh2.centtech.com X-Virus-Status: Clean Subject: ollecting pv entries -- suggest increasing PMAP_SHPGPERPROC 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, 07 Aug 2006 17:50:29 -0000 I saw these two warnings come up soon after rebooting a server (running 5-STABLE): kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC I see there is a tunable for tweaking, but I'm not certain what I'm really tweaking. Any hints or guidelines? Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 17:52:54 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 4AF2316A4DE for ; Mon, 7 Aug 2006 17:52:54 +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 28D7443DC4 for ; Mon, 7 Aug 2006 17:52:31 +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 k77HqUbc027150; Mon, 7 Aug 2006 12:52:31 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D77DF1.9040205@centtech.com> Date: Mon, 07 Aug 2006 12:52:49 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Eric Anderson References: <44D77D70.1030508@centtech.com> In-Reply-To: <44D77D70.1030508@centtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1639/Mon Aug 7 08:34:09 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers Subject: Re: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC 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, 07 Aug 2006 17:52:54 -0000 On 08/07/06 12:50, Eric Anderson wrote: > I saw these two warnings come up soon after rebooting a server (running > 5-STABLE): > > kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC > kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC > > I see there is a tunable for tweaking, but I'm not certain what I'm > really tweaking. Any hints or guidelines? And I've now fixed the subject line too. :) Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 18:34: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 8B06E16A4DD; Mon, 7 Aug 2006 18:34:10 +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 1143543D72; Mon, 7 Aug 2006 18:34:09 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (nsxb7dwc712h1y2q@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k77IY7Yv041000; Mon, 7 Aug 2006 11:34:07 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k77IY6hF040999; Mon, 7 Aug 2006 11:34:06 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Aug 2006 11:34:06 -0700 From: John-Mark Gurney To: Niki Denev Message-ID: <20060807183406.GB99774@funkthat.com> Mail-Followup-To: Niki Denev , Suleiman Souhlal , freebsd-hackers@freebsd.org References: <44D3C333.3030702@cytexbg.com> <44D735E5.4030809@FreeBSD.org> <200608071628.15316.nike_d@cytexbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608071628.15316.nike_d@cytexbg.com> 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, Suleiman Souhlal Subject: Re: linux ioremap equivalent on freebsd 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, 07 Aug 2006 18:34:10 -0000 Niki Denev wrote this message on Mon, Aug 07, 2006 at 16:28 +0300: > On Monday 07 August 2006 15:45, Suleiman Souhlal wrote: > > Niki Denev wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > > Hash: SHA1 > > > > > > Hi, > > > > > > I'm in the middle of a struggle to port the linux > > > nozomi(Option GloberTrotter 3G+ HSDPA cardbus adapter) driver to freebsd. > > > And given the fact that i have very little previous kernel coding > > > experience i can't find what i can use in freebsd as equivalent of > > > linux's ioremap(). > > > > > > Any ideas are appreciated. Thanks! > > > > 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? 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/devicedrivers.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... -- 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 7 19:07: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 0E8DC16A4DE for ; Mon, 7 Aug 2006 19:07:29 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 6E77B43D94 for ; Mon, 7 Aug 2006 19:07:14 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 27978 invoked by uid 1026); 7 Aug 2006 19:09:07 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 1.359385 secs); 07 Aug 2006 19:09:07 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 7 Aug 2006 19:09:06 -0000 From: Niki Denev To: freebsd-hackers@freebsd.org Date: Mon, 7 Aug 2006 22:03:56 +0300 User-Agent: KMail/1.9.3 References: <44D3C333.3030702@cytexbg.com> <200608071628.15316.nike_d@cytexbg.com> <20060807183406.GB99774@funkthat.com> In-Reply-To: <20060807183406.GB99774@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608072203.56320.nike_d@cytexbg.com> Cc: John-Mark Gurney 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: Mon, 07 Aug 2006 19:07:29 -0000 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) Thanks again! --niki From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 19:29: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 22AFE16A4E2 for ; Mon, 7 Aug 2006 19:29:42 +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 CD7D643D69 for ; Mon, 7 Aug 2006 19:29:30 +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 k77JTN4R036769; Mon, 7 Aug 2006 15:29:25 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 7 Aug 2006 15:09:08 -0400 User-Agent: KMail/1.9.1 References: <20060731203213.GA75233@hades.panopticon> <864pwtoorp.fsf@xps.des.no> <20060806145954.GC907@hades.panopticon> In-Reply-To: <20060806145954.GC907@hades.panopticon> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608071509.08923.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, 07 Aug 2006 15:29:26 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1639/Mon Aug 7 09:34:09 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Dag-Erling Sm?rgrav , Dmitry Marakasov Subject: Re: absolute vs. relative offsets in disklabel 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, 07 Aug 2006 19:29:42 -0000 On Sunday 06 August 2006 10:59, Dmitry Marakasov wrote: > * Dag-Erling Sm?rgrav (des@des.no) wrote: > > > Recent `disklabel differences FreeBSD, DragonFly' thread gave me a > > > thought - why do we have absolute offsets in disklabel? > > We don't, AFAIK. Since the transition to GEOM, the offsets are > > relative to the start of the containing provider. > It has nothing to do with GEOM, it's ondisk format of disklabel. I've > confirmed, there are global offsets. Actually, the GEOM provider goes though some gymnastics to portray the offsets as relative to userland, but ondisk they are still stored as absolute to preserve compatiblity. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 19:29: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 CB7F816A4DA for ; Mon, 7 Aug 2006 19:29: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 0768343D5C for ; Mon, 7 Aug 2006 19:29:31 +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 k77JTN4S036769; Mon, 7 Aug 2006 15:29:26 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 7 Aug 2006 15:27:50 -0400 User-Agent: KMail/1.9.1 References: <44D4A5DC.7080403@cytexbg.com> In-Reply-To: <44D4A5DC.7080403@cytexbg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608071527.50711.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, 07 Aug 2006 15:29:27 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1639/Mon Aug 7 09:34:09 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Subject: Re: jkh weird problem (reading pci device memory) 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, 07 Aug 2006 19:29:43 -0000 On Saturday 05 August 2006 10:06, Niki Denev wrote: > for(i=0; i < sizeof(config_table_t); i++) { > r = bus_space_read_1(sc->bar.tag, sc->bar.hdl, i); > *((u_int8_t *)&sc->cfg_table + i) = r; > } Note that you can replace this with: bus_space_read_multi_1(sc->bar.tag, sc->bar.hdl, 0, (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); However, if you are really reading in a table with more than just chars, you might want to read the individual fields and byteswap them as needed (if you care about portability to a big-endian arch like sparc). That is, if your device stores the table as little-endian and you had: typedef struct _config_table { uint32_t signature; uint16_t version; uint8_t dummy; } config_table_t; You would do this instead: sc->cfg_table.signature = letoh32(bus_read_4(sc->bar.res, 0)); sc->cfg_table.version = letoh16(bus_read_2(sc->bar.res, 4)); sc->cfg_table.dummy = bus_read_1(sc->bar.res, 5); (Note this also uses the shorter bus_read functions which just take a struct resouce *.) I have no idea why the printf's make a difference, unless perhaps your card needs a bit of a delay after it is inserted before it's firmware is fully up and running. In that case you might want to insert a delay. Something like this: /* XXX: Doesn't it want to print rman_get_size() / 1024 instead? */ device_printf(dev, "card has %uKB memory\n", sc->card_type); count = 0; while (letoh32(bus_read_4(sc->bar.res, 0)) != CONFIG_MAGIC) { /* If it's not up after a half-second, give up. */ if (count > 50) { device_printf(dev, "ConfigTable Bad!\n"); return (ENXIO); } count++; /* Wait 10 ms. */ DELAY(10000); } -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 19:43:56 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 7C94916A4E1 for ; Mon, 7 Aug 2006 19:43:56 +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 1721343D82 for ; Mon, 7 Aug 2006 19:43:40 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (3pwhbw2zomvd7gmb@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k77JhcWe042082; Mon, 7 Aug 2006 12:43:38 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k77Jhc9m042081; Mon, 7 Aug 2006 12:43:38 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Aug 2006 12:43:38 -0700 From: John-Mark Gurney To: Niki Denev Message-ID: <20060807194337.GD99774@funkthat.com> Mail-Followup-To: Niki Denev , freebsd-hackers@freebsd.org References: <44D3C333.3030702@cytexbg.com> <200608071628.15316.nike_d@cytexbg.com> <20060807183406.GB99774@funkthat.com> <200608072203.56320.nike_d@cytexbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608072203.56320.nike_d@cytexbg.com> 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: linux ioremap equivalent on freebsd 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, 07 Aug 2006 19:43:56 -0000 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.... Good luck! -- 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 7 19:49: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 8588116A4E5 for ; Mon, 7 Aug 2006 19:49:31 +0000 (UTC) (envelope-from tom.hurst@clara.net) Received: from spork.qfe3.net (spork.qfe3.net [212.13.207.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0ECD143D70 for ; Mon, 7 Aug 2006 19:49:30 +0000 (GMT) (envelope-from tom.hurst@clara.net) Received: from [81.104.127.102] (helo=voi.aagh.net) by spork.qfe3.net with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1GAB6P-000Ky9-1f; Mon, 07 Aug 2006 20:49:29 +0100 Received: from freaky by voi.aagh.net with local (Exim 4.62 (FreeBSD)) (envelope-from ) id 1GAB6J-0006ew-Fm; Mon, 07 Aug 2006 20:49:23 +0100 Date: Mon, 7 Aug 2006 20:49:23 +0100 From: Thomas Hurst To: Eric Anderson Message-ID: <20060807194923.GA20676@voi.aagh.net> Mail-Followup-To: Eric Anderson , FreeBSD Hackers References: <44D77D70.1030508@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44D77D70.1030508@centtech.com> Organization: Not much. User-Agent: Mutt/1.5.11 Sender: Thomas Hurst Cc: FreeBSD Hackers Subject: Re: ollecting pv entries -- suggest increasing PMAP_SHPGPERPROC 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, 07 Aug 2006 19:49:31 -0000 * Eric Anderson (anderson@centtech.com) wrote: > I saw these two warnings come up soon after rebooting a server > (running 5-STABLE): > > kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC > kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC > > I see there is a tunable for tweaking, but I'm not certain what I'm > really tweaking. Any hints or guidelines? PV entries are related to the amount of memory that's shared between processes. http://lists.freebsd.org/pipermail/freebsd-hackers/2003-May/000695.html explains a bit. -- Thomas 'Freaky' Hurst http://hur.st/ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 19:55: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 27B3216A4DE for ; Mon, 7 Aug 2006 19:55:18 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 1843F43D46 for ; Mon, 7 Aug 2006 19:55:16 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 40711 invoked by uid 1026); 7 Aug 2006 19:57:11 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 0.205598 secs); 07 Aug 2006 19:57:11 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 7 Aug 2006 19:57:11 -0000 From: Niki Denev To: John-Mark Gurney Date: Mon, 7 Aug 2006 22:51:59 +0300 User-Agent: KMail/1.9.3 References: <44D3C333.3030702@cytexbg.com> <200608072203.56320.nike_d@cytexbg.com> <20060807194337.GD99774@funkthat.com> In-Reply-To: <20060807194337.GD99774@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608072251.59882.nike_d@cytexbg.com> 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: Mon, 07 Aug 2006 19:55:18 -0000 On Monday 07 August 2006 22:43, John-Mark Gurney wrote: > 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.... > > Good luck! I have both DRIVER_MODULE lines, and i can access the card. And I experience lot of kernel panics, as i'm slowly learning about the kernel internals :) Thanks! --niki From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 20:14: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 DA1BE16A4E1 for ; Mon, 7 Aug 2006 20:14:38 +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 40BDB43D64 for ; Mon, 7 Aug 2006 20:14:30 +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 k77KETP3038252 for ; Mon, 7 Aug 2006 15:14:30 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D79F38.4060404@centtech.com> Date: Mon, 07 Aug 2006 15:14:48 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: FreeBSD Hackers References: <44D77D70.1030508@centtech.com> <20060807194923.GA20676@voi.aagh.net> In-Reply-To: <20060807194923.GA20676@voi.aagh.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1639/Mon Aug 7 08:34:09 2006 on mh2.centtech.com X-Virus-Status: Clean Subject: Re: ollecting pv entries -- suggest increasing PMAP_SHPGPERPROC 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, 07 Aug 2006 20:14:38 -0000 On 08/07/06 14:49, Thomas Hurst wrote: > * Eric Anderson (anderson@centtech.com) wrote: > >> I saw these two warnings come up soon after rebooting a server >> (running 5-STABLE): >> >> kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC >> kernel: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC >> >> I see there is a tunable for tweaking, but I'm not certain what I'm >> really tweaking. Any hints or guidelines? > > PV entries are related to the amount of memory that's shared between > processes. > > http://lists.freebsd.org/pipermail/freebsd-hackers/2003-May/000695.html > explains a bit. > Thanks, that answered my question perfectly! Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 21:06: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 F1CB816A4DA for ; Mon, 7 Aug 2006 21:06:49 +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 781CE43D49 for ; Mon, 7 Aug 2006 21:06:49 +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 83D0033C6A for ; Tue, 8 Aug 2006 01:06:48 +0400 (MSD) Message-ID: <44D7AD15.90107@inse.ru> Date: Tue, 08 Aug 2006 01:13:57 +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: freebsd-hackers@freebsd.org References: <20060731203213.GA75233@hades.panopticon> <864pwtoorp.fsf@xps.des.no> <20060806145954.GC907@hades.panopticon> <200608071509.08923.jhb@freebsd.org> In-Reply-To: <200608071509.08923.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: absolute vs. relative offsets in disklabel 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, 07 Aug 2006 21:06:50 -0000 John Baldwin: >On Sunday 06 August 2006 10:59, Dmitry Marakasov wrote: > > >>* Dag-Erling Sm?rgrav (des@des.no) wrote: >> >> >>>>Recent `disklabel differences FreeBSD, DragonFly' thread gave me a >>>>thought - why do we have absolute offsets in disklabel? >>>> >>>> >>>We don't, AFAIK. Since the transition to GEOM, the offsets are >>>relative to the start of the containing provider. >>> >>> >>It has nothing to do with GEOM, it's ondisk format of disklabel. I've >>confirmed, there are global offsets. >> >> > >Actually, the GEOM provider goes though some gymnastics to portray the offsets >as relative to userland, but ondisk they are still stored as absolute to >preserve compatiblity. > > You mean that "read mbroffset" to geom could return a relative value? rik From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 21:21:46 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 7868916A4DD for ; Mon, 7 Aug 2006 21:21:46 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 32D6B43D46 for ; Mon, 7 Aug 2006 21:21:44 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 64892 invoked by uid 1026); 7 Aug 2006 21:23:39 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 0.169765 secs); 07 Aug 2006 21:23:39 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 7 Aug 2006 21:23:39 -0000 From: Niki Denev To: John Baldwin Date: Tue, 8 Aug 2006 00:18:29 +0300 User-Agent: KMail/1.9.3 References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> In-Reply-To: <200608071527.50711.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608080018.29945.nike_d@cytexbg.com> Cc: freebsd-hackers@freebsd.org Subject: Re: jkh weird problem (reading pci device memory) 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, 07 Aug 2006 21:21:46 -0000 On Monday 07 August 2006 22:27, John Baldwin wrote: > On Saturday 05 August 2006 10:06, Niki Denev wrote: > > for(i=0; i < sizeof(config_table_t); i++) { > > r = bus_space_read_1(sc->bar.tag, sc->bar.hdl, i); > > *((u_int8_t *)&sc->cfg_table + i) = r; > > } > > Note that you can replace this with: > > bus_space_read_multi_1(sc->bar.tag, sc->bar.hdl, 0, > (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); > I tried this, but for some reason it gave me different result than the loop i'm using right now. maybe i'm not doing something right, i'll check again. > However, if you are really reading in a table with more than just chars, > you might want to read the individual fields and byteswap them as needed > (if you care about portability to a big-endian arch like sparc). That is, > if your device stores the table as little-endian and you had: > > typedef struct _config_table { > uint32_t signature; > uint16_t version; > uint8_t dummy; > } config_table_t; > > You would do this instead: > > sc->cfg_table.signature = letoh32(bus_read_4(sc->bar.res, 0)); > sc->cfg_table.version = letoh16(bus_read_2(sc->bar.res, 4)); > sc->cfg_table.dummy = bus_read_1(sc->bar.res, 5); Yes, i'm aware of this problem, and if everything goes well i will try to make it big-endian friendly, but for now it's easier for me to deal with less code :) > > (Note this also uses the shorter bus_read functions which just take a > struct resouce *.) > Cool! this looks much more convenient. Maybe they must be noted in the manual page? > I have no idea why the printf's make a difference, unless perhaps your card > needs a bit of a delay after it is inserted before it's firmware is fully > up and running. In that case you might want to insert a delay. Something > like this: > Thanks! The card really needed a delay to setup it's memory right, and i was reading it too soon. (which is also a mistake, because in the original linux driver the config table read is done later from the interrupt handler, when the card has had the time to init it's memory properly.) > /* XXX: Doesn't it want to print rman_get_size() / 1024 instead? */ > device_printf(dev, "card has %uKB memory\n", sc->card_type); the "KB" suffix here is a typo :-/ > count = 0; > while (letoh32(bus_read_4(sc->bar.res, 0)) != CONFIG_MAGIC) { > /* If it's not up after a half-second, give up. */ > if (count > 50) { > device_printf(dev, "ConfigTable Bad!\n"); > return (ENXIO); > } > count++; > > /* Wait 10 ms. */ > DELAY(10000); > } Thanks for the useful info! Best Regards, Niki Denev From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 21:54: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 BF89F16A4DA for ; Mon, 7 Aug 2006 21:54:44 +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 06E9443D55 for ; Mon, 7 Aug 2006 21:54: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 k77LsZiQ039316; Mon, 7 Aug 2006 17:54:35 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Kurakin Date: Mon, 7 Aug 2006 17:41:24 -0400 User-Agent: KMail/1.9.1 References: <20060731203213.GA75233@hades.panopticon> <200608071509.08923.jhb@freebsd.org> <44D7AB21.8080303@inse.ru> In-Reply-To: <44D7AB21.8080303@inse.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608071741.24844.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, 07 Aug 2006 17:54:35 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1639/Mon Aug 7 09:34:09 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org, Dmitry Marakasov , Dag-Erling Sm?rgrav Subject: Re: absolute vs. relative offsets in disklabel 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, 07 Aug 2006 21:54:44 -0000 On Monday 07 August 2006 17:05, Roman Kurakin wrote: > John Baldwin: > > >On Sunday 06 August 2006 10:59, Dmitry Marakasov wrote: > > > > > >>* Dag-Erling Sm?rgrav (des@des.no) wrote: > >> > >> > >>>>Recent `disklabel differences FreeBSD, DragonFly' thread gave me a > >>>>thought - why do we have absolute offsets in disklabel? > >>>> > >>>> > >>>We don't, AFAIK. Since the transition to GEOM, the offsets are > >>>relative to the start of the containing provider. > >>> > >>> > >>It has nothing to do with GEOM, it's ondisk format of disklabel. I've > >>confirmed, there are global offsets. > >> > >> > >Actually, the GEOM provider goes though some gymnastics to portray the offsets > >as relative to userland, but ondisk they are still stored as absolute to > >preserve compatiblity. > > > > > You mean that "read mbroffset" to geom could return a relative value? No, this is specific to the BSD label class, not something GEOM does in general. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 7 22:05: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 53E7116A4DE; Mon, 7 Aug 2006 22:05:52 +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 CC03A43D69; Mon, 7 Aug 2006 22:05:51 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (urrj39rygb7s74oq@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k77M5pgs044318; Mon, 7 Aug 2006 15:05:51 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k77M5pMW044317; Mon, 7 Aug 2006 15:05:51 -0700 (PDT) (envelope-from jmg) Date: Mon, 7 Aug 2006 15:05:51 -0700 From: John-Mark Gurney To: John Baldwin Message-ID: <20060807220550.GF99774@funkthat.com> Mail-Followup-To: John Baldwin , freebsd-hackers@freebsd.org References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608071527.50711.jhb@freebsd.org> 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: jkh weird problem (reading pci device memory) 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, 07 Aug 2006 22:05:52 -0000 John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: > sc->cfg_table.signature = letoh32(bus_read_4(sc->bar.res, 0)); > sc->cfg_table.version = letoh16(bus_read_2(sc->bar.res, 4)); > sc->cfg_table.dummy = bus_read_1(sc->bar.res, 5); Note that this may or may not be correct... the bus_read_X macros do endian conversion if the bus is of different endianness than the processor arch... So if the device is on a PCI bus, and the machine is sparc64, the bus_read_X will already be swapped as necessary... If you don't want the byte swapping to be done for you, there are the _stream versions... The are useful for transfering data like disk data that needs to maintain the same order... -- 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 Tue Aug 8 01:12: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 C93C916A4DA; Tue, 8 Aug 2006 01:12:11 +0000 (UTC) (envelope-from adamsmithx@hotmail.com) Received: from bay0-omc1-s3.bay0.hotmail.com (bay0-omc1-s3.bay0.hotmail.com [65.54.246.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DCF443D45; Tue, 8 Aug 2006 01:12:11 +0000 (GMT) (envelope-from adamsmithx@hotmail.com) Received: from hotmail.com ([207.46.11.117]) by bay0-omc1-s3.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 7 Aug 2006 18:10:43 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 7 Aug 2006 18:10:42 -0700 Message-ID: Received: from 207.46.11.123 by by123fd.bay123.hotmail.msn.com with HTTP; Tue, 08 Aug 2006 01:10:41 GMT X-Originating-IP: [66.93.45.209] X-Originating-Email: [adamsmithx@hotmail.com] X-Sender: adamsmithx@hotmail.com From: "Joseph Maxwell" To: freebsd-hackers@freebsd.org, freebsd-questions-request@freebsd.org, freebsd-fs@freebsd.org Date: Mon, 07 Aug 2006 18:10:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 08 Aug 2006 01:10:42.0874 (UTC) FILETIME=[7853B1A0:01C6BA87] Cc: Subject: NFS Problems 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, 08 Aug 2006 01:12:11 -0000 Hope I have the right site here Hello, Indigo2 machine in network w/ FreeBSD, both configured for nfs server/client functions, and "nfsd" daemon running on both. IRIX idaho 6.5 04101930 IP22 FreeBSD presto 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000 jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC i386 (Yes an old system inst. on an infrequently used critical and stable point in our system. Not eager to perturb.) FreeBSD machine mounts IRIX disks OK, but Indigo2 does not mount FreeBSD disks. Changed to manual approach Setup fstab: /dev/root / xfs rw,raw=/dev/rroot 0 0 /dev/dsk/dks0d2s7 /disk_02/ xfs rw 0 0 /swap/swap1 swap swap pri=2 0 0 /vswap/vswap1 swap swap pri=5,vlength=409600 0 0 /vswap/vswap2 swap swap pri=5,vlength=1024000 0 0 presto:/usr /diskA-1 nfs soft,rw 0 0 presto:/disk2 /diskA-2 nfs soft,rw 0 0 Then attempted to mount presto disks mount -h presto -v mount: presto:/disk2 server not responding: Port mapper failure - Timed out mount: NFS version 3 mount failed, trying NFS version 2 mount: retrying /diskA-2 mount: NFS version 3 mount failed, trying NFS version 2 mount: NFS version 3 mount failed, trying NFS version 2 mount: NFS version 3 mount failed, trying NFS version 2 mount: NFS version 3 mount failed, trying NFS version 2 Could someone identify problem & suggest corrective action? Thanks ---------------------------------------------------------------------------- Hello, FreeBSD machine in network w/ Indigo2 SGI machine, both configured for nfs server/client functions, and "nfsd" daemon running on both. FreeBSD presto 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000 jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC i386 IRIX idaho 6.5 04101930 IP22 FreeBSD machine mounts IRIX disks OK, but Indigo2 does not mount FreeBSD disks. Found couple of problems w/ FreeBSD, portmap, mountd etc. don't know if I have them all corrected but SGI machine cannot mount FreeBSD disks ------------------ >From FreeBSD machine: In rc.conf ==> nfs_client_enable="YES" nfs_server_enable="YES" ------------------ >From FreeBSD machine: cat /etc/exports /usr -alldirs idaho /disk2 -alldirs idaho ------------------ >From SGI machine rpcinfo -p presto program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100005 3 udp 997 mountd 100005 3 tcp 1021 mountd 100005 1 udp 997 mountd 100005 1 tcp 1021 mountd >From FreeBSD machine rpcinfo -p idaho program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100024 1 udp 798 status 100024 1 tcp 800 status 100021 1 udp 2049 nlockmgr 100021 3 udp 2049 nlockmgr 100021 4 udp 2049 nlockmgr 100021 1 tcp 2049 nlockmgr 100021 3 tcp 2049 nlockmgr 100021 4 tcp 2049 nlockmgr 100005 1 tcp 1024 mountd 100005 3 tcp 1024 mountd 100005 1 udp 1026 mountd 100005 3 udp 1026 mountd 391004 1 tcp 1025 391004 1 udp 1027 100001 1 udp 1028 rstatd 100001 2 udp 1028 rstatd 100001 3 udp 1028 rstatd 100008 1 udp 1029 walld 100002 1 udp 1030 rusersd 100011 1 udp 1031 rquotad 100012 1 udp 1032 sprayd 391011 1 tcp 1026 391002 1 tcp 1027 391002 2 tcp 1027 391006 1 udp 1033 391029 1 tcp 1028 100083 1 tcp 1029 ttdbserver 391017 1 tcp 889 -------------- mutual enerties of each are in each others /etc/hosts and /etc/host.allow files >From fstab on SGI machine: ......... ......... presto:/usr /diskA-1 nfs soft,rw 0 0 presto:/disk2 /diskA-2 nfs soft,rw 0 0 ------------------ Attempts at mounting presto disks from SGI machine idaho ==> mount -h idaho -v mount: NFS version 3 mount failed, trying NFS version 2. mount: idaho:/disk2 on /diskA-2: Connection timed out mount: retrying /diskA-2 mount: unknown filesystem type: nfs mount: giving up on: /diskA-2 ------------------ Could someone suggest something else to look at, identify problem & suggest corrective action? Thanks _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 01:17: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 A0B6B16A4DF; Tue, 8 Aug 2006 01:17:55 +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 3994F43D6B; Tue, 8 Aug 2006 01:17:45 +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 A6689EB3C3B; Tue, 8 Aug 2006 09:17:43 +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 juJ8zAv+kTTp; Tue, 8 Aug 2006 09:17:41 +0800 (CST) Received: from [10.217.12.96] (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 2A31BEB267E; Tue, 8 Aug 2006 09:17:40 +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=cY0ViI/jWKe6k2sgK5r78BXlkFshYxdvan/w+FhZoOA+WkX9H9oiTtZ/ZHFNq46GP k7wVcHA7pxGav1qiaOxSQ== From: Xin LI To: Joseph Maxwell In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-9cH1HVtFJYAyiVFlovfs" Organization: The FreeBSD Project Date: Tue, 08 Aug 2006 09:17:25 +0800 Message-Id: <1154999845.927.2.camel@spirit> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 FreeBSD GNOME Team Port Cc: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org, freebsd-questions-request@freebsd.org Subject: Re: NFS Problems 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, 08 Aug 2006 01:17:55 -0000 --=-9cH1HVtFJYAyiVFlovfs Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, =E5=9C=A8 2006-08-07=E4=B8=80=E7=9A=84 18:10 -0700=EF=BC=8CJoseph Maxwell= =E5=86=99=E9=81=93=EF=BC=9A > >From FreeBSD machine: > In rc.conf =3D=3D> > nfs_client_enable=3D"YES" > nfs_server_enable=3D"YES" > ------------------ [...] > >From fstab on SGI machine: > ......... > ......... > presto:/usr /diskA-1 nfs soft,rw 0 0 > presto:/disk2 /diskA-2 nfs soft,rw 0 0 > ------------------ > Attempts at mounting presto disks from SGI machine idaho =3D=3D> > mount -h idaho -v > mount: NFS version 3 mount failed, trying NFS version 2. > mount: idaho:/disk2 on /diskA-2: Connection timed out > mount: retrying > /diskA-2 > mount: unknown filesystem type: nfs > mount: giving up on: > /diskA-2 > ------------------ >=20 > Could someone suggest something else to look at, identify problem & sugge= st=20 > corrective action? Have you tried some other combinations, for instance, using TCP mounts? Sometimes that would be a good workaround for NFS mounting issues... Cheers, --=20 Xin LI http://www.delphij.net/ --=-9cH1HVtFJYAyiVFlovfs 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) iD8DBQBE1+YlhcUczkLqiksRAnt1AKCfOuIA1knHIQLSfp3vMeahBeGSvgCgvgPQ pgOXjXRO1sOF8F4sSoybDKI= =O94k -----END PGP SIGNATURE----- --=-9cH1HVtFJYAyiVFlovfs-- From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 10:05: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 6DD5F16A4E6 for ; Tue, 8 Aug 2006 10:05:21 +0000 (UTC) (envelope-from shriek.007@gmail.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 0A8D543D66 for ; Tue, 8 Aug 2006 10:05:13 +0000 (GMT) (envelope-from shriek.007@gmail.com) Received: by nf-out-0910.google.com with SMTP id g2so217142nfe for ; Tue, 08 Aug 2006 03:05: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:mime-version:content-type; b=uGbfM75mmnHpfRI7Gu+VUXmBdZL09ajOojGslO2inHU7IHMjC8OvaYWHhpvsQRb6XZVCqHsu2oRa66q6fmeNMnRtxV9SgRNCiPPt2BFIPfWpV4R/VlmMWEgPGO/ZenfVTQeKXXV0utJSAuDAjRSm28vznf57fbkYZiupZQDiLdw= Received: by 10.78.175.8 with SMTP id x8mr2685305hue; Tue, 08 Aug 2006 03:05:12 -0700 (PDT) Received: by 10.78.118.14 with HTTP; Tue, 8 Aug 2006 03:05:12 -0700 (PDT) Message-ID: <3ce33f6c0608080305p1ea53072hfb5478de91c4f029@mail.gmail.com> Date: Tue, 8 Aug 2006 15:35:12 +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 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to debug a daemon during its initialization :: gdb 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, 08 Aug 2006 10:05:21 -0000 I need to use gdb to check some initialization functions which are called during the time when the daemon is stopped and restarted ... I usually do gdb but this will not help when I am stopping the daemon and then restarting ... how do I use gdb to this effect ? From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 11: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 0455F16A4E5; Tue, 8 Aug 2006 11:24:35 +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 5037143D55; Tue, 8 Aug 2006 11:24:33 +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 k78BOWPE094225; Tue, 8 Aug 2006 06:24:33 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D87483.8090308@centtech.com> Date: Tue, 08 Aug 2006 06:24:51 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Joseph Maxwell References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1640/Mon Aug 7 20:11:04 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org, freebsd-questions-request@freebsd.org Subject: Re: NFS Problems 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, 08 Aug 2006 11:24:35 -0000 On 08/07/06 20:10, Joseph Maxwell wrote: > Hope I have the right site here > > Hello, > > Indigo2 machine in network w/ FreeBSD, both configured for nfs server/client > functions, and "nfsd" daemon running on both. > > IRIX idaho 6.5 04101930 IP22 > > FreeBSD presto 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT > 2000 jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC i386 > (Yes an old system inst. on an infrequently used critical and stable point > in our system. Not eager to perturb.) > > FreeBSD machine mounts IRIX disks OK, but Indigo2 does not mount FreeBSD > disks. > > Changed to manual approach > > Setup fstab: > /dev/root / xfs rw,raw=/dev/rroot 0 0 > /dev/dsk/dks0d2s7 /disk_02/ xfs rw 0 0 > /swap/swap1 swap swap pri=2 0 0 > /vswap/vswap1 swap swap pri=5,vlength=409600 0 0 > /vswap/vswap2 swap swap pri=5,vlength=1024000 0 0 > presto:/usr /diskA-1 nfs soft,rw 0 0 > presto:/disk2 /diskA-2 nfs soft,rw 0 0 > > Then attempted to mount presto disks > mount -h presto -v > mount: presto:/disk2 server not responding: Port mapper failure - Timed out > mount: NFS version 3 mount failed, trying NFS version 2 > mount: retrying > /diskA-2 > mount: NFS version 3 mount failed, trying NFS version 2 > mount: NFS version 3 mount failed, trying NFS version 2 > mount: NFS version 3 mount failed, trying NFS version 2 > mount: NFS version 3 mount failed, trying NFS version 2 > > Could someone identify problem & suggest corrective action? [..snip..] >>From SGI machine > rpcinfo -p presto > program vers proto port > 100000 2 tcp 111 portmapper > 100000 2 udp 111 portmapper > 100005 3 udp 997 mountd > 100005 3 tcp 1021 mountd > 100005 1 udp 997 mountd > 100005 1 tcp 1021 mountd I think the problem is that you are missing the nfs registrations (and possibly rstatd and nlockmgr too if you need them). I think you can do: nfsd -r to re-register the entries in rpc. You should check the process list on presto and see if nfsd is running, and also check for rstatd, and lockd. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 17:09: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 977E216A4E7 for ; Tue, 8 Aug 2006 17:09:45 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from multiplay.co.uk (core6.multiplay.co.uk [85.236.96.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F30043D73 for ; Tue, 8 Aug 2006 17:09:40 +0000 (GMT) (envelope-from killing@multiplay.co.uk) Received: from vader ([212.135.219.179]) by multiplay.co.uk (multiplay.co.uk [85.236.96.23]) (MDaemon PRO v9.0.1) with ESMTP id md50002862609.msg for ; Tue, 08 Aug 2006 18:09:41 +0100 Message-ID: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> From: "Steven Hartland" To: Date: Tue, 8 Aug 2006 18:09:19 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Spam-Processed: multiplay.co.uk, Tue, 08 Aug 2006 18:09:41 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 212.135.219.179 X-Return-Path: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org X-MDAV-Processed: multiplay.co.uk, Tue, 08 Aug 2006 18:09:42 +0100 Subject: Adding remove file option to BSD tar? 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, 08 Aug 2006 17:09:45 -0000 What do people think about adding an equivalent to gtars --remove-files? Its an option I find myself longing for on a regular basis and hence end up installing gtar and using that which kind of defeats the point of having bsd tar. So what do people think about adding this option? Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 17:31: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 10EA716A4DF for ; Tue, 8 Aug 2006 17:31:55 +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 8571543D4C for ; Tue, 8 Aug 2006 17:31:54 +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 k78HVqAD041828; Tue, 8 Aug 2006 12:31:52 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D8CA9B.6070306@centtech.com> Date: Tue, 08 Aug 2006 12:32:11 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Steven Hartland References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> In-Reply-To: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1640/Mon Aug 7 20:11:04 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 08 Aug 2006 17:31:55 -0000 On 08/08/06 12:09, Steven Hartland wrote: > What do people think about adding an equivalent to > gtars --remove-files? > > Its an option I find myself longing for on a regular > basis and hence end up installing gtar and using that > which kind of defeats the point of having bsd tar. > > So what do people think about adding this option? > > Steve Some people on this list might argue that you could do this another way, something like piping a tar extract to another tar create that excludes that file. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 18:02: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 3804416A512 for ; Tue, 8 Aug 2006 18:02:08 +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 4CD7643D45 for ; Tue, 8 Aug 2006 18:02:07 +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 k78I1vku051917; Tue, 8 Aug 2006 14:02:05 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: John-Mark Gurney Date: Tue, 8 Aug 2006 13:42:51 -0400 User-Agent: KMail/1.9.1 References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> <20060807220550.GF99774@funkthat.com> In-Reply-To: <20060807220550.GF99774@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608081342.51800.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]); Tue, 08 Aug 2006 14:02:06 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1640/Mon Aug 7 21:11:04 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: jkh weird problem (reading pci device memory) 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, 08 Aug 2006 18:02:08 -0000 On Monday 07 August 2006 18:05, John-Mark Gurney wrote: > John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: > > sc->cfg_table.signature = letoh32(bus_read_4(sc->bar.res, 0)); > > sc->cfg_table.version = letoh16(bus_read_2(sc->bar.res, 4)); > > sc->cfg_table.dummy = bus_read_1(sc->bar.res, 5); > > Note that this may or may not be correct... the bus_read_X macros > do endian conversion if the bus is of different endianness than the > processor arch... So if the device is on a PCI bus, and the machine > is sparc64, the bus_read_X will already be swapped as necessary... If > you don't want the byte swapping to be done for you, there are the > _stream versions... The are useful for transfering data like disk > data that needs to maintain the same order... Then why are folks adding these macros to things like mpt? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 18:50: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 CB4FD16A4DE for ; Tue, 8 Aug 2006 18:50:36 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from multiplay.co.uk (core6.multiplay.co.uk [85.236.96.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB95C43D5E for ; Tue, 8 Aug 2006 18:50:24 +0000 (GMT) (envelope-from killing@multiplay.co.uk) Received: from vader ([212.135.219.179]) by multiplay.co.uk (multiplay.co.uk [85.236.96.23]) (MDaemon PRO v9.0.1) with ESMTP id md50002862916.msg for ; Tue, 08 Aug 2006 19:49:53 +0100 Message-ID: <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> From: "Steven Hartland" To: "Eric Anderson" References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> <44D8CA9B.6070306@centtech.com> Date: Tue, 8 Aug 2006 19:49:32 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Spam-Processed: multiplay.co.uk, Tue, 08 Aug 2006 19:49:53 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 212.135.219.179 X-Return-Path: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org X-MDAV-Processed: multiplay.co.uk, Tue, 08 Aug 2006 19:49:54 +0100 Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 08 Aug 2006 18:50:36 -0000 ----- Original Message ----- From: "Eric Anderson" > Some people on this list might argue that you could do this another way, > something like piping a tar extract to another tar create that excludes > that file. Sure that can be done but its a PITA and majorly slow so a none option IMO. Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 19:23: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 5E17116A4DE for ; Tue, 8 Aug 2006 19:23:39 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 4337243D6B for ; Tue, 8 Aug 2006 19:23:37 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 37571 invoked by uid 1026); 8 Aug 2006 19:25:34 -0000 Received: from 213.145.98.14 by office.suresupport.com (envelope-from , uid 1004) with qmail-scanner-1.23 (f-prot: 4.4.2/3.14.11. Clear:RC:1(213.145.98.14):. Processed in 0.119829 secs); 08 Aug 2006 19:25:34 -0000 Received: from unknown (HELO ndenev.office.suresupport.com) (213.145.98.14) by office.suresupport.com with SMTP; 8 Aug 2006 19:25:33 -0000 From: Niki Denev To: freebsd-hackers@freebsd.org Date: Tue, 8 Aug 2006 22:20:24 +0300 User-Agent: KMail/1.9.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608082220.25048.nike_d@cytexbg.com> Subject: provide ttys from device driver 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, 08 Aug 2006 19:23:39 -0000 Hi, The cardbus hsdpa/umts adapter which driver i'm trying to port from linux to\ freebsd should look as four port serial device. The part of the driver that speaks with the hardware is more or less ready and working, i have setup a interrupt handler and can talk to the card and catch and service interrupts. Now the tricky part is to connect this to the tty layer... So, what is the best place to look for examples to provide ttys from a device driver? (apart from reading the code of existing serial drivers, which i'm doing right now :) ) Thanks! --niki From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 20:18: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 F3BEE16A4DA for ; Tue, 8 Aug 2006 20:18: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 28C1A43D79 for ; Tue, 8 Aug 2006 20:18: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 k78KIcKl069125; Tue, 8 Aug 2006 15:18:38 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D8F1B0.1000407@centtech.com> Date: Tue, 08 Aug 2006 15:18:56 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Steven Hartland References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> <44D8CA9B.6070306@centtech.com> <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> In-Reply-To: <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1640/Mon Aug 7 20:11:04 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 08 Aug 2006 20:18:41 -0000 On 08/08/06 13:49, Steven Hartland wrote: > ----- Original Message ----- > From: "Eric Anderson" >> Some people on this list might argue that you could do this another way, >> something like piping a tar extract to another tar create that excludes >> that file. > > Sure that can be done but its a PITA and majorly slow > so a none option IMO. > > Steve Yep, agreed.. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 8 20:27:27 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 05EA616A4E1 for ; Tue, 8 Aug 2006 20:27:27 +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 7505C43D49 for ; Tue, 8 Aug 2006 20:27:25 +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 8084433C66; Wed, 9 Aug 2006 00:27:24 +0400 (MSD) Message-ID: <44D8F550.6060004@inse.ru> Date: Wed, 09 Aug 2006 00:34:24 +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: Niki Denev References: <200608082220.25048.nike_d@cytexbg.com> In-Reply-To: <200608082220.25048.nike_d@cytexbg.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: provide ttys from device driver 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, 08 Aug 2006 20:27:27 -0000 Niki Denev: >Hi, > >The cardbus hsdpa/umts adapter which driver i'm trying to port from linux to\ > freebsd should look as four port serial device. >The part of the driver that speaks with the hardware is more or less ready and >working, i have setup a interrupt handler and can talk to the card and catch >and service interrupts. >Now the tricky part is to connect this to the tty layer... >So, what is the best place to look for examples to provide ttys from a device >driver? (apart from reading the code of existing serial drivers, which i'm >doing right now :) ) > > Check smth like ng_tty. >Thanks! > >--niki >_______________________________________________ >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 8 20:33: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 8AAC716A4DD for ; Tue, 8 Aug 2006 20:33:57 +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 68DFE43D93 for ; Tue, 8 Aug 2006 20:33:40 +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 0699333C66; Wed, 9 Aug 2006 00:33:39 +0400 (MSD) Message-ID: <44D8F6CD.5070307@inse.ru> Date: Wed, 09 Aug 2006 00:40:45 +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: Steven Hartland References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> <44D8CA9B.6070306@centtech.com> <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> In-Reply-To: <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 08 Aug 2006 20:33:57 -0000 Steven Hartland: > ----- Original Message ----- From: "Eric Anderson" > > >> Some people on this list might argue that you could do this another >> way, something like piping a tar extract to another tar create that >> excludes that file. > > > Sure that can be done but its a PITA and majorly slow > so a none option IMO. In case one concerned by the space problem there is now other way to do it failsafe. In case it is gziped it need to be extracted first in any case. rik > > Steve > > > ================================================ > This e.mail is private and confidential between Multiplay (UK) Ltd. > and the person or entity to whom it is addressed. In the event of > misdirection, the recipient is prohibited from using, copying, > printing or otherwise disseminating it or any information contained in > it. > In the event of misdirection, illegible or incomplete transmission > please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. > > _______________________________________________ > 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 8 21:01: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 4E92D16A4DE; Tue, 8 Aug 2006 21:01:00 +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 E90B043D64; Tue, 8 Aug 2006 21:00:47 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (8vrpm0g9aq64ap8l@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k78L0k6H064175; Tue, 8 Aug 2006 14:00:46 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k78L0kYY064174; Tue, 8 Aug 2006 14:00:46 -0700 (PDT) (envelope-from jmg) Date: Tue, 8 Aug 2006 14:00:46 -0700 From: John-Mark Gurney To: John Baldwin Message-ID: <20060808210046.GH99774@funkthat.com> Mail-Followup-To: John Baldwin , freebsd-hackers@freebsd.org References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> <20060807220550.GF99774@funkthat.com> <200608081342.51800.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608081342.51800.jhb@freebsd.org> 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: jkh weird problem (reading pci device memory) 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: Tue, 08 Aug 2006 21:01:00 -0000 John Baldwin wrote this message on Tue, Aug 08, 2006 at 13:42 -0400: > On Monday 07 August 2006 18:05, John-Mark Gurney wrote: > > John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: > > > sc->cfg_table.signature = letoh32(bus_read_4(sc->bar.res, 0)); > > > sc->cfg_table.version = letoh16(bus_read_2(sc->bar.res, 4)); > > > sc->cfg_table.dummy = bus_read_1(sc->bar.res, 5); > > > > Note that this may or may not be correct... the bus_read_X macros > > do endian conversion if the bus is of different endianness than the > > processor arch... So if the device is on a PCI bus, and the machine > > is sparc64, the bus_read_X will already be swapped as necessary... If > > you don't want the byte swapping to be done for you, there are the > > _stream versions... The are useful for transfering data like disk > > data that needs to maintain the same order... > > Then why are folks adding these macros to things like mpt? I haven't seen the patches for mpt, but usually they are only doing the byte swapping to data structures that are to be dma'd to/from the card... As when dma happens, there is no byte swapping done.. -- 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 Tue Aug 8 21:24: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 8F1F016A4DD for ; Tue, 8 Aug 2006 21:24:16 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from multiplay.co.uk (core6.multiplay.co.uk [85.236.96.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76AC743D46 for ; Tue, 8 Aug 2006 21:24:14 +0000 (GMT) (envelope-from killing@multiplay.co.uk) Received: from vader ([212.135.219.179]) by multiplay.co.uk (multiplay.co.uk [85.236.96.23]) (MDaemon PRO v9.0.1) with ESMTP id md50002863295.msg for ; Tue, 08 Aug 2006 22:23:33 +0100 Message-ID: <0c0701c6bb30$df405f40$b3db87d4@multiplay.co.uk> From: "Steven Hartland" To: "Roman Kurakin" References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> <44D8CA9B.6070306@centtech.com> <024d01c6bb1b$68e53240$b3db87d4@multiplay.co.uk> <44D8F6CD.5070307@inse.ru> Date: Tue, 8 Aug 2006 22:23:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Spam-Processed: multiplay.co.uk, Tue, 08 Aug 2006 22:23:33 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 212.135.219.179 X-Return-Path: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org X-MDAV-Processed: multiplay.co.uk, Tue, 08 Aug 2006 22:23:34 +0100 Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 08 Aug 2006 21:24:16 -0000 ----- Original Message ----- From: "Roman Kurakin" > In case one concerned by the space problem there is now other way to > do it failsafe. > In case it is gziped it need to be extracted first in any case. Sorry dont follow you there? Are you talking about issues of deleting the files before successful creation of the archive can be confirmed? If so this an implementation decision and should not be allowed to cloud the issue. Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 02:46: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 5B39816A4DA for ; Wed, 9 Aug 2006 02:46:03 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16BA143D46 for ; Wed, 9 Aug 2006 02:46:02 +0000 (GMT) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.221] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id k792k1Fh001398; Tue, 8 Aug 2006 19:46:02 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <44D94C69.1030901@freebsd.org> Date: Tue, 08 Aug 2006 19:46:01 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steven Hartland References: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> In-Reply-To: <020701c6bb0d$68ae7330$b3db87d4@multiplay.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Adding remove file option to BSD tar? 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, 09 Aug 2006 02:46:03 -0000 Steven Hartland wrote: > What do people think about adding an equivalent to > gtars --remove-files? Shouldn't be too tricky. If you think you know how to implement it, send me the diffs. Doing this "safely" is nearly impossible, of course. In the compressed case, the compression pipeline buffers a LOT of data (bzip2 analyzes 900k blocks at a time). But even in the uncompressed case, archive blocking means that you CANNOT flush the archive after every file. A "safe" implementation would have to defer the actual deletion for a long time. Even without that, though, this is the sort of feature that many people would no doubt find useful. Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 04:23: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 5520C16A4DA for ; Wed, 9 Aug 2006 04:23:00 +0000 (UTC) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from correo.novusordo.net (cdjj.org [216.194.85.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 013FE43D46 for ; Wed, 9 Aug 2006 04:22:57 +0000 (GMT) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from [192.168.2.100] (S010600c049bda6b5.ed.shawcable.net [68.149.198.157]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by correo.novusordo.net (Postfix) with ESMTP id 6FEE311523; Tue, 8 Aug 2006 22:22:56 -0600 (MDT) In-Reply-To: <1154876916.5303.7.camel@berloga.shadowland> References: <1154876916.5303.7.camel@berloga.shadowland> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <05B49B1A-C425-41BC-8676-AE6AEE29DF09@novusordo.net> Content-Transfer-Encoding: 7bit From: Chris Jones Date: Tue, 8 Aug 2006 22:22:18 -0600 To: Alex Lyashkov X-Mailer: Apple Mail (2.752.2) Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Jail Memory Limits 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, 09 Aug 2006 04:23:00 -0000 On 6-Aug-06, at 9:08 AM, Alex Lyashkov wrote: > I read you patch and see you start N kernel threads for control > memory/CPU usage, when each thread in loop count total memory usage. > What are reason why not create memory limit similar limit(1)? > for this need add pointer to prison structure at each VMA struct > and add > few checks at same points when LIMIT_VMEM and LIMIT_RSS checks. Hi, Alex --- there are a few reasons I chose not to do it that way: First, I think it makes more sense to limit memory over the jail as a whole, rather than against whichever process happens to hit the limit first; that suggests that the approach taken by limit(1) is probably not appropriate for my purposes. I could use that as a trigger to launch the "push things out of physical memory" bit, but it seems a bit unnatural to me. (I'm open to persuasion, though.) Second, I think that it's valuable to be able to overcommit memory to some extent; that is, turning this into a soft-ish limit rather than a hard limit. Being able to tune the response time, if you will, of enforcing the limit against a jail means that you could permit one jail to have a more lenient overcommit policy than another. Third, there's precedent for this in other OSes: Solaris implements its resource limits for zones (analogous to jails) in a similar manner. My apologies for not replying to this sooner; I've just got home from a few days' vacation in California, and to have worked on the project (I'm told including correspondence) while there would have not only been illegal for me but (worse!) created some major tax headaches. I look forward to your thoughts. Cheers, Chris From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 06:08: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 447B316A4E0 for ; Wed, 9 Aug 2006 06:08:38 +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 C899643D4C for ; Wed, 9 Aug 2006 06:08:37 +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 k7967FUW021445; Wed, 9 Aug 2006 00:07:15 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 09 Aug 2006 00:07:19 -0600 (MDT) Message-Id: <20060809.000719.-432838874.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200608021437.55500.hselasky@c2i.net> References: <200608021437.55500.hselasky@c2i.net> 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]); Wed, 09 Aug 2006 00:07:15 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: miibus + USB = problem 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, 09 Aug 2006 06:08:38 -0000 In message: <200608021437.55500.hselasky@c2i.net> Hans Petter Selasky writes: : I am currently in the progress of porting "if_aue.c" to my new USB API, and : have hit a problem that needs to be solved. The problem is that the USB : system sleeps under "miibus_xxx". Questions are: : : Is this allowed? Yes. : What locks are held when these functions are called ? Whatever locks are held when they are called :-). miibus is called in the following instances: (1) during probe/attach of children (bus_generic_probe is the typical cause) (2) During the 'tick' routine. The tick routine is called from a timeout typically. In the aue driver, for example, this is done with timeout/untimeout. There's been rumblings for a genric mii /dev entry that can be used for things like kicking off the autonegotiation, etc, but that's not in the tree now, nor is it likely to be soon. The aue driver takes out the AUE_LOCK in these routines, and in detach, it unregisters the timeout. Alas, it is stupid, and does this with the lock held, thus ensuring deadlock if the timeout fires after the lock is acquired, but before the untimeout can complete (meaning that the timeout routine would sleep forever waiting for the lock, oops). This is why you can't run the detach routine locked in most cases. You have to make sure that all other threads have exited, and that can be tricky. : The problem with USB devices, is that the read-register process is very slow. : It can take up to several milliseconds. And if the device is suddenly : detached one has to think about adding exit code everywhere. Yes. One does. There's no such thing as a free lunch in the kernel, alas. : The solution I see with USB devices is something like this: : : if (sc->device_gone) { : : exit mutexes ; : : kthread_exit(0); : } : : Of course I cannot "kthread_exit()" when the call comes from read/write/ioctl, : because there is a stack, that expects a returning call. If the kernel code : was objective C, then maybe one could throw an exception or do something : alike so that the processor gets out of the USB-read procedure. Yes. You can't longjmp your way out of this problem. :-) There's no thread to kill here... : Solutions: : : 1) use USB hardware polling, not releasing any mutexes, simply using DELAY(), : until read/writes complete. That's insanely ugly. : 2) pre-read all read registers regularly. How can I do this with "miibus"? You can't do that either. You have to use the aue 'registers' to read the mii bus management registers. The only way to deal with this is to have all the places that read the registers deal with getting an error. If the device really is dying, you can set a flag so that further reads also return an error to catch places where the code is sloppy and doesn't check the return value. In fact, the aue_csr_read_* routines do exactly this already, and much of the code is written to check for the dying. Apart from the deadlock in the locking unwiding (I'm sure there are others, because we also call if_detach with this lock held...) Warner From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 08:21: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 0E84C16A4DA for ; Wed, 9 Aug 2006 08:21:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B90843D45 for ; Wed, 9 Aug 2006 08:21:53 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.216.87.71] (HELO [10.0.0.249]) by mailfe04.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 249536009; Wed, 09 Aug 2006 10:21:51 +0200 From: Hans Petter Selasky To: "M. Warner Losh" Date: Wed, 9 Aug 2006 10:22:01 +0200 User-Agent: KMail/1.7 References: <200608021437.55500.hselasky@c2i.net> <20060809.000719.-432838874.imp@bsdimp.com> In-Reply-To: <20060809.000719.-432838874.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608091022.02584.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org Subject: Re: miibus + USB = problem 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, 09 Aug 2006 08:21:55 -0000 On Wednesday 09 August 2006 08:07, M. Warner Losh wrote: > In message: <200608021437.55500.hselasky@c2i.net> > > Hans Petter Selasky writes: > : I am currently in the progress of porting "if_aue.c" to my new USB API, > : and have hit a problem that needs to be solved. The problem is that the > : USB system sleeps under "miibus_xxx". Questions are: > : > : Is this allowed? > > Yes. > > : What locks are held when these functions are called ? > > Whatever locks are held when they are called :-). > > miibus is called in the following instances: > > (1) during probe/attach of children (bus_generic_probe is the > typical cause) > (2) During the 'tick' routine. The tick routine is called > from a timeout typically. In the aue driver, for example, > this is done with timeout/untimeout. > > There's been rumblings for a genric mii /dev entry that can be used > for things like kicking off the autonegotiation, etc, but that's not > in the tree now, nor is it likely to be soon. > > The aue driver takes out the AUE_LOCK in these routines, and in > detach, it unregisters the timeout. Alas, it is stupid, and does this > with the lock held, thus ensuring deadlock if the timeout fires after > the lock is acquired, but before the untimeout can complete (meaning > that the timeout routine would sleep forever waiting for the lock, > oops). This is why you can't run the detach routine locked in most > cases. Yes, all of that is gone now. I use "callout_init_mtx()" and that solves the problem, except it does not wait for the last mtx_lock()/mtx_unlock(), in case of a race :-( You need to hold a lock during detach. Else you can risk that the callbacks will re-start functions you have already shut down, like USB transfers, and then you never get detached. > You have to make sure that all other threads have exited, and > that can be tricky. Did you look at the new if_aue, at: http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb/ > > : The problem with USB devices, is that the read-register process is very > : slow. It can take up to several milliseconds. And if the device is > : suddenly detached one has to think about adding exit code everywhere. > > Yes. One does. There's no such thing as a free lunch in the kernel, > alas. > > : The solution I see with USB devices is something like this: > : > : if (sc->device_gone) { > : > : exit mutexes ; > : > : kthread_exit(0); > : } > : > : Of course I cannot "kthread_exit()" when the call comes from > : read/write/ioctl, because there is a stack, that expects a returning > : call. If the kernel code was objective C, then maybe one could throw an > : exception or do something alike so that the processor gets out of the > : USB-read procedure. > > Yes. You can't longjmp your way out of this problem. :-) There's no > thread to kill here... > > : Solutions: > : > : 1) use USB hardware polling, not releasing any mutexes, simply using > : DELAY(), until read/writes complete. > > That's insanely ugly. Yes, I agree on that. But if you're out of time, and just need to have something working solid, then just use hardware polling. That's why I provided that option. > > : 2) pre-read all read registers regularly. How can I do this with > : "miibus"? > > You can't do that either. You have to use the aue 'registers' to read > the mii bus management registers. Yes, but I can call "mii_pollstat()" from the "config thread", and then cache the two integers it stores the current status in. > > The only way to deal with this is to have all the places that read the > registers deal with getting an error. If the device really is dying, > you can set a flag so that further reads also return an error to catch > places where the code is sloppy and doesn't check the return value. > This is not going to be a perfect solution. You really need to run all USB reads/writes for a separate thread, that you tear down first. > In fact, the aue_csr_read_* routines do exactly this already, and much > of the code is written to check for the dying. Apart from the > deadlock in the locking unwiding (I'm sure there are others, because > we also call if_detach with this lock held...) I do something similar. --HPS From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 12:22: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 1AE5716A4E7 for ; Wed, 9 Aug 2006 12:22:52 +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 12CA543D4C for ; Wed, 9 Aug 2006 12:22:50 +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 k79CMehk060174; Wed, 9 Aug 2006 08:22:40 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 9 Aug 2006 08:15:30 -0400 User-Agent: KMail/1.9.1 References: <200608021437.55500.hselasky@c2i.net> <20060809.000719.-432838874.imp@bsdimp.com> <200608091022.02584.hselasky@c2i.net> In-Reply-To: <200608091022.02584.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608090815.31152.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]); Wed, 09 Aug 2006 08:22:41 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1641/Tue Aug 8 19:01:19 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Hans Petter Selasky Subject: Re: miibus + USB = problem 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, 09 Aug 2006 12:22:52 -0000 On Wednesday 09 August 2006 04:22, Hans Petter Selasky wrote: > > The aue driver takes out the AUE_LOCK in these routines, and in > > detach, it unregisters the timeout. Alas, it is stupid, and does this > > with the lock held, thus ensuring deadlock if the timeout fires after > > the lock is acquired, but before the untimeout can complete (meaning > > that the timeout routine would sleep forever waiting for the lock, > > oops). This is why you can't run the detach routine locked in most > > cases. > > Yes, all of that is gone now. I use "callout_init_mtx()" and that solves the > problem, except it does not wait for the last mtx_lock()/mtx_unlock(), in > case of a race :-( > > You need to hold a lock during detach. Else you can risk that the callbacks > will re-start functions you have already shut down, like USB transfers, and > then you never get detached. This is the model that other drivers follow: FOO_LOCK(sc); foo_stop(sc); FOO_UNLOCK(sc); callout_drain(...); taskqueue_drain(...); bus_teardown_intr(...); ether_ifdetach(...); in foo_lock() you do things like a callout_stop() with the lock held and disable interrupts from the device. You can also mark it as dying, etc. in that function. Then after you drop the lock you perform several operations to wait for any other threads that might be in the driver to be out of the driver. callout_drain() should be called on each callout. If you have any task's, call taskqueue_drain() on those. bus_teardown_intr() won't return until your handler is both deregistered and finished executing if it was currently in progress. ether_ifdetach() should guarantee that any other threads coming into your driver via the if_*() routines are all gone. (This last one doesn't actually do that yet, but eventually it will, and other drivers depend on it to do so.. that is a problem to be solved in the ifnet layer, not in your driver.) -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 9 18:57:22 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 6A81616A4E0 for ; Wed, 9 Aug 2006 18:57:22 +0000 (UTC) (envelope-from jan@melen.org) Received: from foxgw.melen.org (Savi-Mel.dna.fi [83.143.60.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA77643D45 for ; Wed, 9 Aug 2006 18:57:20 +0000 (GMT) (envelope-from jan@melen.org) Received: from localhost ([IPv6:2001:14b8:400:f00::ffff]) by foxgw.melen.org (8.13.7/8.13.7) with ESMTP id k79Iv75T088520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 9 Aug 2006 21:57:18 +0300 (EEST) (envelope-from jan@melen.org) Content-Disposition: inline From: Jan Mikael Melen To: freebsd-hackers@freebsd.org Date: Wed, 9 Aug 2006 21:57:07 +0300 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200608092157.07573.jan@melen.org> X-Virus-Scanned: ClamAV version 0.88.2, clamav-milter version 0.88.2 on foxgw.melen.org X-Virus-Status: Clean X-Mailman-Approved-At: Wed, 09 Aug 2006 22:02:51 +0000 Subject: Problem with routes when configuring IPv6 addresses 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, 09 Aug 2006 18:57:22 -0000 Hello, I previously already sent this to the freebsd-net list but didn't get any response so let's try the hackers list instead. I have a problem with routes in 6.1 when configuring IPv6 address using both autoconfigured addresses at the same time with statically configured addresses from different prefixes. If the host is not accepting router advertisements everything seems to work fine: # sysctl -a | grep rtad net.inet6.ip6.accept_rtadv: 0 # ifconfig fxp0 inet6 3ffe:101::1 prefixlen 64 # netstat -rn -f inet6 | grep 3ffe:101 3ffe:101::/64 link#1 UC fxp0 3ffe:101::1 00:12:3f:71:3e:ef UHL lo0 # As you can see I have two routes one for the loopback and one for the prefix as it should GREAT! Now if I'll set the host to accept router advertisements then the route for the 3ffe:101:: prefix will be deleted as the first router advertisement is received. The router advertises prefix 3ffe:14b8:400:101::/64. # sysctl net.inet6.ip6.accept_rtadv=1 net.inet6.ip6.accept_rtadv: 0 -> 1 # rtsol -a # netstat -rn -f inet6 | grep 3ffe:101 3ffe:101::1 00:12:3f:71:3e:ef UHL lo0 # It seems that the route is deleted because in function pfxlist_onlink_check() there is a check that if the state has changed to DETACHED the nd6_prefix_offlink will be called which then removes the route: if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 && (pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { if ((e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, "pfxlist_onlink_check: failed to " "make %s/%d offlink, errno=%d\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); } } This far I digged in to the code but then ran out of steam :-( Obviously the state should not be set to DETACHED for manually configured prefixes but the question is rather where it should be done. Before somebody asks, if I first do the autoconfiguration part and then after I have the autoconfigured address add the manually configured address the result is that there wont be any route for the manually configured prefix (3ffe:101::/64). Regards, Jan From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 12:09:15 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 B69DC16A4DA; Thu, 10 Aug 2006 12:09:15 +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 E8DE243D6A; Thu, 10 Aug 2006 12:09:07 +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 1GB9LT-0003qF-Dt; Thu, 10 Aug 2006 16:09:06 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 08D981261B; Thu, 10 Aug 2006 16:08:38 +0600 (YEKST) Date: Thu, 10 Aug 2006 16:08:36 +0600 From: Stanislav Sedov To: freebsd-hackers@freebsd.org, ports@freebsd.org Message-ID: <20060810160836.40eb4128@localhost> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_.kbk=UX5wQx2XLg/92CBHt_"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Cc: Subject: make(1) is broken? 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, 10 Aug 2006 12:09:15 -0000 --Sig_.kbk=UX5wQx2XLg/92CBHt_ Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi! I have a strange problem linked with make(1) Consider the following Makefile: --------------------------------------------------------------- COMPS=3Daa ab ac AA=3Daa VAR1=3D${COMPS:Maa} VAR2=3D${COMPS:M${AA}} .for COMP in ${AA} VAR3=3D${COMPS:M${COMP}} .endfor --------------------------------------------------------------- Now, running make(1) gives: % make -V VAR1 aa % make -V VAR2 } % make -V VAR3 aa Results for VAR2 seems quite strange for me. It looks like ${COMP}!=3D${AA} So, the question: is make(1) broken, or it's my misunderstanding? Any help greatly appreciated. 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_.kbk=UX5wQx2XLg/92CBHt_ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE2wWlK/VZk+smlYERAh7MAJsEidt+U+HVg9ngOgoBEDccghd41gCfcqc+ SThr8DMpWsUoYXtlLh5MUc4= =Np0M -----END PGP SIGNATURE----- --Sig_.kbk=UX5wQx2XLg/92CBHt_-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 14:34: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 304C716A4E0; Thu, 10 Aug 2006 14:34:40 +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 8A2C343D49; Thu, 10 Aug 2006 14:34:39 +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 k7AEYY0t074000; Thu, 10 Aug 2006 10:34:34 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 10 Aug 2006 10:34:24 -0400 User-Agent: KMail/1.9.1 References: <20060810160836.40eb4128@localhost> In-Reply-To: <20060810160836.40eb4128@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608101034.24589.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]); Thu, 10 Aug 2006 10:34:36 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1644/Wed Aug 9 23:55:42 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: ports@freebsd.org, Stanislav Sedov Subject: Re: make(1) is broken? 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, 10 Aug 2006 14:34:40 -0000 On Thursday 10 August 2006 06:08, Stanislav Sedov wrote: > Hi! > > I have a strange problem linked with make(1) > > Consider the following Makefile: > --------------------------------------------------------------- > COMPS=aa ab ac > AA=aa > > VAR1=${COMPS:Maa} > VAR2=${COMPS:M${AA}} > > .for COMP in ${AA} > VAR3=${COMPS:M${COMP}} > .endfor > --------------------------------------------------------------- > > Now, running make(1) gives: > % make -V VAR1 > aa > % make -V VAR2 > } > % make -V VAR3 > aa > > Results for VAR2 seems quite strange for me. It looks like > ${COMP}!=${AA} > > So, the question: is make(1) broken, or it's my misunderstanding? > > Any help greatly appreciated. Thanks! I think it's your misunderstanding, when you do .for, make expands $COMP to generate more lines that it then later evaluates, so with the .for expanded you get: COMPS= AA= VAR1=${COMPS:Maa} VAR2=${COMPS:M${AA}} VAR3=${COMPS:Maa} Then when make evaluates VAR2, it doesn't expand ${AA} but tries to match that substring ('${AA}') in COMPS. Actually, though, it's less obvious than that, as since it isn't looking to do variable expansion in an M modifier, it ends the $COMPS expansion when it sees the first }, so what you end up with is this: VAR2='${COMPS:M${AA}'} That is, it tries to match the substring '${AA' in ${COMPS} and then appends a '}' character to that, which gives the '}' result you saw. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 15:16:24 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 CF06516A4DA for ; Thu, 10 Aug 2006 15:16:24 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D6EC43D46 for ; Thu, 10 Aug 2006 15:16:23 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7AFGH5S018054 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 10 Aug 2006 17:16:17 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7AFGHWf018053 for hackers@freebsd.org; Thu, 10 Aug 2006 17:16:17 +0200 (CEST) Date: Thu, 10 Aug 2006 17:16:17 +0200 From: Divacky Roman To: hackers@freebsd.org Message-ID: <20060810151616.GA17109@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: Subject: SoC: help with LISTs and killing procs 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, 10 Aug 2006 15:16:24 -0000 hi I am doing this: (pseudocode) LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { kill(em, SIGKILL); } kill(SIGKILL) calls exit() which calls my exit_hook() my exit_hook() does LIST_REMOVE(em, threads). the problem is that this is not synchronous so I am getting a panic by INVARIANTS that "Bad link elm prev->next != elm". This is because I list 1st item in the list I call kill on it, then process 2nd list, then scheduler preempts my code and calls exit() on the first proc which removes the first entry and bad things happen. I see this possible solutions: make this synchronous, it can be done by something like: .... kill(em, SIGKILL); wait_for_proc_to_vanish(); pls. tell me what do you think about this solution and if its correct what is the wait_for_proc_to_vanish() maybe there's some better solution, pls tell me. thnx a lot roman ---------------------- www.liberalnistrana.cz From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 15:24:09 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 AD42F16A4DD for ; Thu, 10 Aug 2006 15:24:09 +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 3A2B943D53 for ; Thu, 10 Aug 2006 15:24:07 +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 <20060810152406m92002stjge>; Thu, 10 Aug 2006 15:24:06 +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 k7AFNxFd021365; Thu, 10 Aug 2006 10:24:00 -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 k7AFNxf6021364; Thu, 10 Aug 2006 10:23:59 -0500 (CDT) (envelope-from brooks) Date: Thu, 10 Aug 2006 10:23:59 -0500 From: Brooks Davis To: Divacky Roman Message-ID: <20060810152359.GA21318@lor.one-eyed-alien.net> References: <20060810151616.GA17109@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20060810151616.GA17109@stud.fit.vutbr.cz> User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 15:24:09 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > hi >=20 > I am doing this: >=20 > (pseudocode) > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { >=20 > kill(em, SIGKILL); > } >=20 > kill(SIGKILL) calls exit() which calls my exit_hook() >=20 > my exit_hook() does LIST_REMOVE(em, threads). >=20 > the problem is that this is not synchronous so I am getting a panic by IN= VARIANTS > that "Bad link elm prev->next !=3D elm". This is because I list 1st item = in the list > I call kill on it, then process 2nd list, then scheduler preempts my code= and calls > exit() on the first proc which removes the first entry and bad things hap= pen.=20 >=20 > I see this possible solutions: >=20 > make this synchronous, it can be done by something like: >=20 > .... > kill(em, SIGKILL); > wait_for_proc_to_vanish(); >=20 > pls. tell me what do you think about this solution and if its correct wha= t is the wait_for_proc_to_vanish() >=20 > maybe there's some better solution, pls tell me. It sounds like you need a lock protecting the list. If you held it over the whole loop you could signal all processes before the exit_hook could remove any. -- Brooks --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFE20+OXY6L6fI4GtQRArGnAJ9bYoA/FKM2i/nC9ruQOgf0eBqVeACggCp3 LYDzzW882nN0kTqY59TqoqI= =wWhk -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 15:35:50 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 F404416A4DD for ; Thu, 10 Aug 2006 15:35:49 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57EE043D49 for ; Thu, 10 Aug 2006 15:35:48 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7AFZhav019151 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 10 Aug 2006 17:35:43 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7AFZhnC019150; Thu, 10 Aug 2006 17:35:43 +0200 (CEST) Date: Thu, 10 Aug 2006 17:35:43 +0200 From: Divacky Roman To: Brooks Davis Message-ID: <20060810153543.GA19047@stud.fit.vutbr.cz> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810152359.GA21318@lor.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060810152359.GA21318@lor.one-eyed-alien.net> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 15:35:50 -0000 On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > hi > > > > I am doing this: > > > > (pseudocode) > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > > > kill(em, SIGKILL); > > } > > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > > > my exit_hook() does LIST_REMOVE(em, threads). > > > > the problem is that this is not synchronous so I am getting a panic by INVARIANTS > > that "Bad link elm prev->next != elm". This is because I list 1st item in the list > > I call kill on it, then process 2nd list, then scheduler preempts my code and calls > > exit() on the first proc which removes the first entry and bad things happen. > > > > I see this possible solutions: > > > > make this synchronous, it can be done by something like: > > > > .... > > kill(em, SIGKILL); > > wait_for_proc_to_vanish(); > > > > pls. tell me what do you think about this solution and if its correct what is the wait_for_proc_to_vanish() > > > > maybe there's some better solution, pls tell me. > > It sounds like you need a lock protecting the list. If you held it over > the whole loop you could signal all processes before the exit_hook could > remove any. I dont understand. I am protecting the lock by a rw_rlock(); the exit_hook() then acquires rw_wlock(); when removing the entry. what exactly do you suggest me to do? I dont get it. thnx for claryfication roman From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 15:43: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 1100D16A4E0 for ; Thu, 10 Aug 2006 15:43:45 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7420643D7D for ; Thu, 10 Aug 2006 15:43:33 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20060810154331m9100872dae>; Thu, 10 Aug 2006 15:43:32 +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 k7AFhIxw021664; Thu, 10 Aug 2006 10:43:20 -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 k7AFhBU0021662; Thu, 10 Aug 2006 10:43:11 -0500 (CDT) (envelope-from brooks) Date: Thu, 10 Aug 2006 10:43:05 -0500 From: Brooks Davis To: Divacky Roman Message-ID: <20060810154305.GA21483@lor.one-eyed-alien.net> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810152359.GA21318@lor.one-eyed-alien.net> <20060810153543.GA19047@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <20060810153543.GA19047@stud.fit.vutbr.cz> User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 15:43:45 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 10, 2006 at 05:35:43PM +0200, Divacky Roman wrote: > On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > > hi > > >=20 > > > I am doing this: > > >=20 > > > (pseudocode) > > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > >=20 > > > kill(em, SIGKILL); > > > } > > >=20 > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > >=20 > > > my exit_hook() does LIST_REMOVE(em, threads). > > >=20 > > > the problem is that this is not synchronous so I am getting a panic b= y INVARIANTS > > > that "Bad link elm prev->next !=3D elm". This is because I list 1st i= tem in the list > > > I call kill on it, then process 2nd list, then scheduler preempts my = code and calls > > > exit() on the first proc which removes the first entry and bad things= happen.=20 > > >=20 > > > I see this possible solutions: > > >=20 > > > make this synchronous, it can be done by something like: > > >=20 > > > .... > > > kill(em, SIGKILL); > > > wait_for_proc_to_vanish(); > > >=20 > > > pls. tell me what do you think about this solution and if its correct= what is the wait_for_proc_to_vanish() > > >=20 > > > maybe there's some better solution, pls tell me. > >=20 > > It sounds like you need a lock protecting the list. If you held it over > > the whole loop you could signal all processes before the exit_hook could > > remove any. >=20 > I dont understand. I am protecting the lock by a rw_rlock(); >=20 > the exit_hook() then acquires rw_wlock(); when removing the entry. > what exactly do you suggest me to do? I dont get it. This can't be the case. If you're holding a read lock around the loop (it must cover the entire loop), it should not be possible for the exit_hook() to obtain a write lock while you are in the loop. Just to verify, is the lock for the list and not per element? -- Brooks --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFE21QIXY6L6fI4GtQRAqPuAJ9ZQU8u+K/aonW/PPa77NRYWJ4kNgCfUygQ iX3d+4i+EdsfDsgunqHIpPY= =K7US -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 13:11:22 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 EFDFA16A4DD for ; Thu, 10 Aug 2006 13:11:22 +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 2315843D45 for ; Thu, 10 Aug 2006 13:11:21 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (pszcds@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k7ADBD9c075287 for ; Thu, 10 Aug 2006 15:11:19 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k7ADBDWn075286; Thu, 10 Aug 2006 15:11:13 +0200 (CEST) (envelope-from olli) Date: Thu, 10 Aug 2006 15:11:13 +0200 (CEST) Message-Id: <200608101311.k7ADBDWn075286@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG In-Reply-To: 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]); Thu, 10 Aug 2006 15:11:19 +0200 (CEST) X-Mailman-Approved-At: Thu, 10 Aug 2006 16:02:52 +0000 Cc: Subject: Re: make(1) is broken? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2006 13:11:23 -0000 Stanislav Sedov wrote: > Consider the following Makefile: > --------------------------------------------------------------- > COMPS=aa ab ac > AA=aa > > VAR1=${COMPS:Maa} > VAR2=${COMPS:M${AA}} > > .for COMP in ${AA} > VAR3=${COMPS:M${COMP}} > .endfor > --------------------------------------------------------------- > > Now, running make(1) gives: > % make -V VAR1 > aa > % make -V VAR2 > } > % make -V VAR3 > aa > > Results for VAR2 seems quite strange for me. It looks like > ${COMP}!=${AA} > > So, the question: is make(1) broken, or it's my misunderstanding? Nested variable expansion is _only_ documented to work for the ":S" modifier, see the make(1) manual page. When the VAR2 assignment is parsed, the second opening brace is ignored, and the first closing brace closes the first opening one. The second closing brace doesn't belong to anything and is just appended to the assignment. A bit simplified, the parser sees these tokens: <=> <$> <{> <:> <${AA> <}> <}> Of course, "${AA" doesn't match anything, so the whole expansion is empty. Then the closing brace is appended, so the value of VAR2 is just "}". Now, why does it work within the for loop? That's a side effect of the way how .for loops work. When such a loop is parsed, an expanded (duplicated) text is generated, and the control variable of the loop is expanded before _anything_ else, i.e. the expanded text of the .for loop is parsed a second time. I think it is better not to rely on that side effect. It isn't well documented and might change without notice in the future. 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. 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 16:17:13 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 782C016A4DD for ; Thu, 10 Aug 2006 16:17:13 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 981B443D53 for ; Thu, 10 Aug 2006 16:17:11 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7AGH6Jm022649 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 10 Aug 2006 18:17:06 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7AGH5fI022648; Thu, 10 Aug 2006 18:17:05 +0200 (CEST) Date: Thu, 10 Aug 2006 18:17:05 +0200 From: Divacky Roman To: Brooks Davis Message-ID: <20060810161705.GB19047@stud.fit.vutbr.cz> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810152359.GA21318@lor.one-eyed-alien.net> <20060810153543.GA19047@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060810154305.GA21483@lor.one-eyed-alien.net> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 16:17:13 -0000 On Thu, Aug 10, 2006 at 10:43:05AM -0500, Brooks Davis wrote: > On Thu, Aug 10, 2006 at 05:35:43PM +0200, Divacky Roman wrote: > > On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > > > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > > > hi > > > > > > > > I am doing this: > > > > > > > > (pseudocode) > > > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > > > > > > > kill(em, SIGKILL); > > > > } > > > > > > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > > > > > > > my exit_hook() does LIST_REMOVE(em, threads). > > > > > > > > the problem is that this is not synchronous so I am getting a panic by INVARIANTS > > > > that "Bad link elm prev->next != elm". This is because I list 1st item in the list > > > > I call kill on it, then process 2nd list, then scheduler preempts my code and calls > > > > exit() on the first proc which removes the first entry and bad things happen. > > > > > > > > I see this possible solutions: > > > > > > > > make this synchronous, it can be done by something like: > > > > > > > > .... > > > > kill(em, SIGKILL); > > > > wait_for_proc_to_vanish(); > > > > > > > > pls. tell me what do you think about this solution and if its correct what is the wait_for_proc_to_vanish() > > > > > > > > maybe there's some better solution, pls tell me. > > > > > > It sounds like you need a lock protecting the list. If you held it over > > > the whole loop you could signal all processes before the exit_hook could > > > remove any. > > > > I dont understand. I am protecting the lock by a rw_rlock(); > > > > the exit_hook() then acquires rw_wlock(); when removing the entry. > > what exactly do you suggest me to do? I dont get it. > > This can't be the case. If you're holding a read lock around the > loop (it must cover the entire loop), it should not be possible for the > exit_hook() to obtain a write lock while you are in the loop. Just to > verify, is the lock for the list and not per element? oh.. I see whats going on.. in the exit_hook I am doing this: em = em_find(p->p_pid, EMUL_UNLOCKED); // this performs EMUL_RLOCK(&emul_lock); ... EMUL_RUNLOCK(&emul_lock); EMUL_WLOCK(&emul_lock); LIST_REMOVE(em, threads); SLIST_REMOVE(&emuldata_head, em, linux_emuldata, emuldatas); EMUL_WUNLOCK(&emul_lock); the EMUL_RUNLOCK() unlocks it so it doesnt wait. This should be turned into rw_try_upgrade() but I dont understand how ;( anyway, I still dont understand how should I use the lock to achieve the synchronization. my code looks like: EMUL_RLOCK(&emul_lock); LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { } EMUL_RUNLOCK(&emul_lock); what do you suggest? I need to process the list first and then let the exit_hook in the various processes run. From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 16:34:02 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 1192116A4DA for ; Thu, 10 Aug 2006 16:34:02 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7912A43D46 for ; Thu, 10 Aug 2006 16:33:58 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20060810163356m910086rl1e>; Thu, 10 Aug 2006 16:33:57 +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 k7AGXnXp022295; Thu, 10 Aug 2006 11:33:50 -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 k7AGXcSx022294; Thu, 10 Aug 2006 11:33:38 -0500 (CDT) (envelope-from brooks) Date: Thu, 10 Aug 2006 11:33:37 -0500 From: Brooks Davis To: Divacky Roman Message-ID: <20060810163337.GA22097@lor.one-eyed-alien.net> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810152359.GA21318@lor.one-eyed-alien.net> <20060810153543.GA19047@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> <20060810161705.GB19047@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20060810161705.GB19047@stud.fit.vutbr.cz> User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 16:34:02 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 10, 2006 at 06:17:05PM +0200, Divacky Roman wrote: > On Thu, Aug 10, 2006 at 10:43:05AM -0500, Brooks Davis wrote: > > On Thu, Aug 10, 2006 at 05:35:43PM +0200, Divacky Roman wrote: > > > On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > > > > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > > > > hi > > > > >=20 > > > > > I am doing this: > > > > >=20 > > > > > (pseudocode) > > > > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > > > >=20 > > > > > kill(em, SIGKILL); > > > > > } > > > > >=20 > > > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > > > >=20 > > > > > my exit_hook() does LIST_REMOVE(em, threads). > > > > >=20 > > > > > the problem is that this is not synchronous so I am getting a pan= ic by INVARIANTS > > > > > that "Bad link elm prev->next !=3D elm". This is because I list 1= st item in the list > > > > > I call kill on it, then process 2nd list, then scheduler preempts= my code and calls > > > > > exit() on the first proc which removes the first entry and bad th= ings happen.=20 > > > > >=20 > > > > > I see this possible solutions: > > > > >=20 > > > > > make this synchronous, it can be done by something like: > > > > >=20 > > > > > .... > > > > > kill(em, SIGKILL); > > > > > wait_for_proc_to_vanish(); > > > > >=20 > > > > > pls. tell me what do you think about this solution and if its cor= rect what is the wait_for_proc_to_vanish() > > > > >=20 > > > > > maybe there's some better solution, pls tell me. > > > >=20 > > > > It sounds like you need a lock protecting the list. If you held it= over > > > > the whole loop you could signal all processes before the exit_hook = could > > > > remove any. > > >=20 > > > I dont understand. I am protecting the lock by a rw_rlock(); > > >=20 > > > the exit_hook() then acquires rw_wlock(); when removing the entry. > > > what exactly do you suggest me to do? I dont get it. > >=20 > > This can't be the case. If you're holding a read lock around the > > loop (it must cover the entire loop), it should not be possible for the > > exit_hook() to obtain a write lock while you are in the loop. Just to > > verify, is the lock for the list and not per element? >=20 > oh.. I see whats going on.. in the exit_hook I am doing this: >=20 >=20 > em =3D em_find(p->p_pid, EMUL_UNLOCKED); // this performs EMUL_RLOC= K(&emul_lock); > ... > EMUL_RUNLOCK(&emul_lock); > =09 > EMUL_WLOCK(&emul_lock); > LIST_REMOVE(em, threads); > SLIST_REMOVE(&emuldata_head, em, linux_emuldata, emuldatas); > EMUL_WUNLOCK(&emul_lock); > =20 > the EMUL_RUNLOCK() unlocks it so it doesnt wait. This should be turned in= to rw_try_upgrade() > but I dont understand how ;( >=20 > anyway, I still dont understand how should I use the lock to achieve the = synchronization. >=20 > my code looks like: >=20 > EMUL_RLOCK(&emul_lock); > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > } > EMUL_RUNLOCK(&emul_lock); >=20 > what do you suggest? I need to process the list first and then let the > exit_hook in the various processes run. I'll admit to not being super familiar with the rwlock code, but unless exit_hook is being run in the same context as loop (i.e. the signal handling isn't asynchronous) the unlock shouldn't result in the release of the loops' reader lock and thus the write lock request should fail. -- Brooks --liOOAslEiF7prFVr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFE21/hXY6L6fI4GtQRAirjAKCxdwcw78bOADcRGwRcfazKUnD0JQCfZGhP llKfXRb6rd2I9HYpT96oocI= =HdX9 -----END PGP SIGNATURE----- --liOOAslEiF7prFVr-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 17:14: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 80D9816A4DF for ; Thu, 10 Aug 2006 17:14:03 +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 EF4EF43D5F for ; Thu, 10 Aug 2006 17:13:59 +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 1GBE6W-00073N-MM for freebsd-hackers@freebsd.org; Thu, 10 Aug 2006 21:13:59 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id 5025E1261B for ; Thu, 10 Aug 2006 21:13:33 +0600 (YEKST) Date: Thu, 10 Aug 2006 21:13:33 +0600 From: Stanislav Sedov To: freebsd-hackers@freebsd.org Message-ID: <20060810211333.2d0a73fe@localhost> In-Reply-To: <200608101311.k7ADBDWn075286@lurza.secnetix.de> References: <200608101311.k7ADBDWn075286@lurza.secnetix.de> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_PaWuBzfNzXK8wyQ_AtEnG6h; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 Subject: Re: make(1) is broken? 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, 10 Aug 2006 17:14:03 -0000 --Sig_PaWuBzfNzXK8wyQ_AtEnG6h Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Thu, 10 Aug 2006 15:11:13 +0200 (CEST) Oliver Fromme mentioned: > I think it is better not to rely on that side effect. It > isn't well documented and might change without notice in > the future. Thanks for explanation. I suppose, however, that .for behavior could be used rather safely for it's well documented in make(1). According to this manpage, it's not a side effect - .for loops always unrolled and variable substitutions occurs. Thanks for all answers!=20 --=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_PaWuBzfNzXK8wyQ_AtEnG6h Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE200dK/VZk+smlYERAtyXAJ9YV/BhG74rMVtOnQSOYfE15HclTgCeMMtt B0eg1XiQqQRPFfXuc02Y40M= =BjTF -----END PGP SIGNATURE----- --Sig_PaWuBzfNzXK8wyQ_AtEnG6h-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 18:05:58 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 DBEA216A4DF; Thu, 10 Aug 2006 18:05:58 +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 E494543D49; Thu, 10 Aug 2006 18:05:57 +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 k7AI5pXM075318; Thu, 10 Aug 2006 14:05:54 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 10 Aug 2006 13:31:50 -0400 User-Agent: KMail/1.9.1 References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> <20060810161705.GB19047@stud.fit.vutbr.cz> In-Reply-To: <20060810161705.GB19047@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608101331.51473.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]); Thu, 10 Aug 2006 14:05:56 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1644/Wed Aug 9 23:55:42 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Divacky Roman , hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 18:05:59 -0000 On Thursday 10 August 2006 12:17, Divacky Roman wrote: > On Thu, Aug 10, 2006 at 10:43:05AM -0500, Brooks Davis wrote: > > On Thu, Aug 10, 2006 at 05:35:43PM +0200, Divacky Roman wrote: > > > On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > > > > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > > > > hi > > > > > > > > > > I am doing this: > > > > > > > > > > (pseudocode) > > > > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > > > > > > > > > kill(em, SIGKILL); > > > > > } > > > > > > > > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > > > > > > > > > my exit_hook() does LIST_REMOVE(em, threads). > > > > > > > > > > the problem is that this is not synchronous so I am getting a panic by INVARIANTS > > > > > that "Bad link elm prev->next != elm". This is because I list 1st item in the list > > > > > I call kill on it, then process 2nd list, then scheduler preempts my code and calls > > > > > exit() on the first proc which removes the first entry and bad things happen. > > > > > > > > > > I see this possible solutions: > > > > > > > > > > make this synchronous, it can be done by something like: > > > > > > > > > > .... > > > > > kill(em, SIGKILL); > > > > > wait_for_proc_to_vanish(); > > > > > > > > > > pls. tell me what do you think about this solution and if its correct what is the wait_for_proc_to_vanish() > > > > > > > > > > maybe there's some better solution, pls tell me. > > > > > > > > It sounds like you need a lock protecting the list. If you held it over > > > > the whole loop you could signal all processes before the exit_hook could > > > > remove any. > > > > > > I dont understand. I am protecting the lock by a rw_rlock(); > > > > > > the exit_hook() then acquires rw_wlock(); when removing the entry. > > > what exactly do you suggest me to do? I dont get it. > > > > This can't be the case. If you're holding a read lock around the > > loop (it must cover the entire loop), it should not be possible for the > > exit_hook() to obtain a write lock while you are in the loop. Just to > > verify, is the lock for the list and not per element? > > oh.. I see whats going on.. in the exit_hook I am doing this: > > > em = em_find(p->p_pid, EMUL_UNLOCKED); // this performs EMUL_RLOCK(&emul_lock); > ... > EMUL_RUNLOCK(&emul_lock); > > EMUL_WLOCK(&emul_lock); > LIST_REMOVE(em, threads); > SLIST_REMOVE(&emuldata_head, em, linux_emuldata, emuldatas); > EMUL_WUNLOCK(&emul_lock); > > the EMUL_RUNLOCK() unlocks it so it doesnt wait. This should be turned into rw_try_upgrade() > but I dont understand how ;( You could make em_find() take an argument to specify if it should acquire a WLOCK instead of an RLOCK. Really, unless you have measured a lot of contention on this lock, you should just make it a mtx, and only go back and make it a rwlock if it really needs it. Also, you currently can't do an interlocked msleep() or cv_wait() with a rwlock, so you really need to use a mutex anyway. > anyway, I still dont understand how should I use the lock to achieve the synchronization. > > my code looks like: > > EMUL_RLOCK(&emul_lock); > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > } > EMUL_RUNLOCK(&emul_lock); > > what do you suggest? I need to process the list first and then let the exit_hook in the various processes run. This is not safe anyway. kill() is way too big of a function to call with a lock held. You also pass the wrong thread to it IIRC (you should always pass curthread as the td argument to a syscall). You probably need to use psignal, and you probably should be doing something like this: EMUL_LOCK(); LIST_FOREACH(td, &td_em->shared->threads, threads) { p = td->td_proc; PROC_LOCK(p); psignal(p, SIGKILL); PROC_UNLOCK(p); } while (THREADS_STILL_AROUND(&td->em)) msleep(td_em, &emul_lock, PWAIT, "foo", 0); EMUL_UNLOCK(); Then in your exit_hook you should do this: em = em_find(p->p_pid, EMUL_UNLOCKED); LIST_REMOVE(...); SLIST_REMOVE(...); wakeup(em); EMUL_UNLOCK(); -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 18:05:58 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 DBEA216A4DF; Thu, 10 Aug 2006 18:05:58 +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 E494543D49; Thu, 10 Aug 2006 18:05:57 +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 k7AI5pXM075318; Thu, 10 Aug 2006 14:05:54 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 10 Aug 2006 13:31:50 -0400 User-Agent: KMail/1.9.1 References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> <20060810161705.GB19047@stud.fit.vutbr.cz> In-Reply-To: <20060810161705.GB19047@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608101331.51473.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]); Thu, 10 Aug 2006 14:05:56 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1644/Wed Aug 9 23:55:42 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.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Divacky Roman , hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 10 Aug 2006 18:05:59 -0000 On Thursday 10 August 2006 12:17, Divacky Roman wrote: > On Thu, Aug 10, 2006 at 10:43:05AM -0500, Brooks Davis wrote: > > On Thu, Aug 10, 2006 at 05:35:43PM +0200, Divacky Roman wrote: > > > On Thu, Aug 10, 2006 at 10:23:59AM -0500, Brooks Davis wrote: > > > > On Thu, Aug 10, 2006 at 05:16:17PM +0200, Divacky Roman wrote: > > > > > hi > > > > > > > > > > I am doing this: > > > > > > > > > > (pseudocode) > > > > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > > > > > > > > > kill(em, SIGKILL); > > > > > } > > > > > > > > > > kill(SIGKILL) calls exit() which calls my exit_hook() > > > > > > > > > > my exit_hook() does LIST_REMOVE(em, threads). > > > > > > > > > > the problem is that this is not synchronous so I am getting a panic by INVARIANTS > > > > > that "Bad link elm prev->next != elm". This is because I list 1st item in the list > > > > > I call kill on it, then process 2nd list, then scheduler preempts my code and calls > > > > > exit() on the first proc which removes the first entry and bad things happen. > > > > > > > > > > I see this possible solutions: > > > > > > > > > > make this synchronous, it can be done by something like: > > > > > > > > > > .... > > > > > kill(em, SIGKILL); > > > > > wait_for_proc_to_vanish(); > > > > > > > > > > pls. tell me what do you think about this solution and if its correct what is the wait_for_proc_to_vanish() > > > > > > > > > > maybe there's some better solution, pls tell me. > > > > > > > > It sounds like you need a lock protecting the list. If you held it over > > > > the whole loop you could signal all processes before the exit_hook could > > > > remove any. > > > > > > I dont understand. I am protecting the lock by a rw_rlock(); > > > > > > the exit_hook() then acquires rw_wlock(); when removing the entry. > > > what exactly do you suggest me to do? I dont get it. > > > > This can't be the case. If you're holding a read lock around the > > loop (it must cover the entire loop), it should not be possible for the > > exit_hook() to obtain a write lock while you are in the loop. Just to > > verify, is the lock for the list and not per element? > > oh.. I see whats going on.. in the exit_hook I am doing this: > > > em = em_find(p->p_pid, EMUL_UNLOCKED); // this performs EMUL_RLOCK(&emul_lock); > ... > EMUL_RUNLOCK(&emul_lock); > > EMUL_WLOCK(&emul_lock); > LIST_REMOVE(em, threads); > SLIST_REMOVE(&emuldata_head, em, linux_emuldata, emuldatas); > EMUL_WUNLOCK(&emul_lock); > > the EMUL_RUNLOCK() unlocks it so it doesnt wait. This should be turned into rw_try_upgrade() > but I dont understand how ;( You could make em_find() take an argument to specify if it should acquire a WLOCK instead of an RLOCK. Really, unless you have measured a lot of contention on this lock, you should just make it a mtx, and only go back and make it a rwlock if it really needs it. Also, you currently can't do an interlocked msleep() or cv_wait() with a rwlock, so you really need to use a mutex anyway. > anyway, I still dont understand how should I use the lock to achieve the synchronization. > > my code looks like: > > EMUL_RLOCK(&emul_lock); > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > } > EMUL_RUNLOCK(&emul_lock); > > what do you suggest? I need to process the list first and then let the exit_hook in the various processes run. This is not safe anyway. kill() is way too big of a function to call with a lock held. You also pass the wrong thread to it IIRC (you should always pass curthread as the td argument to a syscall). You probably need to use psignal, and you probably should be doing something like this: EMUL_LOCK(); LIST_FOREACH(td, &td_em->shared->threads, threads) { p = td->td_proc; PROC_LOCK(p); psignal(p, SIGKILL); PROC_UNLOCK(p); } while (THREADS_STILL_AROUND(&td->em)) msleep(td_em, &emul_lock, PWAIT, "foo", 0); EMUL_UNLOCK(); Then in your exit_hook you should do this: em = em_find(p->p_pid, EMUL_UNLOCKED); LIST_REMOVE(...); SLIST_REMOVE(...); wakeup(em); EMUL_UNLOCK(); -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 10 18:06: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 818FB16A4DA for ; Thu, 10 Aug 2006 18:06:44 +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 F059543D5E for ; Thu, 10 Aug 2006 18:06:41 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (klyvwf@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k7AI6Yf6089041 for ; Thu, 10 Aug 2006 20:06:40 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k7AI6Y00089040; Thu, 10 Aug 2006 20:06:34 +0200 (CEST) (envelope-from olli) Date: Thu, 10 Aug 2006 20:06:34 +0200 (CEST) Message-Id: <200608101806.k7AI6Y00089040@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG In-Reply-To: <20060810211333.2d0a73fe@localhost> 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]); Thu, 10 Aug 2006 20:06:40 +0200 (CEST) X-Mailman-Approved-At: Thu, 10 Aug 2006 18:37:29 +0000 Cc: Subject: Re: make(1) is broken? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2006 18:06:44 -0000 Stanislav Sedov wrote: > Oliver Fromme wrote: > > I think it is better not to rely on that side effect. It > > isn't well documented and might change without notice in > > the future. > > Thanks for explanation. I suppose, however, that .for behavior could > be used rather safely for it's well documented in make(1). I wouldn't call that side-effect "well-documented". The manpage says: | The iteration variable is successively set to each | word, and substituted in the make-rules inside the | body of the for loop. While that description is correct, it doesn't clearly state the side-effect of allowing nested expansion of the loop variable within other variables, i.e. the fact that a line VAR=${foo:M${bar}} is parsed and handled completely differently, depending on whether "bar" is a loop variable or a normal variable. Well, if you like it, you're free to use that hack to wrap your nested variable expansion in a dummy for loop. But don't complain if it doesn't work anymore in FreeBSD 8. :-) > According > to this manpage, it's not a side effect - .for loops always unrolled > and variable substitutions occurs. Yes, but the point is that _nested_ variable substitutions (inside other variables) are only documented to work for the ":S" modifier, but nowhere else. Relying on something that's not documented is asking for trouble. 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. "Python tricks" is a tough one, cuz the language is so clean. E.g., C makes an art of confusing pointers with arrays and strings, which leads to lotsa neat pointer tricks; APL mistakes everything for an array, leading to neat one-liners; and Perl confuses everything period, making each line a joyous adventure . -- Tim Peters From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 09:05:58 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 2BBE416A4DA; Fri, 11 Aug 2006 09:05:58 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F27843D62; Fri, 11 Aug 2006 09:05:53 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7B95lQ8072934 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 11 Aug 2006 11:05:47 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7B95l2k072933; Fri, 11 Aug 2006 11:05:47 +0200 (CEST) Date: Fri, 11 Aug 2006 11:05:47 +0200 From: Divacky Roman To: John Baldwin Message-ID: <20060811090547.GA72742@stud.fit.vutbr.cz> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> <20060810161705.GB19047@stud.fit.vutbr.cz> <200608101331.51473.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608101331.51473.jhb@freebsd.org> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 11 Aug 2006 09:05:58 -0000 > You could make em_find() take an argument to specify if it should acquire > a WLOCK instead of an RLOCK. Really, unless you have measured a lot of > contention on this lock, you should just make it a mtx, and only go back and > make it a rwlock if it really needs it. Also, you currently can't do an > interlocked msleep() or cv_wait() with a rwlock, so you really need to use a > mutex anyway. well... I rethink my design and I'll alter it to not use the rwlock at all. I'll use per-emuldata mutex and there will be no SLIST of linux-thrads (I'll use proc->p_emuldata to point at that) > > anyway, I still dont understand how should I use the lock to achieve the > synchronization. > > > > my code looks like: > > > > EMUL_RLOCK(&emul_lock); > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > } > > EMUL_RUNLOCK(&emul_lock); > > > > what do you suggest? I need to process the list first and then let the > exit_hook in the various processes run. > > This is not safe anyway. kill() is way too big of a function to call with a > lock held. You also pass the wrong thread to it IIRC (you should always pass > curthread as the td argument to a syscall). You probably need to use > psignal, and you probably should be doing something like this: > > EMUL_LOCK(); > LIST_FOREACH(td, &td_em->shared->threads, threads) { > p = td->td_proc; > PROC_LOCK(p); > psignal(p, SIGKILL); > PROC_UNLOCK(p); > } > > while (THREADS_STILL_AROUND(&td->em)) > msleep(td_em, &emul_lock, PWAIT, "foo", 0); > EMUL_UNLOCK(); > > Then in your exit_hook you should do this: > > em = em_find(p->p_pid, EMUL_UNLOCKED); > LIST_REMOVE(...); > SLIST_REMOVE(...); > wakeup(em); > EMUL_UNLOCK(); thnx! the psignal() is exactly what I wanted to know. but the original problem was that INVARIATNS causes panic when LIST_FOREACH() {LIST_REMOV();} I found a solution (I reference the data and free it in a separate step) to this so everything is nice and smooth now :) thnx! roman From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 09:05:58 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 2BBE416A4DA; Fri, 11 Aug 2006 09:05:58 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F27843D62; Fri, 11 Aug 2006 09:05:53 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7B95lQ8072934 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 11 Aug 2006 11:05:47 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7B95l2k072933; Fri, 11 Aug 2006 11:05:47 +0200 (CEST) Date: Fri, 11 Aug 2006 11:05:47 +0200 From: Divacky Roman To: John Baldwin Message-ID: <20060811090547.GA72742@stud.fit.vutbr.cz> References: <20060810151616.GA17109@stud.fit.vutbr.cz> <20060810154305.GA21483@lor.one-eyed-alien.net> <20060810161705.GB19047@stud.fit.vutbr.cz> <200608101331.51473.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608101331.51473.jhb@freebsd.org> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: SoC: help with LISTs and killing procs 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, 11 Aug 2006 09:05:58 -0000 > You could make em_find() take an argument to specify if it should acquire > a WLOCK instead of an RLOCK. Really, unless you have measured a lot of > contention on this lock, you should just make it a mtx, and only go back and > make it a rwlock if it really needs it. Also, you currently can't do an > interlocked msleep() or cv_wait() with a rwlock, so you really need to use a > mutex anyway. well... I rethink my design and I'll alter it to not use the rwlock at all. I'll use per-emuldata mutex and there will be no SLIST of linux-thrads (I'll use proc->p_emuldata to point at that) > > anyway, I still dont understand how should I use the lock to achieve the > synchronization. > > > > my code looks like: > > > > EMUL_RLOCK(&emul_lock); > > LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { > > } > > EMUL_RUNLOCK(&emul_lock); > > > > what do you suggest? I need to process the list first and then let the > exit_hook in the various processes run. > > This is not safe anyway. kill() is way too big of a function to call with a > lock held. You also pass the wrong thread to it IIRC (you should always pass > curthread as the td argument to a syscall). You probably need to use > psignal, and you probably should be doing something like this: > > EMUL_LOCK(); > LIST_FOREACH(td, &td_em->shared->threads, threads) { > p = td->td_proc; > PROC_LOCK(p); > psignal(p, SIGKILL); > PROC_UNLOCK(p); > } > > while (THREADS_STILL_AROUND(&td->em)) > msleep(td_em, &emul_lock, PWAIT, "foo", 0); > EMUL_UNLOCK(); > > Then in your exit_hook you should do this: > > em = em_find(p->p_pid, EMUL_UNLOCKED); > LIST_REMOVE(...); > SLIST_REMOVE(...); > wakeup(em); > EMUL_UNLOCK(); thnx! the psignal() is exactly what I wanted to know. but the original problem was that INVARIATNS causes panic when LIST_FOREACH() {LIST_REMOV();} I found a solution (I reference the data and free it in a separate step) to this so everything is nice and smooth now :) thnx! roman From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 09:45: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 85E3D16A4DE for ; Fri, 11 Aug 2006 09:45:45 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA04643D45 for ; Fri, 11 Aug 2006 09:45:44 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp6-g19.free.fr (Postfix) with ESMTP id E365822697; Fri, 11 Aug 2006 11:45:43 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id 43F3B9B520; Fri, 11 Aug 2006 09:46:24 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 1C60C405A; Fri, 11 Aug 2006 11:46:24 +0200 (CEST) Date: Fri, 11 Aug 2006 11:46:24 +0200 From: Jeremie Le Hen To: Ulf Zimmermann Message-ID: <20060811094623.GA39702@obiwan.tataz.chchile.org> References: <20060718221415.GI45191@evil.alameda.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060718221415.GI45191@evil.alameda.net> User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: [fbsd] sshd throwing signal 6 (sigabrt) 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, 11 Aug 2006 09:45:45 -0000 Hi Ulf, On Tue, Jul 18, 2006 at 03:14:16PM -0700, Ulf Zimmermann wrote: > I have a FreeBSD server (was 5.4-prerelease, now 6-stable as of noon PDT). > On this server I got a problem with sshd throwing signal 6: > > Jul 18 15:04:03 log01 sshd[66161]: debug2: User child is on pid 66163 > Jul 18 15:04:03 log01 sshd[66163]: debug3: PAM: opening session > Jul 18 15:04:03 log01 sshd[66163]: debug1: PAM: reinitializing credentials > Jul 18 15:04:03 log01 sshd[66163]: debug2: set_newkeys: mode 0 > Jul 18 15:04:03 log01 sshd[66163]: debug2: set_newkeys: mode 1 > Jul 18 15:04:03 log01 sshd[66163]: debug1: Entering interactive session for SSH2. > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 5 setting O_NONBLOCK > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 6 setting O_NONBLOCK > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_init_dispatch_20 > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_open: ctype session rchan 0 win 131072 max 32768 > Jul 18 15:04:03 log01 sshd[66163]: debug1: input_session_request > Jul 18 15:04:03 log01 sshd[66163]: debug1: channel 0: new [server-session] > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_new: init > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_new: session 0 > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_open: channel 0 > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_open: session 0: link with channel 0 > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_open: confirm session > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_req: channel 0 request exec reply 0 > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_by_channel: session 0 channel 0 > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_input_channel_req: session 0 req exec > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 8 setting O_NONBLOCK > Jul 18 15:04:03 log01 sshd[66163]: debug3: fd 8 is O_NONBLOCK > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 10 setting O_NONBLOCK > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: rcvd eof > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: output open -> drain > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: obuf empty > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: close_write > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: output drain -> closed > Jul 18 15:04:03 log01 pid 66163 (sshd), uid 10042: exited on signal 6 > > About 80 servers have two cronjobs each starting at the full hour. Each > cronjob has a random sleep of 0 to 900 seconds before it executes ssh/scp/rsync > to copy one or multiple files to that FreeBSD server. One cronjob copies > one file ranging in size 30KB to 300KB. The other cronjob copies 10-30 > RRD files, ranging in size from 200KB to 1MB. > > Of these about 160 ssh connections in a time range of 15 minutes, I get > 1 to 10 errors at the end of the connection. All files get copied as far > I can tell but when the connection closes I see the above signal 6. > > On the source side of the ssh connection I get error messages like > > "Connection to xxxx closed by remote host" > "ssh_exchange_identification: Connection closed by remote host lost connection" > > Anyone have an idea what the problem could be that sshd see sigabrt? % obiwan:openssh$ grep -rl SIGABRT . | wc -l % 0 This should come from one of the underlying librairies sshd(8) is linked to. Do you run by chance 6-STABLE with ProPolice/SSP patch ? If a stack-based buffer overflow is detected, SIGABRT (signal 6) will be sent to the faulty process. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 17:54: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 4ADA216A4DD for ; Fri, 11 Aug 2006 17:54:31 +0000 (UTC) (envelope-from jchoque@tlmat.unican.es) Received: from luna.tlmat.unican.es (luna.tlmat.unican.es [193.144.186.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94AB243D4C for ; Fri, 11 Aug 2006 17:54:29 +0000 (GMT) (envelope-from jchoque@tlmat.unican.es) Received: from Altair (altair.tlmat.unican.es [193.144.186.43]) by luna.tlmat.unican.es (8.12.11/8.12.11) with ESMTP id k7BHSMAk004502 for ; Fri, 11 Aug 2006 19:28:22 +0200 From: "Johnny Choque" To: Date: Fri, 11 Aug 2006 19:56:27 +0200 Message-ID: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Aca9b3eZafrLKPswTweDOslZeF3+WA== Subject: Attach/detach devices 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, 11 Aug 2006 17:54:31 -0000 Hi, I'm trying to do a userland program that detect the event when a device is attached/detached. In particular, I would like to detect these events for wireless pc card insertion/ejection or when tear down the connection of the wireless interface build-in laptop. I've found that functions device_attach/device_detach are used by the kernel when a device is attached/detached respectively, and, e.g, when a device is detached "a notification event is sent to userland for user-based device management service", how can I use that notification event in my userland program? Could you give me some ideas to do my program? Cheers, Johnny From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 17:58:31 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 CAA2F16A4DD for ; Fri, 11 Aug 2006 17:58:31 +0000 (UTC) (envelope-from ulf@alameda.net) Received: from mail.alameda.net (mail.alameda.net [64.81.53.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7000443D6B for ; Fri, 11 Aug 2006 17:58:31 +0000 (GMT) (envelope-from ulf@alameda.net) Received: by mail.alameda.net (Postfix, from userid 1000) id 5A71933C62; Fri, 11 Aug 2006 10:58:26 -0700 (PDT) Date: Fri, 11 Aug 2006 10:58:26 -0700 From: Ulf Zimmermann To: Jeremie Le Hen Message-ID: <20060811175825.GI37510@evil.alameda.net> References: <20060718221415.GI45191@evil.alameda.net> <20060811094623.GA39702@obiwan.tataz.chchile.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060811094623.GA39702@obiwan.tataz.chchile.org> User-Agent: Mutt/1.4.2.1i Organization: Alameda Networks, Inc. X-Operating-System: FreeBSD 5.3-STABLE X-ANI-MailScanner-Information: Please contact the ISP for more information X-ANI-MailScanner: Found to be clean X-ANI-MailScanner-From: ulf@alameda.net Cc: hackers@freebsd.org, Ulf Zimmermann Subject: Re: [fbsd] sshd throwing signal 6 (sigabrt) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ulf@Alameda.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2006 17:58:31 -0000 On Fri, Aug 11, 2006 at 11:46:24AM +0200, Jeremie Le Hen wrote: > Hi Ulf, > > On Tue, Jul 18, 2006 at 03:14:16PM -0700, Ulf Zimmermann wrote: > > I have a FreeBSD server (was 5.4-prerelease, now 6-stable as of noon PDT). > > On this server I got a problem with sshd throwing signal 6: > > > > Jul 18 15:04:03 log01 sshd[66161]: debug2: User child is on pid 66163 > > Jul 18 15:04:03 log01 sshd[66163]: debug3: PAM: opening session > > Jul 18 15:04:03 log01 sshd[66163]: debug1: PAM: reinitializing credentials > > Jul 18 15:04:03 log01 sshd[66163]: debug2: set_newkeys: mode 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug2: set_newkeys: mode 1 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: Entering interactive session for SSH2. > > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 5 setting O_NONBLOCK > > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 6 setting O_NONBLOCK > > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_init_dispatch_20 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_open: ctype session rchan 0 win 131072 max 32768 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: input_session_request > > Jul 18 15:04:03 log01 sshd[66163]: debug1: channel 0: new [server-session] > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_new: init > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_new: session 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_open: channel 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_open: session 0: link with channel 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_open: confirm session > > Jul 18 15:04:03 log01 sshd[66163]: debug1: server_input_channel_req: channel 0 request exec reply 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_by_channel: session 0 channel 0 > > Jul 18 15:04:03 log01 sshd[66163]: debug1: session_input_channel_req: session 0 req exec > > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 8 setting O_NONBLOCK > > Jul 18 15:04:03 log01 sshd[66163]: debug3: fd 8 is O_NONBLOCK > > Jul 18 15:04:03 log01 sshd[66163]: debug2: fd 10 setting O_NONBLOCK > > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: rcvd eof > > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: output open -> drain > > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: obuf empty > > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: close_write > > Jul 18 15:04:03 log01 sshd[66163]: debug2: channel 0: output drain -> closed > > Jul 18 15:04:03 log01 pid 66163 (sshd), uid 10042: exited on signal 6 > > > > About 80 servers have two cronjobs each starting at the full hour. Each > > cronjob has a random sleep of 0 to 900 seconds before it executes ssh/scp/rsync > > to copy one or multiple files to that FreeBSD server. One cronjob copies > > one file ranging in size 30KB to 300KB. The other cronjob copies 10-30 > > RRD files, ranging in size from 200KB to 1MB. > > > > Of these about 160 ssh connections in a time range of 15 minutes, I get > > 1 to 10 errors at the end of the connection. All files get copied as far > > I can tell but when the connection closes I see the above signal 6. > > > > On the source side of the ssh connection I get error messages like > > > > "Connection to xxxx closed by remote host" > > "ssh_exchange_identification: Connection closed by remote host lost connection" > > > > Anyone have an idea what the problem could be that sshd see sigabrt? > > % obiwan:openssh$ grep -rl SIGABRT . | wc -l > % 0 > > This should come from one of the underlying librairies sshd(8) is > linked to. > > Do you run by chance 6-STABLE with ProPolice/SSP patch ? If a > stack-based buffer overflow is detected, SIGABRT (signal 6) will > be sent to the faulty process. > > Regards, > -- > Jeremie Le Hen I was running a 5.3-PRERELEASE and now it is running 6.1-STABLE (Jul 18). Pretty much a plain box, the only thing added are things like Apache, PHP, syslog-ng. There should not be an overflow, as these are regular ssh connections. The upgrade to 6.1-STABLE made things happen less often, but they still happen. Mostly during close of connection, much more rarely during opening of the connection. -- Regards, Ulf. --------------------------------------------------------------------- Ulf Zimmermann, 1525 Pacific Ave., Alameda, CA-94501, #: 510-865-0204 You can find my resume at: http://seven.Alameda.net/~ulf/resume.html From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 18:05:25 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 1071116A4DD for ; Fri, 11 Aug 2006 18:05:25 +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 B08E643D93 for ; Fri, 11 Aug 2006 18:05:07 +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 EC42B20A5; Fri, 11 Aug 2006 20:05:03 +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 DE7E12085; Fri, 11 Aug 2006 20:05:03 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id C67A533C28; Fri, 11 Aug 2006 20:05:03 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Johnny Choque" References: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> Date: Fri, 11 Aug 2006 20:05:03 +0200 In-Reply-To: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> (Johnny Choque's message of "Fri, 11 Aug 2006 19:56:27 +0200") Message-ID: <86r6znywq8.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 Subject: Re: Attach/detach devices 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, 11 Aug 2006 18:05:25 -0000 "Johnny Choque" writes: > I'm trying to do a userland program that detect the event when a > device is attached/detached. man devd DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 18:24:56 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 83EB416A57F for ; Fri, 11 Aug 2006 18:24:56 +0000 (UTC) (envelope-from jchoque@tlmat.unican.es) Received: from luna.tlmat.unican.es (luna.tlmat.unican.es [193.144.186.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B993043EB4 for ; Fri, 11 Aug 2006 18:24:26 +0000 (GMT) (envelope-from jchoque@tlmat.unican.es) Received: from Altair (altair.tlmat.unican.es [193.144.186.43]) by luna.tlmat.unican.es (8.12.11/8.12.11) with ESMTP id k7BHvvVU004659 for ; Fri, 11 Aug 2006 19:57:57 +0200 From: "Johnny Choque" To: Date: Fri, 11 Aug 2006 20:26:02 +0200 Message-ID: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <86r6znywq8.fsf@xps.des.no> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Aca9bUCgHRp/vlz/TmKdM104OUbH0QABVgOg Subject: RE: Attach/detach devices 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, 11 Aug 2006 18:24:56 -0000 Hi, I sent an email to this mailing list some day ago (August 2) explaining = a problem that I had with devd.conf. Using devd -dD, I detected that = removing the wireless pc card the rules that are included in the detach section = do not happen to run, but anybody answered my question :-( Cheers, Johnny > -----Mensaje original----- > De: owner-freebsd-hackers@freebsd.org=20 > [mailto:owner-freebsd-hackers@freebsd.org] En nombre de=20 > Dag-Erling "Sm=F8rgrav" > Enviado el: viernes, 11 de agosto de 2006 20:05 > Para: Johnny Choque > CC: freebsd-hackers@freebsd.org > Asunto: Re: Attach/detach devices >=20 > "Johnny Choque" writes: > > I'm trying to do a userland program that detect the event when a=20 > > device is attached/detached. >=20 > man devd >=20 > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > _______________________________________________ > freebsd-hackers@freebsd.org mailing list=20 > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to=20 > "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 19:24: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 38D1516A509 for ; Fri, 11 Aug 2006 19:24:17 +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 3CB6243D69 for ; Fri, 11 Aug 2006 19:24: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 82BE720A9; Fri, 11 Aug 2006 21:24:07 +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 68DA32085; Fri, 11 Aug 2006 21:24:07 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 3BCA433C28; Fri, 11 Aug 2006 21:24:07 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: "Johnny Choque" References: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> Date: Fri, 11 Aug 2006 21:24:07 +0200 In-Reply-To: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> (Johnny Choque's message of "Fri, 11 Aug 2006 20:26:02 +0200") Message-ID: <867j1fyt2g.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 Subject: Re: Attach/detach devices 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, 11 Aug 2006 19:24:17 -0000 "Johnny Choque" writes: > I sent an email to this mailing list some day ago (August 2) explaining a > problem that I had with devd.conf. Using devd -dD, I detected that removi= ng > the wireless pc card the rules that are included in the detach section do > not happen to run, but anybody answered my question :-( That's because you didn't ask here; you asked on freebsd-questions, which nobody capable of answering your question ever reads. http://lists.freebsd.org/pipermail/freebsd-questions/2006-August/127990.html DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 20:19: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 0A64616A4E9 for ; Fri, 11 Aug 2006 20:19:17 +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 3730743D5E for ; Fri, 11 Aug 2006 20:19:10 +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 k7BKHMxA013973; Fri, 11 Aug 2006 14:17:23 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 11 Aug 2006 14:17:30 -0600 (MDT) Message-Id: <20060811.141730.-108811090.imp@bsdimp.com> To: jchoque@tlmat.unican.es From: "M. Warner Losh" In-Reply-To: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> References: <86r6znywq8.fsf@xps.des.no> <00d301c6bd73$99ef3fc0$2bba90c1@Altair> 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]); Fri, 11 Aug 2006 14:17:23 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Attach/detach devices 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, 11 Aug 2006 20:19:17 -0000 In message: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> "Johnny Choque" writes: : I sent an email to this mailing list some day ago (August 2) explaining a : problem that I had with devd.conf. Using devd -dD, I detected that removing : the wireless pc card the rules that are included in the detach section do : not happen to run, but anybody answered my question :-( They run for me. Maybe they are commented out for you somehow? Warner From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 20:20: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 B12D516A500 for ; Fri, 11 Aug 2006 20:20:45 +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 C50F343D7F for ; Fri, 11 Aug 2006 20:20:36 +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 k7BKGZgU013939; Fri, 11 Aug 2006 14:16:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 11 Aug 2006 14:16:41 -0600 (MDT) Message-Id: <20060811.141641.824013164.imp@bsdimp.com> To: jchoque@tlmat.unican.es From: "M. Warner Losh" In-Reply-To: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> References: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> 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]); Fri, 11 Aug 2006 14:16:36 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Attach/detach devices 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, 11 Aug 2006 20:20:45 -0000 In message: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> "Johnny Choque" writes: : Hi, : : I'm trying to do a userland program that detect the event when a device is : attached/detached. In particular, I would like to detect these events for : wireless pc card insertion/ejection or when tear down the connection of the : wireless interface build-in laptop. I've found that functions : device_attach/device_detach are used by the kernel when a device is : attached/detached respectively, and, e.g, when a device is detached "a : notification event is sent to userland for user-based device management : service", how can I use that notification event in my userland program? : Could you give me some ideas to do my program? man 8 devd Warner From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 20:25: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 26E7316A4DA for ; Fri, 11 Aug 2006 20:25:20 +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 471F443D62 for ; Fri, 11 Aug 2006 20:25:19 +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 k7BKO4kQ014002; Fri, 11 Aug 2006 14:24:04 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 11 Aug 2006 14:24:11 -0600 (MDT) Message-Id: <20060811.142411.723206251.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <867j1fyt2g.fsf@xps.des.no> References: <00d301c6bd73$99ef3fc0$2bba90c1@Altair> <867j1fyt2g.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]); Fri, 11 Aug 2006 14:24:05 -0600 (MDT) Cc: jchoque@tlmat.unican.es, freebsd-hackers@freebsd.org Subject: Re: Attach/detach devices 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, 11 Aug 2006 20:25:20 -0000 In message: <867j1fyt2g.fsf@xps.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : "Johnny Choque" writes: : > I sent an email to this mailing list some day ago (August 2) explai= ning a : > problem that I had with devd.conf. Using devd -dD, I detected that = removing : > the wireless pc card the rules that are included in the detach sect= ion do : > not happen to run, but anybody answered my question :-( : = : That's because you didn't ask here; you asked on freebsd-questions, : which nobody capable of answering your question ever reads. : = : http://lists.freebsd.org/pipermail/freebsd-questions/2006-August/1279= 90.html The problem is chicken and egg. I see how you are doing this now... detach 0 { media-type "802.11"; action "/etc/pccard_ether $device-name stop"; }; The problem is that by the time the 'detach' comes, the device is no longer in the system. It is long gone. So when we do the comparison against media type, we have no clue what kind of media it is, and the test fails. For now, add a rule matching device name wi. Warner From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 08: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 49DBD16A4DD for ; Sat, 12 Aug 2006 08:42:37 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from mail.interbgc.com (mx04.interbgc.com [217.9.224.231]) by mx1.FreeBSD.org (Postfix) with SMTP id 0EDE943D49 for ; Sat, 12 Aug 2006 08:42:35 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 85497 invoked from network); 12 Aug 2006 08:42:34 -0000 Received: from nike_d@cytexbg.com by keeper.interbgc.com by uid 1002 with qmail-scanner-1.14 (uvscan: v4.2.40/v4374. spamassassin: 2.63. Clear:SA:0(0.1/8.0):. Processed in 2.186776 secs); 12 Aug 2006 08:42:34 -0000 X-Spam-Status: No, hits=0.1 required=8.0 Received: from niked.ddns.cablebg.net (HELO tormentor.totalterror.net) (85.130.14.211) by mx04.interbgc.com with SMTP; 12 Aug 2006 08:42:31 -0000 Received: (qmail 15036 invoked from network); 12 Aug 2006 08:42:31 -0000 Received: from unknown (HELO ?10.0.0.3?) (10.0.0.3) by tormentor.totalterror.net with SMTP; 12 Aug 2006 08:42:31 -0000 Message-ID: <44DD9476.7020706@cytexbg.com> Date: Sat, 12 Aug 2006 11:42:30 +0300 From: Niki Denev User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: John Baldwin References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> In-Reply-To: <200608071527.50711.jhb@freebsd.org> X-Enigmail-Version: 0.94.0.0 OpenPGP: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: jkh weird problem (reading pci device memory) 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, 12 Aug 2006 08:42:37 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Baldwin wrote: > On Saturday 05 August 2006 10:06, Niki Denev wrote: >> for(i=0; i < sizeof(config_table_t); i++) { >> r = bus_space_read_1(sc->bar.tag, sc->bar.hdl, i); >> *((u_int8_t *)&sc->cfg_table + i) = r; >> } > > Note that you can replace this with: > > bus_space_read_multi_1(sc->bar.tag, sc->bar.hdl, 0, > (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); > I can't understand why the code above gives me different results. i.e.: for(i=0; i < sizeof(config_table_t); i++) { *((u_int8_t *)&sc->cfg_table + i) = bus_read_1(sc->res, i); } printf("cfg_table signature : %08X\n", sc->cfg_table.signature); This prints : cfg_table signaature 0xEFEFFEFE, which is the correct signature that should be read from the card. But this code : bus_read_multi_1(sc->res, 0, (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); printf("cfg_table signature : %08X\n", sc->cfg_table.signature); prints : cfg_table signature 0xFEFEFEFE which is not correct... Shouldn't the above examples do exactly the same thing? - --niki -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE3ZR2HNAJ/fLbfrkRAlVBAJ42fHV0cQ4uw5SIdUl7TQHaKkBSKQCZAcd6 eCFWNusXoCuqm88OObX+AFw= =J0mZ -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 16: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 65A8316A4DF for ; Sat, 12 Aug 2006 16:36:38 +0000 (UTC) (envelope-from artifact.one@googlemail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id D300443D6B for ; Sat, 12 Aug 2006 16:36:32 +0000 (GMT) (envelope-from artifact.one@googlemail.com) Received: by nf-out-0910.google.com with SMTP id g2so1448446nfe for ; Sat, 12 Aug 2006 09:36:31 -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=mPfCeyBcDFoVoBA4CtCSvYzZr1BBdp1woMFJZdixpeaAl6uiYY161qHMIRLAGxdVNj5dwrZ3AVR+BmZzgQxJR4/1SpwDyVgFxGMYJETz95sS0VkjTAS/kkY1AqdMCLCs6JY7kjz2X/eh5RfKrxpQkzKRAiCEEAJ6j5DqpptmzEs= Received: by 10.78.193.19 with SMTP id q19mr2615928huf; Sat, 12 Aug 2006 09:36:30 -0700 (PDT) Received: by 10.78.43.9 with HTTP; Sat, 12 Aug 2006 09:36:30 -0700 (PDT) Message-ID: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> Date: Sat, 12 Aug 2006 17:36:30 +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: 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: Sat, 12 Aug 2006 16:36:38 -0000 Hello, this is a simplified re-phrasing of a question posted to questions@. It didn't get any answers over there because I think people took one look at it and switched off. A cut down version follows... How does one do packet filtering on tap interfaces? I'm using qemu and I'm going to be loading some untrusted OS images so I'd like complete filtering of packets to and from the qemu process. I was given a partial solution by somebody before, but I couldn't get it to work. I'm currently: 1. Using bridge.sh[1] to bridge between tap0 and my real fxp0 interface. 2. Trying to log or filter packets on tap0. My current pf.conf looks like this: nic0 = "fxp0" host_ip = "192.168.2.5" pass in log all pass out log all Which should surely filter everything. However, I can use the network on the guest OS (going through tap0) without ever triggering the pf logging. Why is this happening? Even when explicity specifying: pass in log all on tap0 pass out log all on tap0 I still don't see any logs. Can tap interfaces reliably be filtered? MC [1] http://www.freebsd.org/cgi/cvsweb.cgi/src/share/examples/netgraph/ether.bridge From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 17:28: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 1F95016A4DD for ; Sat, 12 Aug 2006 17:28:20 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EC6E43D45 for ; Sat, 12 Aug 2006 17:28:19 +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 01:28:17 +0800 id 00102E27.44DE0FB1.0001160E From: "Intron" To: freebsd-hackers@freebsd.org Date: Sun, 13 Aug 2006 01:28:17 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Subject: 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: Sat, 12 Aug 2006 17:28:20 -0000 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 From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 17:35: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 6D4D516A4DA for ; Sat, 12 Aug 2006 17:35:37 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E2E243D46 for ; Sat, 12 Aug 2006 17:35:36 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.180.29] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1GBxOY17Jb-0005lJ; Sat, 12 Aug 2006 19:35:34 +0200 From: Max Laier Organization: FreeBSD To: freebsd-hackers@freebsd.org Date: Sat, 12 Aug 2006 19:35:27 +0200 User-Agent: KMail/1.9.3 References: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> In-Reply-To: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4112652.B6gO07oNMV"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200608121935.33395.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: mal content 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: Sat, 12 Aug 2006 17:35:37 -0000 --nextPart4112652.B6gO07oNMV Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 12 August 2006 18:36, mal content wrote: > Hello, this is a simplified re-phrasing of a question posted to > questions@. It didn't get any answers over there because I > think people took one look at it and switched off. A cut down > version follows... > > How does one do packet filtering on tap interfaces? I'm using > qemu and I'm going to be loading some untrusted OS images > so I'd like complete filtering of packets to and from the qemu > process. > > I was given a partial solution by somebody before, but I couldn't > get it to work. > > I'm currently: > > 1. Using bridge.sh[1] to bridge between tap0 and my real fxp0 > interface. > > 2. Trying to log or filter packets on tap0. > > My current pf.conf looks like this: > > nic0 =3D "fxp0" > host_ip =3D "192.168.2.5" > pass in log all > pass out log all > > Which should surely filter everything. However, I can use the > network on the guest OS (going through tap0) without ever > triggering the pf logging. Why is this happening? Even when > explicity specifying: > > pass in log all on tap0 > pass out log all on tap0 > > I still don't see any logs. > > Can tap interfaces reliably be filtered? This is because the packets never make it to the IP-Layer (where our=20 packet filters normally hook into). You can try to use if_bridge(4) to=20 bridge tap0 and fxp0. if_bridge(4) offers extensive means of packet=20 filtering described in the man page in great detail. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart4112652.B6gO07oNMV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBE3hFlXyyEoT62BG0RAt17AJ92xVakPAnAbUvATURqMKDI4g81fACcCl5g enRgPkm4C5uc7qJZetiQlr0= =Lb/4 -----END PGP SIGNATURE----- --nextPart4112652.B6gO07oNMV-- From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 18:09: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 6A76016A4E0; Sat, 12 Aug 2006 18:09:39 +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 D85FF43D45; Sat, 12 Aug 2006 18:09:38 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (m6mrs3iru1dnp6tm@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k7CI9afP072114; Sat, 12 Aug 2006 11:09: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 k7CI9Yp3072113; Sat, 12 Aug 2006 11:09:34 -0700 (PDT) (envelope-from jmg) Date: Sat, 12 Aug 2006 11:09:34 -0700 From: John-Mark Gurney To: Niki Denev Message-ID: <20060812180934.GN99774@funkthat.com> Mail-Followup-To: Niki Denev , John Baldwin , freebsd-hackers@freebsd.org References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> <44DD9476.7020706@cytexbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44DD9476.7020706@cytexbg.com> 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: jkh weird problem (reading pci device memory) 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: Sat, 12 Aug 2006 18:09:39 -0000 Niki Denev wrote this message on Sat, Aug 12, 2006 at 11:42 +0300: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > John Baldwin wrote: > > On Saturday 05 August 2006 10:06, Niki Denev wrote: > >> for(i=0; i < sizeof(config_table_t); i++) { > >> r = bus_space_read_1(sc->bar.tag, sc->bar.hdl, i); > >> *((u_int8_t *)&sc->cfg_table + i) = r; > >> } > > > > Note that you can replace this with: > > > > bus_space_read_multi_1(sc->bar.tag, sc->bar.hdl, 0, > > (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); > > > > I can't understand why the code above gives me different results. > i.e.: > > for(i=0; i < sizeof(config_table_t); i++) { > *((u_int8_t *)&sc->cfg_table + i) = bus_read_1(sc->res, i); > } > printf("cfg_table signature : %08X\n", sc->cfg_table.signature); > > This prints : cfg_table signaature 0xEFEFFEFE, which is the correct signature > that should be read from the card. > > But this code : > > bus_read_multi_1(sc->res, 0, (u_int8_t *)&sc->cfg_table, sizeof(config_table_t)); > printf("cfg_table signature : %08X\n", sc->cfg_table.signature); > > prints : cfg_table signature 0xFEFEFEFE > which is not correct... > > Shouldn't the above examples do exactly the same thing? No, read_multi reads from the same location every time.. This is for things like a FIFO where the value can change each time, you want bus_read_region_1... Read the bus_space(9) man page for more info about the differences between the two... http://www.freebsd.org/cgi/man.cgi?query=bus_space&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format=html -- 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 Sat Aug 12 18:48:34 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 4B02216A4E0 for ; Sat, 12 Aug 2006 18:48:34 +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 98F8143D79 for ; Sat, 12 Aug 2006 18:48:23 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 24339 invoked by uid 1001); 12 Aug 2006 18:47:34 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Sat, 12 Aug 2006 14:47:34 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17630.8773.656653.169665@bhuda.mired.org> Date: Sat, 12 Aug 2006 14:47:33 -0400 To: hackers@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\ From: Mike Meyer X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) Cc: Subject: 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: Sat, 12 Aug 2006 18:48:34 -0000 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. Thanks, http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 21:12: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 64C8316A4E1 for ; Sat, 12 Aug 2006 21:12:10 +0000 (UTC) (envelope-from artifact.one@googlemail.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 232A443D45 for ; Sat, 12 Aug 2006 21:12:05 +0000 (GMT) (envelope-from artifact.one@googlemail.com) Received: by nf-out-0910.google.com with SMTP id g2so1508173nfe for ; Sat, 12 Aug 2006 14:12:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aV6W46Asgzmvn3d0KZWbeFCeK3YolSfQpl1gE4Cs2E8RnYSGQll8q2CdGzhragKTxOenc+DJxuOAt6rONbVzdVsRrb5kE7vsLnVqeQDkMPOTakj8b0np2lQ1kDp5HoMSVtoT0PximTwXEt1nO2BSCaLCKdNIyM2kF3ct8fWd5LU= Received: by 10.78.159.7 with SMTP id h7mr2697436hue; Sat, 12 Aug 2006 14:12:04 -0700 (PDT) Received: by 10.78.43.9 with HTTP; Sat, 12 Aug 2006 14:12:04 -0700 (PDT) Message-ID: <8e96a0b90608121412u50d9add8g8e3573990134ae2c@mail.gmail.com> Date: Sat, 12 Aug 2006 22:12:04 +0100 From: "mal content" To: "Max Laier" In-Reply-To: <200608121935.33395.max@love2party.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8e96a0b90608120936q67a5365vcc97217b44a272c0@mail.gmail.com> <200608121935.33395.max@love2party.net> 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: Sat, 12 Aug 2006 21:12:10 -0000 On 12/08/06, Max Laier wrote: > > This is because the packets never make it to the IP-Layer (where our > packet filters normally hook into). You can try to use if_bridge(4) to > bridge tap0 and fxp0. if_bridge(4) offers extensive means of packet > filtering described in the man page in great detail. > Ah, thanks, I didn't know that existed (and I've even got the kernel module loaded for some reason). If I'm understanding that manual page correctly, I would put pf rules on 'bridge0', yes? MC From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 12 21:49: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 97F2B16A4DA for ; Sat, 12 Aug 2006 21:49:57 +0000 (UTC) (envelope-from nike_d@tormentor.totalterror.net) Received: from mail.interbgc.com (mx03.interbgc.com [217.9.224.229]) by mx1.FreeBSD.org (Postfix) with SMTP id 9B44943D46 for ; Sat, 12 Aug 2006 21:49:55 +0000 (GMT) (envelope-from nike_d@tormentor.totalterror.net) Received: (qmail 23738 invoked from network); 12 Aug 2006 21:49:53 -0000 Received: from nike_d@tormentor.totalterror.net by keeper.interbgc.com by uid 1002 with qmail-scanner-1.14 (uvscan: v4.2.40/v4374. spamassassin: 2.63. Clear:SA:0(0.1/8.0):. Processed in 1.624182 secs); 12 Aug 2006 21:49:53 -0000 X-Spam-Status: No, hits=0.1 required=8.0 Received: from niked.ddns.cablebg.net (HELO tormentor.totalterror.net) (85.130.14.211) by mx03.interbgc.com with SMTP; 12 Aug 2006 21:49:51 -0000 Received: (qmail 9595 invoked from network); 12 Aug 2006 21:49:51 -0000 Received: from unknown (HELO tormentor.totalterror.net) (10.0.0.2) by tormentor.totalterror.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 Aug 2006 21:49:51 -0000 References: <44D4A5DC.7080403@cytexbg.com> <200608071527.50711.jhb@freebsd.org> <44DD9476.7020706@cytexbg.com> <20060812180934.GN99774@funkthat.com> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: John-Mark Gurney Date: Sun, 13 Aug 2006 00:49:51 +0300 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 12 Aug 2006 23:28:19 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: jkh weird problem (reading pci device memory) [ Success story ! ] 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, 12 Aug 2006 21:49:57 -0000 John-Mark Gurney writes: > No, read_multi reads from the same location every time.. This is for > things like a FIFO where the value can change each time, you want > bus_read_region_1... Read the bus_space(9) man page for more info > about the differences between the two... > > http://www.freebsd.org/cgi/man.cgi?query=bus_space&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format=html > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." Oh, that's what i was looking for... thanks. I'm very new to all this, and it seems like i overloaded myself with information, and began to lose details. ( next time i'll read more carefully, and will not use lame excuses like this :) ) However, the good news is that i made some progress and now i can talk to the 3G card! The tty code is still a mess, (well, not only the tty code is a mess :) ) and i can't start PPP session yet, but issuing AT commands and getting response from the card works! phobos# uname -a FreeBSD phobos 7.0-CURRENT FreeBSD 7.0-CURRENT #11: Fri Jun 30 09:11:17 EDT 2006 root@phobos:/usr/obj/usr/src/sys/PHOBOS i386 -> card insert here nozomi0: