From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 31 23:00:13 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B444F16A419 for ; Mon, 31 Dec 2007 23:00:13 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta2.rz.uni-regensburg.de (rrzmta2.rz.uni-regensburg.de [194.94.155.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6E9B913C43E for ; Mon, 31 Dec 2007 23:00:13 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta2.rz.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 79048555CB; Tue, 1 Jan 2008 00:00:20 +0100 (CET) Received: from yeti.mininet (rrzras1-25.rz.uni-regensburg.de [132.199.208.35]) by rrzmta2.rz.uni-regensburg.de (Postfix) with ESMTP id C2CCF55522; Tue, 1 Jan 2008 00:00:04 +0100 (CET) X-Mailer: emacs 21.3.1 (via feedmail 8 I); VM 7.19 under Emacs 21.3.1 From: "Markus Hoenicka" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18297.29732.232221.862066@yeti.mininet> Date: Mon, 31 Dec 2007 23:58:44 +0100 To: John Baldwin In-Reply-To: <200712311735.43320.jhb@freebsd.org> References: <18297.6718.750894.937199@yeti.mininet> <18297.20596.564077.568365@yeti.mininet> <47796B43.9050704@elischer.org> <200712311735.43320.jhb@freebsd.org> X-Mailman-Approved-At: Tue, 01 Jan 2008 01:29:20 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 31 Dec 2007 23:00:13 -0000 John Baldwin writes: > need this. If you used a regular old static C++ singleton on 6.x instead of > trying to be cute and call atexit() directly you would be fine. I've no idea > if Linux treats atexit() special. > Just to make it clear: it is not me trying to be cute but the Firebird folks. I'm just trying to use their client library in a dlopen()ed module, and I was investigating whether something can be done from the FreeBSD end. I've also forwarded Alexander's reply to the Firebird folks for consideration. regards, Markus -- Markus Hoenicka markus.hoenicka@cats.de (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 03:01:28 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0DED16A41A for ; Tue, 1 Jan 2008 03:01:28 +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 4A17013C467 for ; Tue, 1 Jan 2008 03:01:28 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.12.9/8.12.9) id m0131NZh070549; Mon, 31 Dec 2007 19:01:23 -0800 (PST) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.209] (p54.kientzle.com [66.166.149.54]) by kientzle.com with SMTP; Mon, 31 Dec 2007 19:01:23 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <4779AD03.1060505@freebsd.org> Date: Mon, 31 Dec 2007 19:01:23 -0800 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: Markus Hoenicka References: <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> In-Reply-To: <18297.20596.564077.568365@yeti.mininet> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 01 Jan 2008 03:01:28 -0000 Markus Hoenicka wrote: > Alexander Kabaev writes: > > As designed. atexit should not be used by shared objects that do not > > expect themselves to live until actual exit() happens. ELF provides > > proper _init/_fini sections to support shared object > > initialization/destruction. > > > > That is, the only real solution to this problem is to convince the > Firebird folks to remove their atexit() calls from the client > libraries? I suspect they never considered that their dynamic library might be used via dlopen()/dlclose(). The real question is whether they're interesting in supporting this model. If the Firebird folks aren't interested in having their library be accessible in that fashion, then you have little choice but to simply forgo unloading this particular library. It's a bit unfortunate that there is no standard way to remove an atexit() registration. It would probably be easier to convince the Firebird folks to remove the registration as part of their cleanup routines (and you could then invoke those cleanup routines manually for that case). > Also, I'm wondering how other OSes handle this. I don't see this > code crash on Linux, contrary to its design as you say. I would be curious to see the results of running your sample program (with lots of extra fprint(stderr...) calls, of course) on Linux to see whether it calls the registered exit function at dlclose time or never. I suspect the answer is "never." If I'm right, the Firebird folks might be easier to convince (since it means that their atexit() registration isn't really reliable anywhere). Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 03:54:03 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BB3E16A421 for ; Tue, 1 Jan 2008 03:54:03 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id F1CC713C459 for ; Tue, 1 Jan 2008 03:54:02 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m013ru29029148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jan 2008 14:53:57 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m013rulG038978; Tue, 1 Jan 2008 14:53:56 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m013rtrc038977; Tue, 1 Jan 2008 14:53:55 +1100 (EST) (envelope-from peter) Date: Tue, 1 Jan 2008 14:53:55 +1100 From: Peter Jeremy To: Chuck Robey Message-ID: <20080101035355.GM72458@server.vk2pj.dyndns.org> References: <86abo1g2pu.fsf@ds4.des.no> <476EA521.9020707@chuckr.org> <20071224131425.GF23337@cicely12.cicely.de> <47715E1F.9080502@chuckr.org> <86sl1qikam.fsf@ds4.des.no> <477440A2.4070601@chuckr.org> <86sl1n14vv.fsf@ds4.des.no> <477698D8.2040802@chuckr.org> <20071229213216.GV40785@server.vk2pj.dyndns.org> <47782631.6070305@chuckr.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: <47782631.6070305@chuckr.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: FreeBSD-Hackers Subject: Re: printing boot probe messages X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 03:54:03 -0000 --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 30, 2007 at 06:13:53PM -0500, Chuck Robey wrote: >during booting is to call out a verbose boot. If I do that, then the boot >messages DO print during booting, and examination afterwards shows a big >file (~ 60K in size). This happens if I use /boot.config=3D=3D-v, or if I >enter option #5 to the beastie menu, or even if I call out a manual loader >run, and enter boot -v at the prompt. > >If I do none of those things, it will not print boot messages. This doesn't really make sense because the only difference is code like if (bootverbose) printf("Lots more detail\n"); and there shouldn't be any side-effects. > After >booting, if I do a "dmesg > dm" then the resulting file is only about 10k >in size, and things like the enormous pci probing don't show up. That makes sense. > At this >moment, I'm in a boot that wasn't printed, and I just got a 0 back from a >"sysctl debug.bootverbose" That is also correct. >Right now, I moved my /boot.config to /notboot.config. My loader.conf is > >boot_mute=3D"NO" I think this is your problem. The kernel doesn't look at the value of the environment variable, just whether or not it is set. Try removing or commenting out this line and check for other occurrences of "boot_mute" >verbose_loading=3D"YES" verbose_loading is different to boot_verbose. The former makes the forth boot loader more verbose, the latter is passed onto the kernel and makes it more verbose. >Sure. "sysctl debug.boothowto" returns -2147418112, any idea what that >means? It's a bitmask of values defined in -2147418112 =3D=3D 0x80010000 =3D=3D RB_BOOTINFO | RB_MUTE The "RB_MUTE" explains the lack of console messages and is caused by the boot_mute=3D"NO" in your kenv output. Other than that, the kenv all looks reasonable. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHeblT/opHv/APuIcRAu2CAKCtZkH8fAMNd9Ja+RGVUhH5A2nwhgCdH/K5 lyDogVQ+QUT6VKVDRI1N6AM= =qLcV -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 15:40:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E63C516A41A for ; Tue, 1 Jan 2008 15:40:26 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAEE13C4D9 for ; Tue, 1 Jan 2008 15:40:26 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so1056634anc.13 for ; Tue, 01 Jan 2008 07:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; bh=JiOU2g+BXUckPkn7v4oahALbim84hTM8ErAhVYYQNQE=; b=WZnB53oEx6fxCfuhsDV5G7zb/1ZCz6IJ+vUxO07qUSJ7j9hUJWkTlNc+1kgM0GU9/PruN5nRJvgaG+pU5KbpglbkfBRjqjR+GiLxllcTbYyjPORjcGgzoUel7tEuHyjY3sTzoGavPMOw6g8Zh9wLqoTAysC+0F+P8BHzEyY/mtY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=JwDXnvuPVEDWA9xd/Zxg+C2EVtAxp4vZBIi9TrFAV0sCFKIkLEmid9z697oSn1Qt54s+4WeDUThYMDVeswH9eM+xMTzs9b+ZIl27EaXVNdiZ1obWXoo2EiJO0Y+hiA3frS978fR3Eg91wqFsqtz9iVoIEwsdJPabW/9RXzfDZOw= Received: by 10.101.68.19 with SMTP id v19mr28065847ank.4.1199202025908; Tue, 01 Jan 2008 07:40:25 -0800 (PST) Received: from kan.dnsalias.net ( [24.218.183.247]) by mx.google.com with ESMTPS id 31sm13055388wri.24.2008.01.01.07.40.23 (version=SSLv3 cipher=OTHER); Tue, 01 Jan 2008 07:40:24 -0800 (PST) Date: Tue, 1 Jan 2008 10:40:18 -0500 From: Alexander Kabaev To: Tim Kientzle Message-ID: <20080101104018.0fe51d67@kan.dnsalias.net> In-Reply-To: <4779AD03.1060505@freebsd.org> References: <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> <4779AD03.1060505@freebsd.org> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/py4gisGwkapcdZ84_msMOkv"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-hackers@freebsd.org, Markus Hoenicka Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 01 Jan 2008 15:40:27 -0000 --Sig_/py4gisGwkapcdZ84_msMOkv Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 31 Dec 2007 19:01:23 -0800 Tim Kientzle wrote: > Markus Hoenicka wrote: > > Alexander Kabaev writes: > > > As designed. atexit should not be used by shared objects that do > > > not expect themselves to live until actual exit() happens. ELF > > > provides proper _init/_fini sections to support shared object > > > initialization/destruction. > > >=20 > >=20 > > That is, the only real solution to this problem is to convince the > > Firebird folks to remove their atexit() calls from the client > > libraries? >=20 > I suspect they never considered that their dynamic library > might be used via dlopen()/dlclose(). The real question is > whether they're interesting in supporting this model. > If the Firebird folks aren't interested in having their > library be accessible in that fashion, then you have > little choice but to simply forgo unloading this particular > library. >=20 > It's a bit unfortunate that there is no standard way > to remove an atexit() registration. It would probably > be easier to convince the Firebird folks to remove the > registration as part of their cleanup routines (and > you could then invoke those cleanup routines manually > for that case). >=20 > > Also, I'm wondering how other OSes handle this. I don't see this > > code crash on Linux, contrary to its design as you say. >=20 > I would be curious to see the results of running your > sample program (with lots of extra fprint(stderr...) > calls, of course) on Linux to see whether it calls the > registered exit function at dlclose time or never. >=20 Linux pulls hidden atexit symbol into every binary that uses it by means of linking in libc_nonshared.a into every glibc consumer. Having local function allows for reliable determination of who has called the atexit function. Linux calls atexit entries at object unload time. Solaris implements a libc callback from ld.so.1 to cleanup dangling pointers from objects being unloaded. This resets sigaction entries, atfork and atexit callbacks. Solaris calls atexit callback when removing it too. I guess we better follow the suit, if anyone wants to that. I prefer Solaris approach myself, but see the reason for Linux one too. --=20 Alexander Kabaev --Sig_/py4gisGwkapcdZ84_msMOkv Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHel7iQ6z1jMm+XZYRApSYAKDQvld7nzJom/cJxM1aEX/EEpTEGACgtb4E htCiKwZa6bKLOSNr99KfPE0= =ziMS -----END PGP SIGNATURE----- --Sig_/py4gisGwkapcdZ84_msMOkv-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 15:44:46 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD4116A419 for ; Tue, 1 Jan 2008 15:44:46 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta1.rz.uni-regensburg.de (rrzmta1.rz.uni-regensburg.de [194.94.155.51]) by mx1.freebsd.org (Postfix) with ESMTP id 78C1613C468 for ; Tue, 1 Jan 2008 15:44:46 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta1.rz.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id C822E50A1B; Tue, 1 Jan 2008 16:44:49 +0100 (CET) Received: from yeti.mininet (rrzras1-24.rz.uni-regensburg.de [132.199.208.34]) by rrzmta1.rz.uni-regensburg.de (Postfix) with ESMTP id 748EE50974; Tue, 1 Jan 2008 16:44:43 +0100 (CET) X-Mailer: emacs 21.3.1 (via feedmail 8 Q); VM 7.19 under Emacs 21.3.1 From: "Markus Hoenicka" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18298.23974.148428.962657@yeti.mininet> Date: Tue, 1 Jan 2008 16:35:02 +0100 To: Tim Kientzle In-Reply-To: <4779AD03.1060505@freebsd.org> References: <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> <4779AD03.1060505@freebsd.org> X-Mailman-Approved-At: Tue, 01 Jan 2008 16:11:40 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 01 Jan 2008 15:44:46 -0000 Tim Kientzle writes: > I would be curious to see the results of running your > sample program (with lots of extra fprint(stderr...) > calls, of course) on Linux to see whether it calls the > registered exit function at dlclose time or never. > > I suspect the answer is "never." If I'm right, the > Firebird folks might be easier to convince (since it > means that their atexit() registration isn't really > reliable anywhere). > I've opened a Firebird bug report, so please don't misread me as "please fix it on the FreeBSD end". But interestingly, I get the following output of my test program on Linux (note that you have to link against libdl on Linux as their libc does not contain the dl* functions): markus@ocean:~/prog/datest$ ./datest hello driver now exiting So the installed handler is called and runs ok. I'm wondering if this just so happens to work, or if Linux uses some weird mechanism to keep the installed routines accessible. But again, there is no need to investigate this any further, I'm just curious by design. regards, Markus -- Markus Hoenicka markus.hoenicka@cats.de (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 18:30:44 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0828816A418 for ; Tue, 1 Jan 2008 18:30:44 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: from mail4.sea5.speakeasy.net (mail4.sea5.speakeasy.net [69.17.117.6]) by mx1.freebsd.org (Postfix) with ESMTP id D4E3B13C447 for ; Tue, 1 Jan 2008 18:30:43 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: (qmail 13481 invoked from network); 1 Jan 2008 18:30:43 -0000 Received: from april.chuckr.org (chuckr@[66.92.151.30]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 1 Jan 2008 18:30:42 -0000 Message-ID: <477A85F7.1030906@chuckr.org> Date: Tue, 01 Jan 2008 13:27:03 -0500 From: Chuck Robey User-Agent: Thunderbird 2.0.0.6 (X11/20071107) MIME-Version: 1.0 To: Peter Jeremy References: <86abo1g2pu.fsf@ds4.des.no> <476EA521.9020707@chuckr.org> <20071224131425.GF23337@cicely12.cicely.de> <47715E1F.9080502@chuckr.org> <86sl1qikam.fsf@ds4.des.no> <477440A2.4070601@chuckr.org> <86sl1n14vv.fsf@ds4.des.no> <477698D8.2040802@chuckr.org> <20071229213216.GV40785@server.vk2pj.dyndns.org> <47782631.6070305@chuckr.org> <20080101035355.GM72458@server.vk2pj.dyndns.org> In-Reply-To: <20080101035355.GM72458@server.vk2pj.dyndns.org> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD-Hackers Subject: Re: printing boot probe messages X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 18:30:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Jeremy wrote: > On Sun, Dec 30, 2007 at 06:13:53PM -0500, Chuck Robey wrote: >> during booting is to call out a verbose boot. If I do that, then the boot >> messages DO print during booting, and examination afterwards shows a big >> file (~ 60K in size). This happens if I use /boot.config==-v, or if I >> enter option #5 to the beastie menu, or even if I call out a manual loader >> run, and enter boot -v at the prompt. >> >> If I do none of those things, it will not print boot messages. > > This doesn't really make sense because the only difference is code like > if (bootverbose) > printf("Lots more detail\n"); > and there shouldn't be any side-effects. > >> After >> booting, if I do a "dmesg > dm" then the resulting file is only about 10k >> in size, and things like the enormous pci probing don't show up. > > That makes sense. > >> At this >> moment, I'm in a boot that wasn't printed, and I just got a 0 back from a >> "sysctl debug.bootverbose" > > That is also correct. > >> Right now, I moved my /boot.config to /notboot.config. My loader.conf is >> >> boot_mute="NO" > > I think this is your problem. The kernel doesn't look at the value of > the environment variable, just whether or not it is set. Try removing > or commenting out this line and check for other occurrences of "boot_mute" Fantastic, that was it! There is a strong chance that at some point, I also had something wrong with my device.hints, because that boot_mute line wasn't in there when my non-printing problems began, I put it in while searching for something to make the probes print. During this, I think I finally got my worst misunderstanding, that of how to formulate a good device.hints, corrected. Anyhow, great to finally have this fixed, thanks, now I can get back to my real problems (which I am not hitting the list with). > >> verbose_loading="YES" > > verbose_loading is different to boot_verbose. The former makes the forth > boot loader more verbose, the latter is passed onto the kernel and makes > it more verbose. > >> Sure. "sysctl debug.boothowto" returns -2147418112, any idea what that >> means? > > It's a bitmask of values defined in > -2147418112 == 0x80010000 == RB_BOOTINFO | RB_MUTE > > The "RB_MUTE" explains the lack of console messages and is caused by > the boot_mute="NO" in your kenv output. Other than that, the kenv > all looks reasonable. > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHeoX3z62J6PPcoOkRAgsfAJkBgbRWWnT1AOiWhZuRMJKOKGYi+ACbBpTd ZjjQq71Ll9ZjUNYlGHTByoc= =AdUW -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 18:41:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C6E016A419 for ; Tue, 1 Jan 2008 18:41:57 +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 03BE713C455 for ; Tue, 1 Jan 2008 18:41:56 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.12.9/8.12.9) id m01IfqQS075669; Tue, 1 Jan 2008 10:41:52 -0800 (PST) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.209] (p54.kientzle.com [66.166.149.54]) by kientzle.com with SMTP; Tue, 01 Jan 2008 10:41:51 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <477A896F.4050509@freebsd.org> Date: Tue, 01 Jan 2008 10:41:51 -0800 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: Alexander Kabaev References: <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> <4779AD03.1060505@freebsd.org> <20080101104018.0fe51d67@kan.dnsalias.net> In-Reply-To: <20080101104018.0fe51d67@kan.dnsalias.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Markus Hoenicka Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 01 Jan 2008 18:41:57 -0000 >>>Also, I'm wondering how other OSes handle this. I don't see this >>>code crash on Linux, contrary to its design as you say. >> >>I would be curious to see the results of running your >>sample program ... on Linux to see whether it calls the >>registered exit function at dlclose time or never. > > Linux pulls hidden atexit symbol into every binary that uses it > ... Linux calls atexit entries at object unload time. > > Solaris implements a libc callback from ld.so.1 ... > Solaris calls atexit callback when removing it too. Interesting. So the consensus here (at least for Linux and Solaris, anyone know about Mac OS?) seems to be that atexit() can be called from a dynamically loaded library and that functions registered this way will be called at library unload time. And FreeBSD doesn't implement this behavior. Tim Kientzle From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 18:39:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D7D16A417 for ; Tue, 1 Jan 2008 18:39:57 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from mother.ludd.ltu.se (mother.ludd.ltu.se [130.240.16.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9A72B13C455 for ; Tue, 1 Jan 2008 18:39:56 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from brother.ludd.ltu.se (root@brother.ludd.ltu.se [130.240.16.78]) by mother.ludd.ltu.se (8.13.6+Sun/8.12.10) with ESMTP id m01IMZND015434 for ; Tue, 1 Jan 2008 19:22:35 +0100 (MET) Received: from brother.ludd.ltu.se (pb@localhost [127.0.0.1]) by brother.ludd.ltu.se (8.13.6+Sun/8.12.2) with ESMTP id m01IMZMt017096 for ; Tue, 1 Jan 2008 19:22:35 +0100 (MET) Received: (from pb@localhost) by brother.ludd.ltu.se (8.13.6+Sun/8.13.6/Submit) id m01IMZ9K017094 for freebsd-hackers@freebsd.org; Tue, 1 Jan 2008 19:22:35 +0100 (MET) From: Peter B Message-Id: <200801011822.m01IMZ9K017094@brother.ludd.ltu.se> To: freebsd-hackers@freebsd.org Date: Tue, 1 Jan 2008 19:22:35 +0100 (MET) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 01 Jan 2008 18:44:26 +0000 Subject: 6.2R Patch to allow broken frames 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, 01 Jan 2008 18:39:57 -0000 I had to debug an phy+fpga setup and found this patch that makes tx(4) to allow broken/runt frames and includes both mac and crc32 useful. Maybe this could be a feature in the network drivers? (or some) I don't consider this production code. Rather a demo/suggestion. The quick patch is to just do the changes to tx_if.c disregarding any IFF_* flags. Any information if this would interfere with normal operation would be welcome. /P begin 644 patch_allow_broken_packets.bz2 M0EIH.3%!62936?DH3:L``:??@&@Z>7__^[__W^2_[__N8`:\^3,T`-``%``` ME$2CT>HF0TT>H?JCTCR@TQJ9``/4#0!Z@T-#C)DT:`T:8C(T,0P)HTQ!B-!A M``8<9,FC0&C3$9&AB&!-&F(,1H,(`#!(E1/()H9`&F0T`::&C0`&F0```<9, MFC0&C3$9&AB&!-&F(,1H,(`#`JB30!$VDQ-`1-/4&4Q&3$Q--&0,GJ,CR&IC M&'43;8U"H(*A.@D&*$TTTQC4PE@;#?N7)$KI>:)R:@NWVXGBD&`PD1!!E$&H M?BIWNA4O4E5]BQ[%IV)BE_#[4678)BU2+IQTL3NI"N#K16M9SP]\Q46Y72LN M][WIPVHPCP2F3&)L;"P-*!I*(A%="!L:;I59LVP-`5"2/)&2H4P"08I[39[D MH^\_I"WA*56=BG#M637DLM;69(0Q13-60K7R_.,&H;I8NJN^AENABHQ4BGHA*P^\_871<]I^BC!7?N. M'AT+H\%UJQ@]3E=P8LV"Q6?,FN:BD9,[L<67L8J86]73,S,S1M?1PW/F=A2M M(3-.6^%=UKXZ>FBN MYS1\LHF)1+9)1$'4A8B43!,+GR/&(P;71QB.IL8/J4Q+V;YG%A1.#T.N"W(_E)R9LF1X%61H)/8X0^W2/2ZJH<[> M[FL2*OL*J?-12([4K5C%0ZPZ M*.]F^5>T8C%M*9RL4DF8W7:)6*);CY\XO=1?28OO2E19G.&:MJ5RBS!;3*C1 M9>G"MBD842P+6%ZM5J5E-#4H5+X4OV49M(P8*L;XHFN5?GI-,+-^V^FF,V^) M\LA&/);LPXA@C%FG,!GAPBHAN((+RX2@\A2N<7D]<1_;_E5>F<2S3)1^ M225L?\?5U=C;"T]Q@^."6<6DWK#1 M2R)PBR(;_W#BU8?DRP574N>HS=+=`RI$602C;>;4;FL?(]2UMXLUL4AS90]- MT=]DS#)JR8J0=IP*QWFC?+O:(M@O'..1JU:*/@3B^)@XH7/B2.2.HX.Y8VP7 MX&?>[5#W6;`Z7%#UKM[%;BCBSBD&+-8T53*MA82O;E[@4$I.<;AN7NIT;:7R MP7#FMM77M&]FU535JQKM0W(8F-B.B6Q?#=#[MK)>SA-W$YQ MV.U6B]H;B74Z7AT+.U$ M>2.^(I!D[F+11KA18N*.*F*JMWME+?H^!^T^E+[A>LE!@Q!^Q2.]!%/2\^HT MX$22*.NY=",]\?J3#GDS8.IG& M,1=G][(T8Q%S!R7E$DI2(M%D0W[6[5PA*]>K1$K))HO-LC\^M^B,Z(=K"(R6KV9J/U,5(AJJT,8ULVG<<;\(17X=,W@E/\5\>2%_ M7F8-.QO8,RBD%%V%7EVW0JRBDI44<':6+KL5J=8_),7L281S8BC*%,EM2R$Q MQ=\Z/+U;SQPWQ$6S"^^?(88->1AL8(EI:5Z*M*)DM%S10>][_HO.<3X&UDL9 M[-784=D>9UO'A113*FLQ&BQVEBYVF3N71&-L:1%J@N%OEKL++5BJTZ.5S9+K MLN6RJ5+>M1N@Z(987Q%L6'=?/$;8AQ1B:I)3#_XNY(IPH2'R4)M6` ` end From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 21:20:06 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8B916A418 for ; Tue, 1 Jan 2008 21:20:06 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id C17C413C458 for ; Tue, 1 Jan 2008 21:20:05 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so9599794pyb.10 for ; Tue, 01 Jan 2008 13:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=cl7VI4fx8hK4Pa+1YtbYCf9LjeNowMokicY8oZWnIbo=; b=Nbd8vDQbTDCff7ibGFahr2zDLoIdTHIDwSvqd1gjo5QDNuw3iyQFWLgEfHj6qcwCQ/3wMHv74/nCdDd/xzXmIat8syYMWW91WVYLRE7Ktf66Y1L01QUU0UWbXnLGC3gOip70/xILXmsHbvWahy7MJMCqpHy4BiDkbd+JMy2YFIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=BX2nVtvZoFBRxQaz6nxImymjCe0WVXwmBvfLkt+DBxntbllMHawLDqtVEF/b9vS/nOopPQ1UB10g2ycHLAqUo97KMi5fIeE6QLgAu8X6iaV1IuetMnfAz6fpYwkB7k/CeAFvVeNbCEwtHXtDJsJsIhxMCXDt0q1axQABV+s4Mu4= Received: by 10.35.40.10 with SMTP id s10mr4031613pyj.41.1199220947044; Tue, 01 Jan 2008 12:55:47 -0800 (PST) Received: by 10.35.101.2 with HTTP; Tue, 1 Jan 2008 12:55:47 -0800 (PST) Message-ID: <97ca98bc0801011255r3be18ea7h1c51969e2b515afa@mail.gmail.com> Date: Wed, 2 Jan 2008 00:25:47 +0330 From: "Neeku Shamekhi" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 01 Jan 2008 21:28:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: FreeBSD Kernel Analysis 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, 01 Jan 2008 21:20:06 -0000 Dear Sir, I need some help with finding a piece of FreeBSD's kernel files analysis, preferably for semaphores or scheduler. I mean, I want to get some explanations about a file in kernel of FreeBSD. The shorter, the better! Could you please help me finding something like this? I googled and I'm going to do it again, but I couldn't find anything. Thanks in advance. Sincerely, Neeku Shamekhi From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 22:08:05 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CFD16A41A for ; Tue, 1 Jan 2008 22:08:05 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7E43313C45A for ; Tue, 1 Jan 2008 22:08:05 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so9611847pyb.10 for ; Tue, 01 Jan 2008 14:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=iDfQK00rhywsqvC4Wp1pecgr7XWg2OQJxK1Ywmo2DN4=; b=pj8b+luT46Fjaep4End/rzm1FaO31cMn7laYzrsT0/0LNdOi67ASSWQ3zfPL2e84fkyvB69zj9REbYBsHQr4WbZugdl/ZDPt3Nus2J4O4k2e3RYqGHppRBP7j0BLIO5IJ/eut2hVMT86llPdaV+Sk5+ReZPiLK8wc5cXXjg9meI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=pUWusH5NC5oKKxm9H5fTJ0j01W9C8kQRbk2eSabsr6qBd3qi0RtmiIG8ejcyq/6HLLTHmwWf6CqIVvv7j6nx+NEGLt9u9fFm4+/OnVKkXiGnQqX5rMkvLJ+Ery6KpwQhaEW6FUoMKPXaLsrNiigmLo2IrJbkFgN2mV3vdKpZ/3g= Received: by 10.35.83.20 with SMTP id k20mr16916353pyl.7.1199225284746; Tue, 01 Jan 2008 14:08:04 -0800 (PST) Received: by 10.35.101.2 with HTTP; Tue, 1 Jan 2008 14:08:04 -0800 (PST) Message-ID: <97ca98bc0801011408x51f6ff08q73d13ce33240e83c@mail.gmail.com> Date: Wed, 2 Jan 2008 01:38:04 +0330 From: "Neeku Shamekhi" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: FreeBSD Kernel Analysis - In Detail 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, 01 Jan 2008 22:08:05 -0000 Dear Sir, I just subscribed to the mailing list. I had a look at the kernel files; I found "kern_sema" somehow short, with less lines. I wonder if I can find any analysis or explanation of its code. Thanks in advande. Sincerely, Neeku Shamekhi From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 03:21:13 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0353716A41A for ; Wed, 2 Jan 2008 03:21:13 +0000 (UTC) (envelope-from xistence@0x58.com) Received: from mailexchange.osnn.net (1e.66.5646.static.theplanet.com [70.86.102.30]) by mx1.freebsd.org (Postfix) with SMTP id C9D0E13C448 for ; Wed, 2 Jan 2008 03:21:12 +0000 (UTC) (envelope-from xistence@0x58.com) Received: (qmail 20711 invoked by uid 0); 2 Jan 2008 03:17:24 -0000 Received: from unknown (HELO WideLoad.lan) (xistence@0x58.com@86.87.237.117) by mailexchange.osnn.net with SMTP; 2 Jan 2008 03:17:24 -0000 Message-Id: From: Bert JW Regeer In-Reply-To: <477A896F.4050509@freebsd.org> Content-Type: multipart/signed; boundary=Apple-Mail-2--253954344; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v915) Date: Wed, 2 Jan 2008 04:21:01 +0100 References: <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> <4779AD03.1060505@freebsd.org> <20080101104018.0fe51d67@kan.dnsalias.net> <477A896F.4050509@freebsd.org> X-Mailer: Apple Mail (2.915) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Hackers , Markus Hoenicka Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) 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, 02 Jan 2008 03:21:13 -0000 --Apple-Mail-2--253954344 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Jan 1, 2008, at 19:41 , Tim Kientzle wrote: >>>> Also, I'm wondering how other OSes handle this. I don't see this >>>> code crash on Linux, contrary to its design as you say. >>> >>> I would be curious to see the results of running your >>> sample program ... on Linux to see whether it calls the >>> registered exit function at dlclose time or never. >> Linux pulls hidden atexit symbol into every binary that uses it ... >> Linux calls atexit entries at object unload time. >> Solaris implements a libc callback from ld.so.1 ... >> Solaris calls atexit callback when removing it too. > > Interesting. So the consensus here (at least for Linux > and Solaris, anyone know about Mac OS?) seems to be that > atexit() can be called from a dynamically loaded library > and that functions registered this way will be called > at library unload time. > > And FreeBSD doesn't implement this behavior. > > Tim Kientzle Mac OS X (10.5.1) $ gcc -dynamiclib -o atexitmod.so atexitmod.c $ gcc -o datest datatest.c $ ./datest hello driver now exiting $ uname -a Darwin WideLoad.lan 9.1.0 Darwin Kernel Version 9.1.0: Wed Oct 31 17:46:22 PDT 2007; root:xnu-1228.0.2~1/RELEASE_I386 i386 $ gcc --version i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465) I guess Mac OS X calls atexit() somehow. I don't know the internals of Mac OS X, just wanted to post that the example given in this thread works as one would semi-expect, and thus possibly against the spec. Bert JW Regeer --Apple-Mail-2--253954344-- From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 04:50:28 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBA1116A418 for ; Wed, 2 Jan 2008 04:50:28 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id 996FC13C461 for ; Wed, 2 Jan 2008 04:50:28 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so9230547waf.3 for ; Tue, 01 Jan 2008 20:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; bh=nDpS+w9aw6AVzqBNwbzp20TbCiui242NtUzhEubhvSg=; b=JmpDiNRmFpMbr1ftcB4cRifCxEtNhY71asaimPsQhpCfeOggljaB73IZT8qrUN5rGvJHjpQS8ZTpRI1PZFROrBppB9aukigFP8fkhoW8P0B7JVvyUirW1DMg8hTl4VeSt8Uu9albgnOiIqjLCRsj6O2zKvKFfTa1MpO3zTKW2UQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=HHXpkFf/1Leg0lDHNzYFxG0wIE4jA7KEDgXXBQD21GF/WkHveW6UWpViLVqOyINPk7GAggIXClpY6ti/jtI7s/IBqIVA6soH7GeXky98hiwgjLby3zQQx42rEawt1O6Z/dAjOPKUpCStzwpPUl+CdZ6fzlqkIqQvXXN9giBiMTM= Received: by 10.115.109.1 with SMTP id l1mr15192160wam.136.1199247870847; Tue, 01 Jan 2008 20:24:30 -0800 (PST) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id n37sm21734029wag.24.2008.01.01.20.24.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Jan 2008 20:24:29 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id m024MCY7028489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jan 2008 13:22:12 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m024MA0p028488; Wed, 2 Jan 2008 13:22:10 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 2 Jan 2008 13:22:10 +0900 From: Pyun YongHyeon To: Peter B Message-ID: <20080102042210.GC27551@cdnetworks.co.kr> References: <200801011822.m01IMZ9K017094@brother.ludd.ltu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200801011822.m01IMZ9K017094@brother.ludd.ltu.se> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: 6.2R Patch to allow broken frames X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2008 04:50:28 -0000 On Tue, Jan 01, 2008 at 07:22:35PM +0100, Peter B wrote: > > I had to debug an phy+fpga setup and found this patch that makes tx(4) to > allow broken/runt frames and includes both mac and crc32 useful. > Maybe this could be a feature in the network drivers? (or some) > I don't consider this production code. Rather a demo/suggestion. > > The quick patch is to just do the changes to tx_if.c disregarding any IFF_* > flags. > Any information if this would interfere with normal operation would be welcome. > /P > Some ethernet controllers allow receving broken frames but I'm not sure whether it really helps on production box execept debugging aid. Receving broken frames would waste PCI bandwidth as well as systems resources as it would be dropped anyway in upper layer. I guess you can see increasing input errors(if_ierrors) in case of receving broken frames. Did the counter is not enough? -- Regards, Pyun YongHyeon From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 09:18:39 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CF9A16A420 for ; Wed, 2 Jan 2008 09:18:39 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 38A1413C43E for ; Wed, 2 Jan 2008 09:18:39 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1J9zkE-00030D-0d for freebsd-hackers@freebsd.org; Wed, 02 Jan 2008 11:18:38 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 02 Jan 2008 11:18:37 +0200 From: Danny Braniss Message-ID: Subject: nfs v2/v3 and diskless boot 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, 02 Jan 2008 09:18:39 -0000 there is an undocumented option: boot-nfsroot-options that the diskeless boot can use. I tried boot-nfsroot-options = "nfsv3" since the pxeboot does the initial mount via nfsv2, and this has at least one problem: removing a file from the readonly / will hang the system. so, the remount to v3 works in the case that the root is served by a Freebsd nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE :-) While I'm trying to come up with a solution, I am wondering if someone can shed some light: - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to 32 bytes will start WW3? cheers danny From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 06:31:38 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7534216A41B for ; Wed, 2 Jan 2008 06:31:38 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from mother.ludd.ltu.se (mother.ludd.ltu.se [130.240.16.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0230F13C455 for ; Wed, 2 Jan 2008 06:31:37 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from brother.ludd.ltu.se (root@brother.ludd.ltu.se [130.240.16.78]) by mother.ludd.ltu.se (8.13.6+Sun/8.12.10) with ESMTP id m026VXr4006563; Wed, 2 Jan 2008 07:31:33 +0100 (MET) Received: from brother.ludd.ltu.se (pb@localhost [127.0.0.1]) by brother.ludd.ltu.se (8.13.6+Sun/8.12.2) with ESMTP id m026VXWD018892; Wed, 2 Jan 2008 07:31:33 +0100 (MET) Received: (from pb@localhost) by brother.ludd.ltu.se (8.13.6+Sun/8.13.6/Submit) id m026VV3s018890; Wed, 2 Jan 2008 07:31:31 +0100 (MET) From: Peter B Message-Id: <200801020631.m026VV3s018890@brother.ludd.ltu.se> To: pyunyh@gmail.com Date: Wed, 2 Jan 2008 07:31:31 +0100 (MET) In-Reply-To: <20080102042210.GC27551@cdnetworks.co.kr> from "Pyun YongHyeon" at Jan 02, 2008 01:22:10 PM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 02 Jan 2008 12:38:55 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: 6.2R Patch to allow broken frames 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, 02 Jan 2008 06:31:38 -0000 >Some ethernet controllers allow receving broken frames but I'm not >sure whether it really helps on production box execept debugging aid. >Receving broken frames would waste PCI bandwidth as well as systems >resources as it would be dropped anyway in upper layer. It's intended as an aid to debug malfunctions. And this patch makes it possible to enable/disable it at will. For fpga + phy, it helps to see exactly what's sent over the wire, and what the phy likely see at it's input. This is especially true for the crc32, which took some effort to get it right in verilog. By enableing broken frames I could see that the rest of the packet was ok and what crc the code generated. Things like last step xor etc.. Is much easier to spot. >I guess you can see increasing input errors(if_ierrors) in case of >receving broken frames. Did the counter is not enough? Just seing that there is an error won't help much. One needs to see exactly what's sent, ie nibble by nibble. Ofcourse the intended tool to get the results is tcpdump(1). Higher levels arn't likely to benefit much. Except for verifying error resilence. Involved files: /usr/src/sbin/ifconfig/ifconfig.c /usr/src/sbin/ifconfig/ifconfig.h /usr/src/sys/dev/tx/if_tx.c /usr/src/sys/net/if.h From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 13:07:09 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 687B616A418 for ; Wed, 2 Jan 2008 13:07:09 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from ns.trinitel.com (186.161.36.72.static.reverse.ltdomains.com [72.36.161.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3E07713C4CC for ; Wed, 2 Jan 2008 13:07:09 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from proton.storspeed.com (209-163-168-124.static.tenantsolutions.com [209.163.168.124] (may be forged)) (authenticated bits=0) by ns.trinitel.com (8.14.1/8.14.1) with ESMTP id m02Cce6k074934; Wed, 2 Jan 2008 06:38:41 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <477B85D1.6030109@freebsd.org> Date: Wed, 02 Jan 2008 06:38:41 -0600 From: Eric Anderson User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Danny Braniss References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.trinitel.com Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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, 02 Jan 2008 13:07:09 -0000 Danny Braniss wrote: > there is an undocumented option: > boot-nfsroot-options > that the diskeless boot can use. I tried > boot-nfsroot-options = "nfsv3" > since the pxeboot does the initial mount via nfsv2, and this has at least > one problem: removing a file from the readonly / will hang the system. > > so, the remount to v3 works in the case that the root is served by a Freebsd > nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle > is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). > This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE > :-) > > While I'm trying to come up with a solution, I am wondering if someone > can shed some light: > - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to > 32 bytes will start WW3? NFSv3 file handles (by spec) can be up to 64bytes. I'm not 100% sure what is happening, but it sounds like the file handle for the mount point or maybe one of the directories is not getting reset on remount. When do you get the BADHANDLE error? Can you capture a tshark/wireshark/tcpdump of the remount and error? Eric From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 15:15:08 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7937C16A418 for ; Wed, 2 Jan 2008 15:15:08 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 31AB713C43E for ; Wed, 2 Jan 2008 15:15:08 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1JA5JD-0007S6-6F; Wed, 02 Jan 2008 17:15:07 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Eric Anderson In-reply-to: Your message of Wed, 02 Jan 2008 06:38:41 -0600 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 02 Jan 2008 17:15:07 +0200 From: Danny Braniss Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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, 02 Jan 2008 15:15:08 -0000 > Danny Braniss wrote: > > there is an undocumented option: > > boot-nfsroot-options > > that the diskeless boot can use. I tried > > boot-nfsroot-options = "nfsv3" > > since the pxeboot does the initial mount via nfsv2, and this has at least > > one problem: removing a file from the readonly / will hang the system. > > > > so, the remount to v3 works in the case that the root is served by a Freebsd > > nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle > > is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). > > This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE > > :-) > > > > While I'm trying to come up with a solution, I am wondering if someone > > can shed some light: > > - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to > > 32 bytes will start WW3? > > > NFSv3 file handles (by spec) can be up to 64bytes. true, but in freebsd, look at sys/nfs/nfsproto.h #define NFSX_V2FH 32 #define NFSX_V3FH (sizeof (fhandle_t)) #define NFSX_V4FH 128 so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) > > I'm not 100% sure what is happening, but it sounds like the file handle > for the mount point or maybe one of the directories is not getting reset > on remount. > > When do you get the BADHANDLE error? Can you capture a > tshark/wireshark/tcpdump of the remount and error? I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and it panics the kernel :-( danny From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 2 16:22:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0D5B16A418 for ; Wed, 2 Jan 2008 16:22:41 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from ns.trinitel.com (186.161.36.72.static.reverse.ltdomains.com [72.36.161.186]) by mx1.freebsd.org (Postfix) with ESMTP id AD11713C468 for ; Wed, 2 Jan 2008 16:22:41 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from proton.storspeed.com (209-163-168-124.static.tenantsolutions.com [209.163.168.124] (may be forged)) (authenticated bits=0) by ns.trinitel.com (8.14.1/8.14.1) with ESMTP id m02GMSJh056792; Wed, 2 Jan 2008 10:22:29 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <477BBA44.7030803@freebsd.org> Date: Wed, 02 Jan 2008 10:22:28 -0600 From: Eric Anderson User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Danny Braniss References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.trinitel.com Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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, 02 Jan 2008 16:22:42 -0000 Danny Braniss wrote: >> Danny Braniss wrote: >>> there is an undocumented option: >>> boot-nfsroot-options >>> that the diskeless boot can use. I tried >>> boot-nfsroot-options = "nfsv3" >>> since the pxeboot does the initial mount via nfsv2, and this has at least >>> one problem: removing a file from the readonly / will hang the system. >>> >>> so, the remount to v3 works in the case that the root is served by a Freebsd >>> nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle >>> is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). >>> This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE >>> :-) >>> >>> While I'm trying to come up with a solution, I am wondering if someone >>> can shed some light: >>> - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to >>> 32 bytes will start WW3? >> >> NFSv3 file handles (by spec) can be up to 64bytes. > > true, but in freebsd, look at sys/nfs/nfsproto.h > #define NFSX_V2FH 32 > #define NFSX_V3FH (sizeof (fhandle_t)) > #define NFSX_V4FH 128 > > so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) > > >> I'm not 100% sure what is happening, but it sounds like the file handle >> for the mount point or maybe one of the directories is not getting reset >> on remount. >> >> When do you get the BADHANDLE error? Can you capture a >> tshark/wireshark/tcpdump of the remount and error? > > I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible > for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and > it panics the kernel :-( > > danny oh - looks like this says it all: http://fxr.googlebit.com/source/sys/nfsclient/nfsdiskless.h?v=8-CURRENT#L51 Snippet: 51 /* 52 * I have defined a new structure that can handle an NFS Version 3 file handle 53 * but the kernel still expects the old Version 2 one to be provided. The 54 * changes required in nfs_vfsops.c for using the new are documented there in 55 * comments. (I felt that breaking network booting code by changing this 56 * structure would not be prudent at this time, since almost all servers are 57 * still Version 2 anyhow.) 58 */ Eric From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 06:57:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CCD716A417; Thu, 3 Jan 2008 06:57:41 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id BA34C13C44B; Thu, 3 Jan 2008 06:57:40 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1JAK1L-000HRX-FV; Thu, 03 Jan 2008 08:57:39 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Eric Anderson In-reply-to: Your message of Wed, 02 Jan 2008 10:22:28 -0600 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 03 Jan 2008 08:57:39 +0200 From: Danny Braniss Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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: Thu, 03 Jan 2008 06:57:41 -0000 > Danny Braniss wrote: > >> Danny Braniss wrote: > >>> there is an undocumented option: > >>> boot-nfsroot-options > >>> that the diskeless boot can use. I tried > >>> boot-nfsroot-options = "nfsv3" > >>> since the pxeboot does the initial mount via nfsv2, and this has at least > >>> one problem: removing a file from the readonly / will hang the system. > >>> > >>> so, the remount to v3 works in the case that the root is served by a Freebsd > >>> nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle > >>> is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). > >>> This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE > >>> :-) > >>> > >>> While I'm trying to come up with a solution, I am wondering if someone > >>> can shed some light: > >>> - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to > >>> 32 bytes will start WW3? > >> > >> NFSv3 file handles (by spec) can be up to 64bytes. > > > > true, but in freebsd, look at sys/nfs/nfsproto.h > > #define NFSX_V2FH 32 > > #define NFSX_V3FH (sizeof (fhandle_t)) > > #define NFSX_V4FH 128 > > > > so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) > > > > > >> I'm not 100% sure what is happening, but it sounds like the file handle > >> for the mount point or maybe one of the directories is not getting reset > >> on remount. > >> > >> When do you get the BADHANDLE error? Can you capture a > >> tshark/wireshark/tcpdump of the remount and error? > > > > I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible > > for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and > > it panics the kernel :-( > > > > danny > > > oh - looks like this says it all: > http://fxr.googlebit.com/source/sys/nfsclient/nfsdiskless.h?v=8-CURRENT#L51 > that's where the boot-nfsroot-options comes from:-) if you notice, the filehandle for v3 is 64 bytes, but only 28 are used. but as I mentioned initially, this ONLY works when the server is FreeBSD, and breaks for other servers, ie NetAPP. AND the initial question stands: what's in a filehandle, or can it be > 28bytes. danny From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 11:49:47 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49E7B16A419 for ; Thu, 3 Jan 2008 11:49:47 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: from hs-out-2122.google.com (hs-out-0708.google.com [64.233.178.249]) by mx1.freebsd.org (Postfix) with ESMTP id 05F8113C4CE for ; Thu, 3 Jan 2008 11:49:46 +0000 (UTC) (envelope-from neeku.sh@gmail.com) Received: by hs-out-2122.google.com with SMTP id j58so4767770hsj.11 for ; Thu, 03 Jan 2008 03:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=xRkrHldI7PHgi0RvS2KOZvB1jkB7MqtUT2uYPzzqIrM=; b=OYQsf8sQGX7qyX6MNbzVqIIJMhis1y63550shJE1VDjDQSDtPkMztGXyj74YI6XwWXixM/MDxmpu/30oQuXTxBhNtjyHzmQNleRv3KX+ND5IdkWaLt+YLHqDaL7JxK7Vt6Um+6VANCyzdVDdtTNQ+uIStL992CWNZ6fmVXFhhXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=uVe1DmRapNd4eehwIOIrTGq9vPGnHDJ5WQBPS8imuxaFYRBYq81/I7nPvasZc1qEZpUzhVe82o2EWmK2UkR4giTxP2e2+Bdp1wGv4SRX/fKsgliKTbxdrCiSxeQZV1/My0ljHJvhvCurOKe7ogiRTI1P7hH4CEpfThdak+YX6J0= Received: by 10.151.9.1 with SMTP id m1mr4113979ybi.150.1199360986350; Thu, 03 Jan 2008 03:49:46 -0800 (PST) Received: by 10.35.101.2 with HTTP; Thu, 3 Jan 2008 03:49:46 -0800 (PST) Message-ID: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> Date: Thu, 3 Jan 2008 15:19:46 +0330 From: "Neeku Shamekhi" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Semaphores 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, 03 Jan 2008 11:49:47 -0000 I need some article about semaphores in freeBSD and mainly about kern_sema.c file. From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 12:32:19 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E1F116A41A for ; Thu, 3 Jan 2008 12:32:19 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3005C13C4D3 for ; Thu, 3 Jan 2008 12:32:18 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JAPF9-0004i7-RB for freebsd-hackers@freebsd.org; Thu, 03 Jan 2008 12:32:15 +0000 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 12:32:15 +0000 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 12:32:15 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Thu, 03 Jan 2008 13:31:57 +0100 Lines: 37 Message-ID: References: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD554315B265E16489324E912" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.9 (X11/20070801) In-Reply-To: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> X-Enigmail-Version: 0.95.5 Sender: news Subject: Re: Semaphores 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, 03 Jan 2008 12:32:19 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD554315B265E16489324E912 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Neeku Shamekhi wrote: > I need some article about semaphores in freeBSD and mainly about kern_s= ema.c > file. About the best documentation you will find is this: http://fxr.watson.org/fxr/source/kern/kern_sema.c For general information on the FreeBSD kernel see the book "Design and implementation of the FreeBSD operating system", http://www.amazon.com/Design-Implementation-FreeBSD-Operating-System/dp/0= 201702452 and various articles at http://www.freebsd.org/docs/books.html . You won't find anything better. --------------enigD554315B265E16489324E912 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHfNXFldnAQVacBcgRApkmAKC+LEVX5ZM3J5kMNL5ftU6vDSrH+wCeMw/8 tBj0pxLajF3wdlXykgF22qE= =Yuxo -----END PGP SIGNATURE----- --------------enigD554315B265E16489324E912-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 12:46:49 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC1416A419 for ; Thu, 3 Jan 2008 12:46:49 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from ns.trinitel.com (186.161.36.72.static.reverse.ltdomains.com [72.36.161.186]) by mx1.freebsd.org (Postfix) with ESMTP id ED1D013C45B for ; Thu, 3 Jan 2008 12:46:48 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from proton.storspeed.com (209-163-168-124.static.tenantsolutions.net [209.163.168.124] (may be forged)) (authenticated bits=0) by ns.trinitel.com (8.14.1/8.14.1) with ESMTP id m03CkYq1044287; Thu, 3 Jan 2008 06:46:35 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <477CD92A.9090906@freebsd.org> Date: Thu, 03 Jan 2008 06:46:34 -0600 From: Eric Anderson User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Danny Braniss References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.trinitel.com Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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: Thu, 03 Jan 2008 12:46:49 -0000 Danny Braniss wrote: >> Danny Braniss wrote: >>>> Danny Braniss wrote: >>>>> there is an undocumented option: >>>>> boot-nfsroot-options >>>>> that the diskeless boot can use. I tried >>>>> boot-nfsroot-options = "nfsv3" >>>>> since the pxeboot does the initial mount via nfsv2, and this has at least >>>>> one problem: removing a file from the readonly / will hang the system. >>>>> >>>>> so, the remount to v3 works in the case that the root is served by a Freebsd >>>>> nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle >>>>> is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). >>>>> This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE >>>>> :-) >>>>> >>>>> While I'm trying to come up with a solution, I am wondering if someone >>>>> can shed some light: >>>>> - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to >>>>> 32 bytes will start WW3? >>>> NFSv3 file handles (by spec) can be up to 64bytes. >>> true, but in freebsd, look at sys/nfs/nfsproto.h >>> #define NFSX_V2FH 32 >>> #define NFSX_V3FH (sizeof (fhandle_t)) >>> #define NFSX_V4FH 128 >>> >>> so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) >>> >>> >>>> I'm not 100% sure what is happening, but it sounds like the file handle >>>> for the mount point or maybe one of the directories is not getting reset >>>> on remount. >>>> >>>> When do you get the BADHANDLE error? Can you capture a >>>> tshark/wireshark/tcpdump of the remount and error? >>> I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible >>> for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and >>> it panics the kernel :-( >>> >>> danny >> >> oh - looks like this says it all: >> http://fxr.googlebit.com/source/sys/nfsclient/nfsdiskless.h?v=8-CURRENT#L51 >> > that's where the boot-nfsroot-options comes from:-) > if you notice, the filehandle for v3 is 64 bytes, but > only 28 are used. > > but as I mentioned initially, this ONLY works when the server is FreeBSD, and > breaks for other servers, ie NetAPP. AND the initial question stands: > what's in a filehandle, or can it be > 28bytes. Yea, FreeBSD is making the assumption that all NFS servers will use the same size FH for NFSv3. That is just wrong. The FH is a server created opaque handle that it can create however it wishes. Most servers use information like inode, generation, fsid, etc to create it, but it's something that you can't necessarily decode. I've created a patch that might fix this, but I'm still testing and QEMU (which I use for my testing) keeps making my system either panic or lock up, so hopefully I should have something for you to try tonight. Also - can you tell me the exact 'mount' command you tried to do the remount/update? Eric From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 13:25:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E156716A419; Thu, 3 Jan 2008 13:25:57 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9B17C13C45A; Thu, 3 Jan 2008 13:25:57 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1JAQ55-000MJe-VY; Thu, 03 Jan 2008 15:25:56 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Eric Anderson In-reply-to: Your message of Thu, 03 Jan 2008 06:46:34 -0600 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 03 Jan 2008 15:25:55 +0200 From: Danny Braniss Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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: Thu, 03 Jan 2008 13:25:58 -0000 > Danny Braniss wrote: > >> Danny Braniss wrote: > >>>> Danny Braniss wrote: > >>>>> there is an undocumented option: > >>>>> boot-nfsroot-options > >>>>> that the diskeless boot can use. I tried > >>>>> boot-nfsroot-options = "nfsv3" > >>>>> since the pxeboot does the initial mount via nfsv2, and this has at least > >>>>> one problem: removing a file from the readonly / will hang the system. > >>>>> > >>>>> so, the remount to v3 works in the case that the root is served by a Freebsd > >>>>> nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle > >>>>> is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). > >>>>> This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE > >>>>> :-) > >>>>> > >>>>> While I'm trying to come up with a solution, I am wondering if someone > >>>>> can shed some light: > >>>>> - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to > >>>>> 32 bytes will start WW3? > >>>> NFSv3 file handles (by spec) can be up to 64bytes. > >>> true, but in freebsd, look at sys/nfs/nfsproto.h > >>> #define NFSX_V2FH 32 > >>> #define NFSX_V3FH (sizeof (fhandle_t)) > >>> #define NFSX_V4FH 128 > >>> > >>> so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) > >>> > >>> > >>>> I'm not 100% sure what is happening, but it sounds like the file handle > >>>> for the mount point or maybe one of the directories is not getting reset > >>>> on remount. > >>>> > >>>> When do you get the BADHANDLE error? Can you capture a > >>>> tshark/wireshark/tcpdump of the remount and error? > >>> I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible > >>> for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and > >>> it panics the kernel :-( > >>> > >>> danny > >> > >> oh - looks like this says it all: > >> http://fxr.googlebit.com/source/sys/nfsclient/nfsdiskless.h?v=8-CURRENT#L51 > >> > > that's where the boot-nfsroot-options comes from:-) > > if you notice, the filehandle for v3 is 64 bytes, but > > only 28 are used. > > > > but as I mentioned initially, this ONLY works when the server is FreeBSD, and > > breaks for other servers, ie NetAPP. AND the initial question stands: > > what's in a filehandle, or can it be > 28bytes. > > > Yea, FreeBSD is making the assumption that all NFS servers will use the > same size FH for NFSv3. That is just wrong. > carful, I think this is the case only if fsb is the server, it will 'probably' accept filehandles of other sizes from other servers. > The FH is a server created opaque handle that it can create however it > wishes. Most servers use information like inode, generation, fsid, etc > to create it, but it's something that you can't necessarily decode. > yes, but the FH has information that the server can/must use to figure out which local filesystem it refers to - remember that v2/v3 are stateless. > I've created a patch that might fix this, but I'm still testing and QEMU > (which I use for my testing) keeps making my system either panic or lock > up, so hopefully I should have something for you to try tonight. > > Also - can you tell me the exact 'mount' command you tried to do the > remount/update? > it's only in the diskless boot, where setting boot-nfsroot-options = "nfsv3" in /boot/loader.conf will do the remount. cheers, danny From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 13:38:06 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFFAB16A417 for ; Thu, 3 Jan 2008 13:38:06 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from ns.trinitel.com (186.161.36.72.static.reverse.ltdomains.com [72.36.161.186]) by mx1.freebsd.org (Postfix) with ESMTP id B0FA813C458 for ; Thu, 3 Jan 2008 13:38:06 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from proton.storspeed.com (209-163-168-124.static.tenantsolutions.net [209.163.168.124] (may be forged)) (authenticated bits=0) by ns.trinitel.com (8.14.1/8.14.1) with ESMTP id m03DbiG1075468; Thu, 3 Jan 2008 07:37:45 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <477CE528.7070404@freebsd.org> Date: Thu, 03 Jan 2008 07:37:44 -0600 From: Eric Anderson User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Danny Braniss References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.trinitel.com Cc: freebsd-hackers@freebsd.org Subject: Re: nfs v2/v3 and diskless boot 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: Thu, 03 Jan 2008 13:38:06 -0000 Danny Braniss wrote: >> Danny Braniss wrote: >>>> Danny Braniss wrote: >>>>>> Danny Braniss wrote: >>>>>>> there is an undocumented option: >>>>>>> boot-nfsroot-options >>>>>>> that the diskeless boot can use. I tried >>>>>>> boot-nfsroot-options = "nfsv3" >>>>>>> since the pxeboot does the initial mount via nfsv2, and this has at least >>>>>>> one problem: removing a file from the readonly / will hang the system. >>>>>>> >>>>>>> so, the remount to v3 works in the case that the root is served by a Freebsd >>>>>>> nfs server, but fails if it's NetAPP. The reason is that the v2 filehandle >>>>>>> is 32 bytes, and when switching to V3 it becomes 28bytes - sizeof(fhandle_t). >>>>>>> This is not liked by the NetApp, which correctly gives error 1001: BADHANDLE >>>>>>> :-) >>>>>>> >>>>>>> While I'm trying to come up with a solution, I am wondering if someone >>>>>>> can shed some light: >>>>>>> - is sizeof(fhandle_t) == 28 bytes is mystical, or changing it to >>>>>>> 32 bytes will start WW3? >>>>>> NFSv3 file handles (by spec) can be up to 64bytes. >>>>> true, but in freebsd, look at sys/nfs/nfsproto.h >>>>> #define NFSX_V2FH 32 >>>>> #define NFSX_V3FH (sizeof (fhandle_t)) >>>>> #define NFSX_V4FH 128 >>>>> >>>>> so for v3 it's 28 bytes. (fhandle_t is defined in sys/mount.h) >>>>> >>>>> >>>>>> I'm not 100% sure what is happening, but it sounds like the file handle >>>>>> for the mount point or maybe one of the directories is not getting reset >>>>>> on remount. >>>>>> >>>>>> When do you get the BADHANDLE error? Can you capture a >>>>>> tshark/wireshark/tcpdump of the remount and error? >>>>> I did, and if you look in sys/nfsclient/nfs_vfsops.c, nfs_convert_diskless is responsible >>>>> for chopping off the 4 extra bytes. BTW, I tried to change the bcopy count to NFSX_V2FH/32, and >>>>> it panics the kernel :-( >>>>> >>>>> danny >>>> oh - looks like this says it all: >>>> http://fxr.googlebit.com/source/sys/nfsclient/nfsdiskless.h?v=8-CURRENT#L51 >>>> >>> that's where the boot-nfsroot-options comes from:-) >>> if you notice, the filehandle for v3 is 64 bytes, but >>> only 28 are used. >>> >>> but as I mentioned initially, this ONLY works when the server is FreeBSD, and >>> breaks for other servers, ie NetAPP. AND the initial question stands: >>> what's in a filehandle, or can it be > 28bytes. >> >> Yea, FreeBSD is making the assumption that all NFS servers will use the >> same size FH for NFSv3. That is just wrong. >> > carful, I think this is the case only if fsb is the server, it will 'probably' > accept > filehandles of other sizes from other servers. I'm talking about the diskless root mounting code only at this point.. >> The FH is a server created opaque handle that it can create however it >> wishes. Most servers use information like inode, generation, fsid, etc >> to create it, but it's something that you can't necessarily decode. >> > yes, but the FH has information that the server can/must use to figure out > which local filesystem it refers to - remember that v2/v3 are stateless. Right, see my list right above your comment: inode, generation, fsid. Those three can uniquely identify a file on a filesystem on a server. There can be anything the server wants to stuff in the FH, or the FH can be a random number assigned to that file, etc. >> I've created a patch that might fix this, but I'm still testing and QEMU >> (which I use for my testing) keeps making my system either panic or lock >> up, so hopefully I should have something for you to try tonight. >> >> Also - can you tell me the exact 'mount' command you tried to do the >> remount/update? >> > it's only in the diskless boot, where setting > boot-nfsroot-options = "nfsv3" > in /boot/loader.conf will do the remount. Ok - I'll do a little more testing on my patch tonight and let you know. Eric From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 15:28:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D58816A417 for ; Thu, 3 Jan 2008 15:28:14 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id BC5C813C448 for ; Thu, 3 Jan 2008 15:28:13 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JARzN-0007Kc-FU for freebsd-hackers@freebsd.org; Thu, 03 Jan 2008 15:28:09 +0000 Received: from www.creo.hu ([217.113.62.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 15:28:09 +0000 Received: from csaba-ml by www.creo.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 15:28:09 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Csaba Henk Date: Thu, 3 Jan 2008 15:27:56 +0000 (UTC) Lines: 115 Message-ID: References: <20071211001828.54e1da6b@deimos.mars.bsd> <20071212134316.3d65f102@deimos.mars.bsd> <20071216232655.5d829d41@deimos.mars.bsd> <20071217141504.1f3d8932@deimos.mars.bsd> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: www.creo.hu User-Agent: slrn/0.9.8.1 (FreeBSD) Sender: news Subject: Re: Disk sync at shutdown and fusefs filesystems 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, 03 Jan 2008 15:28:14 -0000 On 2007-12-17, Alejandro Pulver wrote: > When the implementation is ready, and if these problems are sorted out, > do you think it could be enabled by default (at least for root)? Because > that's the behavior most filesystems would prefer I think. I made up a testable implementation, see it here: http://mercurial.creo.hu/repos/fuse4bsd-hg-experimental/?rev/abc018d9f535 It seems to work fine. In order to have a fuse daemon which is "malicious", ie. tries to stall shutdown, I hacked fusexmp_fh.c as follows: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- /dispatch/root/fuse-2.7.0/example/fusexmp_fh.c 2007-05-20 13:05:43.000000000 +0200 +++ fusexmp_fh.c 2008-01-03 02:47:00.000000000 +0100 @@ -416,6 +416,17 @@ static int xmp_lock(const char *path, st sizeof(fi->lock_owner)); } +static void xmp_destroy(void *foo) +{ + unsigned i = 0; + + for(;;) { + fprintf(stderr, "%d ", i++); + sleep(1); + } +} + + static struct fuse_operations xmp_oper = { .getattr = xmp_getattr, .fgetattr = xmp_fgetattr, @@ -451,6 +462,7 @@ static struct fuse_operations xmp_oper = .removexattr= xmp_removexattr, #endif .lock = xmp_lock, + .destroy = xmp_destroy, }; int main(int argc, char *argv[]) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% shutdown(8) was able to complete. The above hack could only cause a ten second delay -- see the output of the daemon: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% unique: 0, opcode: INIT (26), nodeid: 0, insize: 56 INIT: 7.8 flags=0x00000000 max_readahead=0x00000000 INIT: 7.8 flags=0x00000002 max_readahead=0x00000000 max_write=0x00020000 unique: 0, error: 0 (Unknown error: 0), outsize: 40 0 1 2 3 4 5 6 7 8 9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% So FreeBSD's shutdown handles this fine, the system can't really be DoS'd this way. Therefore we don't need a too strict access policy. I think that from our POV, it would be sufficient to add a "-osync_unmount" mount option and a sysctl via which it's availability for unpriviliged users can be set. But life is not that simple: if we added such a mount opt that would remain FreeBSD specific (on Linux it won't happen, for reasons I don't want to digress on here), and therefore filesystem authors -- who usually use fuse options internally -- won't use it; although they are the authorative persons whether their filesystems needs to have a sychronized unmount or not. I'll try to find the fine middle ground with Miklos with respect to this. So while the interface to this feature is under construction, you can already play with it and I'd like to know about your experiences. This can be done as follows: - Get the experimental version of fuse4bsd from the above mentioned URL. (More exactly, the above URL shows the cset which brings in the current implementation; if you want to get the latest of this branch, use hg {clone,pull} -r sync_unmount0 http://mercurial.creo.hu/repos/fuse4bsd-hg-experimental or fetch http://mercurial.creo.hu/repos/fuse4bsd-hg-experimental/?archive/sync_unmount0.tar.gz As of the time of writing this, abc018d9f535 and sync_unmount0 refer to the same revision.) - Compile it with the CFLAG -DFUSE_HAS_DESTROY=1 (the proto version hasn't been bumped when DESTROY was added, so I can't figure it out if DESTROY is available; you have to pass this setting manually). (Apart from loading the kld, don't forget to use the mount_fusefs(8) binary compiled from this code!) - Recompile fusefs-libs using the following revision of lib/mount_bsd.c: http://fuse.cvs.sourceforge.net/*checkout*/fuse/fuse/lib/mount_bsd.c?revision=1.14 (this includes the patch http://fuse.cvs.sourceforge.net/fuse/fuse/lib/mount_bsd.c?r1=1.13&r2=1.14 which fixes a bug referred to in this thread as "issue 2"). - Go wild with your experiments. ATM the easiest way to enable sync unmount is adding MOUNT_FUSEFS_SYNC_UNMOUNT=1 to the environment. (Making it settable via the environment lets us leave the lib/fs code intact.) ATM sync unmount is available without restrictions. Have fun, Csaba From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 16:16:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5374016A419 for ; Thu, 3 Jan 2008 16:16:44 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1720013C455 for ; Thu, 3 Jan 2008 16:16:43 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so6191267rvb.43 for ; Thu, 03 Jan 2008 08:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=fkLaYp32jFmSvDKSgfzB5i7r5cPZczusmOotu6V+WRk=; b=RGo3HtkGoc8gbSldZiLQEmC3HfsmGsCMwlLsdv8lB2xvrVn7j5eknj3ERI4qYxTBkIjDjwKt5AD2lZnztraFEbrTTnGeduLXP4tcLMynPJ2m+KJ2CBAJ234XiM+JMkBpHK+SFFgaKukRhBGe/a4PpEbpkGcWtcvqyYKXXXNlaAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=nMC3KIjP+cZtV5pdD/yABcsWAyxCeFtaVZcvxjZmNiTh0J6Ic6r2VD2lbic+KcB7MsyM2vN8mVWJn4D29St5V9AKQyB/INO5bhuJ96nr3Or2b5XM711Ta7F0aBmoHx7uYhHJoTD9rq2qPhb1f33Hf0E3y233NiA6Y/HH6J5BGFc= Received: by 10.140.128.11 with SMTP id a11mr8176261rvd.232.1199377002752; Thu, 03 Jan 2008 08:16:42 -0800 (PST) Received: by 10.141.212.1 with HTTP; Thu, 3 Jan 2008 08:16:42 -0800 (PST) Message-ID: <9bbcef730801030816y1c7b173cp65b60a9aefccd00a@mail.gmail.com> Date: Thu, 3 Jan 2008 17:16:42 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "=?UTF-8?Q?Fernando_Apestegu=C3=ADa?=" In-Reply-To: <1bd550a00801030746y29b2c028j9351b99e8684f66c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Content-Disposition: inline References: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> <1bd550a00801030746y29b2c028j9351b99e8684f66c@mail.gmail.com> X-Google-Sender-Auth: f588295608bfb30f Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Porting from linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 16:16:45 -0000 T24gMDMvMDEvMjAwOCwgRmVybmFuZG8gQXBlc3RlZ3XDrWEgPGZlcm5hbmRvLmFwZXN0ZWd1aWFA Z21haWwuY29tPiB3cm90ZToKCj4gWWVzLCB0aGF0J3MgbXkgcHJvYmxlbS4gSW4gTGludXggSSBj YW4gZ2V0IGZyb20gL3Byb2MvY3B1aW5mbyBmb3IKPiBleGFtcGxlOiBuYW1lLCBtb2RlbCwgc3Rl cHBpbmcsIGNhY2hlIHNpemUsIGNsb2NrIHNwZWVkLCBzdXBwb3J0ZWQKPiBleHRlbnNpb25zLCBl dGMuLi4KPiBCdXQgdXNpbmcgc3lzY3RsIGluIEZyZWVCU0QgKHN5c2N0bCAtYSkgSSBjYW4gb25s eSBzZWUgbmFtZSBhbmQgdmVuZG9yCj4gZm9yIHRoZSBjcHUgYW5kIGEgZmV3IG1vcmUgdGhpbmdz LiBBbSBJIGxpbWl0ZWQgdG8gdGhlIHZhcmlhYmxlcwo+IHNob3dlZCBpbiBzeXNjdGwgLWE/CgpQ cm9iYWJseS4gSSBkb24ndCBrbm93IGlmIHRoZXJlJ3MgYW55dGhpbmcgdGhhdCBjYW4gZ2l2ZSB5 b3UgdGhlCmRldGFpbHMgcHJlc2VudCBpbiBjcHVpbmZvIChleGNlcHQgdXNpbmcgQ1BVSUQgZGF0 YSBkaXJlY3RseSkuCgo+IFRoYW5rcyBpbiBhZHZhbmNlLgo+Cj4gQlRXIGlmIHRoaXMgaXMgaXNu J3QgdGhlIHByb3BlciBsaXN0IHRvIGNvbnRpbnVlIHdpdGggdGhpcyB0aHJlYWQsIGxldCBtZSBr bm93LgoKTWF5YmUgaGFja2Vyc0Agd291bGQgaGVscCB5b3UgbW9yZS4K From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 16:33:43 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316B416A46B; Thu, 3 Jan 2008 16:33:43 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 1AB7013C4D5; Thu, 3 Jan 2008 16:33:42 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id E12EF1CC038; Thu, 3 Jan 2008 08:33:42 -0800 (PST) Date: Thu, 3 Jan 2008 08:33:42 -0800 From: Jeremy Chadwick To: Ivan Voras Message-ID: <20080103163342.GA50642@eos.sc1.parodius.com> References: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> <1bd550a00801030746y29b2c028j9351b99e8684f66c@mail.gmail.com> <9bbcef730801030816y1c7b173cp65b60a9aefccd00a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9bbcef730801030816y1c7b173cp65b60a9aefccd00a@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org, Fernando =?iso-8859-1?Q?Apestegu=EDa?= Subject: Re: Porting from linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 16:33:43 -0000 On Thu, Jan 03, 2008 at 05:16:42PM +0100, Ivan Voras wrote: > On 03/01/2008, Fernando Apesteguía wrote: > > > Yes, that's my problem. In Linux I can get from /proc/cpuinfo for > > example: name, model, stepping, cache size, clock speed, supported > > extensions, etc... > > But using sysctl in FreeBSD (sysctl -a) I can only see name and vendor > > for the cpu and a few more things. Am I limited to the variables > > showed in sysctl -a? > > Probably. I don't know if there's anything that can give you the > details present in cpuinfo (except using CPUID data directly). Best bet is parsing or using the hw.model sysctl, or if you need lower-level information, there is a port that apparently gets cache size and other data. There are very few things I liked about Linux /proc when I used it, but getting h/w information happened to be one of them... -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 17:52:13 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078C616A419 for ; Thu, 3 Jan 2008 17:52:13 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.228]) by mx1.freebsd.org (Postfix) with ESMTP id A05B513C447 for ; Thu, 3 Jan 2008 17:52:12 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wr-out-0506.google.com with SMTP id 68so211698wra.13 for ; Thu, 03 Jan 2008 09:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=flwCVwxxLSgm2TzF2R9X0+sTDlVKvXVU4leHM3eO+OE=; b=Dc311aXNHcyV+uYWfidT0/Rk6zljsR6B6Dc+rtjqA6S97En2QheGokbMJ+2LxvD92GnfkQSsCGr3fFylKRL680Q2fqsSHnZkpIKLKkDlMeekADIHgf2RilOaYOMVeEzT7L8pBGcucM5wJ87p37mcjR8H96E1Qj76TxgjUX+of5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=nUOIiCqjjXmPlV4dtOJo7ztOoHjbgImd3GiEZMTrGoszARQLTDhNrb5ZI3XGel/s/ejVKl/TJanZvH9Vms4JXjWX9HD0Eh2fgSjiHGa8yvnEAscZBWKTRFIQUvXXs+zq2Iy2QwOvt9yL/QYeRB3SG49XTTvYLGLINf62EWZavj4= Received: by 10.150.202.17 with SMTP id z17mr2294459ybf.70.1199381181154; Thu, 03 Jan 2008 09:26:21 -0800 (PST) Received: by 10.150.178.13 with HTTP; Thu, 3 Jan 2008 09:26:21 -0800 (PST) Message-ID: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> Date: Thu, 3 Jan 2008 18:26:21 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 17:52:13 -0000 Hi all, I post my question in this list cause Ivan Voras (ivoras@freebsd.org) suggested that here I could find more help. I have an application written in C + Gtk + Glib that gathers information from procfs under Linux. Now, I'm trying to port this application to FreeBSD (I'm working with 7.0 RC1). I've been pointed to get rid of the procfs stuff in the freebsd code and use sysctl instead. However, I can't find some of the information that is present under /proc in Linux. I can only get for the CPU for instance some small bits of info in "hw.model" but I can't get the cache size, supported extensions, etc. I have the same problem with the memory (how much memory is cached, in buffers, marked as dirty, etc...). How can I get all that information? Could you point me to some source I can look at? Is this information (that I suppose it is known by the kernel) somehow exported to userland? Here is a small list of the information the Linux application is available to show: - CPU info: (vendor, model, clock speed, stepping, cache size, supported extensions) - Memory: total, free, shared, cached, used in buffers, marked as dirty, etc.. - Devices: list of block and char devices - Filesystems loaded in the kernel - Network information (bytes sent and received, packets, errors, for each NIC) - Loaded modules (sizes of the modules, if they are used by other modules...) - Some kernel parameters (max files per process, semaphores, etc...) I've seen this is fully covered with sysctl. Thanks in advance.... and Happy New Year. From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 18:07:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 116F316A417 for ; Thu, 3 Jan 2008 18:07:41 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id ADBF913C458 for ; Thu, 3 Jan 2008 18:07:40 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.1/8.13.8) with ESMTP id m03I7dJi030343; Thu, 3 Jan 2008 12:07:39 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.1/8.13.8/Submit) id m03I7dJc030342; Thu, 3 Jan 2008 12:07:39 -0600 (CST) (envelope-from brooks) Date: Thu, 3 Jan 2008 12:07:39 -0600 From: Brooks Davis To: Fernando Apestegu?a Message-ID: <20080103180739.GA30164@lor.one-eyed-alien.net> References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 03 Jan 2008 12:07:39 -0600 (CST) Cc: freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 18:07:41 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 03, 2008 at 06:26:21PM +0100, Fernando Apestegu?a wrote: > Hi all, >=20 > I post my question in this list cause Ivan Voras (ivoras@freebsd.org) > suggested that here I could find more help. >=20 > I have an application written in C + Gtk + Glib that gathers > information from procfs under Linux. Now, I'm trying to port this > application to FreeBSD (I'm working with 7.0 RC1). >=20 > I've been pointed to get rid of the procfs stuff in the freebsd code > and use sysctl instead. However, I can't find some of the information > that is present under /proc in Linux. >=20 > I can only get for the CPU for instance some small bits of info in > "hw.model" but I can't get the cache size, supported extensions, etc. > I have the same problem with the memory (how much memory is cached, in > buffers, marked as dirty, etc...). >=20 > How can I get all that information? Could you point me to some source > I can look at? >=20 > Is this information (that I suppose it is known by the kernel) somehow > exported to userland? >=20 > Here is a small list of the information the Linux application is > available to show: >=20 > - CPU info: (vendor, model, clock speed, stepping, cache size, > supported extensions) See misc/cpuid for a port that extracts this from the CPU. To some extent it would be better if the kernel did this because it can better know which CPU it's on, but this does most of it. > - Memory: total, free, shared, cached, used in buffers, marked as dirty, = etc.. You can't get a perfect mapping do these because we have different virtual memory systems. The continued delusion that any of this is comparable between OSes is a pet peeve of mine. :) The sysutils/ganglia-monitor-core port does some of this (search for freebsd.c). > - Devices: list of block and char devices ls /dev :-) > - Filesystems loaded in the kernel lsvfs(1) reports this information. > - Network information (bytes sent and received, packets, errors, for each= NIC) See ganglia. > - Loaded modules (sizes of the modules, if they are used by other modules= =2E..) see kldstat(8) > - Some kernel parameters (max files per process, semaphores, etc...) > I've seen this is fully covered with sysctl. -- Brooks --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFHfSRrXY6L6fI4GtQRArTqAKDGT7j6zEXRc/FeVFxDYVvTKmxhfwCglEZ2 rDf5EZP+XrvWgnfzq6C62Ls= =3tyV -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 18:16:02 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A0E16A419 for ; Thu, 3 Jan 2008 18:16:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outJ.internet-mail-service.net (outJ.internet-mail-service.net [216.240.47.233]) by mx1.freebsd.org (Postfix) with ESMTP id 6035113C46B for ; Thu, 3 Jan 2008 18:16:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 03 Jan 2008 10:16:01 -0800 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id ED1D9126DF8; Thu, 3 Jan 2008 10:16:00 -0800 (PST) Message-ID: <477D266F.3090807@elischer.org> Date: Thu, 03 Jan 2008 10:16:15 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Neeku Shamekhi References: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> In-Reply-To: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Semaphores 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, 03 Jan 2008 18:16:02 -0000 Neeku Shamekhi wrote: > I need some article about semaphores in freeBSD and mainly about kern_sema.c > file. man 9 sema > _______________________________________________ > 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 Thu Jan 3 19:19:44 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4815E16A46E for ; Thu, 3 Jan 2008 19:19:44 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id AEF0613C457 for ; Thu, 3 Jan 2008 19:19:43 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: (qmail 987 invoked by uid 1040); 3 Jan 2008 18:53:33 -0000 Received: from unknown (HELO ?192.168.2.4?) (metin@88.237.193.104) by 0 with ESMTPA; 3 Jan 2008 18:53:32 -0000 Date: Thu, 3 Jan 2008 20:52:48 +0200 From: Metin KAYA X-Mailer: The Bat! (v3.98.4) Professional Organization: EnderUNIX X-Priority: 3 (Normal) Message-ID: <1571995824.20080103205248@EnderUNIX.org> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Subject: select 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, 03 Jan 2008 19:19:44 -0000 Hi all, How select(2) will behave if I give the "utimeout" parameter as NULL? -- Metin KAYA EnderUNIX Software Developer Endersys Software Engineer http://www.EnderUNIX.org/metin http://www.Endersys.com/ From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:32:56 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E01B16A418 for ; Thu, 3 Jan 2008 19:32:56 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id 7792113C46E for ; Thu, 3 Jan 2008 19:32:55 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: (qmail 2519 invoked by uid 1040); 3 Jan 2008 19:33:26 -0000 Received: from unknown (HELO ?192.168.2.4?) (metin@88.237.193.104) by 0 with ESMTPA; 3 Jan 2008 19:33:14 -0000 Date: Thu, 3 Jan 2008 21:32:23 +0200 From: Metin KAYA X-Mailer: The Bat! (v3.98.4) Professional Organization: EnderUNIX X-Priority: 3 (Normal) Message-ID: <363446479.20080103213223@EnderUNIX.org> To: "Rick C. Petty" In-Reply-To: <20080103192245.GB90170@keira.kiwi-computer.com> References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Cc: freebsd-hackers@freebsd.org Subject: Re[2]: select 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, 03 Jan 2008 19:32:56 -0000 Yes Rick, I'm asking this "indefinitely" issue. Is there anything that handle this NULL situation a signal, or etc.? How does Linux or FreeBSD behave? > On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: >> >> How select(2) will behave if I give the "utimeout" parameter as >> NULL? > According to the man page: > If timeout is not a null pointer, it specifies the maximum interval to > wait for the selection to complete. System activity can lengthen the > interval by an indeterminate amount. > If timeout is a null pointer, the select blocks indefinitely. > To effect a poll, the timeout argument should not be a null pointer, but > it should point to a zero-valued timeval structure. > -- Rick C. Petty -- Metin KAYA EnderUNIX Software Developer Endersys Software Engineer http://www.EnderUNIX.org/metin http://www.Endersys.com/ From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:34:22 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2140816A473 for ; Thu, 3 Jan 2008 19:34:22 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout7.cac.washington.edu (mxout7.cac.washington.edu [140.142.32.178]) by mx1.freebsd.org (Postfix) with ESMTP id 0069813C4D1 for ; Thu, 3 Jan 2008 19:34:21 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout7.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JY8el021021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Jan 2008 11:34:08 -0800 X-Auth-Received: from dzihan.cs.washington.edu (dzihan.cs.washington.edu [128.208.4.96]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JY7Ew000389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 3 Jan 2008 11:34:08 -0800 Message-ID: <477D38AF.2070603@u.washington.edu> Date: Thu, 03 Jan 2008 11:34:07 -0800 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (X11/20071003) MIME-Version: 1.0 To: Metin KAYA References: <1571995824.20080103205248@EnderUNIX.org> In-Reply-To: <1571995824.20080103205248@EnderUNIX.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.1.3.111644 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_900_999 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: freebsd-hackers@freebsd.org Subject: Re: select 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, 03 Jan 2008 19:34:22 -0000 Metin KAYA wrote: > Hi all, > > How select(2) will behave if I give the "utimeout" parameter as > NULL? > > -- > Metin KAYA > EnderUNIX Software Developer Endersys Software Engineer > http://www.EnderUNIX.org/metin http://www.Endersys.com/ > > _______________________________________________ > 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" > In the future: Why not try compiling a simple test program to try it out or google the subject...? Your doing that would be more effective use of your time and others'.. My guess is that it's implementation independent and may involve segfaults or other 'unknown' behavior, as it's not a defined input.. -Garrett From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:36:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D841C16A419 for ; Thu, 3 Jan 2008 19:36:57 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id F240A13C447 for ; Thu, 3 Jan 2008 19:36:56 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: (qmail 2722 invoked by uid 1040); 3 Jan 2008 19:37:28 -0000 Received: from unknown (HELO ?192.168.2.4?) (metin@88.237.193.104) by 0 with ESMTPA; 3 Jan 2008 19:37:27 -0000 Date: Thu, 3 Jan 2008 21:36:40 +0200 From: Metin KAYA X-Mailer: The Bat! (v3.98.4) Professional Organization: EnderUNIX X-Priority: 3 (Normal) Message-ID: <1115612197.20080103213640@EnderUNIX.org> To: Garrett Cooper In-Reply-To: <477D38AF.2070603@u.washington.edu> References: <1571995824.20080103205248@EnderUNIX.org> <477D38AF.2070603@u.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Cc: freebsd-hackers@freebsd.org Subject: Re[2]: select 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, 03 Jan 2008 19:36:57 -0000 Thank you a lot for your good answer. Please read my other mail. I'm asking a question in man page. > Metin KAYA wrote: >> Hi all, >> >> How select(2) will behave if I give the "utimeout" parameter as >> NULL? >> >> -- >> Metin KAYA >> EnderUNIX Software Developer Endersys Software Engineer >> http://www.EnderUNIX.org/metin http://www.Endersys.com/ >> >> _______________________________________________ >> 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" >> > In the future: > Why not try compiling a simple test program to try it out or google the > subject...? Your doing that would be more effective use of your time and > others'.. > My guess is that it's implementation independent and may involve > segfaults or other 'unknown' behavior, as it's not a defined input.. > -Garrett -- Metin KAYA EnderUNIX Software Developer Endersys Software Engineer http://www.EnderUNIX.org/metin http://www.Endersys.com/ From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:37:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C8C16A418 for ; Thu, 3 Jan 2008 19:37:41 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout5.cac.washington.edu (mxout5.cac.washington.edu [140.142.32.135]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2DE13C4D5 for ; Thu, 3 Jan 2008 19:37:41 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout5.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JbRad008610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Jan 2008 11:37:28 -0800 X-Auth-Received: from dzihan.cs.washington.edu (dzihan.cs.washington.edu [128.208.4.96]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JbRai001037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 3 Jan 2008 11:37:27 -0800 Message-ID: <477D3977.3030608@u.washington.edu> Date: Thu, 03 Jan 2008 11:37:27 -0800 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (X11/20071003) MIME-Version: 1.0 To: Metin KAYA References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> <363446479.20080103213223@EnderUNIX.org> In-Reply-To: <363446479.20080103213223@EnderUNIX.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.1.3.111644 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: freebsd-hackers@freebsd.org, "Rick C. Petty" Subject: Re: select 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, 03 Jan 2008 19:37:41 -0000 Metin KAYA wrote: > Yes Rick, I'm asking this "indefinitely" issue. Is there anything > that handle this NULL situation a signal, or etc.? How does Linux or > FreeBSD behave? > > >> On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: >> >>> How select(2) will behave if I give the "utimeout" parameter as >>> NULL? >>> > > >> According to the man page: >> > > >> If timeout is not a null pointer, it specifies the maximum interval to >> wait for the selection to complete. System activity can lengthen the >> interval by an indeterminate amount. >> > > >> If timeout is a null pointer, the select blocks indefinitely. >> > > >> To effect a poll, the timeout argument should not be a null pointer, but >> it should point to a zero-valued timeval structure. >> > > > >> -- Rick C. Petty >> > > > -- > Metin KAYA > EnderUNIX Software Developer Endersys Software Engineer > http://www.EnderUNIX.org/metin http://www.Endersys.com/ > Nevermind -- yes, block indefinitely, which implies that the program won't proceed until it receives an umasked signal and exits or a file descriptor becomes available in the 'infinite' time frame. That would essentially be the same as listen or send though with blocking sockets, correct? -Garrett From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:45:18 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5225B16A478 for ; Thu, 3 Jan 2008 19:45:18 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 2E85C13C457 for ; Thu, 3 Jan 2008 19:45:18 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03Jj4gm011213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Jan 2008 11:45:04 -0800 X-Auth-Received: from dzihan.cs.washington.edu (dzihan.cs.washington.edu [128.208.4.96]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03Jj4lB016348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 3 Jan 2008 11:45:04 -0800 Message-ID: <477D3B40.9020805@u.washington.edu> Date: Thu, 03 Jan 2008 11:45:04 -0800 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (X11/20071003) MIME-Version: 1.0 To: Metin KAYA References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> <363446479.20080103213223@EnderUNIX.org> <477D3977.3030608@u.washington.edu> In-Reply-To: <477D3977.3030608@u.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.1.3.113120 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: freebsd-hackers@freebsd.org, "Rick C. Petty" Subject: Re: select 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, 03 Jan 2008 19:45:18 -0000 Garrett Cooper wrote: > Metin KAYA wrote: >> Yes Rick, I'm asking this "indefinitely" issue. Is there anything >> that handle this NULL situation a signal, or etc.? How does Linux or >> FreeBSD behave? >> >> >>> On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: >>> >>>> How select(2) will behave if I give the "utimeout" parameter as >>>> NULL? >>>> >> >> >>> According to the man page: >>> >> >> >>> If timeout is not a null pointer, it specifies the maximum >>> interval to >>> wait for the selection to complete. System activity can >>> lengthen the >>> interval by an indeterminate amount. >>> >> >> >>> If timeout is a null pointer, the select blocks indefinitely. >>> >> >> >>> To effect a poll, the timeout argument should not be a null >>> pointer, but >>> it should point to a zero-valued timeval structure. >>> >> >> >> >>> -- Rick C. Petty >>> >> >> >> -- Metin KAYA EnderUNIX >> Software Developer Endersys Software Engineer >> http://www.EnderUNIX.org/metin http://www.Endersys.com/ >> > Nevermind -- yes, block indefinitely, which implies that the program > won't proceed until it receives an umasked signal and exits or a file > descriptor becomes available in the 'infinite' time frame. > > That would essentially be the same as listen or send though with > blocking sockets, correct? > > -Garrett Well, the waiting part at least, not the sending and receiving part of send and listen, respectively.. -Garrett From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:49:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E801716A419 for ; Thu, 3 Jan 2008 19:49:26 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 775D313C459 for ; Thu, 3 Jan 2008 19:49:26 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 90249 invoked by uid 2001); 3 Jan 2008 19:22:45 -0000 Date: Thu, 3 Jan 2008 13:22:45 -0600 From: "Rick C. Petty" To: Metin KAYA Message-ID: <20080103192245.GB90170@keira.kiwi-computer.com> References: <1571995824.20080103205248@EnderUNIX.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1571995824.20080103205248@EnderUNIX.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: select X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 19:49:27 -0000 On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: > > How select(2) will behave if I give the "utimeout" parameter as > NULL? According to the man page: If timeout is not a null pointer, it specifies the maximum interval to wait for the selection to complete. System activity can lengthen the interval by an indeterminate amount. If timeout is a null pointer, the select blocks indefinitely. To effect a poll, the timeout argument should not be a null pointer, but it should point to a zero-valued timeval structure. -- Rick C. Petty From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:50:52 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2663C16A420 for ; Thu, 3 Jan 2008 19:50:52 +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 D681D13C455 for ; Thu, 3 Jan 2008 19:50:51 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 46AC7209C; Thu, 3 Jan 2008 20:50:43 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.1/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 39B4F2099; Thu, 3 Jan 2008 20:50:43 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id F3802844C3; Thu, 3 Jan 2008 20:50:42 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: =?utf-8?Q?Fernando_Apestegu=C3=ADa?= References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> Date: Thu, 03 Jan 2008 20:50:42 +0100 In-Reply-To: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> ("Fernando =?utf-8?Q?Apestegu=C3=ADa=22's?= message of "Thu\, 3 Jan 2008 18\:26\:21 +0100") Message-ID: <86tzlud6y5.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 19:50:52 -0000 "Fernando Apestegu=C3=ADa" writes: > I have an application written in C + Gtk + Glib that gathers > information from procfs under Linux. Now, I'm trying to port this > application to FreeBSD (I'm working with 7.0 RC1). man linprocfs DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:53:32 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 003A116A417 for ; Thu, 3 Jan 2008 19:53:31 +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 AEBDF13C457 for ; Thu, 3 Jan 2008 19:53:31 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 1E6C220B1; Thu, 3 Jan 2008 20:53:23 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.1/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 8FB99209C; Thu, 3 Jan 2008 20:53:22 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 656C3844C3; Thu, 3 Jan 2008 20:53:22 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Metin KAYA References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> <363446479.20080103213223@EnderUNIX.org> Date: Thu, 03 Jan 2008 20:53:22 +0100 In-Reply-To: <363446479.20080103213223@EnderUNIX.org> (Metin KAYA's message of "Thu\, 3 Jan 2008 21\:32\:23 +0200") Message-ID: <86prwid6tp.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, "Rick C. Petty" Subject: Re: select 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, 03 Jan 2008 19:53:32 -0000 Metin KAYA writes: > Yes Rick, I'm asking this "indefinitely" issue. Is there anything that > handle this NULL situation a signal, or etc.? How does Linux or > FreeBSD behave? Please don't top-post. Like most other system calls that block "indefinitely", select(2) will be interrupted by signals. This is *also* documented in the man page you didn't read: [EINTR] A signal was delivered before the time limit expired and before any of the selected events occurred. See sigaction(2) for details on how to modify the way system calls behave when a signal is delivered. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:56:12 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0FF16A41B for ; Thu, 3 Jan 2008 19:56:12 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id CA1D613C448 for ; Thu, 3 Jan 2008 19:56:11 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.2/8.14.2) id m03JYDpg059462; Thu, 3 Jan 2008 13:34:13 -0600 (CST) (envelope-from dan) Date: Thu, 3 Jan 2008 13:34:13 -0600 From: Dan Nelson To: Metin KAYA Message-ID: <20080103193413.GE52545@dan.emsphone.com> References: <1571995824.20080103205248@EnderUNIX.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1571995824.20080103205248@EnderUNIX.org> X-OS: FreeBSD 7.0-PRERELEASE User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: select 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, 03 Jan 2008 19:56:12 -0000 In the last episode (Jan 03), Metin KAYA said: > Hi all, > > How select(2) will behave if I give the "utimeout" parameter as > NULL? >From the man page: If timeout is a null pointer, the select blocks indefinitely. http://www.freebsd.org/cgi/man.cgi?query=select -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:57:19 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E7416A41A for ; Thu, 3 Jan 2008 19:57:19 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by mx1.freebsd.org (Postfix) with ESMTP id 209D513C442 for ; Thu, 3 Jan 2008 19:57:18 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so1914490wxd.7 for ; Thu, 03 Jan 2008 11:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=mo0yW+N9Tw11CKy59sCEcfdDctt/YCKDYkl2mHYCE40=; b=U1sUShTyVl1g92w46Ancp+OXuJxMu0CKYqMrxT/mtZTDOCa2UXOaNpaj+MT9AIHC3RUs5Cr0jk1mP3nlvNe8F73WZjldGsyM7vDgIaIMM3VIS1ipDhPGk8MDN9f3yVj3MTDgijTyXJkuBs5za0kOGUxIdW894wyoNspB8SXVnZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AzZNcRq3dL3GtJJYxAU1OiS5ybQ1JxMeAaU7ClNr7b3G/wkGwobK+3gDHaYwnTca1EvvrjgzH32jUlGzkSxxUC4Lhnaeb8aMGYD3w9n4y51dHSyGS+LyDi2Q6m+l9phzHpzPQ2tdX1zgfI8BO4SrT5F6zzRNGsKrCVRXx7oOiUY= Received: by 10.150.185.14 with SMTP id i14mr4317971ybf.88.1199390238360; Thu, 03 Jan 2008 11:57:18 -0800 (PST) Received: by 10.150.178.13 with HTTP; Thu, 3 Jan 2008 11:57:18 -0800 (PST) Message-ID: <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> Date: Thu, 3 Jan 2008 20:57:18 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: "=?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?=" In-Reply-To: <86tzlud6y5.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> Cc: freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 19:57:19 -0000 On Jan 3, 2008 8:50 PM, Dag-Erling Sm=F8rgrav wrote: > "Fernando Apestegu=EDa" writes: > > I have an application written in C + Gtk + Glib that gathers > > information from procfs under Linux. Now, I'm trying to port this > > application to FreeBSD (I'm working with 7.0 RC1). > > man linprocfs Yes, I checked it. But although the cpuinfo file is quite close to the "original" one in Linux, there are other important files missed. That's because I'm trying to find the best approach. Maybe a mix of both could be good: use the linxprocfs when it is almost straightforward (in fact I could run the app, just changing few lines) and sysctl when the linprocfs doesn't provide the information that I need. Cheers > > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 19:57:39 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D6E16A421 for ; Thu, 3 Jan 2008 19:57:39 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 2069B13C461 for ; Thu, 3 Jan 2008 19:57:39 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JvPhx015321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Jan 2008 11:57:25 -0800 X-Auth-Received: from dzihan.cs.washington.edu (dzihan.cs.washington.edu [128.208.4.96]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.09) with ESMTP id m03JvPRA005192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 3 Jan 2008 11:57:25 -0800 Message-ID: <477D3E25.4080807@u.washington.edu> Date: Thu, 03 Jan 2008 11:57:25 -0800 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (X11/20071003) MIME-Version: 1.0 To: Metin KAYA References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> <363446479.20080103213223@EnderUNIX.org> <477D3977.3030608@u.washington.edu> In-Reply-To: <477D3977.3030608@u.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.1.3.113316 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: freebsd-hackers@freebsd.org, "Rick C. Petty" Subject: Re: select 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, 03 Jan 2008 19:57:39 -0000 Garrett Cooper wrote: > Metin KAYA wrote: >> Yes Rick, I'm asking this "indefinitely" issue. Is there anything >> that handle this NULL situation a signal, or etc.? How does Linux or >> FreeBSD behave? >> >> >>> On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: >>> >>>> How select(2) will behave if I give the "utimeout" parameter as >>>> NULL? >>>> >> >> >>> According to the man page: >>> >> >> >>> If timeout is not a null pointer, it specifies the maximum >>> interval to >>> wait for the selection to complete. System activity can >>> lengthen the >>> interval by an indeterminate amount. >>> >> >> >>> If timeout is a null pointer, the select blocks indefinitely. >>> >> >> >>> To effect a poll, the timeout argument should not be a null >>> pointer, but >>> it should point to a zero-valued timeval structure. >>> >> >> >> >>> -- Rick C. Petty >>> >> >> >> -- Metin KAYA EnderUNIX >> Software Developer Endersys Software Engineer >> http://www.EnderUNIX.org/metin http://www.Endersys.com/ >> > Nevermind -- yes, block indefinitely, which implies that the program > won't proceed until it receives an umasked signal and exits or a file > descriptor becomes available in the 'infinite' time frame. > > That would essentially be the same as listen or send though with > blocking sockets, correct? > > -Garrett Give this beauty a shot [manually modified from the FC7 select(2) manpage]: #include #include int main() { fd_set rfds; FD_ZERO(&rfds); FD_SET(0, &rfds); printf("Wait for it...\n"); select(1, &rfds, NULL, NULL, NULL); printf("Done!\n"); return 0; } It will indefinitely block until you provide an EOF on the terminal (or have some other EOF'ed data written to STDIN for the program, i.e. via a pipe). Sending signals (apart from SIGIO -- 23) instantly kills the program as nothing's masked. SIGIO not killing the program is to be expected as per signal(7) and fcntl(2)'s manpage descriptions. Tested on an FC7 machine, so your mileage on a FreeBSD machine may differ. Cheers, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 20:10:54 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8671516A41A for ; Thu, 3 Jan 2008 20:10:54 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id 9964613C442 for ; Thu, 3 Jan 2008 20:10:53 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: (qmail 3984 invoked by uid 1040); 3 Jan 2008 20:11:21 -0000 Received: from unknown (HELO ?192.168.2.4?) (metin@88.237.193.104) by 0 with ESMTPA; 3 Jan 2008 20:11:18 -0000 Date: Thu, 3 Jan 2008 22:10:34 +0200 From: Metin KAYA X-Mailer: The Bat! (v3.98.4) Professional Organization: EnderUNIX X-Priority: 3 (Normal) Message-ID: <172618207.20080103221034@EnderUNIX.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86prwid6tp.fsf@ds4.des.no> References: <1571995824.20080103205248@EnderUNIX.org><20080103192245.GB90170@keira.kiwi-computer.com><363446479.20080103213223@EnderUNIX.org> <86prwid6tp.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Cc: freebsd-hackers@freebsd.org, "Rick C. Petty" Subject: Re[2]: select 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, 03 Jan 2008 20:10:54 -0000 > Metin KAYA writes: >> Yes Rick, I'm asking this "indefinitely" issue. Is there anything that >> handle this NULL situation a signal, or etc.? How does Linux or >> FreeBSD behave? > Please don't top-post. > Like most other system calls that block "indefinitely", select(2) will > be interrupted by signals. This is *also* documented in the man page > you didn't read: > [EINTR] A signal was delivered before the time limit expired > and before any of the selected events occurred. > See sigaction(2) for details on how to modify the way system calls > behave when a signal is delivered. > DES Thanks. I've read select_tut(2) man page in FC8 but there is no such explanation about EINTR, so don't mind my this mistake. -- Metin KAYA EnderUNIX Software Developer Endersys Software Engineer http://www.EnderUNIX.org/metin http://www.Endersys.com/ From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 20:53:29 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D16316A420 for ; Thu, 3 Jan 2008 20:53:29 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id DEC4413C4E8 for ; Thu, 3 Jan 2008 20:53:27 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JAX43-0003JX-Aw for freebsd-hackers@freebsd.org; Thu, 03 Jan 2008 20:53:19 +0000 Received: from 78-0-90-175.adsl.net.t-com.hr ([78.0.90.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 20:53:19 +0000 Received: from ivoras by 78-0-90-175.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 20:53:19 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Thu, 03 Jan 2008 21:53:05 +0100 Lines: 33 Message-ID: References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig53D64A636C450A3ECB961278" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 78-0-90-175.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> X-Enigmail-Version: 0.95.5 Sender: news Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 20:53:29 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig53D64A636C450A3ECB961278 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Fernando Apestegu=C3=ADa wrote: > Maybe a mix of both could be good: use the linxprocfs when it is > almost straightforward (in fact I could run the app, just changing few > lines) and sysctl when the linprocfs doesn't provide the information > that I need. Also, linprocfs is never mounted by default - this might or might not be an obstacle, depending on how user-friendly the application is (asking desktop users to alter their fstabs may be asking too much :) ). --------------enig53D64A636C450A3ECB961278 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHfUsxldnAQVacBcgRArbXAKCLRSsoFU9x9itiyDEsQQnd//j5HACfXokX Mq/7/EwXa3BExJPgztq6+lk= =MbwZ -----END PGP SIGNATURE----- --------------enig53D64A636C450A3ECB961278-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 20:59:03 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD7B916A420 for ; Thu, 3 Jan 2008 20:59:03 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.236]) by mx1.freebsd.org (Postfix) with ESMTP id 61F7C13C4E8 for ; Thu, 3 Jan 2008 20:59:03 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wr-out-0506.google.com with SMTP id 68so262372wra.13 for ; Thu, 03 Jan 2008 12:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=X4XcM111OIuWWoDB3Kb3Hf2Ryol3tS9qza3egPu8g2g=; b=n6moTMLjW8IWNHdfiP0leNR/mBB6oklWj56PMYPMJzU+Uxa0jrtKs0rjnYqL0M8Pb62QvddqXarv0QQ+IWWtOnj20CVV8W/o37tLYuK3Aw6KB0t5/Fo+C4pVngl/f1s5tnq6BcGXhMiT8JFWAIe+UZNf1jn3gLhCyRkhhc7NmaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RNeWswpkxgFob0DgizkCU4ZaaBSPAASsC60LpyZF+pw+uKuLv1AYRIo7et7xcjkUloeT6nAzUriHtleVRTab6nGlSX75cJPa23IJnt7hjN5MdbvC7iT7r9vwQ6fr4M5glG1Fe4IVYFsk5BQ4MrPKmDx+1L9TEWelgAgrSCZHwUY= Received: by 10.150.143.14 with SMTP id q14mr4337196ybd.113.1199393942412; Thu, 03 Jan 2008 12:59:02 -0800 (PST) Received: by 10.150.178.13 with HTTP; Thu, 3 Jan 2008 12:59:02 -0800 (PST) Message-ID: <1bd550a00801031259q56965b82n86a050f945a5df3d@mail.gmail.com> Date: Thu, 3 Jan 2008 21:59:02 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: "Ivan Voras" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 20:59:03 -0000 On Jan 3, 2008 9:53 PM, Ivan Voras wrote: > Fernando Apestegu=EDa wrote: > > > Maybe a mix of both could be good: use the linxprocfs when it is > > almost straightforward (in fact I could run the app, just changing few > > lines) and sysctl when the linprocfs doesn't provide the information > > that I need. > > Also, linprocfs is never mounted by default - this might or might not be > an obstacle, depending on how user-friendly the application is (asking > desktop users to alter their fstabs may be asking too much :) ). > I hadn't thought about it... but it's quite to the point. Maybe it makes no sense to ask for a particular filesystem from a graphical Gnome application... > > From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 23:21:27 2008 Return-Path: Delivered-To: FreeBSD-Hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00AFF16A418 for ; Thu, 3 Jan 2008 23:21:27 +0000 (UTC) (envelope-from Danovitsch@vitsch.net) Received: from VM01.Vitsch.net (vm01.vitsch.net [85.17.51.140]) by mx1.freebsd.org (Postfix) with ESMTP id 97D3D13C478 for ; Thu, 3 Jan 2008 23:21:26 +0000 (UTC) (envelope-from Danovitsch@vitsch.net) Received: from [192.168.45.230] (dhcp-077-250-050-082.chello.nl [77.250.50.82]) (authenticated bits=0) by VM01.Vitsch.net (8.13.8/8.13.8) with ESMTP id m03MrVta099251 for ; Thu, 3 Jan 2008 23:53:32 +0100 (CET) (envelope-from Danovitsch@vitsch.net) From: "Daan Vreeken [PA4DAN]" Organization: Vitsch Electronics To: FreeBSD-Hackers@FreeBSD.org Date: Thu, 3 Jan 2008 23:52:56 +0100 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801032352.56491.Danovitsch@vitsch.net> Cc: Subject: mksnap_ffs time 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, 03 Jan 2008 23:21:27 -0000 Hi Hackers, I'm running a 6.2-RELEASE server with a /home partition that's used to backup a customer's data. The backups are being made during the night. Since a couple of weeks I'm running mksnap_ffs daily to create filesystem snapshots of the data. I've been logging the time it takes mksnap_ffs to create it's snapshot. Here are the 'time' numbers for the last 11 days : 1696.25 real 0.00 user 16.55 sys 1884.09 real 0.00 user 18.63 sys 2038.50 real 0.00 user 20.72 sys 2354.69 real 0.00 user 25.07 sys 2202.43 real 0.00 user 23.08 sys 2621.88 real 0.00 user 27.46 sys 2791.46 real 0.00 user 29.57 sys 2845.48 real 0.00 user 31.69 sys 2894.24 real 0.00 user 32.60 sys 3085.37 real 0.00 user 35.62 sys 3253.11 real 0.00 user 37.25 sys Right now the filesystem contains 'just' 16 snapshots. The filesystem itself is a 700GB partition : # df Filesystem 1K-blocks Used Avail Capacity Mounted on ... /dev/twed0s3d 700905640 271350848 373482342 42% /home The filesystem has been created with default newfs flags. Today the filesystem contains 186615 files. Average file size is about 140 to 150KB. The data consists of lots of very small files, lots of middle-sized files, and a bunch of huge files, so 'average' file size might not be a very good measure. Every day between 300 to 400MB of data is changed/added. The time it takes to take another snapshot seems to increase with about 140 seconds a day. If the snapshot time keeps increasing in this fashion, the server will spend half of it's time in a day creating snapshots by the end of the year ;-) 1) Is anyone else seeing this? 2) Is there anything that can be done to improve snapshot creation time? 3) Is this something that has already been improved in version X of FreeBSD? And just for my own curiosity: Where does mksnap_ffs spend most of it's time? Is this something that simply can't be changed by the nature of UFS, or is it a known deficiency in the code that could by improved somehow? (btw: I can provide more information on the hardware or the filesystem (file size histograms anyone?) if anyone is interested.) Thanks for any insights, -- Daan From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 23:46:59 2008 Return-Path: Delivered-To: FreeBSD-Hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD4016A41B for ; Thu, 3 Jan 2008 23:46:59 +0000 (UTC) (envelope-from Danovitsch@vitsch.net) Received: from VM01.Vitsch.net (vm01.vitsch.net [85.17.51.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC7013C461 for ; Thu, 3 Jan 2008 23:46:59 +0000 (UTC) (envelope-from Danovitsch@vitsch.net) Received: from [192.168.45.230] (dhcp-077-250-050-082.chello.nl [77.250.50.82]) (authenticated bits=0) by VM01.Vitsch.net (8.13.8/8.13.8) with ESMTP id m03Nl0oV099922; Fri, 4 Jan 2008 00:47:01 +0100 (CET) (envelope-from Danovitsch@vitsch.net) From: "Daan Vreeken [PA4DAN]" Organization: Vitsch Electronics To: Markus Boelter Date: Fri, 4 Jan 2008 00:46:25 +0100 User-Agent: KMail/1.9.7 References: <200801032352.56491.Danovitsch@vitsch.net> <20080103233019.GE17445@rebooten.de> In-Reply-To: <20080103233019.GE17445@rebooten.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801040046.25465.Danovitsch@vitsch.net> Cc: FreeBSD-Hackers@freebsd.org Subject: Re: mksnap_ffs time 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, 03 Jan 2008 23:47:00 -0000 On Friday 04 January 2008 00:30:20 you wrote: > Hi! > > > 1) Is anyone else seeing this? > > As far as I know, this is somehow related to the SoftUpdates, but I am not > 100% sure. Look at the mailinglist archives, there was a discussion a few > months ago about the same topic as far as I remember. > > Please note that according to > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/snapshots.html > a filesystem can only have 20 snapshots! :-) Hmm.. Then at least time spent per snapshot isn't going to get much worse than it is today ;-) Too bad this limitation isn't mentioned in 'man 8 mksnap_ffs'. If this limitation is still there, I think it deserves a place in the manual. Thanks! -- Daan From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 02:32:35 2008 Return-Path: Delivered-To: FreeBSD-Hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE2DF16A418 for ; Fri, 4 Jan 2008 02:32:35 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from ns.trinitel.com (186.161.36.72.static.reverse.ltdomains.com [72.36.161.186]) by mx1.freebsd.org (Postfix) with ESMTP id 8042A13C442 for ; Fri, 4 Jan 2008 02:32:35 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from neutrino.vnode.org (r74-193-81-203.pfvlcmta01.grtntx.tl.dh.suddenlink.net [74.193.81.203]) (authenticated bits=0) by ns.trinitel.com (8.14.1/8.14.1) with ESMTP id m042WTt9018680; Thu, 3 Jan 2008 20:32:30 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <477D9AB8.8050805@freebsd.org> Date: Thu, 03 Jan 2008 20:32:24 -0600 From: Eric Anderson User-Agent: Thunderbird 2.0.0.9 (X11/20071227) MIME-Version: 1.0 To: "Daan Vreeken [PA4DAN]" References: <200801032352.56491.Danovitsch@vitsch.net> <20080103233019.GE17445@rebooten.de> <200801040046.25465.Danovitsch@vitsch.net> In-Reply-To: <200801040046.25465.Danovitsch@vitsch.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on ns.trinitel.com Cc: Markus Boelter , FreeBSD-Hackers@freebsd.org Subject: Re: mksnap_ffs time 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, 04 Jan 2008 02:32:35 -0000 On 01/03/08 17:46, Daan Vreeken [PA4DAN] wrote: > On Friday 04 January 2008 00:30:20 you wrote: >> Hi! >> >>> 1) Is anyone else seeing this? >> As far as I know, this is somehow related to the SoftUpdates, but I am not >> 100% sure. Look at the mailinglist archives, there was a discussion a few >> months ago about the same topic as far as I remember. >> >> Please note that according to >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/snapshots.html >> a filesystem can only have 20 snapshots! :-) > > Hmm.. Then at least time spent per snapshot isn't going to get much worse than > it is today ;-) > Too bad this limitation isn't mentioned in 'man 8 mksnap_ffs'. If this > limitation is still there, I think it deserves a place in the manual. The limitation is still there, and probably should be mentioned in the manual - good point. The time is spent making copies of all the cylinder groups, which there are a *lot* of on a 700GB file system. When UFS snapshots were developed, 4-20GB file systems were pretty big. Over time, this problem is going to just get worse. :( The only way to help it, is to use some custom newfs options to reduce the number of cylinder groups, but it won't buy you much. Snapshots also impede on your general file system performance. In FreeBSD 7, you could use ZFS, which would give you the power and control you need (plus FreeBSD 7 has many many performance improvements). Eric From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 08:55:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFBD916A421 for ; Fri, 4 Jan 2008 08:55:26 +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 ACDB413C458 for ; Fri, 4 Jan 2008 08:55:26 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 6B46A20CC; Fri, 4 Jan 2008 09:55:18 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 562BC20CB; Fri, 4 Jan 2008 09:55:18 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 3BFD6844D2; Fri, 4 Jan 2008 09:55:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: =?utf-8?Q?Fernando_Apestegu=C3=ADa?= References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> Date: Fri, 04 Jan 2008 09:55:18 +0100 In-Reply-To: <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> ("Fernando =?utf-8?Q?Apestegu=C3=ADa=22's?= message of "Thu\, 3 Jan 2008 20\:57\:18 +0100") Message-ID: <86d4sic6mh.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 08:55:27 -0000 "Fernando Apestegu=C3=ADa" writes: > Dag-Erling Sm=C3=B8rgrav writes: > > "Fernando Apestegu=C3=ADa" writes: > > > I have an application written in C + Gtk + Glib that gathers > > > information from procfs under Linux. Now, I'm trying to port this > > > application to FreeBSD (I'm working with 7.0 RC1). > > man linprocfs > Yes, I checked it. But although the cpuinfo file is quite close to the > "original" one in Linux, there are other important files missed. Have you checked that the missing files aren't in linsysfs? If they aren't, submit a PR and maybe the lin{proc,sys}fs maintainers (or somebody else) will add them. This is really the least-effort solution for you (less code to modify), and it will also benefit native Linux binaries running under the linuxulator. While you're at it, please also submit a PR pointing out that the linprocfs(5) man page is lagging behind the code... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 10:11:33 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0624416A420; Fri, 4 Jan 2008 10:11:33 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from postfix2-g20.free.fr (postfix2-g20.free.fr [212.27.60.43]) by mx1.freebsd.org (Postfix) with ESMTP id B461813C46B; Fri, 4 Jan 2008 10:11:32 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from smtp8-g19.free.fr (smtp8-g19.free.fr [212.27.42.65]) by postfix2-g20.free.fr (Postfix) with ESMTP id F0CC121CCB68; Fri, 4 Jan 2008 08:41:54 +0100 (CET) Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 6CD2A17F55D; Fri, 4 Jan 2008 10:42:36 +0100 (CET) Received: from imp6-g19.free.fr (imp6-g19.free.fr [212.27.42.6]) by smtp8-g19.free.fr (Postfix) with ESMTP id 61A5B17F536; Fri, 4 Jan 2008 10:42:36 +0100 (CET) Received: by imp6-g19.free.fr (Postfix, from userid 33) id 29821423A; Fri, 4 Jan 2008 10:42:36 +0100 (CET) Received: from bel62-2-88-160-33-190.fbx.proxad.net (bel62-2-88-160-33-190.fbx.proxad.net [88.160.33.190]) by imp.free.fr (IMP) with HTTP for ; Fri, 04 Jan 2008 10:42:35 +0100 Message-ID: <1199439755.477dff8beec06@imp.free.fr> Date: Fri, 04 Jan 2008 10:42:35 +0100 From: gregoryd.freebsd@free.fr To: Ivan Voras References: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 88.160.33.190 Cc: freebsd-hackers@freebsd.org Subject: Re: Semaphores 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, 04 Jan 2008 10:11:33 -0000 Quoting Ivan Voras : > For general information on the FreeBSD kernel see the book "Design and > implementation of the FreeBSD operating system", Will this edition be updated, or is it still relevant with the coming of 7.0 ? It was written with 5.0 in mind, and considerable progress has been made since then, hasn't it ? From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 11:26:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE4AB16A41A for ; Fri, 4 Jan 2008 11:26:45 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by mx1.freebsd.org (Postfix) with ESMTP id AEFF913C457 for ; Fri, 4 Jan 2008 11:26:45 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so6533585rvb.43 for ; Fri, 04 Jan 2008 03:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=HVWZJt3sWM2vq++W0srKLc/JSpzlX6/ZOQNZkT5d/d4=; b=auR5eBKcAfuLlh8uNQUZcUuNuXtKui5+mU6JSjroSdXnreQyOFgu2aHkXAO5snVJuFO1uZRjse7yN88ozHl39BOm0FiWQO5g1iiQplZw4/CItjyZm7lQPxZeAK5yLcwulD3tSwYM6qX8vNGAfiKu8QXxR7tZUHbrwJLSd95ZDII= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=H3FHC2DtYAgS+UqdGHazhkCNrevUAe9cpGpONaERrC9bz7BhrMPJUuFhp6nPhUwmokL6DHVzQTjwQjKmzCY29dBBDEqqTxS+am0MIhTby4xr75hoSD7J0i73fWYwet3Qb3NCaedn0yiPn7ugDaXDbnT48vaMZ/PMylq3F3TqpbY= Received: by 10.141.33.21 with SMTP id l21mr8772082rvj.105.1199446005398; Fri, 04 Jan 2008 03:26:45 -0800 (PST) Received: by 10.141.212.1 with HTTP; Fri, 4 Jan 2008 03:26:45 -0800 (PST) Message-ID: <9bbcef730801040326g7142fee8i78ef938c500f9161@mail.gmail.com> Date: Fri, 4 Jan 2008 12:26:45 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "gregoryd.freebsd@free.fr" In-Reply-To: <1199439755.477dff8beec06@imp.free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <97ca98bc0801030349g695702afr569a5305238b1595@mail.gmail.com> <1199439755.477dff8beec06@imp.free.fr> X-Google-Sender-Auth: fcdcda83c3c7ef50 Cc: freebsd-hackers@freebsd.org Subject: Re: Semaphores 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, 04 Jan 2008 11:26:46 -0000 On 04/01/2008, gregoryd.freebsd@free.fr wrote: > Quoting Ivan Voras : > > > For general information on the FreeBSD kernel see the book "Design and > > implementation of the FreeBSD operating system", > > Will this edition be updated, or is it still relevant with the coming of 7.0 ? Don't know, ask the author. > It was written with 5.0 in mind, and considerable progress has been made since > then, hasn't it ? Some material is still valid. From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 13:15:31 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249C216A418; Fri, 4 Jan 2008 13:15:31 +0000 (UTC) (envelope-from marcov@stack.nl) Received: from mx1.stack.nl (meestal-mk5.stack.nl [IPv6:2001:610:1108:5010::149]) by mx1.freebsd.org (Postfix) with ESMTP id C12E413C4EB; Fri, 4 Jan 2008 13:15:30 +0000 (UTC) (envelope-from marcov@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id AB479439B3; Fri, 4 Jan 2008 14:15:29 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 816) id 974EF22891; Fri, 4 Jan 2008 14:15:29 +0100 (CET) Date: Fri, 4 Jan 2008 14:15:29 +0100 From: Marco van de Voort To: Ivan Voras Message-ID: <20080104131529.GA31354@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: Architectures with strict alignment? 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, 04 Jan 2008 13:15:31 -0000 On Sat, Dec 08, 2007 at 03:43:30AM +0100, Ivan Voras wrote: > Which of the architectures FreeBSD supports (if any) have strict memory > alignment requirements? (in the sense that accessing a 32-bit integer > not aligned on a 32-bit address results in a hardware trap/exception). I do know that older PPCs (PowerPC603) have a requirement on aligning of floats. IIRC the e.g. Linux the kernel hooks an exception handler that makes it transparent for apps (at the cost of some performance), and NetBSD does not I never ran FreeBSD on PPC, so I wouldn't know that one. From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 13:38:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5768416A46C for ; Fri, 4 Jan 2008 13:38:04 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from smtp8-g19.free.fr (smtp8-g19.free.fr [212.27.42.65]) by mx1.freebsd.org (Postfix) with ESMTP id 180E913C4E7 for ; Fri, 4 Jan 2008 13:38:04 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 0613C17F596; Fri, 4 Jan 2008 14:38:03 +0100 (CET) Received: from imp6-g19.free.fr (imp6-g19.free.fr [212.27.42.6]) by smtp8-g19.free.fr (Postfix) with ESMTP id A718517F571; Fri, 4 Jan 2008 14:38:02 +0100 (CET) Received: by imp6-g19.free.fr (Postfix, from userid 33) id 807DB4250; Fri, 4 Jan 2008 14:38:02 +0100 (CET) Received: from bel62-2-88-160-33-190.fbx.proxad.net (bel62-2-88-160-33-190.fbx.proxad.net [88.160.33.190]) by imp.free.fr (IMP) with HTTP for ; Fri, 04 Jan 2008 14:38:02 +0100 Message-ID: <1199453882.477e36ba4d4d7@imp.free.fr> Date: Fri, 04 Jan 2008 14:38:02 +0100 From: gregoryd.freebsd@free.fr To: Fernando =?iso-8859-1?b?QXBlc3RlZ3XtYQ==?= References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> In-Reply-To: <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 88.160.33.190 Cc: Dag-Erling =?iso-8859-1?b?U234cmdyYXY=?= , freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 13:38:04 -0000 Quoting Fernando Apesteguía : > Maybe a mix of both could be good: use the linxprocfs when it is > almost straightforward (in fact I could run the app, just changing few > lines) and sysctl when the linprocfs doesn't provide the information > that I need. Wouldn't the opposite be more legitimate: using sysctl and falling back on linuxprocfs when lacking functionality ? (Depending on whether it's a FreeBSD *port*, or if you want to keep it as general as you can) Also, have you considered procstat ? (as i read here: http://ivoras.sharanet.org/freebsd/freebsd8.html it is destined to replace procfs in a way, am I wrong ?) Depending on how short term your application must be available (and how long it will take to MFC procstat), it might do the thing. From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 13:41:32 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572DF16A41A for ; Fri, 4 Jan 2008 13:41:32 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from smtp8-g19.free.fr (smtp8-g19.free.fr [212.27.42.65]) by mx1.freebsd.org (Postfix) with ESMTP id 16AAB13C4F2 for ; Fri, 4 Jan 2008 13:41:31 +0000 (UTC) (envelope-from gregoryd.freebsd@free.fr) Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 0C52F17F582; Fri, 4 Jan 2008 14:41:31 +0100 (CET) Received: from imp6-g19.free.fr (imp6-g19.free.fr [212.27.42.6]) by smtp8-g19.free.fr (Postfix) with ESMTP id F220217F535; Fri, 4 Jan 2008 14:41:30 +0100 (CET) Received: by imp6-g19.free.fr (Postfix, from userid 33) id E712E4250; Fri, 4 Jan 2008 14:41:30 +0100 (CET) Received: from bel62-2-88-160-33-190.fbx.proxad.net (bel62-2-88-160-33-190.fbx.proxad.net [88.160.33.190]) by imp.free.fr (IMP) with HTTP for ; Fri, 04 Jan 2008 14:41:30 +0100 Message-ID: <1199454090.477e378abb4a5@imp.free.fr> Date: Fri, 04 Jan 2008 14:41:30 +0100 From: gregoryd.freebsd@free.fr To: Fernando =?iso-8859-1?b?QXBlc3RlZ3XtYQ==?= References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> In-Reply-To: <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 88.160.33.190 Cc: Dag-Erling =?iso-8859-1?b?U234cmdyYXY=?= , freebsd-hackers@freebsd.org Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 13:41:32 -0000 Quoting Fernando Apesteguía : > Maybe a mix of both could be good: use the linxprocfs when it is > almost straightforward (in fact I could run the app, just changing few > lines) and sysctl when the linprocfs doesn't provide the information > that I need. And I just made a fool of myself by mistaking procfs for linprocfs: ooops, awfully sorry :-( From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 20:57:23 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E6B116A4E5 for ; Fri, 4 Jan 2008 20:57:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C0D3413C46A for ; Fri, 4 Jan 2008 20:57:22 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id m04KroRf026858; Fri, 4 Jan 2008 13:53:53 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 04 Jan 2008 13:54:21 -0700 (MST) Message-Id: <20080104.135421.96120312.imp@bsdimp.com> To: metin@EnderUNIX.org From: "M. Warner Losh" In-Reply-To: <363446479.20080103213223@EnderUNIX.org> References: <1571995824.20080103205248@EnderUNIX.org> <20080103192245.GB90170@keira.kiwi-computer.com> <363446479.20080103213223@EnderUNIX.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, rick-freebsd@kiwi-computer.com Subject: Re: select 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, 04 Jan 2008 20:57:23 -0000 In message: <363446479.20080103213223@EnderUNIX.org> Metin KAYA writes: : Yes Rick, I'm asking this "indefinitely" issue. Is there anything : that handle this NULL situation a signal, or etc.? How does Linux or : FreeBSD behave? : : > On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: : >> : >> How select(2) will behave if I give the "utimeout" parameter as : >> NULL? : : > According to the man page: : : > If timeout is not a null pointer, it specifies the maximum interval to : > wait for the selection to complete. System activity can lengthen the : > interval by an indeterminate amount. : : > If timeout is a null pointer, the select blocks indefinitely. : : > To effect a poll, the timeout argument should not be a null pointer, but : > it should point to a zero-valued timeval structure. : Indefinitely means "it won't return until there's an error or data" Warner From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 4 21:39:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCF4416A41A for ; Fri, 4 Jan 2008 21:39:07 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id F1D7213C448 for ; Fri, 4 Jan 2008 21:39:06 +0000 (UTC) (envelope-from metin@EnderUNIX.org) Received: (qmail 44151 invoked by uid 1040); 4 Jan 2008 21:19:36 -0000 Received: from unknown (HELO ?192.168.2.3?) (metin@78.185.157.122) by 0 with ESMTPA; 4 Jan 2008 21:19:35 -0000 Date: Fri, 4 Jan 2008 23:18:48 +0200 From: Metin KAYA X-Mailer: The Bat! (v3.98.4) Professional Organization: EnderUNIX X-Priority: 3 (Normal) Message-ID: <1643154686.20080104231848@EnderUNIX.org> To: "M. Warner Losh" In-Reply-To: <20080104.135421.96120312.imp@bsdimp.com> References: <1571995824.20080103205248@EnderUNIX.org><20080103192245.GB90170@keira.kiwi-computer.com><363446479.20080103213223@EnderUNIX.org> <20080104.135421.96120312.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Cc: freebsd-hackers@freebsd.org, rick-freebsd@kiwi-computer.com Subject: Re[2]: select 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, 04 Jan 2008 21:39:07 -0000 > In message: <363446479.20080103213223@EnderUNIX.org> > Metin KAYA writes: > : Yes Rick, I'm asking this "indefinitely" issue. Is there anything > : that handle this NULL situation a signal, or etc.? How does Linux or > : FreeBSD behave? > : : >> On Thu, Jan 03, 2008 at 08:52:48PM +0200, Metin KAYA wrote: : >>> : >>> How select(2) will behave if I give the "utimeout" parameter as : >>> NULL? > : : >> According to the man page: > : : >> If timeout is not a null pointer, it specifies the maximum interval to : >> wait for the selection to complete. System activity can lengthen the : >> interval by an indeterminate amount. > : : >> If timeout is a null pointer, the select blocks indefinitely. > : : >> To effect a poll, the timeout argument should not be a null pointer, but : >> it should point to a zero-valued timeval structure. > : > Indefinitely means "it won't return until there's an error or data" > Warner Thanks a lot Warner. It's a good explanation. -- Metin KAYA EnderUNIX Software Developer Endersys Software Engineer http://www.EnderUNIX.org/metin http://www.Endersys.com/ From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 5 10:16:30 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E527916A476; Sat, 5 Jan 2008 10:16:30 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (muon.bluestop.org [IPv6:2001:41c8:1:548a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 99C9C13C447; Sat, 5 Jan 2008 10:16:30 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from tau.draftnet (unknown [IPv6:2a01:348:10f:0:240:f4ff:fe57:9871]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id 4E490300EA; Sat, 5 Jan 2008 10:16:28 +0000 (GMT) Message-ID: <477F5901.3000006@cran.org.uk> Date: Sat, 05 Jan 2008 10:16:33 +0000 From: Bruce Cran User-Agent: Thunderbird 2.0.0.9 (X11/20071201) MIME-Version: 1.0 To: Marco van de Voort References: <20080104131529.GA31354@stack.nl> In-Reply-To: <20080104131529.GA31354@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 05 Jan 2008 12:36:14 +0000 Cc: freebsd-hackers@freebsd.org, Ivan Voras Subject: Re: Re: Architectures with strict alignment? 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, 05 Jan 2008 10:16:31 -0000 Marco van de Voort wrote: > On Sat, Dec 08, 2007 at 03:43:30AM +0100, Ivan Voras wrote: > > >> Which of the architectures FreeBSD supports (if any) have strict memory >> alignment requirements? (in the sense that accessing a 32-bit integer >> not aligned on a 32-bit address results in a hardware trap/exception). >> > > I do know that older PPCs (PowerPC603) have a requirement on aligning of > floats. > > IIRC the e.g. Linux the kernel hooks an exception handler that makes it > transparent for apps (at the cost of some performance), and NetBSD does not > I never ran FreeBSD on PPC, so I wouldn't know that one. > The newer 32-bit PPCs (G4 / PPC7447A) can't handle unaligned 64-bit accesses either - they generate a trap which gets handled by fix_unaligned in /sys/powerpc/powerpc/trap.c on FreeBSD. -- Bruce From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 5 12:50:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE3E16A4CC for ; Sat, 5 Jan 2008 12:50:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1A91213C45A for ; Sat, 5 Jan 2008 12:50:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 12A6D46D50; Sat, 5 Jan 2008 07:50:44 -0500 (EST) Date: Sat, 5 Jan 2008 12:50:43 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: gregoryd.freebsd@free.fr In-Reply-To: <1199453882.477e36ba4d4d7@imp.free.fr> Message-ID: <20080105124940.U76186@fledge.watson.org> References: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> <86tzlud6y5.fsf@ds4.des.no> <1bd550a00801031157s521665e4p77b2250d3966ec1d@mail.gmail.com> <1199453882.477e36ba4d4d7@imp.free.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Dag-Erling =?iso-8859-1?b?U234cmdyYXY=?= , freebsd-hackers@freebsd.org, Fernando =?iso-8859-1?b?QXBlc3RlZ3XtYQ==?= Subject: Re: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2008 12:50:45 -0000 On Fri, 4 Jan 2008, gregoryd.freebsd@free.fr wrote: > Also, have you considered procstat ? (as i read here: > http://ivoras.sharanet.org/freebsd/freebsd8.html it is destined to replace > procfs in a way, am I wrong ?) > > Depending on how short term your application must be available (and how long > it will take to MFC procstat), it might do the thing. Not really related to the thread in a general sense, but: I do plan to MFC procstat, probably in February or March. I will definitely MFC it to 7.x, and I may also MFC it to 6.x. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 5 18:23:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EDF16A419 for ; Sat, 5 Jan 2008 18:23:26 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 1920C13C457 for ; Sat, 5 Jan 2008 18:23:25 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JBDfz-00047N-52 for freebsd-hackers@freebsd.org; Sat, 05 Jan 2008 18:23:19 +0000 Received: from 78-1-101-244.adsl.net.t-com.hr ([78.1.101.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Jan 2008 18:23:19 +0000 Received: from ivoras by 78-1-101-244.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Jan 2008 18:23:19 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Sat, 05 Jan 2008 19:23:09 +0100 Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6BB8936AA0F97039461437DD" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 78-1-101-244.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) X-Enigmail-Version: 0.95.6 Sender: news Subject: IRQ-CPU binding? 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, 05 Jan 2008 18:23:26 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6BB8936AA0F97039461437DD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi, Is there a notion of binding interrupt handlers to specific CPUs in=20 FreeBSD? Is there a way to find out that mapping from the userland, for=20 debugging purposes? --------------enig6BB8936AA0F97039461437DD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHf8sNldnAQVacBcgRAoU6AJ9j5gRDAAyoCejOW8kQLi6M2CxnkQCfSaRV tv8SGqmjJjcZKhupYU4+NRs= =hbLi -----END PGP SIGNATURE----- --------------enig6BB8936AA0F97039461437DD-- From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 5 20:16:30 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08A7916A41B for ; Sat, 5 Jan 2008 20:16:30 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mx1.freebsd.org (Postfix) with ESMTP id DC24B13C4E8 for ; Sat, 5 Jan 2008 20:16:29 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so11843293waf.3 for ; Sat, 05 Jan 2008 12:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=9qcmaJ8oBdrJNumOcniOO515iLHPfW1fJ3bP/ZBFj9k=; b=E7H7LPLWG6UJIwgPRv/AxSnQ1XitAelqz/qEorMjASdU8yjdmsNauMDrIeUhUB0nnT7HOnW6ZxzrRRN3m+ZaYE85n208yZiyy8zsPlxBWRgb50wSK4NN/ebeeAPhCXfhbbAF1rFdPMCitA2kmBlac0osO+4Ir8f6hZbV7N6RbYw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ArYKHGiwJR0aHa/8luYlbdk3eIQrM57cRPtsMl4NiNsKVrLrKrk8zapdSKOqB6kpmXGdxVIbORbBurZ4AH8diHIrEc3zM2RpcmWQbtiaatQKeQ3Fc0hobJiiytJiV4SzCCklPozMNbwuKsMPsaRbipLS+6vPKi8/MY16SP9HEeE= Received: by 10.114.201.1 with SMTP id y1mr4538239waf.121.1199564189468; Sat, 05 Jan 2008 12:16:29 -0800 (PST) Received: by 10.114.255.11 with HTTP; Sat, 5 Jan 2008 12:16:29 -0800 (PST) Message-ID: Date: Sat, 5 Jan 2008 12:16:29 -0800 From: "Kip Macy" To: "Ivan Voras" , freebsd-hackers@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: Subject: Re: IRQ-CPU binding? 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, 05 Jan 2008 20:16:30 -0000 It can easily be done, there is no API for it in CVS. -Kip On 1/5/08, Ivan Voras wrote: > Hi, > > Is there a notion of binding interrupt handlers to specific CPUs in > FreeBSD? Is there a way to find out that mapping from the userland, for > debugging purposes? > > > -- Sent from Gmail for mobile | mobile.google.com