From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 31 14:17:27 2010 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 67AF5106568B for ; Sun, 31 Jan 2010 14:17:27 +0000 (UTC) (envelope-from shashidhara.sm@gmail.com) Received: from mail-yx0-f191.google.com (mail-yx0-f191.google.com [209.85.210.191]) by mx1.freebsd.org (Postfix) with ESMTP id 260468FC0A for ; Sun, 31 Jan 2010 14:17:26 +0000 (UTC) Received: by yxe29 with SMTP id 29so2850034yxe.14 for ; Sun, 31 Jan 2010 06:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Hl4sOqERO/1z1+Pm6NW0fIMLyghu+sf7d8+jIvEPadQ=; b=VL+wuafqhDf73lCWDCttYiORJRihO7QfjysOiLqNwBWf+qIvTLRVX2UKHZ+pCSfw4V 2eS+ZGQ7hMXww9xClLi915B74t/Sbv2B0EI10QwJsLCosQLtM3qRV+309/LnM9AlDeuX K0TTE0EDaXVFnaGIATr72EnohyMHMEeNTLx/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=uy9+AkF/cI/8l/fwR4zUJQIClo4cv1AQP2DWRs38H3ivJiEcEy0gbSJu8Xjva2Yqln mLCXAbDR8ozV1kQPOKN5uOaIDWSFUbQFAD7rfQK/qon9ZJqoKNnrOKAzclbI5KWxJee5 xHQwOUaa4vfhOqtiSX9HbnL5qhM50GJo3jGg0= MIME-Version: 1.0 Received: by 10.101.145.27 with SMTP id x27mr3666443ann.77.1264945830656; Sun, 31 Jan 2010 05:50:30 -0800 (PST) Date: Sun, 31 Jan 2010 19:20:30 +0530 Message-ID: <7cce29b51001310550v55791a46m133cef72d4cc2345@mail.gmail.com> From: shashidhara none To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Contribution to FreeBSD network stack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 14:17:27 -0000 Hi All, I am interested to contribute to FreeBSD network stack. I found some projects at http://wiki.freebsd.org/Networking . But could not figure out how to start working on the same. Please help. Thanks, Shashi From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 31 17:46:45 2010 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 6211A1065676 for ; Sun, 31 Jan 2010 17:46:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB5C8FC2D for ; Sun, 31 Jan 2010 17:46:44 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7EE8546B03; Sun, 31 Jan 2010 12:46:44 -0500 (EST) Date: Sun, 31 Jan 2010 17:46:44 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: shashidhara none In-Reply-To: <7cce29b51001310550v55791a46m133cef72d4cc2345@mail.gmail.com> Message-ID: References: <7cce29b51001310550v55791a46m133cef72d4cc2345@mail.gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Contribution to FreeBSD network stack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 17:46:46 -0000 On Sun, 31 Jan 2010, shashidhara none wrote: > I am interested to contribute to FreeBSD network stack. I found some > projects at http://wiki.freebsd.org/Networking . But could not figure out > how to start working on the same. Please help. Hi Shashi-- The FreeBSD network stack is a very large piece of code, and there are lots of opportunities to get involved helping to measure and improve its behavior, add new features, etc. Could you say a bit more about your background -- have you done much kernel programming and/or network stack programming before? Robert From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 31 18:12:07 2010 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 0ED3A1065670 for ; Sun, 31 Jan 2010 18:12:07 +0000 (UTC) (envelope-from jgordeev@dir.bg) Received: from dir.bg (mail.dir.bg [194.145.63.28]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC1C8FC08 for ; Sun, 31 Jan 2010 18:12:05 +0000 (UTC) Received: from client-33-134.speedy-net.bg (account jgordeev@dir.bg [212.117.33.134] verified) by srv.dir.bg (CommuniGate Pro SMTP 5.2.19) with ESMTPSA id 125905559; Sun, 31 Jan 2010 19:42:03 +0200 Message-ID: <4B65C0E2.6040500@dir.bg> Date: Sun, 31 Jan 2010 19:41:54 +0200 From: Jordan Gordeev User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: shashidhara none References: <7cce29b51001310550v55791a46m133cef72d4cc2345@mail.gmail.com> In-Reply-To: <7cce29b51001310550v55791a46m133cef72d4cc2345@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Contribution to FreeBSD network stack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 18:12:07 -0000 On 1/31/10 3:50 PM, shashidhara none wrote: > Hi All, > > I am interested to contribute to FreeBSD network stack. I found some > projects at > http://wiki.freebsd.org/Networking . But could not figure out how to start > working on the same. Please help. Which project have you chosen? Do you have relevant education and/or previous experience? From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 31 20:59:40 2010 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 8C88B106566C for ; Sun, 31 Jan 2010 20:59:40 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id E64C28FC1D for ; Sun, 31 Jan 2010 20:59:39 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.49,378,1262559600"; d="scan'208";a="24741925" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 31 Jan 2010 21:59:38 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 09D8E1B0768; Sun, 31 Jan 2010 21:59:38 +0100 (CET) Date: Sun, 31 Jan 2010 21:59:37 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Warren Block , Jung-uk Kim Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: Spin down HDD after disk sync or before power off X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 20:59:40 -0000 imo this patch takes good care of the problem. would be nice to have it in HEAD. cheers. alex Warren Block schrieb am 2010-01-30: > On Fri, 29 Jan 2010, Jung-uk Kim wrote: > >On Friday 29 January 2010 05:38 pm, Warren Block wrote: > >I am not 100% sure but I think it should be something like the > >attached patch. > Yes, I had the two commands backwards. So let me try to summarize: > ad_shutdown uses ATA_FLUSHCACHE writes out any cached data, but does > not park the heads. At powerdown, the heads do an emergency park, > which is louder than a normal park and possibly damaging. > Adding ATA_STANDBY_IMMEDIATE after the ATA_FLUSHCACHE will park the > heads more quietly and possibly more safely. Should do no harm, at > least. > ad_spindown looks like it's meant to spin the disk down for sleep > operations, and does some higher-level things. > I suspect flushcache and standby should be as close together as > possible to avoid the chance of anything getting back into the cache > or spinning the disk back up. > Anyway, testing this use of ad_spindown inside ad_shutdown brought > back the GLINK on shutdown. > A fixed version of the earlier patch that does flushcache and then > standbyimmediate is attached. > -Warren Block * Rapid City, South Dakota USA From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 31 21:14:42 2010 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 2970B1065670; Sun, 31 Jan 2010 21:14:42 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay3.uni-muenster.de (ZIVM-EXRELAY3.UNI-MUENSTER.DE [128.176.192.20]) by mx1.freebsd.org (Postfix) with ESMTP id 842AB8FC1B; Sun, 31 Jan 2010 21:14:41 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.49,378,1262559600"; d="scan'208";a="24742582" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 31 Jan 2010 22:14:40 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 96F691B0768; Sun, 31 Jan 2010 22:14:40 +0100 (CET) Date: Sun, 31 Jan 2010 22:14:40 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Alexander Leidinger , Kostik Belousov Message-ID: In-Reply-To: <20100125104538.31651ntuzhoyg3no@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Doug Barton Subject: Re: [patch] extending/completing brandelf's OS knowledge X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 21:14:42 -0000 so it seems some people consider the patch a useful extension to brandelf and other would like brandelf to keep it's core functionality. also some people would like brandelf to move from base to ports. alex Alexander Leidinger schrieb am 2010-01-25: > Quoting Kostik Belousov (from Mon, 25 Jan 2010 > 11:16:25 +0200): > >On Mon, Jan 25, 2010 at 10:01:29AM +0100, Alexander Leidinger wrote: > >>If it was to brandelf a static linux executable so that the FreeBSD > >>system does not reboot when executing the static linux executable, > >>then I would say it does not need to be reported and we still need > >>brandelf in the base system. > >>If someone says that exactly this case has been fixed recently: it > >>would be great to hear on emulation@ about cases where brandelf is > >>still needed. > >If static linux binary contains .note.ABI-tag section, and I believe > >that relatively modern binaries do, then brand is autodetected. > Our linuxulator is not restricted to modern binaries. I remember > reports from people which run or try to run binaries (proprietary > stuff, all limitations of non-open-source software applies) from > linux 2.2 or even older. It's been a while since I've seen such a > report, but as it typically just works, I can not tell that we can > be sure that nobody wants to run binaries which do not fit your > definition of "relatively modern". > Bye, > Alexander. > -- > "No, don't protest. I'm telling you their thoughts, not mine." > -- Vito Corleone, "Chapter 2", page 74 > http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = > B0063FE7 > http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = > 72077137 From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 07:21:57 2010 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 3BAE41065670 for ; Mon, 1 Feb 2010 07:21:57 +0000 (UTC) (envelope-from tyler@monkeypox.org) Received: from starfish.geekisp.com (mail.geekisp.com [216.168.135.169]) by mx1.freebsd.org (Postfix) with ESMTP id DB4D58FC1A for ; Mon, 1 Feb 2010 07:21:56 +0000 (UTC) Received: (qmail 1969 invoked by uid 1003); 1 Feb 2010 07:21:55 -0000 Received: from localhost (HELO kiwi.sharlinx.com) (tyler@monkeypox.org@127.0.0.1) by mail.geekisp.com with SMTP; 1 Feb 2010 07:21:55 -0000 Date: Sun, 31 Jan 2010 23:21:51 -0800 From: "R. Tyler Ballance" To: Giorgos Keramidas Message-ID: <20100201072150.GD30608@kiwi.sharlinx.com> Mail-Followup-To: Giorgos Keramidas , freebsd-hackers@freebsd.org References: <20100117213049.GA2259@kiwi.sharlinx.com> <877hr9ltym.fsf@kobe.laptop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VMt1DrMGOVs3KQwf" Content-Disposition: inline In-Reply-To: <877hr9ltym.fsf@kobe.laptop> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: Weekend PR smashing 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, 01 Feb 2010 07:21:57 -0000 --VMt1DrMGOVs3KQwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, 22 Jan 2010, Giorgos Keramidas wrote: > On Sun, 17 Jan 2010 13:30:50 -0800, "R. Tyler Ballance" wrote: > > Are there similar resources I've not stumbled across yet? I would like = to help, > > I have but one machine running -CURRENT and sporadic free time over the > > weekends. >=20 > Hi there. I just noticed this post in among others in -hackers. If you > don't know about the bugbuster team already, you should check it out. > There's a mailing list at freebsd-bugbusters and an IRC channel at the > EFnet network. Righteo, I stumbled across that shortly after my email to the list, I've be= en lurking in there since (rtyler). >=20 > Since you are looking for pointers to get you started, the following may > help a bit: >=20 > http://www.freebsd.org/doc/en_US.ISO8859-1/articles/contributing/ > http://www.freebsd.org/doc/en_US.ISO8859-1/articles/pr-guidelines/ > http://www.freebsd.org/doc/en_US.ISO8859-1/articles/problem-reports/ >=20 > Finally, it's worth noting that it is not a huge problem if you only have > weekend-time to contribute. We welcome all the help we can get, so please > feel free to jump in and help in any way you can with the existing bugs (= or > new ones that you have noticed). I certainly get that impression, one of the things that concerns me is the sheer number of PRs with patches that either have been committed without the PRs being updated, or the patches are simply sitting idly in PRs. The list = by the bugbusters waiting for committers to check them out is pretty huge as w= ell: http://people.freebsd.org/~linimon/studies/prs/recommended_prs.html http://people.freebsd.org/~linimon/studies/prs/prs_for_tag_patch.html It's a little difficult to muster up too much motivation to fix issues when the fixes will then sit waiting for committer review for months on end. Wit= hout annoying committers, is there any way I can help get patches "through" and into the tree in less than a lunar cycle? ;) Cheers, -R. Tyler Ballance -------------------------------------- Jabber: rtyler@jabber.org GitHub: http://github.com/rtyler Twitter: http://twitter.com/agentdero Blog: http://unethicalblogger.com --VMt1DrMGOVs3KQwf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAktmgQ4ACgkQFCbH3D9R4W+A6ACbBckvCoY9r0IyIy8yA38czdxU lY4An2KsdkPrBn7mp9t4ANZA0gcj74sb =y46j -----END PGP SIGNATURE----- --VMt1DrMGOVs3KQwf-- From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 09:23:58 2010 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 DBD04106566B; Mon, 1 Feb 2010 09:23:58 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8D08FC1A; Mon, 1 Feb 2010 09:23:56 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 4DF5C45E97; Mon, 1 Feb 2010 10:23:51 +0100 (CET) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3A69B45CD9; Mon, 1 Feb 2010 10:23:37 +0100 (CET) Date: Mon, 1 Feb 2010 10:23:34 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20100201092334.GB1743@garage.freebsd.pl> References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <20100130114451.GB1660@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , kib@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. 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, 01 Feb 2010 09:23:59 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > Maybe I'll add how I understand what's going on: >=20 > GEOM calls destroy_dev() while holding the topology lock. >=20 > Destroy_dev() wants to destroy device, but can't because there are > threads that still have it open. >=20 > The threads can't close it, because to close it they need the topology > lock. >=20 > The deadlock is quite obvious, IMHO. Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes the problem for me (at least it makes race window so small that I can't reproduce it). Is there anyone who isn't happy with such a change? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLZp2WForvXbEpPzQRAn35AJ90hK1k5qJWXM68Y6u2ZFu7WP3E+gCgmqPv 6sEImmRWQ3kLgUElGxoKA04= =o3JH -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG-- From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 09:37:26 2010 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 9EF67106568B; Mon, 1 Feb 2010 09:37:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0CA8FC14; Mon, 1 Feb 2010 09:37:24 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=997wlf2A6M0A:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=u5rT9GMeTmaUgEkNOPQA:9 a=24a_TDEfwaxw72SPfbkA:7 a=f3IbZGw5FHbRJNiLlJho4bEFI7kA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 628255019; Mon, 01 Feb 2010 10:37:23 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Mon, 1 Feb 2010 10:35:57 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <4B636812.8060403@FreeBSD.org> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> In-Reply-To: <20100201092334.GB1743@garage.freebsd.pl> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002011035.57862.hselasky@c2i.net> Cc: kib@freebsd.org, Alexander Motin , FreeBSD-Current , Pawel Jakub Dawidek , freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. 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, 01 Feb 2010 09:37:26 -0000 On Monday 01 February 2010 10:23:34 Pawel Jakub Dawidek wrote: > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > > Maybe I'll add how I understand what's going on: > > > > GEOM calls destroy_dev() while holding the topology lock. > > > > Destroy_dev() wants to destroy device, but can't because there are > > threads that still have it open. > > > > The threads can't close it, because to close it they need the topology > > lock. > > > > The deadlock is quite obvious, IMHO. > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > the problem for me (at least it makes race window so small that I can't > reproduce it). Is there anyone who isn't happy with such a change? > Are you sure there are no races or leftover resources that can be accessed by the callbacks of the device being destroyed? --HPS From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 10:11:23 2010 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 8AB7F106568F; Mon, 1 Feb 2010 10:11:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 105978FC26; Mon, 1 Feb 2010 10:11:20 +0000 (UTC) Received: by fxm27 with SMTP id 27so6636fxm.3 for ; Mon, 01 Feb 2010 02:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=4C+2dtjr7H34TXYZfwwNTmVG0F2U2MYsuZpisFty3SM=; b=dl+Bqdy8svR7JQS+qjOjJsWyFEijYaG8Ciwvt0LC8BruY2S52ofNQe3gQm2058Cir0 SiZ8Emii+MJiBEktQyPHlViGZHS76oBI57X5GX7vsrh9DDAbBuCDeDusN7HcqgMOoN+V dCOA8xZLMP5Dsg5atplQ1LYGNgxfJHI09Otx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=gCmtiqrEIlMBDg1i/PP5Z/EThk7GTRI1ZQms33WQSrRhpoAQqZMh4gDRra9gLkOs7E NplRVh+dIbRU9jlF+talHEFnd3thurh14Fn6//5/Btqi4x9kgt/Pu21qmCSgU4ev9nza gm5ypXwZAhg5H8xCLOOgii9IYZl46eZ6hJVN8= Received: by 10.102.182.6 with SMTP id e6mr2415630muf.63.1265018476992; Mon, 01 Feb 2010 02:01:16 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id s10sm14582853muh.29.2010.02.01.02.01.15 (version=SSLv3 cipher=RC4-MD5); Mon, 01 Feb 2010 02:01:15 -0800 (PST) Sender: Alexander Motin Message-ID: <4B66A669.2070406@FreeBSD.org> Date: Mon, 01 Feb 2010 12:01:13 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> In-Reply-To: <20100201092334.GB1743@garage.freebsd.pl> X-Enigmail-Version: 0.96.0 Content-Type: multipart/mixed; boundary="------------020500080902030103010007" Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , kib@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. 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, 01 Feb 2010 10:11:23 -0000 This is a multi-part message in MIME format. --------------020500080902030103010007 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Pawel Jakub Dawidek wrote: > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: >> Maybe I'll add how I understand what's going on: >> >> GEOM calls destroy_dev() while holding the topology lock. >> >> Destroy_dev() wants to destroy device, but can't because there are >> threads that still have it open. >> >> The threads can't close it, because to close it they need the topology >> lock. >> >> The deadlock is quite obvious, IMHO. > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > the problem for me (at least it makes race window so small that I can't > reproduce it). Is there anyone who isn't happy with such a change? Have you done some locking there? Because my system crashes with such straightforward change, when g_dev_close() called after geom node being destroyed. Attached patch fixes that for me, but I have doubts that it is complete. There is still seems to be a race with new I/O requests and ioctl's, that are not protected by topology lock. At least if devfs code doesn't handle it somehow. -- Alexander Motin --------------020500080902030103010007 Content-Type: text/plain; name="geom_dev.destroy.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="geom_dev.destroy.patch" --- geom_dev.c.prev 2010-01-30 05:22:36.000000000 +0200 +++ geom_dev.c 2010-02-01 11:55:53.000000000 +0200 @@ -184,10 +184,13 @@ g_dev_close(struct cdev *dev, int flags, struct g_consumer *cp; int error, r, w, e, i; + g_topology_lock(); gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL) + if (gp == NULL || cp == NULL) { + g_topology_unlock(); return(ENXIO); + } g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)", gp->name, flags, fmt, td); r = flags & FREAD ? -1 : 0; @@ -197,7 +200,6 @@ g_dev_close(struct cdev *dev, int flags, #else e = 0; #endif - g_topology_lock(); if (dev->si_devsw == NULL) error = ENXIO; /* We were orphaned */ else @@ -435,7 +437,10 @@ g_dev_orphan(struct g_consumer *cp) set_dumper(NULL); /* Destroy the struct cdev *so we get no more requests */ - destroy_dev(dev); + gp->softc = NULL; + dev->si_drv1 = NULL; + dev->si_drv2 = NULL; + destroy_dev_sched(dev); /* Wait for the cows to come home */ while (cp->nstart != cp->nend) --------------020500080902030103010007-- From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 11:08:55 2010 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 30DBF10656E4; Mon, 1 Feb 2010 11:08:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6720F8FC20; Mon, 1 Feb 2010 11:08:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o11B8Z5S048484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Feb 2010 13:08:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id o11AhSRO031239; Mon, 1 Feb 2010 12:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o11AhSXE031205; Mon, 1 Feb 2010 12:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 1 Feb 2010 12:43:28 +0200 From: Kostik Belousov To: Alexander Motin Message-ID: <20100201104328.GD15587@deviant.kiev.zoral.com.ua> References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> <4B66A669.2070406@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xB0nW4MQa6jZONgY" Content-Disposition: inline In-Reply-To: <4B66A669.2070406@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , Pawel Jakub Dawidek , freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. 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, 01 Feb 2010 11:08:55 -0000 --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 01, 2010 at 12:01:13PM +0200, Alexander Motin wrote: > Pawel Jakub Dawidek wrote: > > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > >> Maybe I'll add how I understand what's going on: > >> > >> GEOM calls destroy_dev() while holding the topology lock. > >> > >> Destroy_dev() wants to destroy device, but can't because there are > >> threads that still have it open. > >> > >> The threads can't close it, because to close it they need the topology > >> lock. > >> > >> The deadlock is quite obvious, IMHO. > >=20 > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > > the problem for me (at least it makes race window so small that I can't > > reproduce it). Is there anyone who isn't happy with such a change? >=20 > Have you done some locking there? Because my system crashes with such > straightforward change, when g_dev_close() called after geom node being > destroyed. Attached patch fixes that for me, but I have doubts that it > is complete. There is still seems to be a race with new I/O requests and > ioctl's, that are not protected by topology lock. At least if devfs code > doesn't handle it somehow. Devfs prevents new threads from entering cdevsw methods after destroy_dev_sched() is called. It is driver responsibility to take care about other code pathes that may access cdev. --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktmsFAACgkQC3+MBN1Mb4hNzQCg2m16aRPIrgVnePtnZj0tCrYU AqYAoJZ0iO6X7ivDvPxIgD5rdeEuLje/ =7DeA -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY-- From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 11:24:47 2010 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 1D4661065694 for ; Mon, 1 Feb 2010 11:24:47 +0000 (UTC) (envelope-from lvj@nietykalni.org) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id B1AD18FC1C for ; Mon, 1 Feb 2010 11:24:46 +0000 (UTC) Received: by bwz5 with SMTP id 5so1235215bwz.3 for ; Mon, 01 Feb 2010 03:24:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.8.73 with SMTP id g9mr3183549bkg.146.1265022127953; Mon, 01 Feb 2010 03:02:07 -0800 (PST) Date: Mon, 1 Feb 2010 12:02:07 +0100 Message-ID: <3930e0781002010302r3758968cl5f010bd7a585cca4@mail.gmail.com> From: Lukasz Jaroszewski To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: PFIL: how to get tcp/ip fields from mbuf 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, 01 Feb 2010 11:24:47 -0000 Hello, I am wondering about most elegant and proper way to get IP header fields from mbuf, using PFILs. I have read=A0Murat Balaban paper on PFIL_HOOKS where I found some example function. Question is how can I access IP header field in such manner. static int hisar_chkinput(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp) { in_bytes +=3D (*m)->m_len; return 0; } Regards LVJ. From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 13:26:10 2010 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 9980410656E9 for ; Mon, 1 Feb 2010 13:26:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 742A28FC1E for ; Mon, 1 Feb 2010 13:26:10 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 18EF146B17; Mon, 1 Feb 2010 08:26:10 -0500 (EST) Date: Mon, 1 Feb 2010 13:26:09 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Lukasz Jaroszewski In-Reply-To: <3930e0781002010302r3758968cl5f010bd7a585cca4@mail.gmail.com> Message-ID: References: <3930e0781002010302r3758968cl5f010bd7a585cca4@mail.gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-2020675623-1265030770=:23174" Cc: freebsd-hackers@freebsd.org Subject: Re: PFIL: how to get tcp/ip fields from mbuf 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, 01 Feb 2010 13:26:10 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-2020675623-1265030770=:23174 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 1 Feb 2010, Lukasz Jaroszewski wrote: > I am wondering about most elegant and proper way to get IP header fields > from mbuf, using PFILs. I have read Murat Balaban paper on PFIL_HOOKS where > I found some example function. Question is how can I access IP header field > in such manner. The best reference here is probably firewall source code that already exists in the tree. For IP-layer hooks, you'll need to use the m_pullup() call to ensure the bytes you want are contiguously stored, and then mtod() to cast the mbuf pointer appropriately. Although I notice ipfw, at least, doesn't call m_pullup() for the base header, as it assumes the calling context will already have arranged for it to be contiguous: static int ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) { ... if (mtod(*m0, struct ip *)->ip_v == 4) ret = ip_dn_io_ptr(m0, dir, &args); ... Robert > > static int > hisar_chkinput(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, > struct inpcb *inp) > { > in_bytes += (*m)->m_len; > return 0; > } > Regards > LVJ. > _______________________________________________ > 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" > --621616949-2020675623-1265030770=:23174-- From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 16:05:36 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 335601065694 for ; Mon, 1 Feb 2010 16:05:36 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id BB0D48FC1A for ; Mon, 1 Feb 2010 16:05:35 +0000 (UTC) Received: by bwz5 with SMTP id 5so1477670bwz.3 for ; Mon, 01 Feb 2010 08:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=T4HVYHHY/EJGUgidrf68nIxcjHD7qcQjIAqvgNVpFGc=; b=bIHMpe7pPOBiyeph18LWHQHQnmK82Qvfiai7EIgVMOizyEpkgXjqSp0BYFxZg8PE9G 5Mwxy680/rmw5NDk2Gk3LBMBl49DEt/I15bjR8Y7RFSh3h4zZbv9FIeBWckBaQH5t+Pa sRYSbh6snnk+t0pE/4vPsNmOuPH5SgOw+r8CA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=DQo2OKFl41CvNLnudSu8KgVbp6rVotwR/JCNUUXi83QGSSc2x/eDkfdITWW/F1rc2m xMzi0dD9a35h5dkvbluHcebBuoZuFJDTyr5BnhshiivIGDyHJJRHk1mIeE/uthx9zhdb ohdHn3EVRl5dEnsv3MReBeJGxONBNHUkG5tRQ= MIME-Version: 1.0 Received: by 10.239.192.79 with SMTP id d15mr635774hbi.52.1265039034316; Mon, 01 Feb 2010 07:43:54 -0800 (PST) From: Eitan Adler Date: Mon, 1 Feb 2010 17:43:32 +0200 Message-ID: To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: [patch] pkill verbose option 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, 01 Feb 2010 16:05:36 -0000 Here is a patch that adds a -V option which prints out what PIDs it is taking action on. Index: pkill.c =================================================================== --- pkill.c (revision 203347) +++ pkill.c (working copy) @@ -105,6 +105,7 @@ static int oldest; static int interactive; static int inverse; +static int flagPrint = 0; static int longfmt; static int matchargs; static int fullmatch; @@ -182,7 +183,7 @@ pidfilelock = 0; execf = coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:Vad:fg:ij:lnos:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -272,6 +273,9 @@ case 'v': inverse = 1; break; + case 'V': + flagPrint = 1; + break; case 'x': fullmatch = 1; break; @@ -532,6 +536,10 @@ if (PSKIP(kp)) continue; if (selected[i]) { + if (flagPrint) + { + printf("%d\n",kp->ki_pid); + } if (inverse) continue; } else if (!inverse) From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 03:48:03 2010 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 1EC51106568D for ; Tue, 2 Feb 2010 03:48:03 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id D6DB58FC16 for ; Tue, 2 Feb 2010 03:48:02 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id E69947E820; Tue, 2 Feb 2010 14:48:00 +1100 (EST) Message-ID: <4B67A06D.10405@freebsd.org> Date: Tue, 02 Feb 2010 14:47:57 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100105 Thunderbird/3.0 MIME-Version: 1.0 To: Lukasz Jaroszewski References: <3930e0781002010302r3758968cl5f010bd7a585cca4@mail.gmail.com> In-Reply-To: <3930e0781002010302r3758968cl5f010bd7a585cca4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: PFIL: how to get tcp/ip fields from mbuf 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, 02 Feb 2010 03:48:03 -0000 On 02/01/10 22:02, Lukasz Jaroszewski wrote: > Hello, > I am wondering about most elegant and proper way to get IP header > fields from mbuf, using PFILs. I have read Murat Balaban paper on > PFIL_HOOKS where I found some example function. Question is how can I > access IP header field in such manner. > > static int > hisar_chkinput(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, > struct inpcb *inp) > { > in_bytes += (*m)->m_len; > return 0; > } I hacked on a tool that uses pfil hooks to do in-kernel TCP data gathering. Probably has some useful snippets for you to look at in addition to Robert's suggestion. http://svn.freebsd.org/base/projects/tcp_ffcaia2008_head/sys/netinet/siftr.c Cheers, Lawrence From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 16:22:08 2010 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 5DFBE106566C for ; Tue, 2 Feb 2010 16:22:08 +0000 (UTC) (envelope-from kuku@kukulies.org) Received: from werkwelt.de (post.werkwelt.de [91.194.85.74]) by mx1.freebsd.org (Postfix) with ESMTP id EE4FB8FC17 for ; Tue, 2 Feb 2010 16:22:07 +0000 (UTC) Received: from [87.79.34.228] (account kuku@kukulies.org HELO [172.27.4.215]) by werkwelt.de (CommuniGate Pro SMTP 5.0.13) with ESMTPSA id 6761560 for freebsd-hackers@freebsd.org; Tue, 02 Feb 2010 16:21:30 +0100 Message-ID: <4B6842E8.2030800@kukulies.org> Date: Tue, 02 Feb 2010 16:21:12 +0100 From: Christoph Kukulies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: our little daemon abused as symbol of the evil 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, 02 Feb 2010 16:22:08 -0000 Look here: http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html -- Christoph From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 17:27:41 2010 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 B3398106568B for ; Tue, 2 Feb 2010 17:27:41 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f198.google.com (mail-qy0-f198.google.com [209.85.221.198]) by mx1.freebsd.org (Postfix) with ESMTP id 656E88FC17 for ; Tue, 2 Feb 2010 17:27:41 +0000 (UTC) Received: by qyk36 with SMTP id 36so346033qyk.15 for ; Tue, 02 Feb 2010 09:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=c5uvKkJTkwNJ/CzyVs0qycdtlWZ9dAZVuKPN1930nF0=; b=KU/f0oerk3Ne4DMZI3p4NWfU/921ht5/v/e6u/hn2xihJlgBCs6lERsSUmY113AY8X wOBCQkg8525RfPiyfNWom+/A2Pj4R2MX0baz2uRXtyAD62r9r5UvLkBZANAki4vohmzo EaDNddvKy5kFqwI63lwk0Mr6fiv11/brTNfo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=uOhCKjJWUbCK95eqLda3dsiV0qsotQa/7WkxqUgX8Sgjwx9hZinvCiZy8S6B2llQfh ujHIQ6ce1yMpXV3A7/34S6RsQRwcRuHD8DpA0xR+LvJiv6jpLbkLLt5A+cqfjIBW4gEe IfsCy7MChrBYqg9CgddoHQwMVaxlmfPj2BVac= Received: by 10.102.211.39 with SMTP id j39mr1047988mug.106.1265131659873; Tue, 02 Feb 2010 09:27:39 -0800 (PST) Received: from centel.dataix.local (ppp-21.224.dialinfree.com [209.172.21.224]) by mx.google.com with ESMTPS id j2sm1750016mue.2.2010.02.02.09.27.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Feb 2010 09:27:36 -0800 (PST) Sender: "J. Hellenthal" Date: Tue, 2 Feb 2010 12:27:22 -0500 From: jhell To: Christoph Kukulies In-Reply-To: <4B6842E8.2030800@kukulies.org> Message-ID: References: <4B6842E8.2030800@kukulies.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: our little daemon abused as symbol of the evil 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, 02 Feb 2010 17:27:41 -0000 On Tue, 2 Feb 2010 10:21, kuku@ wrote: > Look here: > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html > > -- > Christoph > OH! no! someone quick get a Microsoft Solicitation! "I mean solution" -- jhell From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 18:30:59 2010 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 5BBA6106568B for ; Tue, 2 Feb 2010 18:30:59 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id C20A38FC14 for ; Tue, 2 Feb 2010 18:30:58 +0000 (UTC) Received: from park.js.berklix.net (p549A55C9.dip.t-dialin.net [84.154.85.201]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id o12IUqe5052020; Tue, 2 Feb 2010 18:30:55 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id o12IUiER059886; Tue, 2 Feb 2010 19:30:45 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id o12IUTLl059175; Tue, 2 Feb 2010 19:30:34 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201002021830.o12IUTLl059175@fire.js.berklix.net> To: Christoph Kukulies From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Tue, 02 Feb 2010 16:21:12 +0100." <4B6842E8.2030800@kukulies.org> Date: Tue, 02 Feb 2010 19:30:29 +0100 Sender: jhs@berklix.com Cc: Kirk McKusick , freebsd-hackers@freebsd.org Subject: Re: our little daemon abused as symbol of the evil 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, 02 Feb 2010 18:30:59 -0000 Christoph Kukulies wrote: > Look here: > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html ( Well spotted Christoph ! ) For those that don't read German, tracing back, Text article starts here http://www.spiegel.de/netzwelt/web/0,1518,675395,00.html That is in German, (some might like a translator web, eg http://babelfish.org ) I did read the german article (but skipped graphics). Key paragraph: Es ist ein Horrorszenario für Datenschützer, was Thorsten Holz, Gilbert Wondracek, Engin Kirda und Christopher Kruegel in ihrem 15-seitigen Aufsatz beschreiben ( PDF-Datei hier, 803 KB): Die Experten vom Isec-Forschungslabor für IT-Sicherheit, einer Kooperation der Technischen Universität Wien, dem Institute Eurcom und der University of California, dokumentieren einen technisch eher simplen Angriff, der eine seit zehn Jahren bekannte Sicherheitslücke ausnutzt. In key para there I could click & download sonda-TR.pdf (though now I can't seem to redownload http://www.iseclab.org/papers/sonda-TR.pdf ) A 15 page article in Engish. Page 4 uses the Firefox & BSD logos. I havent read that English [yet], but with it, any interested here can now read & form own opinions if it seems fair to use the Daemon logo, especially cc'd copyright holder of BSD daemon holder: Kirk McKusick IMO The German article by weekly magazine Spiegel.de didnt really seem to have anything to do with BSD, they just copied the graphics. Personaly my 2c: Initial reaction was I'd be a happier if a generic PC graphic had been used in the spiegel.de web, but maybe its the price of fame, I guess tests were done using BSD, & Spiegel thought it was nice colourful graphic. (Politicians never looked good on British TV Spitting Image programme, but they learnt it was better to look bad there, & be talked about, than not seen, not recognised & ignored). Cheers, Julian -- Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text not quoted-printable, HTML or Base64 http://www.asciiribbon.org From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 21:43:00 2010 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 A83EF10656A5 for ; Tue, 2 Feb 2010 21:43:00 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id 35D708FC25 for ; Tue, 2 Feb 2010 21:43:00 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id o12L9TsJ039446; Tue, 2 Feb 2010 13:09:30 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201002022109.o12L9TsJ039446@chez.mckusick.com> To: "Julian H. Stacey" Date: Tue, 02 Feb 2010 13:09:29 -0800 From: Kirk McKusick X-Mailman-Approved-At: Tue, 02 Feb 2010 21:46:11 +0000 Cc: freebsd-hackers@freebsd.org, Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 02 Feb 2010 21:43:00 -0000 Thanks for the pointer. As you note, the damage (or benefit :-) is done. Still I have sent an email to the editor at Spiegel notifying them of my copyright in the hopes that they will at least ask in the future. Kirk McKusick =-=-=-= From: "Julian H. Stacey" Date: Tue, 02 Feb 2010 19:30:29 +0100 To: Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil Cc: freebsd-hackers@freebsd.org, Kirk McKusick Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany Christoph Kukulies wrote: > Look here: > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html ( Well spotted Christoph ! ) For those that don't read German, tracing back, Text article starts here http://www.spiegel.de/netzwelt/web/0,1518,675395,00.html That is in German, (some might like a translator web, eg http://babelfish.org ) I did read the german article (but skipped graphics). Key paragraph: Es ist ein Horrorszenario für Datenschützer, was Thorsten Holz, Gilbert Wondracek, Engin Kirda und Christopher Kruegel in ihrem 15-seitigen Aufsatz beschreiben ( PDF-Datei hier, 803 KB): Die Experten vom Isec-Forschungslabor für IT-Sicherheit, einer Kooperation der Technischen Universität Wien, dem Institute Eurcom und der University of California, dokumentieren einen technisch eher simplen Angriff, der eine seit zehn Jahren bekannte Sicherheitslücke ausnutzt. In key para there I could click & download sonda-TR.pdf (though now I can't seem to redownload http://www.iseclab.org/papers/sonda-TR.pdf ) A 15 page article in Engish. Page 4 uses the Firefox & BSD logos. I havent read that English [yet], but with it, any interested here can now read & form own opinions if it seems fair to use the Daemon logo, especially cc'd copyright holder of BSD daemon holder: Kirk McKusick IMO The German article by weekly magazine Spiegel.de didnt really seem to have anything to do with BSD, they just copied the graphics. Personaly my 2c: Initial reaction was I'd be a happier if a generic PC graphic had been used in the spiegel.de web, but maybe its the price of fame, I guess tests were done using BSD, & Spiegel thought it was nice colourful graphic. (Politicians never looked good on British TV Spitting Image programme, but they learnt it was better to look bad there, & be talked about, than not seen, not recognised & ignored). Cheers, Julian -- Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text not quoted-printable, HTML or Base64 http://www.asciiribbon.org From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 2 22:36:49 2010 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 A3178106566C for ; Tue, 2 Feb 2010 22:36:49 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 451E48FC15 for ; Tue, 2 Feb 2010 22:36:49 +0000 (UTC) Received: from park.js.berklix.net (p549A5955.dip.t-dialin.net [84.154.89.85]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id o12MakiN054787; Tue, 2 Feb 2010 22:36:47 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id o12Mab26061463; Tue, 2 Feb 2010 23:36:37 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id o12MaLOY062533; Tue, 2 Feb 2010 23:36:27 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201002022236.o12MaLOY062533@fire.js.berklix.net> To: Kirk McKusick From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Tue, 02 Feb 2010 13:09:29 PST." <201002022109.o12L9TsJ039446@chez.mckusick.com> Date: Tue, 02 Feb 2010 23:36:21 +0100 Sender: jhs@berklix.com Cc: freebsd-hackers@freebsd.org, Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 02 Feb 2010 22:36:49 -0000 Kirk McKusick wrote: > Thanks for the pointer. As you note, the damage (or benefit :-) is > done. Still I have sent an email to the editor at Spiegel notifying > them of my copyright in the hopes that they will at least ask in the > future. > > Kirk McKusick Good idea. You might want to contact authors of that PDF paper too. In case, as my browser still is fails on URL I posted earlier: http://www.iseclab.org/papers/sonda-TR.pdf I'll send you an off list copy of what I downloaded earlier at 2nd Feb 18:14 TZ=GMT+01:00. > =-=-=-= > > From: "Julian H. Stacey" > Date: Tue, 02 Feb 2010 19:30:29 +0100 > To: Christoph Kukulies > Subject: Re: our little daemon abused as symbol of the evil > Cc: freebsd-hackers@freebsd.org, Kirk McKusick > Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany > > Christoph Kukulies wrote: > > Look here: > > > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html > > ( Well spotted Christoph ! ) > For those that don't read German, tracing back, > Text article starts here > http://www.spiegel.de/netzwelt/web/0,1518,675395,00.html > > That is in German, > (some might like a translator web, eg http://babelfish.org ) > I did read the german article (but skipped graphics). > > Key paragraph: > Es ist ein Horrorszenario für Datenschützer, was Thorsten > Holz, Gilbert Wondracek, Engin Kirda und Christopher Kruegel > in ihrem 15-seitigen Aufsatz beschreiben ( PDF-Datei hier, > 803 KB): Die Experten vom Isec-Forschungslabor für > IT-Sicherheit, einer Kooperation der Technischen Universität > Wien, dem Institute Eurcom und der University of California, > dokumentieren einen technisch eher simplen Angriff, der > eine seit zehn Jahren bekannte Sicherheitslücke ausnutzt. > > In key para there I could click & download > sonda-TR.pdf > (though now I can't seem to redownload > http://www.iseclab.org/papers/sonda-TR.pdf ) > A 15 page article in Engish. > Page 4 uses the Firefox & BSD logos. > > I havent read that English [yet], but with it, any interested here > can now read & form own opinions if it seems fair to use the Daemon > logo, especially cc'd copyright holder of BSD daemon holder: > Kirk McKusick > > IMO The German article by weekly magazine Spiegel.de didnt really seem > to have anything to do with BSD, they just copied the graphics. > > Personaly my 2c: > Initial reaction was I'd be a happier if a generic PC graphic had > been used in the spiegel.de web, but maybe its the price of fame, > I guess tests were done using BSD, & Spiegel thought it was nice > colourful graphic. (Politicians never looked good on British TV > Spitting Image programme, but they learnt it was better to look > bad there, & be talked about, than not seen, not recognised & > ignored). Cheers, Julian -- Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text not quoted-printable, HTML or Base64 http://www.asciiribbon.org From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 02:34:20 2010 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 581E21065676 for ; Wed, 3 Feb 2010 02:34:20 +0000 (UTC) (envelope-from grog@lemis.com) Received: from w3.lemis.com (w3.lemis.com [208.86.224.149]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9C88FC17 for ; Wed, 3 Feb 2010 02:34:19 +0000 (UTC) Received: from dereel.lemis.com (121-200-1-204.cust.aussiebb.net [121.200.1.204]) by w3.lemis.com (Postfix) with ESMTP id 6DFD13BB3A; Wed, 3 Feb 2010 02:17:41 +0000 (UTC) Received: by dereel.lemis.com (Postfix, from userid 1004) id 5B505A1098; Wed, 3 Feb 2010 13:17:37 +1100 (EST) Date: Wed, 3 Feb 2010 13:17:37 +1100 From: Greg 'groggy' Lehey To: Kirk McKusick Message-ID: <20100203021737.GV88876@dereel.lemis.com> References: <201002022109.o12L9TsJ039446@chez.mckusick.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TG7lY2/6mW/akb80" Content-Disposition: inline In-Reply-To: <201002022109.o12L9TsJ039446@chez.mckusick.com> User-Agent: Mutt/1.4.2.3i Organization: The FreeBSD Project Phone: +61-3-5346-1370 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-hackers@freebsd.org, "Julian H. Stacey" , Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 03 Feb 2010 02:34:20 -0000 --TG7lY2/6mW/akb80 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 2 February 2010 at 13:09:29 -0800, Kirk McKusick wrote: > Thanks for the pointer. As you note, the damage (or benefit :-) is > done. Still I have sent an email to the editor at Spiegel notifying > them of my copyright in the hopes that they will at least ask in the > future. FWIW, much as I dislike "Der Spiegel", I think you targeted the wrong people. They clearly took it from the original paper (http://www.iseclab.org/papers/sonda-TR.pdf). The authors are Thorsten Holz, Gilbert Wondracek (both at the TU Wien), Engin Kirda (Eurecom, Sophia Antipolis) und Christopher Kruegel (UCSB), in case anybody knows any of them. Greg -- See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft MUA reports problems, please read http://tinyurl.com/broken-mua --TG7lY2/6mW/akb80 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkto3MEACgkQIubykFB6QiO8+wCglJEudX4pxCx/BQxnayPOFt7X gzgAnA9Q0Ut4O/QcGLSmK0aaY8qSVC4f =0c12 -----END PGP SIGNATURE----- --TG7lY2/6mW/akb80-- From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 01:30:03 2010 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 6083F106568D for ; Wed, 3 Feb 2010 01:30:03 +0000 (UTC) (envelope-from erich@alogreentechnologies.com) Received: from nomoremozzie.com (nomoremozzie.com [67.212.226.44]) by mx1.freebsd.org (Postfix) with ESMTP id 26FA38FC18 for ; Wed, 3 Feb 2010 01:30:03 +0000 (UTC) Received: from [192.168.0.110] ([180.129.84.247]) (authenticated bits=0) by nomoremozzie.com (8.13.1/8.13.1) with ESMTP id o1315BQ5019975; Tue, 2 Feb 2010 18:05:14 -0700 From: Erich Dollansky Organization: ALO Green Technologies Pte Ltd To: freebsd-hackers@freebsd.org Date: Wed, 3 Feb 2010 09:04:56 +0800 User-Agent: KMail/1.9.10 References: <4B6842E8.2030800@kukulies.org> In-Reply-To: <4B6842E8.2030800@kukulies.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002030904.58660.erich@alogreentechnologies.com> X-Mailman-Approved-At: Wed, 03 Feb 2010 03:24:24 +0000 Cc: Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 03 Feb 2010 01:30:03 -0000 Hi, On 02 February 2010 pm 23:21:12 Christoph Kukulies wrote: > Look here: > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html > it reminds me of movies in which good guys use Apple, bad guys Windows. Erich From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 01:33:06 2010 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 0C49010656FB for ; Wed, 3 Feb 2010 01:33:06 +0000 (UTC) (envelope-from erich@alogreentechnologies.com) Received: from nomoremozzie.com (nomoremozzie.com [67.212.226.44]) by mx1.freebsd.org (Postfix) with ESMTP id CB5968FC1B for ; Wed, 3 Feb 2010 01:33:05 +0000 (UTC) Received: from [192.168.0.110] ([180.129.84.247]) (authenticated bits=0) by nomoremozzie.com (8.13.1/8.13.1) with ESMTP id o131WxDs009225; Tue, 2 Feb 2010 18:33:01 -0700 From: Erich Dollansky Organization: ALO Green Technologies Pte Ltd To: freebsd-hackers@freebsd.org Date: Wed, 3 Feb 2010 09:32:46 +0800 User-Agent: KMail/1.9.10 References: <201002022236.o12MaLOY062533@fire.js.berklix.net> In-Reply-To: <201002022236.o12MaLOY062533@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002030932.48857.erich@alogreentechnologies.com> X-Mailman-Approved-At: Wed, 03 Feb 2010 03:24:31 +0000 Cc: Kirk McKusick , "Julian H. Stacey" , Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 03 Feb 2010 01:33:06 -0000 Hi, On 03 February 2010 am 06:36:21 Julian H. Stacey wrote: > Kirk McKusick wrote: > > Thanks for the pointer. As you note, the damage (or benefit :-) is > > done. Still I have sent an email to the editor at Spiegel notifying > > them of my copyright in the hopes that they will at least ask in the > > future. > > > > Kirk McKusick > > Good idea. You might want to contact authors of that PDF paper too. > In case, as my browser still is fails on URL I posted earlier: > http://www.iseclab.org/papers/sonda-TR.pdf it seems they are the originator as they wrote the study. Erich From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 11:26:04 2010 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 C9314106568B for ; Wed, 3 Feb 2010 11:26:04 +0000 (UTC) (envelope-from stefan.midjich@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 5B59F8FC14 for ; Wed, 3 Feb 2010 11:26:04 +0000 (UTC) Received: by ewy3 with SMTP id 3so1163601ewy.13 for ; Wed, 03 Feb 2010 03:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=YVkw88wAh192oPFTW71sVcjElyovU9mjElc6OhIkaAM=; b=XzuCNUA9KTJBxQS9gs8wdKYHh6v6J6S7AkK/g2zScqfKkYBtUZ9Kk/VY8Tu+F4GmBW GMx3q7xE31CUpTYGDOiJM4lkCGVWgN0vW0VC5EFz1KUaXRzi2DznuJNlg9Usggl5lv8u Pj9eLeVtRb76w5DxT+v5k69SvZr52WEVOqdbw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:date:x-google-sender-auth:message-id :subject:from:to:content-type; b=SWy9dL9YJy4F7K9uthb+l79G3y/RXokcEEOeOxVb+r54EVl94RgHPP0s7WrZxD7vp4 9eDIXwR36Z9zBkMtqu5mwtBw3BlGhmxBkLC/djVN/dek7ez/HFNKfaTyoU+5nsO30dJ/ k3GVcw9p5ZtgN1JH5EmUxnIvwm6Sk53p8JjEE= MIME-Version: 1.0 Sender: stefan.midjich@gmail.com Received: by 10.213.1.18 with SMTP id 18mr2129802ebd.17.1265196362602; Wed, 03 Feb 2010 03:26:02 -0800 (PST) Date: Wed, 3 Feb 2010 12:26:02 +0100 X-Google-Sender-Auth: 4d5242d185c5bb30 Message-ID: From: Stefan Midjich To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Does getc(3) use the read(2) syscall? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: swehack@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 11:26:04 -0000 I'm having trouble looking this function up in the source tree, the trail seems to end at __sys_read which has a bunch of prototypes but i can't find the actual function code. So my question is primarily, does getc use the read system call eventually? But i would also love it if someone could show me where __sys_read is defined. Thanks in advance for any information! --=20 Med v=E4nliga h=E4lsningar / With kind regards Stefan Midjich http://swehack.se/cv https://www.swehack.se/cv From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 13:44:03 2010 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 E7AB7106566C; Wed, 3 Feb 2010 13:44:03 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2B58FC13; Wed, 3 Feb 2010 13:44:03 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o13Dhka7052508; Wed, 3 Feb 2010 14:44:01 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o13Dhj7i052507; Wed, 3 Feb 2010 14:43:45 +0100 (CET) (envelope-from olli) Date: Wed, 3 Feb 2010 14:43:45 +0100 (CET) Message-Id: <201002031343.o13Dhj7i052507@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.de, wblock@wonkity.com, jkim@FreeBSD.ORG In-Reply-To: X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 03 Feb 2010 14:44:01 +0100 (CET) Cc: Subject: Re: Spin down HDD after disk sync or before power off X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.de, wblock@wonkity.com, jkim@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 13:44:04 -0000 Alexander Best wrote: > imo this patch takes good care of the problem. would be nice to > have it in HEAD. No -- *Please* make sure that the disks are only spun down upon an actual power-off command (i.e. when reboot() is called with the RB_POWEROFF flag). In all other cases the disks should keep running. It's not good to have the disks spin down and then immediately spin up again on every reboot. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd (On the statement print "42 monkeys" + "1 snake":) By the way, both perl and Python get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when the answer is clearly "41 monkeys and 1 fat snake". -- Jim Fulton From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 13:50:14 2010 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 44D4410656CE for ; Wed, 3 Feb 2010 13:50:14 +0000 (UTC) (envelope-from dmw@coder.cl) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id DB89A8FC13 for ; Wed, 3 Feb 2010 13:50:10 +0000 (UTC) Received: by yxe2 with SMTP id 2so1075794yxe.7 for ; Wed, 03 Feb 2010 05:50:10 -0800 (PST) Received: by 10.90.155.9 with SMTP id c9mr3361282age.38.1265203447053; Wed, 03 Feb 2010 05:24:07 -0800 (PST) Received: from coder-cl.no-ip.org ([201.215.99.33]) by mx.google.com with ESMTPS id 15sm4745079gxk.8.2010.02.03.05.24.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 05:24:06 -0800 (PST) From: Daniel Molina Wegener Organization: http://coder.cl/ To: freebsd-hackers@freebsd.org Date: Wed, 3 Feb 2010 10:23:50 -0300 User-Agent: KMail/1.12.4 (Linux/2.6.31-17-generic; KDE/4.3.5; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4926493.zaeND525Xq"; protocol="application/pgp-signature"; micalg=pgp-sha512 Content-Transfer-Encoding: 7bit Message-Id: <201002031024.03835.dmw@coder.cl> Subject: Re: Does getc(3) use the read(2) syscall? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dmw@coder.cl List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 13:50:14 -0000 --nextPart4926493.zaeND525Xq Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wednesday 03 February 2010, Stefan Midjich wrote: > I'm having trouble looking this function up in the source tree, the trail > seems to end at __sys_read which has a bunch of prototypes but i can't fi= nd > the actual function code. Well, you can try cscope --- IMO the best option to search for symbols in the source tree. Also you have well done front-ends like cbrowser, codelite and emacs plus cscope mode. >=20 > So my question is primarily, does getc use the read system call eventuall= y? No, certainly not. Take a look on stdio.h and libc implementation on lib/libc/stdio/getc.c. Mainly on the __sgetc(f) macro. >=20 > But i would also love it if someone could show me where __sys_read is > defined. Take a look on the architecture specific file SYS.h, that's a kind of macro. For example at the i386 file: lib/libc/i386/SYS.h >=20 > Thanks in advance for any information! >=20 Best regards, =2D-=20 | Daniel Molina | | IT Consulting & Software Development | | Phone: +56 2 9790277 | http://coder.cl/ | --nextPart4926493.zaeND525Xq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAABCgAGBQJLaXjmAAoJEHxqfq6Y4O5N/lUQALvyCmbJo1Frj2IMOGejn7sZ 0j48Wd3XQCRkFir9vaUnF3ar7HI6FYDf2b8cp5eav/Qntfk8Y6z7Vzw7YsfqdhC+ M2FeLkpbaGknMpcDp59xni4c3FnGYDuw6dYNQxswwj+sG6BD2L1vUnDWIjeuDks4 WkcFm0hHiVsVdMcxvt+xOpO3g+9fiflqqp0sItyl/0b8Cv+MIgzvirvASnobh/ej zSsjC+HBwV9JrWFqYiokPopQLE3Md+5MHajI5vP1tDYAUzG/DZItGGhBzq2rLbxF 7oW1BfNPKoZqpSTq3Q2M4rg+mYA9nvWpfj9bcuPal9C7Gmlss+RpE251GbCP42uR WnGQpikOtm1xPu9piDPv9ECG7wMAcsCYDNogl5YtxP7WWTFXtsmWBPeaLQR3TMCI 8UX1fmVbkGJ5j+RBV29FmVQXieEzDo0Zh+PcDIHFKbGgyDgV83JLU8X8rYuVvKpO IIUeo9ofcsg1LzzNBZtkvvgW5fyzdyK0J2+kYBqXKIt3zXuZ2zOxNRrMmXff2mcz 31EzeTN5+iSIlaOrrP4suPabMJTQjKbNHCCxaz+S216pnI7lGzbhYIjR2caNQ15I 93SI1vnvty2qcgkCM30aFVs4Hgepxo/0B5VNwWpydUFR0PX9J4avfmJ94xMzn0Pn h020XbY+i0a8HwsiJ7Vt =2mkU -----END PGP SIGNATURE----- --nextPart4926493.zaeND525Xq-- From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 14:04:11 2010 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 4FA99106566B for ; Wed, 3 Feb 2010 14:04:11 +0000 (UTC) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [77.47.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEF68FC0C for ; Wed, 3 Feb 2010 14:04:09 +0000 (UTC) Received: from pm513-1.comsys.ntu-kpi.kiev.ua ([10.18.52.101]) by comsys.ntu-kpi.kiev.ua with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1NcfkI-0008R4-3b; Wed, 03 Feb 2010 15:58:18 +0200 Received: by pm513-1.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1001) id 030311CC23; Wed, 3 Feb 2010 16:03:13 +0200 (EET) Date: Wed, 3 Feb 2010 16:03:12 +0200 From: Andrey Simonenko To: Stefan Midjich Message-ID: <20100203140312.GA34290@pm513-1.comsys.ntu-kpi.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Authenticated-User: simon@comsys.ntu-kpi.kiev.ua X-Authenticator: plain X-Invalid-HELO: Host impersonating [comsys.ntu-kpi.kiev.ua] X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Exim-Version: 4.63 (build at 06-Jan-2007 23:14:37) X-Date: 2010-02-03 15:58:18 X-Connected-IP: 10.18.52.101:46273 X-Message-Linecount: 46 X-Body-Linecount: 31 X-Message-Size: 1956 X-Body-Size: 1273 Cc: freebsd-hackers@freebsd.org Subject: Re: Does getc(3) use the read(2) syscall? 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, 03 Feb 2010 14:04:11 -0000 Hello, On Wed, Feb 03, 2010 at 12:26:02PM +0100, Stefan Midjich wrote: > I'm having trouble looking this function up in the source tree, the trail > seems to end at __sys_read which has a bunch of prototypes but i can't find > the actual function code. > > So my question is primarily, does getc use the read system call eventually? The easiest way is to write a simple program with this function and run it under ktrace and verify all calls in the output of kdump. > > But i would also love it if someone could show me where __sys_read is > defined. Quick check of the path gave me the following: getc -> __sgetc -> __srget -> __srefill -> _sread -> [._read ] -> __sread -> _read Look how Assembler files for system calls invocations are generated in the lib/libc/sys/Makefile.inc file, and look at macro variables defined in the amd64/SYS.h file. If you understand the idea, then check read.S file in the /lib/libc/ directory and the output of "nm read.So". Declaration of _read() in libc/stdio/stdio.c is done by a trick with two header files namespace.h included before and un-namespace.h included after another header files. Looks like that __sys_read in libc/ is used in directories with thread code and prototype for __sys_read is defined there. From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 14:28:27 2010 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 F11C71065679 for ; Wed, 3 Feb 2010 14:28:27 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 608998FC2D for ; Wed, 3 Feb 2010 14:28:27 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o13ESAHS055342; Wed, 3 Feb 2010 15:28:26 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o13ESATl055341; Wed, 3 Feb 2010 15:28:10 +0100 (CET) (envelope-from olli) Date: Wed, 3 Feb 2010 15:28:10 +0100 (CET) Message-Id: <201002031428.o13ESATl055341@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, swehack@gmail.com In-Reply-To: X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 03 Feb 2010 15:28:26 +0100 (CET) Cc: Subject: Re: Does getc(3) use the read(2) syscall? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, swehack@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 14:28:28 -0000 Stefan Midjich wrote: > I'm having trouble looking this function up in the source tree, the trail > seems to end at __sys_read which has a bunch of prototypes but i can't find > the actual function code. > > So my question is primarily, does getc use the read system call eventually? > > But i would also love it if someone could show me where __sys_read is > defined. getc() works like this: 1. The getc() macro can be found in /usr/include/stdio.h, the getc() function (for threaded programs) can be found in src/lib/libc/stdio/getc.c. 2. getc() (both the macro and the function) use the __sgetc() macro defined in stdio.h. 3. The __sgetc() macro either returns a character directly from the buffer, or it calls the __srget() function to refill the buffer. All of the stdio functions can be found in src/lib/libc/stdio/*. 4. The __srget() function calls the __srefill() function, then returns a character from the newly refilled buffer. 5. The __srefill() function uses the _sread() function to perform the actual read operation. 6. The _sread() function uses the _read() method from the FILE struct. 7. The actual value of the _read() method depends on how the file was opened. If it's a standard file opened with fopen() or similar, then the _read() method is initialized to the __sread() function. 8. Finally, the __sread() function calls _read(). 9. _read() is simply an alias for the read() syscall; the definition is in src/lib/libc/include/namespace.h. So to answer you question: Yes, getc() uses the read() syscall. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Python tricks" is a tough one, cuz the language is so clean. E.g., C makes an art of confusing pointers with arrays and strings, which leads to lotsa neat pointer tricks; APL mistakes everything for an array, leading to neat one-liners; and Perl confuses everything period, making each line a joyous adventure . -- Tim Peters From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 15:00:51 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F3E106566B for ; Wed, 3 Feb 2010 15:00:51 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.189]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3438FC0C for ; Wed, 3 Feb 2010 15:00:50 +0000 (UTC) Received: by gv-out-0910.google.com with SMTP id n29so137528gve.39 for ; Wed, 03 Feb 2010 07:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=C4BMfw6s+Ec1RSAbC66Z2cEWqCOeVj5Up79Sycg+4O8=; b=qeaZC9dDP5edkNNnyqlvfsJXu18GFbXMN5S8L9R5keezSbSa3u2bjiVID9AoV0EUUG Rf5cLBgker8SHJESI36xAeYNpphMQ4KRhwoLl1x7DYkFrL5OT2IF3GrQ4UYTcPCbtN/Q WA21f8At4R3cM22KkNSc/ZBc+eXn7t2qGzm/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=fZ0VrUZjJ3zv1N30NbRUAdlq5SV/9yuEfTWhGV6GYcBvvYe4fHsN3uqkMIIkGQjfD2 TIaW17YOfe8qvK86+1CIy5vLK7XH8IEemYgpRVfqbAeShKZ2ZfZ3Sd5DKrrPx1HA8nQ4 79I70eDiUrpFGhOXD58LVCoTfMKRilSXd/onk= MIME-Version: 1.0 Received: by 10.239.180.137 with SMTP id i9mr759986hbg.140.1265209248793; Wed, 03 Feb 2010 07:00:48 -0800 (PST) From: Eitan Adler Date: Wed, 3 Feb 2010 17:00:28 +0200 Message-ID: To: hackers@freebsd.org Content-Type: multipart/mixed; boundary=001485f3b90ed745e7047eb37b9b X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: [RFC] [patch] pkill verbose option 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, 03 Feb 2010 15:00:51 -0000 --001485f3b90ed745e7047eb37b9b Content-Type: text/plain; charset=ISO-8859-1 I added an option to pkill which lists what processes it kills and what signal is sent. If no signals are sent it prints out the same message killall does. --001485f3b90ed745e7047eb37b9b Content-Type: application/octet-stream; name="pkill-verbose-option.patch" Content-Disposition: attachment; filename="pkill-verbose-option.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g588wck60 SW5kZXg6IHBraWxsLjEKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gcGtpbGwuMQkocmV2aXNpb24gMjAzMzQ3KQor KysgcGtpbGwuMQkod29ya2luZyBjb3B5KQpAQCAtMTIyLDYgKzEyMiw4IEBACiBSZXN0cmljdCBt YXRjaGVzIHRvIHByb2Nlc3NlcyB3aXRoIGEgcmVhbCB1c2VyIElEIGluIHRoZSBjb21tYS1zZXBh cmF0ZWQKIGxpc3QKIC5BciB1aWQgLgorLkl0IEZsIFYKK0xpc3RzIHdoaWNoIHByb2Nlc3NlcyBh Y3Rpb24gd2lsbCBiZSB0YWtlbiBvbiBhbmQgd2hhdCBzaWduYWwgd2lsbCBiZSBzZW50LgogLkl0 IEZsIGQgQXIgZGVsaW0KIFNwZWNpZnkgYSBkZWxpbWl0ZXIgdG8gYmUgcHJpbnRlZCBiZXR3ZWVu IGVhY2ggcHJvY2VzcyBJRC4KIFRoZSBkZWZhdWx0IGlzIGEgbmV3bGluZS4KSW5kZXg6IHBraWxs LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQotLS0gcGtpbGwuYwkocmV2aXNpb24gMjAzMzQ3KQorKysgcGtpbGwuYwko d29ya2luZyBjb3B5KQpAQCAtMTA1LDYgKzEwNSw3IEBACiBzdGF0aWMgaW50CW9sZGVzdDsKIHN0 YXRpYyBpbnQJaW50ZXJhY3RpdmU7CiBzdGF0aWMgaW50CWludmVyc2U7CitzdGF0aWMgaW50CWZs YWdQcmludCA9IDA7CiBzdGF0aWMgaW50CWxvbmdmbXQ7CiBzdGF0aWMgaW50CW1hdGNoYXJnczsK IHN0YXRpYyBpbnQJZnVsbG1hdGNoOwpAQCAtMTgyLDcgKzE4Myw3IEBACiAJcGlkZmlsZWxvY2sg PSAwOwogCWV4ZWNmID0gY29yZWYgPSBfUEFUSF9ERVZOVUxMOwogCi0Jd2hpbGUgKChjaCA9IGdl dG9wdChhcmdjLCBhcmd2LCAiREY6RzpJTE06TjpQOlNVOmFkOmZnOmlqOmxub3M6dDp1OnZ4Iikp ICE9IC0xKQorCXdoaWxlICgoY2ggPSBnZXRvcHQoYXJnYywgYXJndiwgIkRGOkc6SUxNOk46UDpT VTpWYWQ6Zmc6aWo6bG5vczp0OnU6dngiKSkgIT0gLTEpCiAJCXN3aXRjaCAoY2gpIHsKIAkJY2Fz ZSAnRCc6CiAJCQlkZWJ1Z19vcHQrKzsKQEAgLTI3Miw2ICsyNzMsOSBAQAogCQljYXNlICd2JzoK IAkJCWludmVyc2UgPSAxOwogCQkJYnJlYWs7CisJCWNhc2UgJ1YnOgorCQkJZmxhZ1ByaW50ID0g MTsKKwkJCWJyZWFrOwogCQljYXNlICd4JzoKIAkJCWZ1bGxtYXRjaCA9IDE7CiAJCQlicmVhazsK QEAgLTUyOCwxNiArNTMyLDI2IEBACiAJLyoKIAkgKiBUYWtlIHRoZSBhcHByb3ByaWF0ZSBhY3Rp b24gZm9yIGVhY2ggbWF0Y2hlZCBwcm9jZXNzLCBpZiBhbnkuCiAJICovCisJaW50IGRpZEFjdGlv biA9IDA7CiAJZm9yIChpID0gMCwgcnYgPSAwLCBrcCA9IHBsaXN0OyBpIDwgbnByb2M7IGkrKywg a3ArKykgewogCQlpZiAoUFNLSVAoa3ApKQogCQkJY29udGludWU7CiAJCWlmIChzZWxlY3RlZFtp XSkgeworCQkJaWYgKGZsYWdQcmludCkKKwkJCXsKKwkJCQlkaWRBY3Rpb24gPSAxOworCQkJCXBy aW50Zigia2lsbCAtJWQgJWRcbiIsc2lnbnVtLGtwLT5raV9waWQpOworCQkJfQogCQkJaWYgKGlu dmVyc2UpCiAJCQkJY29udGludWU7CiAJCX0gZWxzZSBpZiAoIWludmVyc2UpCiAJCQljb250aW51 ZTsKIAkJcnYgfD0gKCphY3Rpb24pKGtwKTsKIAl9CisJaWYgKCFkaWRBY3Rpb24pCisJeworCQlw cmludGYoIk5vIG1hdGNoaW5nIHByb2Nlc3NlcyBiZWxvbmdpbmcgdG8geW91IHdlcmUgZm91bmRc biIpOworCX0KIAogCWV4aXQocnYgPyBTVEFUVVNfTUFUQ0ggOiBTVEFUVVNfTk9NQVRDSCk7CiB9 Cg== --001485f3b90ed745e7047eb37b9b-- From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 16:40:15 2010 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 72F441065790 for ; Wed, 3 Feb 2010 16:40:15 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 299548FC23 for ; Wed, 3 Feb 2010 16:40:14 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NciGs-0005cU-JS for freebsd-hackers@freebsd.org; Wed, 03 Feb 2010 17:40:06 +0100 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 ; Wed, 03 Feb 2010 17:40:06 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Feb 2010 17:40:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Wed, 03 Feb 2010 17:39:06 +0100 Lines: 11 Message-ID: References: <201002031024.03835.dmw@coder.cl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100118 Thunderbird/3.0 In-Reply-To: <201002031024.03835.dmw@coder.cl> Sender: news Subject: Re: Does getc(3) use the read(2) syscall? 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, 03 Feb 2010 16:40:15 -0000 On 02/03/10 14:23, Daniel Molina Wegener wrote: > On Wednesday 03 February 2010, > Stefan Midjich wrote: >> So my question is primarily, does getc use the read system call eventually? > > No, certainly not. I think you missed the "eventually" part :) Eventually, it does - but not for every single byte read. From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 14:27:33 2010 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 7BEC0106566C for ; Wed, 3 Feb 2010 14:27:33 +0000 (UTC) (envelope-from marcolz@zlo.nu) Received: from mzh.zlo.nu (ns0.zlo.nu [85.17.141.90]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3018FC18 for ; Wed, 3 Feb 2010 14:27:33 +0000 (UTC) Received: by mzh.zlo.nu (Postfix, from userid 1000) id E5D6E14125; Wed, 3 Feb 2010 15:16:18 +0100 (CET) Date: Wed, 3 Feb 2010 15:16:18 +0100 From: Marc Olzheim To: Daniel Molina Wegener Message-ID: <20100203141618.GA32485@zlo.nu> References: <201002031024.03835.dmw@coder.cl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <201002031024.03835.dmw@coder.cl> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Wed, 03 Feb 2010 16:40:24 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Does getc(3) use the read(2) syscall? 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, 03 Feb 2010 14:27:33 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 03, 2010 at 10:23:50AM -0300, Daniel Molina Wegener wrote: > > I'm having trouble looking this function up in the source tree, the tra= il > > seems to end at __sys_read which has a bunch of prototypes but i can't = find > > the actual function code. >=20 > Well, you can try cscope --- IMO the best option to > search for symbols in the source tree. Also you have > well done front-ends like cbrowser, codelite and emacs > plus cscope mode. Works wonders in vim as well. :-) > > So my question is primarily, does getc use the read system call eventua= lly? >=20 > No, certainly not. Take a look on stdio.h and libc > implementation on lib/libc/stdio/getc.c. Mainly on the > __sgetc(f) macro. If you follow macros long enough, you'll find that it obviously does use the read system call. read, readv, pread, preadv are basicly the system calls through which all normal reads take place. Marc --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAktphTIACgkQezjnobFOgrHTuACgrl36d0iwaE7H4iV8/ja3Xyc+ EhQAoMivCxPtBHMDbi1k2HhBfVk5iwGQ =jkpJ -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X-- From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 17:52:37 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3669106566B for ; Wed, 3 Feb 2010 17:52:37 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3268FC1A for ; Wed, 3 Feb 2010 17:52:37 +0000 (UTC) Received: by fxm25 with SMTP id 25so227119fxm.14 for ; Wed, 03 Feb 2010 09:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=yXReyhi8c/ndkci/CJ0Tcb3mdYQJaMH9nQhlxyiRATw=; b=RuM2o0SdlqBGfkgiiPZT8oQ0IVyRHQJOQcxI0J+mIX8QJq6rfYImpn8chy+ZytMh13 G3NJVpMtyGUncLv5ROPFpttMK7+SUVIzw4iO86PLspTzMZOElIoshUE3r1fLb4JIqk2c n77JiTZOYzzoAtfY2pxh5OHUoNVP/NoOzsVqA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=brNGcXe2aLm/8jR9YJiKt96FXR7GnjUTlryErakSPn+WTUqE9vV2CaUZQbVlVfrt63 dnHgCbA0qHFgLQ3SCU1eK3dp0cWr0LAiRxe95cjCjUFQpr/4rOOGOGdxF4fHPr0oyA59 z3VezGNPZGwQ++53YyAWWEmtndc2EL08wKnvQ= Received: by 10.87.38.5 with SMTP id q5mr309738fgj.45.1265219556191; Wed, 03 Feb 2010 09:52:36 -0800 (PST) Received: from centel.dataix.local (ppp-21.197.dialinfree.com [209.172.21.197]) by mx.google.com with ESMTPS id 14sm3325373fxm.11.2010.02.03.09.52.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 09:52:34 -0800 (PST) Sender: "J. Hellenthal" Date: Wed, 3 Feb 2010 12:52:17 -0500 From: jhell To: Eitan Adler In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: hackers@freebsd.org Subject: Re: [RFC] [patch] pkill verbose option 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, 03 Feb 2010 17:52:38 -0000 On Wed, 3 Feb 2010 10:00, eitanadlerlist@ wrote: > I added an option to pkill which lists what processes it kills and what > signal is sent. If no signals are sent it prints out the same message > killall does. > Unfortunately that patch works but has unintended operation that can be seen with the following. sleep 1000 & pkill sleep No matching processes belonging to you were found [1]+ Terminated: 15 sleep 10000 It then kills sleep and still prints no processes belong to you message. Now pkill -v sleep on my system actually causes my Xserver to exit with a unexpected signal 15. Without the patches it works as it should... Overhead endured. -- jhell From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 17:58:29 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17068106568D for ; Wed, 3 Feb 2010 17:58:29 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 9728F8FC15 for ; Wed, 3 Feb 2010 17:58:28 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so50655fgb.13 for ; Wed, 03 Feb 2010 09:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=Sk1m3MHQHCqhIJ9WsVnwBLhW7njX0+L1vrpQ01lfwdM=; b=NjDLvQ4R4MAhLYSN6NSPhof8ffqYqAw41P1ORWr9ZkV+zS2qdTq80Ddd9omJaSwnis NnAN8ZIoXliifBfqU4onQoIuR6t89Wswdw/YhvcpcB/+B9TkTGbVFOItoUJ+NIMdPY8K dIDzeFaUuL2GOl3PNbm+6JsllGaOh55+iQ2Ic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=hjQwnsP1j0FKLqtvyOad2wibJ1+XVqaS7rR7w6NS0n+jClTJwZZayGZfDu4EDMaz93 lw/2UuZq6lbxjOp12gQK+U0RnCa8NwIESwwloEYYq6sm4mPyqnbhYbh4Ta/k/huktAH4 AEGnTun9Vnuvf8UqFR3KS4O0xSl3OvCHWgUP8= Received: by 10.87.65.9 with SMTP id s9mr309359fgk.48.1265219907025; Wed, 03 Feb 2010 09:58:27 -0800 (PST) Received: from centel.dataix.local (ppp-21.197.dialinfree.com [209.172.21.197]) by mx.google.com with ESMTPS id 15sm3320479fxm.6.2010.02.03.09.58.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 09:58:25 -0800 (PST) Sender: "J. Hellenthal" Date: Wed, 3 Feb 2010 12:58:11 -0500 From: jhell To: Eitan Adler In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: hackers@freebsd.org Subject: Re: [RFC] [patch] pkill verbose option 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, 03 Feb 2010 17:58:29 -0000 On Wed, 3 Feb 2010 12:52, jhell@ wrote: > > On Wed, 3 Feb 2010 10:00, eitanadlerlist@ wrote: >> I added an option to pkill which lists what processes it kills and what >> signal is sent. If no signals are sent it prints out the same message >> killall does. >> > > Unfortunately that patch works but has unintended operation that can be seen > with the following. > > sleep 1000 & > pkill sleep > No matching processes belonging to you were found > [1]+ Terminated: 15 sleep 10000 > > It then kills sleep and still prints no processes belong to you message. > > Now pkill -v sleep on my system actually causes my Xserver to exit with a > unexpected signal 15. > > Without the patches it works as it should... > > Overhead endured. > > Ugh! ignore the pkill -v comment. Should have noticed the -V instead. -- jhell From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 19:57:51 2010 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 7E940106568D for ; Wed, 3 Feb 2010 19:57:51 +0000 (UTC) (envelope-from dmw@coder.cl) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 16A6F8FC18 for ; Wed, 3 Feb 2010 19:57:50 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so379253eye.9 for ; Wed, 03 Feb 2010 11:57:50 -0800 (PST) Received: by 10.213.107.143 with SMTP id b15mr142556ebp.72.1265227069861; Wed, 03 Feb 2010 11:57:49 -0800 (PST) Received: from coder-cl.no-ip.org ([201.215.99.33]) by mx.google.com with ESMTPS id 15sm138546ewy.12.2010.02.03.11.57.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 11:57:48 -0800 (PST) From: Daniel Molina Wegener Organization: http://coder.cl/ To: Marc Olzheim Date: Wed, 3 Feb 2010 16:57:42 -0300 User-Agent: KMail/1.12.4 (Linux/2.6.31-17-generic; KDE/4.3.5; i686; ; ) References: <201002031024.03835.dmw@coder.cl> <20100203141618.GA32485@zlo.nu> In-Reply-To: <20100203141618.GA32485@zlo.nu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2034385.0TTj51CVDk"; protocol="application/pgp-signature"; micalg=pgp-sha512 Content-Transfer-Encoding: 7bit Message-Id: <201002031657.47714.dmw@coder.cl> Cc: freebsd-hackers@freebsd.org Subject: Re: Does getc(3) use the read(2) syscall? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dmw@coder.cl List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 19:57:51 -0000 --nextPart2034385.0TTj51CVDk Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wednesday 03 February 2010, Marc Olzheim wrote: > On Wed, Feb 03, 2010 at 10:23:50AM -0300, Daniel Molina Wegener wrote: > > > I'm having trouble looking this function up in the source tree, the > > > trail seems to end at __sys_read which has a bunch of prototypes but i > > > can't find the actual function code. > > > > Well, you can try cscope --- IMO the best option to > > search for symbols in the source tree. Also you have > > well done front-ends like cbrowser, codelite and emacs > > plus cscope mode. >=20 > Works wonders in vim as well. :-) Sure, vim supports cscope since 2000 and possibly before that, indeed vim was my first programming editor in FreeBSD and Linux. Then I've learned emcas, and now I use both editors --- the first available on the machine that I'm working on --- also emacs requires a lot of configurations, but is my primary editor on my FreeBSD boxes. >=20 > > > So my question is primarily, does getc use the read system call > > > eventually? > > > > No, certainly not. Take a look on stdio.h and libc > > implementation on lib/libc/stdio/getc.c. Mainly on the > > __sgetc(f) macro. >=20 > If you follow macros long enough, you'll find that it obviously does use > the read system call. read, readv, pread, preadv are basicly the system > calls through which all normal reads take place. That's right, but cscope or even etags should help a lot finding those simbols, most for large source trees like the FreeBSD base system ;) >=20 > Marc >=20 Best regards, =2D-=20 Daniel Molina Wegener Software Architect, System Programmer & Web Developer Phone: +1 (510) 629-4267 | Blog: http://coder.cl/ --nextPart2034385.0TTj51CVDk Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAABCgAGBQJLadU2AAoJEHxqfq6Y4O5N8AEQALMUMFslkAEA5vbpecAZ6yym zrkMo7LiLJqm84Q5U3pS6E3dMh/6uhjsHRZ4FH3KEvrwdUAS/6qUzbUPpIlCYS4E LISRzFcpBv+iH3jcs/ISY4XdD2K3KMfSpFzYh9fok04yWZkXWTU9R0WyYmS2aeOG vhNqYYlH2g1KIaZV7cPbJHmy0AbE1Q1W96XUdXhX/50JbX8rR0Ykav2psnVPrX/4 pf2TVUf3ykB6T327Ypia5MG/C4qlI4fXJ+jsswz49X2vpjzvv0kIGoWT7TrATDxb uSp74YTQuzk741U+Xc2DH05TwIqZmqA3iTCW7Pl111aLekt2M93VdVIqTsdSTiDY rRMVUyZ+y0LddsK1VeV5xBivRqNlOVtd8Oee2tuyXeI5kmOeXv1oVAq/S+pKqdaz h/ax+g3xW1WYeca26uObTFP/KvCh2OT88yuQndMuEM9x1h1IKU4AGnpCFf4jCKdR NJh12nxan0ZDboJL4fxCIecDCQyLFw+0C3utV81yE5lFZ0mw9ZFpYZAsus453ExY VH6PfE/YgKwOnkpIE0/VHfqw46at3mB/v1RjdvLqotSjYUJ+Zq4ZjpQMAvE4I/cU 2MQVZtpFn+dJsDoVYdCr7tN64bg35kYeoYri1cl0s3eZ1XdVIrRPKbUWVOZEmrES b6vB1EmOz7pyfwtOFNfD =Hs+N -----END PGP SIGNATURE----- --nextPart2034385.0TTj51CVDk-- From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 20:44:05 2010 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 DDD5D1065672; Wed, 3 Feb 2010 20:44:05 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 9962C8FC17; Wed, 3 Feb 2010 20:44:05 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.3/8.14.3) with ESMTP id o13Ki4fB009850; Wed, 3 Feb 2010 13:44:04 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.3/8.14.3/Submit) with ESMTP id o13Ki4LN009847; Wed, 3 Feb 2010 13:44:04 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 3 Feb 2010 13:44:04 -0700 (MST) From: Warren Block To: Oliver Fromme , freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.de, jkim@FreeBSD.ORG In-Reply-To: <201002031343.o13Dhj7i052507@lurza.secnetix.de> Message-ID: References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (wonkity.com [127.0.0.1]); Wed, 03 Feb 2010 13:44:04 -0700 (MST) Cc: Subject: Re: Spin down HDD after disk sync or before power off 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, 03 Feb 2010 20:44:06 -0000 On Wed, 3 Feb 2010, Oliver Fromme wrote: > Alexander Best wrote: > > imo this patch takes good care of the problem. would be nice to > > have it in HEAD. > > No -- *Please* make sure that the disks are only spun down > upon an actual power-off command (i.e. when reboot() is > called with the RB_POWEROFF flag). In all other cases the > disks should keep running. It's not good to have the disks > spin down and then immediately spin up again on every > reboot. Could you elaborate a little on why that's bad? It seems like it would be similar to a standby/resume action. Are there any other device drivers that differentiate the reboot and poweroff actions that could be used as inspiration or simply shamelessly copied in modifying ata-disk? -Warren Block * Rapid City, South Dakota USA From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 21:18:18 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF52F106566B for ; Wed, 3 Feb 2010 21:18:17 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by mx1.freebsd.org (Postfix) with ESMTP id 73AF28FC1A for ; Wed, 3 Feb 2010 21:18:17 +0000 (UTC) Received: by fxm5 with SMTP id 5so1768261fxm.35 for ; Wed, 03 Feb 2010 13:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=2vCRrfXFE9VOW11bo3rJCaPc4se5C2j4fs8hqPnPdr0=; b=AFT7dXFRJ0Ab0ZpbYAzNUrmzNMNcrPH3E623KcCz1bpF8m8KdL0os/krEBDSXIiE8y XHfJwbx6a3POWiB31nLOCsuGj1cu7fWX/87AncFDEw5Yahq6CucI+4K1uzWssqEN69Xf f2frUNl8GSSOmep+Sl7EkgSnPgVxzBPJgIX4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Zo/e/0YX0dbhA9yG8ggk2OpQLnpsG7Y4qQlrx2OmFNaHt4o9Kdk5exzbVRCNmP7DAD jQuwtEvMpdqSjrarLpktWzbm8w1FjCnmjkYSfrdoq4YOloZugMXSKviDE4kEqdzO1ane 6IkcmZN8BIhE0lFrCgpvaWeZrl4JyEYDdfjZY= MIME-Version: 1.0 Received: by 10.239.185.83 with SMTP id b19mr16783hbh.75.1265231896239; Wed, 03 Feb 2010 13:18:16 -0800 (PST) In-Reply-To: References: From: Eitan Adler Date: Wed, 3 Feb 2010 23:17:54 +0200 Message-ID: To: jhell Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: hackers@freebsd.org Subject: Re: [RFC] [patch] pkill verbose option 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, 03 Feb 2010 21:18:18 -0000 Yeah - I wasn't sure what else to use. Does the -V work as intended? Is this a worthwhile patch? IMHO the biggest problem with unix system commands is the lack of constancy of the flags. On Wed, Feb 3, 2010 at 7:58 PM, jhell wrote: > > On Wed, 3 Feb 2010 12:52, jhell@ wrote: > >> >> On Wed, 3 Feb 2010 10:00, eitanadlerlist@ wrote: >> >>> I added an option to pkill which lists what processes it kills and what >>> signal is sent. If no signals are sent it prints out the same message >>> killall does. >>> >>> >> Unfortunately that patch works but has unintended operation that can be >> seen with the following. >> >> sleep 1000 & >> pkill sleep >> No matching processes belonging to you were found >> [1]+ Terminated: 15 sleep 10000 >> >> It then kills sleep and still prints no processes belong to you message. >> >> Now pkill -v sleep on my system actually causes my Xserver to exit with a >> unexpected signal 15. >> >> Without the patches it works as it should... >> >> Overhead endured. >> >> >> > Ugh! ignore the pkill -v comment. Should have noticed the -V instead. > > > -- > > jhell > > From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 02:09:36 2010 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 742281065693 for ; Thu, 4 Feb 2010 02:09:36 +0000 (UTC) (envelope-from erich@alogreentechnologies.com) Received: from nomoremozzie.com (nomoremozzie.com [67.212.226.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2748FC15 for ; Thu, 4 Feb 2010 02:09:36 +0000 (UTC) Received: from [192.168.0.110] ([112.199.163.122]) (authenticated bits=0) by nomoremozzie.com (8.13.1/8.13.1) with ESMTP id o1429Id1012662; Wed, 3 Feb 2010 19:09:34 -0700 From: Erich Dollansky Organization: ALO Green Technologies Pte Ltd To: freebsd-hackers@freebsd.org Date: Thu, 4 Feb 2010 10:09:03 +0800 User-Agent: KMail/1.9.10 References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002041009.05222.erich@alogreentechnologies.com> X-Mailman-Approved-At: Thu, 04 Feb 2010 02:18:05 +0000 Cc: alexbestms@wwu.de, Oliver Fromme , jkim@freebsd.org Subject: Re: Spin down HDD after disk sync or before power off 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, 04 Feb 2010 02:09:36 -0000 Hi, let me do. On 04 February 2010 am 04:44:04 Warren Block wrote: > On Wed, 3 Feb 2010, Oliver Fromme wrote: > > > Alexander Best wrote: > > No -- *Please* make sure that the disks are only spun down > > upon an actual power-off command (i.e. when reboot() is > > Could you elaborate a little on why that's bad? It seems like it would > be similar to a standby/resume action. > every disk has a limited number of restarts before it dies. In case of a reboot, it is already known when the command is given that the machine will restart without being powered of. If you spin-down the disk, you lose one start cycle. It is not that important but if it can be done with just one if, please, just do it. Erich From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 02:53:03 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66949106568F for ; Thu, 4 Feb 2010 02:53:03 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 144EE8FC13 for ; Thu, 4 Feb 2010 02:53:02 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so116301qwd.7 for ; Wed, 03 Feb 2010 18:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=tX8oC2+F8/TX3WTh5R8EyQO2Fl0TExqQ+QyHuMoJagM=; b=toXTns8/3R68IafqnuIMnKG/iRU+qtyRZukUKNAiujZU6JK7WAYgZI0dD95Ha7hm1M DOsHctv5bBzoMJbECjSKF5xqEWBIyX+kFOVq7jglpUAfawdySXLBnEjgEVaOWFMC86oJ y8jgemxRwMFl2/1gD4DiL5+SWLEeEdcnIZTlk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=BBiga6cP6kU3TIAAE5DWpF4JYmBv05GJ+vYz0xwjEmaXYgNl3XZUoYMtcGxqQQ2Yjm iiStUCR7cCrVaawtN/yixgAhajYiT5FR8B78Ht8n7BWnKkHqDMToh5aI6Nh62hi7UR1+ CBKkYhpy3nBaf2IUE2pghAL2FD7FYKLcLyUpg= Received: by 10.224.79.166 with SMTP id p38mr3366644qak.238.1265251978577; Wed, 03 Feb 2010 18:52:58 -0800 (PST) Received: from ppp-21.93.dialinfree.com (ppp-21.93.dialinfree.com [209.172.21.93]) by mx.google.com with ESMTPS id 6sm13043376qwk.10.2010.02.03.18.52.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 18:52:57 -0800 (PST) Sender: "J. Hellenthal" Date: Wed, 3 Feb 2010 21:52:33 -0500 From: jhell To: Eitan Adler In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: hackers@freebsd.org Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 02:53:03 -0000 On Wed, 3 Feb 2010 16:17, eitanadlerlist@ wrote: > Yeah - I wasn't sure what else to use. > Does the -V work as intended? Is this a worthwhile patch? > > IMHO the biggest problem with unix system commands is the lack of constancy > of the flags. > Personally I would like to see pkill have this option as '-l' since pgrep uses '-l' for long output I think it would make more sense if the user is already used to what they expect to find in pgrep be also available in pkill. Other than that it works as expected. ;) > On Wed, Feb 3, 2010 at 7:58 PM, jhell wrote: > >> >> On Wed, 3 Feb 2010 12:52, jhell@ wrote: >> >>> >>> On Wed, 3 Feb 2010 10:00, eitanadlerlist@ wrote: >>> >>>> I added an option to pkill which lists what processes it kills and what >>>> signal is sent. If no signals are sent it prints out the same message >>>> killall does. >>>> >>>> >>> Unfortunately that patch works but has unintended operation that can be >>> seen with the following. >>> >>> sleep 1000 & >>> pkill sleep >>> No matching processes belonging to you were found >>> [1]+ Terminated: 15 sleep 10000 >>> >>> It then kills sleep and still prints no processes belong to you message. >>> >>> Now pkill -v sleep on my system actually causes my Xserver to exit with a >>> unexpected signal 15. >>> >>> Without the patches it works as it should... >>> >>> Overhead endured. >>> >>> >>> >> Ugh! ignore the pkill -v comment. Should have noticed the -V instead. >> >> >> -- >> >> jhell >> >> > -- jhell From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 03:07:12 2010 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 AC1051065670; Thu, 4 Feb 2010 03:07:12 +0000 (UTC) (envelope-from oxyd.oxyd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 175088FC14; Thu, 4 Feb 2010 03:07:11 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so59960fge.13 for ; Wed, 03 Feb 2010 19:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=NEC4a4fmg6FsgLRivwJVGAOkN40RvNj51l8eEbe6HJg=; b=M9ia8sruIIUtoRQrsLgDdyVmeT/dvF5i3KALLoS1PihGbbG8fz+bSA0yM0IF+JhlUV +uhiOirt2wUgxGesVDeDVEbRc8KsBYY6VDXiKuGEQ3s02O9IOuhGcuKXqrTODRP85jZa hrGEywrPx6p7aG0j3fsf4IIFOEH4jDYUa9glI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=dtTT7a2iPFLwnr4voqG+uUfRJHv0N/DLacZbnhUlusVE9q8E7ErAs35qtT2zIemJtN kv8cUZCBeQZcFhak5UdxGxe4kXVqum4VjC2ojZFkqspRTdsxlLHIeeAM+yu3uun52PHF ME4/x7n91DQDLSje/7JDE8zfNN0hF0UZE9fHI= MIME-Version: 1.0 Received: by 10.87.2.15 with SMTP id e15mr1170845fgi.22.1265251473548; Wed, 03 Feb 2010 18:44:33 -0800 (PST) In-Reply-To: References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> Date: Thu, 4 Feb 2010 03:44:33 +0100 Message-ID: From: =?UTF-8?Q?Ond=C5=99ej_Majerech?= To: Warren Block Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Oliver Fromme , jkim@freebsd.org, alexbestms@wwu.de Subject: Re: Spin down HDD after disk sync or before power off 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, 04 Feb 2010 03:07:12 -0000 On 3 February 2010 21:44, Warren Block wrote: > Are there any other device drivers that differentiate the reboot and > poweroff actions that could be used as inspiration or simply shamelessly > copied in modifying ata-disk? > I don't know about FreeBSD drivers, but I used NetBSD briefly on my notebook, and I noticed that it spun the disk down properly before poweroff. It was a very distinctive sound from what FreeBSD made on shutdown -p. So perhaps you could see how NetBSD guys do it and get some ideas from there? ~ Ondra From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 03:43:23 2010 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 B4FFD106566C for ; Thu, 4 Feb 2010 03:43:23 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0408FC1C for ; Thu, 4 Feb 2010 03:43:23 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.3/8.14.3) with ESMTP id o143hLVn011304; Wed, 3 Feb 2010 20:43:21 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.3/8.14.3/Submit) with ESMTP id o143hLxh011301; Wed, 3 Feb 2010 20:43:21 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 3 Feb 2010 20:43:21 -0700 (MST) From: Warren Block To: Erich Dollansky In-Reply-To: <201002041009.05222.erich@alogreentechnologies.com> Message-ID: References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> <201002041009.05222.erich@alogreentechnologies.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (wonkity.com [127.0.0.1]); Wed, 03 Feb 2010 20:43:21 -0700 (MST) Cc: freebsd-hackers@freebsd.org Subject: Re: Spin down HDD after disk sync or before power off 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, 04 Feb 2010 03:43:23 -0000 On Thu, 4 Feb 2010, Erich Dollansky wrote: > let me do. > > On 04 February 2010 am 04:44:04 Warren Block wrote: >> On Wed, 3 Feb 2010, Oliver Fromme wrote: >> >>> Alexander Best wrote: >>> No -- *Please* make sure that the disks are only spun down >>> upon an actual power-off command (i.e. when reboot() is >> >> Could you elaborate a little on why that's bad? It seems like it would >> be similar to a standby/resume action. >> > every disk has a limited number of restarts before it dies. Okay. For future reference, here are the numbers I've seen: power cycles (Seagate): 50,000 lifetime normal head load/unload (Hitachi): 600,000 lifetime emergency head load/unload (Hitachi): 20,000 lifetime > In case of a reboot, it is already known when the command is given that the machine will restart without being powered of. > > If you spin-down the disk, you lose one start cycle. > > It is not that important but if it can be done with just one if, please, just do it. AFAICT ad_shutdown can't tell whether it's called for a reboot or a poweroff, it's just told to "shut down". So maybe it's one if, but it's somewhere above ata-disk.c but below reboot(RB_POWEROFF). -Warren Block * Rapid City, South Dakota USA From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 08:34:51 2010 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 040571065672 for ; Thu, 4 Feb 2010 08:34:51 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5A08FC1A for ; Thu, 4 Feb 2010 08:34:50 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NcxAi-0007SZ-8u for freebsd-hackers@freebsd.org; Thu, 04 Feb 2010 09:34:44 +0100 Received: from CPE00134609fbfb-CM0013718690da.cpe.net.cable.rogers.com ([99.226.150.73]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 09:34:44 +0100 Received: from jasonspiro4 by CPE00134609fbfb-CM0013718690da.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 09:34:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Jason Spiro Date: Thu, 4 Feb 2010 08:34:16 +0000 (UTC) Lines: 24 Message-ID: References: <4B315A5A.6040101@delphij.net> <4B31671C.8090005@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 99.226.150.73 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009032803 Iceweasel/3.0.6 (Debian-3.0.6-1)) Sender: news Subject: Re: Renaming "killall" and forever symlinking the old name to the new name 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, 04 Feb 2010 08:34:51 -0000 Jason Spiro gmail.com> writes: [snip] > > You could rename killall to something else, and update the manpage to show the > new name, then symlink or hard link "killall" to the new name forever. This > would encourage people to use the new name, but it would never force them to. > > Xin, what do you think? Since Xin and I CC'ed each other so often in this thread, Gmail automatically added us to each others' Gtalk instant-messenger contact lists. Since it'd been more than a month and Xin still hadn't replied to this message, I instant messaged him the idea and asked him what he thought. He replied that, in his opinion, this new idea is pointless: nobody would notice the renaming, and it would just cause confusion. I asked, what if the tool would show a hint onscreen if you called it using the old name? He said no. He said people can just use pkill. I hope Eitan Adler's patch[1], which adds a "verbose" option to pkill, will get accepted, and that a similar patch will get accepted into the Linux pkill, maintained by Albert Calahan. ^ [1]. http://thread.gmane.org/gmane.os.freebsd.devel.hackers/38636 From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 09:24:53 2010 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 6D3D3106566C for ; Thu, 4 Feb 2010 09:24:53 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 24FF28FC16 for ; Thu, 4 Feb 2010 09:24:52 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NcxxD-0005Di-Ge for freebsd-hackers@freebsd.org; Thu, 04 Feb 2010 10:24:51 +0100 Received: from CPE00134609fbfb-CM0013718690da.cpe.net.cable.rogers.com ([99.226.150.73]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 10:24:51 +0100 Received: from jasonspiro4 by CPE00134609fbfb-CM0013718690da.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 10:24:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Jason Spiro Date: Thu, 4 Feb 2010 09:24:30 +0000 (UTC) Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 99.226.150.73 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009032803 Iceweasel/3.0.6 (Debian-3.0.6-1)) Sender: news Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 09:24:53 -0000 jhell DataIX.net> writes: [snip] > > Now pkill -v sleep on my system actually causes my Xserver to exit with a > unexpected signal 15. Yes. "pkill -v sleep" kills all your own processes except for sleep. As root, it kills all processes running on your machine except for sleep. -V is not a good choice of letter for this option: it's too easy to write -v instead by accident. -l (dash-ell), as jhell has suggested elsewhere in this thread, would be ideal, since it's lowercase and easy to type. If you don't like -l, you could choose to make it -D (for "Debug") instead. From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 10:26:32 2010 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 5DA6B1065672 for ; Thu, 4 Feb 2010 10:26:32 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id D78678FC0A for ; Thu, 4 Feb 2010 10:26:31 +0000 (UTC) Received: by fxm24 with SMTP id 24so570541fxm.3 for ; Thu, 04 Feb 2010 02:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=6D+lE9rXwDL37v6AcCs3DhRl8KmcAGrnsFlEFr+VdE0=; b=UNBnmdZwPI4wj4yp8WtP8AbbPKtmgCPVTXsiQR7ajU4Vsej36WBy5BYmiclAUqUsNs iKuHC5L+owkhGdNXZ27t/jQ67AKqKIf+yQVLNDn88q6V/xTdwArfb1MsVO6IO+B/iMcy xdU9UxBVQawm8vXvne9KrOXVMmn07Rvzkowkw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=EuOLeZn7BZOUyZro7D8Pfr8t881o1xkOe1Cw4TdlHSOqjPWoUNmstY+1lk4RBjZDV5 pZLny8UnltbNKK3rgLiH2hrulU/VjXXhAbHPeAV/UVAFG0YjKDJbOrOkot9sQorc0ADn xhHlnB/M4PqjSHH3u0o/WkmAxesplWfJescxA= MIME-Version: 1.0 Received: by 10.239.190.77 with SMTP id w13mr95006hbh.25.1265277706688; Thu, 04 Feb 2010 02:01:46 -0800 (PST) In-Reply-To: References: From: Eitan Adler Date: Thu, 4 Feb 2010 12:01:26 +0200 Message-ID: To: Jason Spiro Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 10:26:32 -0000 This patch hijacks pgrep's -l Index: pkill.1 =================================================================== --- pkill.1 (revision 203347) +++ pkill.1 (working copy) @@ -168,9 +168,9 @@ If used in conjunction with .Fl f , print the process ID and the full argument list for each matching process. -This option can only be used with the -.Nm pgrep -command. +If used in conjunction with the +.Nm pkill +command, it lists the signal sent as well. .It Fl n Select only the newest (most recently started) of the matching processes. .It Fl o Index: pkill.c =================================================================== --- pkill.c (revision 203347) +++ pkill.c (working copy) @@ -182,7 +182,7 @@ pidfilelock = 0; execf = coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ilj:lnos:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -245,8 +245,6 @@ criteria = 1; break; case 'l': - if (!pgrep) - usage(); longfmt = 1; break; case 'n': @@ -528,16 +526,26 @@ /* * Take the appropriate action for each matched process, if any. */ + int didAction = 0; for (i = 0, rv = 0, kp = plist; i < nproc; i++, kp++) { if (PSKIP(kp)) continue; if (selected[i]) { + if (longfmt) + { + didAction = 1; + printf("kill -%d %d\n",signum,kp->ki_pid); + } if (inverse) continue; } else if (!inverse) continue; rv |= (*action)(kp); } + if (!didAction && !pgrep) + { + printf("No matching processes belonging to you were found\n"); + } exit(rv ? STATUS_MATCH : STATUS_NOMATCH); } On Thu, Feb 4, 2010 at 11:24 AM, Jason Spiro wrote: > jhell DataIX.net> writes: > > [snip] > > > > Now pkill -v sleep on my system actually causes my Xserver to exit with a > > unexpected signal 15. > > Yes. "pkill -v sleep" kills all your own processes except for sleep. As > root, > it kills all processes running on your machine except for sleep. > > -V is not a good choice of letter for this option: it's too easy to write > -v > instead by accident. -l (dash-ell), as jhell has suggested elsewhere in > this > thread, would be ideal, since it's lowercase and easy to type. If you > don't > like -l, you could choose to make it -D (for "Debug") instead. > > _______________________________________________ > 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 Feb 4 10:32:35 2010 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 172631065693 for ; Thu, 4 Feb 2010 10:32:35 +0000 (UTC) (envelope-from cronfy@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4218FC14 for ; Thu, 4 Feb 2010 10:32:34 +0000 (UTC) Received: by fxm24 with SMTP id 24so575924fxm.3 for ; Thu, 04 Feb 2010 02:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=YL3KNISn5baAZwmyxupUy4xjhtEjJ+c4avs4BuoyjkQ=; b=MS5Hdg+lrxHj9R7DI2tSqIfjprntoYrNcxaJZ5ApTeXZj3mEJWyFYmGOFcwTCvDNHW 8go0m+WU7MPFFRBqEm+5X+UzI+OrvjisNyZXnumkjn3UAYoirmx0o6CsiusduHB+ry6S UUrdEpKQNgJAG3Shq2AclUF2w40b883YrmwTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Zy6MVAzo5T2h1drdeyT5WMdZjFy0GJ1RUIcMvzFeMl8TzIsVlTftRbq4uQMRGNGxiF 35UYEhnNiAOZwquiP3WWSff+ihvQO693DQpVXqlXPgFWxpZSnC0wV9uSxXzBLXMoI7Tm 6JjnaEmpGVCC+k65OMmKM8ZL2CnfnWFgscUp8= MIME-Version: 1.0 Received: by 10.223.144.74 with SMTP id y10mr984427fau.18.1265279553497; Thu, 04 Feb 2010 02:32:33 -0800 (PST) In-Reply-To: <20100130000108.GB95021@stack.nl> References: <20100130000108.GB95021@stack.nl> From: cronfy Date: Thu, 4 Feb 2010 13:32:13 +0300 Message-ID: To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Unique process id (not pid) and accounting daemon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 10:32:35 -0000 Hello, >> I am trying to create an accounting daemon that would be more precise >> than usual BSD system accounting. It should read the whole process >> tree from time to time (say, every 10 seconds) and log changes in >> usage of CPU, I/O operations and memory per process. >> There is a problem: it is not always possible to link a process in a >> process tree against matching process in an accounting file. Only >> command name, user/group id =A0and start time will match... > Have you looked at audit(4)? Yes, but I did not see how it can help to measure cpu usage/io operations for long running processes and to sync between process list and accounting file. --=20 // cronfy From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 11:55:14 2010 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 65490106566B for ; Thu, 4 Feb 2010 11:55:14 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id E4AC08FC0A for ; Thu, 4 Feb 2010 11:55:13 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so542674eye.9 for ; Thu, 04 Feb 2010 03:55:12 -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:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=oC9a/L9kmgReURWjFWFXrJiGOi0ZiYzZV5LDZbQRCPA=; b=uw08Mqn4NQgsjYMxBVnugrGq7hmVnFT1JlOZjjBE1xULXMbD5S8/UiQbTYIE3BbrF3 8TMPbM8Isj/5EL+H//SfvI/m0hLFJaIFYbj16XAjbfgIM3SZpuEU33AO/atx3XcY55gb 0XsM08mCSOhRcXejOiN4YsKQGBmO7/rqerxRg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=F2g6pmgIeyuahKJA/lg/2o6zfQWvocoI5cuemEgn0d0IfD+OCGS7e1l9ZhE9fSmblo 6cg+JpB4cqWrEImUULYrGXfzWzmoviP6GKMiCQ0/4r2LbDMNieT5kFijE7iEVzTTP5H1 hHttUFheRkMaoda+ZAgyFn6K3jwdgPV8EtTq0= Received: by 10.213.44.17 with SMTP id y17mr3421734ebe.25.1265284512807; Thu, 04 Feb 2010 03:55:12 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 14sm26546ewy.11.2010.02.04.03.55.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 03:55:11 -0800 (PST) Date: Thu, 4 Feb 2010 13:55:06 +0200 From: Gleb Kurtsou To: Xin LI , Ed Schouten Message-ID: <20100204115505.GA5272@tops.skynet.lt> References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 11:55:14 -0000 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On (25/02/2009 17:24), Mel wrote: > Hi, > > attached is a small patch to add threshold support to du(1). I've been using > it on 7-STABLE machines for a while, cause I got tired of the noise I get > when sorting and then reformatting to human-readable. Especially since > sorting isn't part of the equasion "I'd like to see all dirs exceeding a > given size". > I've not updated the manpage on -STABLE yet, should be the same as HEAD. > > Example usage: > # du -xht 20m . > 29M ./contrib/binutils > 52M ./contrib/gcc > 237M ./contrib > 35M ./crypto > 28M ./lib > 20M ./share > 55M ./sys/dev > 139M ./sys > 545M . > > I'll file a PR for it, if there's no objections to this feature / > implementation, the style(9) or the usage of -t. > -- > Mel Hi, I've cleaned up original patch: * fixed style and some bugs * as suggested changed it to use expand_number * implemented support for negative threshold values I find the patch very useful. Does it look ok to be commited, or should I file a PR so it won't get lost once again. Example usage: src/sys/crypto % du -ht 100k 137K ./des 482K . src/sys/crypto % du -A -ht +100k 129K ./des 446K . src/sys/crypto % du -ht -100k 56K ./camellia 11K ./salsa20 38K ./sha2 9.0K ./rc4 68K ./des/arch/i386 70K ./des/arch 88K ./rijndael 37K ./via 8.0K ./hmac 36K ./blowfish/arch/i386 37K ./blowfish/arch 85K ./blowfish --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="du-threshold.path.txt" diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 index af2ff84..b0e1748 100644 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -42,7 +42,7 @@ .Nm .Op Fl A .Op Fl H | L | P -.Op Fl a | s | d Ar depth +.Op Fl a | s | d Ar depth | t Ar threshold .Op Fl c .Op Fl l .Op Fl h | k | m | B Ar blocksize @@ -107,6 +107,14 @@ This option exists solely for conformance with Display an entry for each specified file. (Equivalent to .Fl d Li 0 ) +.It Fl t Ar threshold +Display only entries for which size exceeds +.Ar threshold . +If +.Ar threshold +is negative, display only entries for which size is less then absolute +value of +.Ar threshold . .It Fl d Ar depth Display an entry for all files and directories .Ar depth diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 63677f5..ff62c5b 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -90,6 +90,7 @@ main(int argc, char *argv[]) FTS *fts; FTSENT *p; off_t savednumber, curblocks; + int64_t threshold, threshold_sign; int ftsoptions; int listall; int depth; @@ -106,12 +107,14 @@ main(int argc, char *argv[]) save = argv; ftsoptions = 0; savednumber = 0; + threshold = 0; + threshold_sign = 1; cblocksize = DEV_BSIZE; blocksize = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1) switch (ch) { case 'A': Aflag = 1; @@ -179,6 +182,14 @@ main(int argc, char *argv[]) break; case 'r': /* Compatibility. */ break; + case 't' : + if (expand_number(optarg, &threshold) != 0 || + threshold == 0) { + warnx("invalid threshold: %s", optarg); + usage(); + } else if (threshold < 0) + threshold_sign = -1; + break; case 'x': ftsoptions |= FTS_XDEV; break; @@ -248,6 +259,10 @@ main(int argc, char *argv[]) blocksize /= DEV_BSIZE; } + if (threshold != 0) + threshold = howmany(threshold / DEV_BSIZE * cblocksize, + blocksize); + rval = 0; (void)signal(SIGINFO, siginfo); @@ -271,7 +286,9 @@ main(int argc, char *argv[]) p->fts_parent->fts_bignum += p->fts_bignum += curblocks; - if (p->fts_level <= depth) { + if (p->fts_level <= depth && threshold <= + threshold_sign * howmany(p->fts_bignum * + cblocksize, blocksize)) { if (hflag) { prthumanval(p->fts_bignum); (void)printf("\t%s\n", p->fts_path); --xHFwDpU9dbj6ez1V-- From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 10:09:49 2010 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 5F3721065672; Thu, 4 Feb 2010 10:09:49 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (lefty.soaustin.net [66.135.55.46]) by mx1.freebsd.org (Postfix) with ESMTP id 2C38F8FC1A; Thu, 4 Feb 2010 10:09:48 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 86F008C060; Thu, 4 Feb 2010 04:09:48 -0600 (CST) Date: Thu, 4 Feb 2010 04:09:48 -0600 From: Mark Linimon To: tyler@monkeypox.org Message-ID: <20100204100948.GA11167@lonesome.com> References: <20100117213049.GA2259@kiwi.sharlinx.com> <877hr9ltym.fsf@kobe.laptop> <20100201072150.GD30608@kiwi.sharlinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100201072150.GD30608@kiwi.sharlinx.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Mailman-Approved-At: Thu, 04 Feb 2010 12:35:14 +0000 Cc: freebsd-hackers@freebsd.org, Giorgos Keramidas , freebsd-bugbusters@FreeBSD.org Subject: Re: Weekend PR smashing 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, 04 Feb 2010 10:09:49 -0000 [adding freebsd-bugbusters@ to the Cc:] I'm sorry I didn't respond to your earlier message. I am currently way behind on tasks that I've already promised people. The KDE howto that you cited (http://quality.kde.org/develop/howto/howtobugs.php) is quite a good one. Our pr-guidelines document isn't as thorough. Part of the problem is that we don't have enough metadata in GNATS to capture some of the things that we would like bugbusters to do, e.g., as they suggest: - attempting to reproduce an 'unconfirmed' bug and change it to 'new' The closest that we have is the 'analyzed' state, which we have used in the past to indicate 'confirmed'. If you can indeed reproduce a bug, it's fair enough to let bugmeister@ know and we can change the state. Alternatively, you can submit a followup and suggest that. Several of the folks on the bugbusting team (e.g. people who have GNATS access) monitor the mailing lists and try to track followups. (I personally track bugs@, ports-bugs@, and a few of the others, but not some of the specialty ones like net@.) - check if a report is a duplicate Reports that are duplicates indicate that various users are being affected by one underlying problem. At one point I was trying to gather them all into a page. I was hoping more people would do the analysis and send me additions for it. However, it looks as though the script that generates that page has rotted. I'll re-add it to my list of things-to-do ... http://people.freebsd.org/~linimon/studies/prs/well_known_prs.html At this point it may be easier to look at the template that I grind up to produce that page: http://people.freebsd.org/~linimon/wellknown.prs It's clearly over a year stale, and could thus use a new set of eyes. - add '(regression)' to the title if indicated I think we've done a fairly good job of getting '[regression]' (our styling of the same idea) into the existing ones, and keeping up with new ones as they come in. Similarly, we've done pretty well with '[patch]' AFAIK. That's my reaction to some specifics on the the KDE page. Now for some more general comments. We have more kern/ PRs than any other category. This category is overloaded to mean both kernel, libraries, networking, and device drivers. http://people.freebsd.org/~linimon/studies/prs/pr_tag_index.html makes this much more tractable. (I have other ideas about how to do much better, but see below.) Whether or not existing PRs are still relevant seems to vary a bit by sub-category. There would also a slightly different way of looking at things, the ones with '[panic]' in the Synopsis. Hmm, I thought there was such a page, but it doesn't seem so. I'll put it on my list to create one. As for the bin/ PRs, you'd be surprised at how many of them are still relevant, even after several years. I've resisted the suggestion that others have made in the past just to close them for this reason. (In the past I have made an effort to contact submitters and ask them if they are still experiencing the problem, but portmgr duties have kept me away from that for a long time. This is something else where we need help.) The i386 and amd64 PRs are more likely to be "can't install/run on a particular piece of hardware", and generally require the most interaction with users to isolate the problem (e.g. to ACPI interacting badly with a buggy BIOS; irq problems; devices not being supported by our current drivers; and so forth.) To work with these people need to have a bit of experience with low-level debuggers and how to examine stack traces. > one of the things that concerns me is the sheer number of PRs with > patches that either have been committed without the PRs being updated Well, that's a task that needs more people working on. You can start by looking at: http://people.freebsd.org/~linimon/studies/prs/prs_possibly_committed.html which is PRs that have had followups appended to their Audit-Trail by the checkin scripts. If these changes have already been merged to all the relevant -stable branches, they should be closed; otherwise, if they are not already set to 'patched', then they should be, and assigned to the committer who made the change. > or the patches are simply sitting idly in PRs. There are certainly a large number of these. IWBNI we could get more of them into the 'analyzed' state to claim 'we think this patch might solve the problem'. > The list by the bugbusters waiting for committers to check them out > is pretty huge as well: Yes, I'm well aware of that, since I set it up :-) This goes to the more general problem that it's more fun to add new things than it is to fix existing things. FreeBSD has traditionally done much better at adding new features than in the more mundane maintenance work. This is a problem not just with FreeBSD or even open source projects in general, but all software. What's interesting is that this situation is slowly changing (again IMHO). Over the past year we have seen several people 'graduate' from being on the bugbusting team to having src commit bits. Slowly some of the PRs that fit the classical "user-annoyance" classification are being fixed. As more people start to do this, the more tractable the problem starts to seem, even for long-time committers who may have despaired over the state of the database over the years. (It is also worth mentioning that with the help of Remko, Gavin, and others, the Synopsis lines of the existing PRs are now much more likely to be useful and correct than even, say, two years ago; and thus, the data-harvesting pages I put up became possible.) Building up people's belief that the overall problem is tractable is a chicken-and-egg problem. Again, compared to where we were, a great deal of progress has been made, albeit slowly. > It's a little difficult to muster up too much motivation to fix issues when > the fixes will then sit waiting for committer review for months on end. My suggestion is to avoid looking at the overall number of PRs, and instead find things that interest you to work on. Are you interested in helping to triage existing PRs; or perhaps, in responding to new PRs that come in and work with users to try to narrow down the problem (especially useful for install/boot issues and regressions); or perhaps in one particular part of the system such as networking? Or perhaps the "overall user experience" things such as sysinstall? > Without annoying committers, is there any way I can help get patches > "through" and into the tree in less than a lunar cycle? ;) The only way that I have found so far is to create the specialized reports (both HTML and email) and try to publicize them. New ideas are welcome. Lastly, my (currently stalled) project to create a prototype for a new PR system tries to deal with some of the limitations of, and frustrations with, GNATS. For instance, see my presentation at BSDCan 2008: http://people.freebsd.org/~linimon/presentations/prs2008/ But I'll reiterate, the way to go (IMHO) is to pick one thing out of the "my suggestion" paragraph above that you think might be interested in, and start with that. I'll be happy to listen to any feedback you might have. mcl From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 12:10:05 2010 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 5D0E3106566C for ; Thu, 4 Feb 2010 12:10:05 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 1D61B8FC08 for ; Thu, 4 Feb 2010 12:10:01 +0000 (UTC) Received: by mail.0x20.net (Postfix, from userid 1002) id 8D78F3A581; Thu, 4 Feb 2010 13:10:00 +0100 (CET) Date: Thu, 4 Feb 2010 13:10:00 +0100 From: Lars Engels To: Eitan Adler Message-ID: <20100204121000.GV61667@e.0x20.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="APlYHCtpeOhspHkB" Content-Disposition: inline In-Reply-To: X-Editor: VIM - Vi IMproved 7.2 X-Operation-System: FreeBSD 5.5-RELEASE-p19 User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Thu, 04 Feb 2010 12:35:25 +0000 Cc: freebsd-hackers@freebsd.org, Jason Spiro Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 12:10:05 -0000 --APlYHCtpeOhspHkB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 04, 2010 at 12:01:26PM +0200, Eitan Adler wrote: > This patch hijacks pgrep's -l >=20 I'd like to paint the bikeshed with little -p's ;-) --APlYHCtpeOhspHkB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAktquRgACgkQKc512sD3afikKACgmftHe+OtSMxMNOXqNPWOi2id A2AAoLsBfGFEVZtJDEOWinD3YPXCMAC9 =PFOW -----END PGP SIGNATURE----- --APlYHCtpeOhspHkB-- From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 12:46:37 2010 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 3AF2A1065697; Thu, 4 Feb 2010 12:46:37 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id B649A8FC0A; Thu, 4 Feb 2010 12:46:36 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o14CkKtB012629; Thu, 4 Feb 2010 13:46:35 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o14CkK39012628; Thu, 4 Feb 2010 13:46:20 +0100 (CET) (envelope-from olli) Date: Thu, 4 Feb 2010 13:46:20 +0100 (CET) Message-Id: <201002041246.o14CkK39012628@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, wblock@wonkity.com, alexbestms@wwu.de, jkim@FreeBSD.ORG In-Reply-To: X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 04 Feb 2010 13:46:35 +0100 (CET) Cc: Subject: Re: Spin down HDD after disk sync or before power off 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, 04 Feb 2010 12:46:37 -0000 Warren Block wrote: > Oliver Fromme wrote: > > Alexander Best wrote: > > > imo this patch takes good care of the problem. would be nice to > > > have it in HEAD. > > > > No -- *Please* make sure that the disks are only spun down > > upon an actual power-off command (i.e. when reboot() is > > called with the RB_POWEROFF flag). In all other cases the > > disks should keep running. It's not good to have the disks > > spin down and then immediately spin up again on every > > reboot. > > Could you elaborate a little on why that's bad? It seems like it would > be similar to a standby/resume action. While notebook disks are usually optimized to handle a high number of start/stop cycles, this isn't true for normal desktop or server disks, especially ones that are meant for continuous operation (24/7). This varies greatly between vendors and models, though. The point is that I defintitely wouldn't want to waste a start/stop cycle when it's not necessary. Also, it would be nice to have a way to disable the STANDBY command alltogether for people who don't want it. This could easily be implemented with a sysctl. > Are there any other device drivers that differentiate the reboot and > poweroff actions that could be used as inspiration or simply shamelessly > copied in modifying ata-disk? I'm sorry, I don't know. If the ad_shutdown() function doesn't have easy access to the boot "howto" variable, maybe the information could be stored in a kenv variable? Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd I suggested holding a "Python Object Oriented Programming Seminar", but the acronym was unpopular. -- Joseph Strout From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 13:46:07 2010 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 AD34B1065676 for ; Thu, 4 Feb 2010 13:46:07 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mx1.freebsd.org (Postfix) with ESMTP id 58AC48FC16 for ; Thu, 4 Feb 2010 13:46:07 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKS2rPnsAVIXYuQZrj6RL7sF9Q4L7W37eh@postini.com; Thu, 04 Feb 2010 05:46:07 PST Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.1.393.1; Thu, 4 Feb 2010 05:32:35 -0800 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Thu, 4 Feb 2010 08:32:34 -0500 From: Andrew Duane To: Warren Block , Erich Dollansky Date: Thu, 4 Feb 2010 08:28:39 -0500 Thread-Topic: Spin down HDD after disk sync or before power off Thread-Index: AcqlTER3spR7xSv3SjqFFTvwXEyKoQAUbG+V Message-ID: References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> <201002041009.05222.erich@alogreentechnologies.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-hackers@freebsd.org" Subject: RE: Spin down HDD after disk sync or before power off 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, 04 Feb 2010 13:46:07 -0000 ________________________________________ From: owner-freebsd-hackers@freebsd.org [owner-freebsd-hackers@freebsd.org]= On Behalf Of Warren Block [wblock@wonkity.com] Sent: Wednesday, February 03, 2010 7:43 PM To: Erich Dollansky Cc: freebsd-hackers@freebsd.org Subject: Re: Spin down HDD after disk sync or before power off On Thu, 4 Feb 2010, Erich Dollansky wrote: > In case of a reboot, it is already known when the command is given that t= he machine will restart without being powered of. > > If you spin-down the disk, you lose one start cycle. > > It is not that important but if it can be done with just one if, please, = just do it. AFAICT ad_shutdown can't tell whether it's called for a reboot or a poweroff, it's just told to "shut down". So maybe it's one if, but it's somewhere above ata-disk.c but below reboot(RB_POWEROFF). -Warren Block * Rapid City, South Dakota USA ________________________________________ You can register for a shutdown even that *does* get to know the "howto" va= riable; we do this quite a bit on some of our platforms that need special h= andling at power-off versus halt. extern void jsrxnle_poweroff_devices(void *junk, int howto); /* Registering power-off handler to be called at the system shutdown */ EVENTHANDLER_REGISTER(shutdown_final, jsrxnle_poweroff_devices, NULL, S= HUTDOWN_PRI_LAST + 10); The howto argument can be checked for RB_POWEROFF: if (howto & RB_POWEROFF) { /* Spin Down */ } -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 16:02:31 2010 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 A63361065693 for ; Thu, 4 Feb 2010 16:02:31 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5998FC0A for ; Thu, 4 Feb 2010 16:02:30 +0000 (UTC) Received: by fxm25 with SMTP id 25so651417fxm.34 for ; Thu, 04 Feb 2010 08:02:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=H12YKGnBZgyXMmMh294lNI6kBSExMW/Ywr5BzDXWFlo=; b=UWudRtMLPeCcNSM0MMDD3ZwKJSV5+0FIwLKxa2kAVF5xAD7DTfcin8qr/RAWHYeJi3 tX6Ob3ii3fImi3tEJ3IGPNiVF0PH0wZ41QKmr/njmzlsScfzAE8N+Zmtz2GTK7N5Gbxw SrffECZkrWYgGFAuPDqcjzBuCkGlUH4BtmXQQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=Cs2s4MNg1MBTEFyj8+0w6zh0YhOVuML1w9Fb9lun4rtJ42C2lx1VGaNbeYkNjTDRSQ ENePr1It2SioIE5xqf9UG+uqEQySBZVVYY/ia2SGuP5naD3x9udQq/ZD43Dm/6rdH7KN 2lpLcqzu1nV8EHsgL79uq31OipAu/2fV2b7G4= Received: by 10.223.6.89 with SMTP id 25mr1301499fay.89.1265299349943; Thu, 04 Feb 2010 08:02:29 -0800 (PST) Received: from ppp-21.223.dialinfree.com (ppp-21.223.dialinfree.com [209.172.21.223]) by mx.google.com with ESMTPS id 16sm129801fxm.8.2010.02.04.08.02.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 08:02:28 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 11:01:57 -0500 From: jhell To: Eitan Adler In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD Hackers , Jason Spiro Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 16:02:31 -0000 On Thu, 4 Feb 2010 05:01, eitanadlerlist@ wrote: > This patch hijacks pgrep's -l > [cut] This particular section of the patch should probably be left out until its worked over in a way that it does not print the info message if a process has been found and killed already. if (!didAction && !pgrep) { printf("No matching processes belonging to you were found\n"); } Thanks for the re-patch, quick and resourceful... ;) -- jhell From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 16:04:35 2010 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 07852106566C for ; Thu, 4 Feb 2010 16:04:35 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mx1.freebsd.org (Postfix) with ESMTP id 82C1F8FC0A for ; Thu, 4 Feb 2010 16:04:34 +0000 (UTC) Received: by fxm25 with SMTP id 25so653787fxm.34 for ; Thu, 04 Feb 2010 08:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=OWWOPXcc/ALpKxAt83tMm+xzy0LPmCCenXGx/cFLMwY=; b=sLv0LLUh33+DTKI8CNacb6D7Y+HQ6Kmkx8kn5e8NYjItWp7U+P/cnPrl+BRaiYcbdN i7C4/swFAGoG0tEXpnd0ykDMjezfVG/TJFDaUkR+xqsjRCQsICS/GDFMrYvWtvUd+MZR mf9YS1/t5SM2HJ2M1ikZZMdDzibswA3xLk8Ms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=nBup5N0mY7mhuY3FtaQ6kEK95v6B0s7w17dV1bl+rksBVxhCyRqblS8Vb4lio/U4Nu J/ATUiCaGN7qHcn+gyZtssjUMfYI3RP9nUzOXY2Be9wUr929dqkuwJsjw3hb/CKAMI8o WdhjVoD9hMd6wHGZZyZO9ow8BDRj438GiPkZY= Received: by 10.223.77.85 with SMTP id f21mr182972fak.40.1265299473662; Thu, 04 Feb 2010 08:04:33 -0800 (PST) Received: from ppp-21.223.dialinfree.com (ppp-21.223.dialinfree.com [209.172.21.223]) by mx.google.com with ESMTPS id 14sm129272fxm.15.2010.02.04.08.04.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 08:04:32 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 11:04:03 -0500 From: jhell To: Lars Engels In-Reply-To: <20100204121000.GV61667@e.0x20.net> Message-ID: References: <20100204121000.GV61667@e.0x20.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Eitan Adler , Jason Spiro Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 16:04:35 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 4 Feb 2010 07:10, lars.engels@ wrote: > On Thu, Feb 04, 2010 at 12:01:26PM +0200, Eitan Adler wrote: >> This patch hijacks pgrep's -l >> > > I'd like to paint the bikeshed with little -p's ;-) > If it is a bikeshed then maybe we should make it '-bs' but then again you might just confuse that for 'bullshit'. - -- jhell -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLau/6AAoJEJBXh4mJ2FR+wbYIAJ6Aw9iMCsdNDVFxyksDWxXH iJoSDE3MRC7IUCR/y8CpCfJxKVuXmoIALoMZXE1v8b9SOAyaSydnMcOTd7b6bvEg LMh1hC3KsHp84lWgzu2fra9BBSWQXFkeb1vgunWjwYbV1AM2XnTKJ1eGlWvVK2Pt BxovnoZhOStiSolTUPPhSDcRjHhkZ0906PfvbX2/oWv/qFonXt7aI3t0rj5Y4anF +TcmtCFIvxgvu7LwPriO+0M5Ud99bqMX4UZSeLMTukWZ96tS9KTisfxliZmixG0H OrBzo4IudUr6HLGvZDClhT6RJtlheeUv88GbGCXtOJg5tmH+IpsQD0+e8t09uGo= =HFpu -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 15:24:01 2010 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 7981A10656A7 for ; Thu, 4 Feb 2010 15:24:01 +0000 (UTC) (envelope-from stefan.midjich@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 07E578FC14 for ; Thu, 4 Feb 2010 15:24:00 +0000 (UTC) Received: by ewy3 with SMTP id 3so468218ewy.13 for ; Thu, 04 Feb 2010 07:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=T9OC2teHN/MS9x4fu8v9lqMYwko15xKZ+eIXqX1b+9U=; b=FX/F7Xx834ptKuE99gY79jkrWi66y8bL0TnC5vMD5WLyYIq6ngW54Xng5KuAoOm+c4 NMCHcXm1kCpsXA1NByjzJRde9gZ/Dst3fd3lYuDHuv2DRUmI8+KVRLPsAD1eUO7tyBYl Iav/Q48BtRz1yuzho8jJL0qK7JWHbh1EJVHOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=m7U0HRF1VWr0jfHUnTdpuNi6jP/XBJflQ5A364rBrcPhvlNRlsFkzMsvcplHvrjN63 bpSoZdZNbA5yFUtEIh+NPE9KXyyqVCDdXCF2c6D2tIMOxTm0j2zMZlqwiLZaxFT6fseT Rnvg1EjqmY5qIHX//BuESa8dSkGghehGWeSoA= MIME-Version: 1.0 Received: by 10.213.1.18 with SMTP id 18mr3786418ebd.17.1265297039880; Thu, 04 Feb 2010 07:23:59 -0800 (PST) In-Reply-To: <201002031657.47714.dmw@coder.cl> References: <201002031024.03835.dmw@coder.cl> <20100203141618.GA32485@zlo.nu> <201002031657.47714.dmw@coder.cl> Date: Thu, 4 Feb 2010 16:23:59 +0100 Message-ID: From: Stefan Midjich To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Thu, 04 Feb 2010 16:43:40 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Does getc(3) use the read(2) syscall? 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, 04 Feb 2010 15:24:01 -0000 Thank you all for your wonderful replies! I should have known it was a macro, thank you. Very informative help from you Oliver. 2010/2/3 Daniel Molina Wegener > On Wednesday 03 February 2010, > Marc Olzheim wrote: > > > On Wed, Feb 03, 2010 at 10:23:50AM -0300, Daniel Molina Wegener wrote: > > > > I'm having trouble looking this function up in the source tree, the > > > > trail seems to end at __sys_read which has a bunch of prototypes bu= t > i > > > > can't find the actual function code. > > > > > > Well, you can try cscope --- IMO the best option to > > > search for symbols in the source tree. Also you have > > > well done front-ends like cbrowser, codelite and emacs > > > plus cscope mode. > > > > Works wonders in vim as well. :-) > > Sure, vim supports cscope since 2000 and possibly before that, > indeed vim was my first programming editor in FreeBSD and Linux. > Then I've learned emcas, and now I use both editors --- the first > available on the machine that I'm working on --- also emacs requires > a lot of configurations, but is my primary editor on my FreeBSD > boxes. > > > > > > > So my question is primarily, does getc use the read system call > > > > eventually? > > > > > > No, certainly not. Take a look on stdio.h and libc > > > implementation on lib/libc/stdio/getc.c. Mainly on the > > > __sgetc(f) macro. > > > > If you follow macros long enough, you'll find that it obviously does us= e > > the read system call. read, readv, pread, preadv are basicly the system > > calls through which all normal reads take place. > > That's right, but cscope or even etags should help a lot > finding those simbols, most for large source trees like > the FreeBSD base system ;) > > > > > Marc > > > > Best regards, > -- > Daniel Molina Wegener > Software Architect, System Programmer & Web Developer > Phone: +1 (510) 629-4267 | Blog: http://coder.cl/ > --=20 Med v=E4nliga h=E4lsningar / With kind regards Stefan Midjich http://swehack.se/cv https://www.swehack.se/cv From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 16:52:04 2010 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 310B2106568D for ; Thu, 4 Feb 2010 16:52:04 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mx1.freebsd.org (Postfix) with ESMTP id A59EA8FC26 for ; Thu, 4 Feb 2010 16:52:03 +0000 (UTC) Received: by fxm25 with SMTP id 25so709041fxm.34 for ; Thu, 04 Feb 2010 08:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type:content-id; bh=WbbIng1kHHd1MNRAauynKpmAe/MN4s3j2mj5nyfmi4k=; b=Sran/D/5zC1yMRV7XxZy16HGOTQHz9Rug1iRpUyWmYsU/pcMhZwxpFe74UdN/i7ZUM IybG4BRri0uWgfC7zIMkLOve3nG5D9CBjt17osRTEB3A1rdblZ2BRgndYn5A4P0MkLBT 8XU9tCHfhO82o7nF3M3WC8gpuuhJAvAdQiC34= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type:content-id; b=QDgYpI+GSh0S3kAHHNNmqzSZZ/7i/iBkRHfNeH6yK/WwqafRnAJj1whnsMyLCUDFPd Y0bBHysNXeQDjv2+WL1Y0inUR9V6BYRIiHS8ay+OFFSVY+YfdvYQrfnn5/BRzvAILcbh JQhtRdfZOhmvxP3Hu0V32x6cb1F+sOt5D7Yq8= Received: by 10.87.21.22 with SMTP id y22mr2559364fgi.52.1265302322523; Thu, 04 Feb 2010 08:52:02 -0800 (PST) Received: from centel.dataix.local (ppp-21.210.dialinfree.com [209.172.21.210]) by mx.google.com with ESMTPS id d6sm3441959fga.29.2010.02.04.08.51.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 08:51:54 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 11:51:14 -0500 From: jhell To: Eitan Adler In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1091451658-1141520619-1265302016=:27763" Content-ID: Cc: FreeBSD Hackers , Jason Spiro Subject: Re: [RFC] [patch] pkill verbose option 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, 04 Feb 2010 16:52:04 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1091451658-1141520619-1265302016=:27763 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Content-ID: On Thu, 4 Feb 2010 11:01, jhell@ wrote: > > On Thu, 4 Feb 2010 05:01, eitanadlerlist@ wrote: >> This patch hijacks pgrep's -l >> > [cut] > > This particular section of the patch should probably be left out until its > worked over in a way that it does not print the info message if a process has > been found and killed already. > > if (!didAction && !pgrep) > { > printf("No matching processes belonging to you were found\n"); > } > > > Thanks for the re-patch, quick and resourceful... ;) > > The attached patch is for stable/7 and does not have the above printf for no matching processes. It also cleans up the formatting a little following the rest of the code and adds the -l flag to the usage statement. This is only the patch for pkill itself and not for the manual page. ;-) - -- jhell -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLavsEAAoJEJBXh4mJ2FR+WMwH/1FQY4+FV5xLd6Lg2xgjcbG0 ptDjfr5EdIowWeE2EckcmkZGHZa6Z9WL3zcgOHBfJbsm7pchKUoAjzihlk2iW76u yBHknDs0Wysv7g0y2nA5sDmjAzzJV8xF8W7aGps+eRJYp1dSDQh9h5zRLAKqZXQ+ hmc43ZUOTYsOoMdPcHJUm48og5Q7IiVeh4B7T6PeMaFdolwW8wGwJuXjOzRw4+UH A6g+bBctFNrLIxj6eb39oxhIXoDv7unwM+JONJKJvtKWOmbVD22VVYSMeNKSOeqX 9SelPiwdBj9ulJfTuRmrpfuPw/J7CpkrIwKsifPqP3DYuKQ8qLiBO/jRJwLNkpA= =PD/9 -----END PGP SIGNATURE----- --1091451658-1141520619-1265302016=:27763 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=pkill.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME=pkill.patch SW5kZXg6IHBraWxsLmMNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBw a2lsbC5jCShyZXZpc2lvbiAxOTM2MjcpDQorKysgcGtpbGwuYwkod29ya2lu ZyBjb3B5KQ0KQEAgLTE4Miw3ICsxODIsNyBAQA0KIAlwaWRmaWxlbG9jayA9 IDA7DQogCWV4ZWNmID0gY29yZWYgPSBfUEFUSF9ERVZOVUxMOw0KIA0KLQl3 aGlsZSAoKGNoID0gZ2V0b3B0KGFyZ2MsIGFyZ3YsICJERjpHOklMTTpOOlA6 U1U6YWQ6Zmc6aWo6bG5vczp0OnU6dngiKSkgIT0gLTEpDQorCXdoaWxlICgo Y2ggPSBnZXRvcHQoYXJnYywgYXJndiwgIkRGOkc6SUxNOk46UDpTVTphZDpm ZzppbGo6bG5vczp0OnU6dngiKSkgIT0gLTEpDQogCQlzd2l0Y2ggKGNoKSB7 DQogCQljYXNlICdEJzoNCiAJCQlkZWJ1Z19vcHQrKzsNCkBAIC0yNDUsOCAr MjQ1LDYgQEANCiAJCQljcml0ZXJpYSA9IDE7DQogCQkJYnJlYWs7DQogCQlj YXNlICdsJzoNCi0JCQlpZiAoIXBncmVwKQ0KLQkJCQl1c2FnZSgpOw0KIAkJ CWxvbmdmbXQgPSAxOw0KIAkJCWJyZWFrOw0KIAkJY2FzZSAnbic6DQpAQCAt NTI4LDEwICs1MjYsMTUgQEANCiAJLyoNCiAJICogVGFrZSB0aGUgYXBwcm9w cmlhdGUgYWN0aW9uIGZvciBlYWNoIG1hdGNoZWQgcHJvY2VzcywgaWYgYW55 Lg0KIAkgKi8NCisJaW50IGRpZEFjdGlvbiA9IDA7DQogCWZvciAoaSA9IDAs IHJ2ID0gMCwga3AgPSBwbGlzdDsgaSA8IG5wcm9jOyBpKyssIGtwKyspIHsN CiAJCWlmIChQU0tJUChrcCkpDQogCQkJY29udGludWU7DQogCQlpZiAoc2Vs ZWN0ZWRbaV0pIHsNCisJCQlpZiAobG9uZ2ZtdCkgew0KKwkJCQlkaWRBY3Rp b24gPSAxOw0KKwkJCQlwcmludGYoImtpbGwgLSVkICVkXG4iLHNpZ251bSxr cC0+a2lfcGlkKTsNCisJCQl9DQogCQkJaWYgKGludmVyc2UpDQogCQkJCWNv bnRpbnVlOw0KIAkJfSBlbHNlIGlmICghaW52ZXJzZSkNCkBAIC01NTAsNyAr NTUzLDcgQEANCiAJaWYgKHBncmVwKQ0KIAkJdXN0ciA9ICJbLUxTZmlsbm92 eF0gWy1kIGRlbGltXSI7DQogCWVsc2UNCi0JCXVzdHIgPSAiWy1zaWduYWxd IFstSUxmaW5vdnhdIjsNCisJCXVzdHIgPSAiWy1zaWduYWxdIFstSUxmaWxu b3Z4XSI7DQogDQogCWZwcmludGYoc3RkZXJyLA0KIAkJInVzYWdlOiAlcyAl cyBbLUYgcGlkZmlsZV0gWy1HIGdpZF0gWy1NIGNvcmVdIFstTiBzeXN0ZW1d XG4iDQo= --1091451658-1141520619-1265302016=:27763-- From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 20:40:36 2010 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 1B7EE1065676 for ; Thu, 4 Feb 2010 20:40:36 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id E17FB8FC1D for ; Thu, 4 Feb 2010 20:40:35 +0000 (UTC) Received: from [172.31.193.10] (rrcs-98-101-145-84.midsouth.biz.rr.com [98.101.145.84]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id o14KeYnv019492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Feb 2010 15:40:35 -0500 (EST) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu o14KeYnv019492 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1265316035; bh=Btz2gXB0w1yjt3Z2+qilAIfJOUpHsbIT4NmtXCMYmUE=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=g/ncvKUd3jdOYjVv5irtZQQbnrtSdqAXxSBj6egONc17rw88qD1jhtzenVW8RLk15 COBM/U/7HmhKKUSoq07r1IqfgqOqUfr+Lqdjxl4Zqgqxxv5/Tj8vCfVxj51fB6EIHE ZBmgrhPgGG5xBaUDWyZAlKwhOZjByijPKLOMeVFs= Message-ID: <4B6B30BC.7030107@cs.duke.edu> Date: Thu, 04 Feb 2010 15:40:28 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: devfs panic w/INVARIANTS 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, 04 Feb 2010 20:40:36 -0000 I've got a commercial driver that uses device cloning. At unload time, the driver calls clone_cleanup(). When I unload the driver when the kernel is built with INVARIANTS, I'll see a panic in devfs_populate_loop(). This happens in 6-stable, as well as 8-stable. From what I can see the clone has been freed, but it remains on the devfs cdevp_list. Then the next time devfs_populate_loop() is called, it trips over the bad entry (cdp->cdp_dirents points to 0xdeadc0dedeadc0de) See appended kgdb session. If I trace the code path, it looks like clone_cleanup() calls destroy_devl(). And destroy_devl() will eventually call devfs_free() if the si_refcnt is zero. But I don't see anything which will get the cdev removed from the cdevp_list prior to it being freed. The only code I see which will get the cdev removed from the cdevp_list() seems to be the "GC any lingering devices" block in devfs_populate_loop What am I missing? Thanks, Drew Fatal trap 9: general protection fault while in kernel mode cpuid = 1; apic id = 01 instruction pointer = 0x8:0xffffffff803e8780 stack pointer = 0x10:0xffffffffade623b0 frame pointer = 0x10:0xffffffffade62400 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 896 (ps) Dumping 510 MB (2 chunks) Dumping 510 MB (2 chunks) Dumping 510 MB (2 chunks) chunk 0: 1MB (156 pages) ... ok chunk 1: 510MB (130528 pages) 494 478 462 446 430 414 398 382 366 350 334 318 302 286 270 254 238 222 206 190 174 158 142 126 110 94 78 62 46 30 14 #0 doadump () at pcpu.h:172 172 __asm __volatile("movq %%gs:0,%0" : "=r" (td)); (kgdb) bt #0 doadump () at pcpu.h:172 #1 0xffffffff801b8d91 in db_fncall (dummy1=0, dummy2=0, dummy3=0, dummy4=0x0) at ../../../ddb/db_command.c:493 #2 0xffffffff801b91e5 in db_command_loop () at ../../../ddb/db_command.c:408 #3 0xffffffff801bb0ed in db_trap (type=-1377427040, code=0) at ../../../ddb/db_main.c:222 #4 0xffffffff80468b99 in kdb_trap (type=9, code=0, tf=0xffffffffade62300) at ../../../kern/subr_kdb.c:473 #5 0xffffffff806c5d14 in trap_fatal (frame=0xffffffffade62300, eva=18446742974557577824) at ../../../amd64/amd64/trap.c:660 #6 0xffffffff806c62eb in trap (frame= {tf_rdi = -2136471632, tf_rsi = -2136471656, tf_rdx = -2401050962867404578, tf_rcx = 1, tf_r8 = -2136471624, tf_r9 = -1099151973792, tf_rax = 0, tf_rbx = -1099307447040, tf_rbp = -1377426432, tf_r10 = 0, tf_r11 = 4, tf_r12 = 0, tf_r13 = -1099086652928, tf_r14 = -1099307447040, tf_r15 = 86032452, tf_trapno = 9, tf_addr = 0, tf_flags = -2143029088, tf_err = 0, tf_rip = -2143385728, tf_cs = 8, tf_rflags = 66071, tf_rsp = -1377426496, tf_ss = 16}) at ../../../amd64/amd64/trap.c:470 #7 0xffffffff806ad84b in calltrap () at ../../../amd64/amd64/exception.S:168 #8 0xffffffff803e8780 in devfs_populate_loop (dm=0xffffff000c2b8d00, cleanup=0) at ../../../fs/devfs/devfs_devs.c:370 #9 0xffffffff803e8beb in devfs_populate (dm=0xffffff000c2b8d00) at ../../../fs/devfs/devfs_devs.c:486 #10 0xffffffff803eafab in devfs_lookup (ap=0x0) at ../../../fs/devfs/devfs_vnops.c:587 #11 0xffffffff80724a2e in VOP_LOOKUP_APV (vop=0xffffffff80948600, a=0xffffffffade62630) at vnode_if.c:99 #12 0xffffffff804aadb2 in lookup (ndp=0xffffffffade629c0) at vnode_if.h:56 #13 0xffffffff804abb66 in namei (ndp=0xffffffffade629c0) at ../../../kern/vfs_lookup.c:216 #14 0xffffffff804c1be2 in vn_open_cred (ndp=0xffffffffade629c0, flagp=0xffffffffade6290c, cmode=0, cred=0xffffff000009ac00, fdidx=3) at ../../../kern/vfs_vnops.c:183 #15 0xffffffff804b8d64 in kern_open (td=0xffffff00156fe260, path=0xffffffff mode=373490024) at ../../../kern/vfs_syscalls.c:1016 #16 0xffffffff804b9455 in open (td=0xffffffff80a807b0, uap=0xffffffffade62bc0) at ../../../kern/vfs_syscalls.c:971 #17 0xffffffff806c6b52 in syscall (frame= {tf_rdi = 4218321, tf_rsi = 0, tf_rdx = 0, tf_rcx = 0, tf_r8 = 140737488348272, tf_r9 = 0, tf_rax = 5, tf_rbx = 5300224, tf_rbp = 4218321, tf_r10 = 0, tf_r11 = 5300224, tf_r12 = 4218321, tf_r13 = 0, tf_r14 = 140737488348272, tf_r15 = 6, tf_trapno = 12, tf_addr = 5300224, tf_flags = 0, tf_err = 2, tf_rip = 34369309420, tf_cs = 43, tf_rflags = 514, tf_rsp = 140737488347528, tf_ss = 35}) at ../../../amd64/amd64/trap.c:807 #18 0xffffffff806ada48 in Xfast_syscall () at ../../../amd64/amd64/exception.S:287 #19 0x0000000800920aec in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) frame 7 #7 0xffffffff806ad84b in calltrap () at ../../../amd64/amd64/exception.S:168 168 call trap Current language: auto; currently asm (kgdb) up #8 0xffffffff803e8780 in devfs_populate_loop (dm=0xffffff000c2b8d00, cleanup=0) at ../../../fs/devfs/devfs_devs.c:370 370 if ((cleanup || !(cdp->cdp_flags & CDP_ACTIVE)) && Current language: auto; currently c (kgdb) p cdp $1 = (struct cdev_priv *) 0xffffff0019549a00 (kgdb) p *cdp $2 = {cdp_c = {si_priv = 0xdeadc0dedeadc0de, si_flags = 3735929054, si_atime = {tv_sec = -2401050962867404578, tv_nsec = -2401050962867404578}, si_ctime = {tv_sec = -2401050962867404578, tv_nsec = -2401050962867404578}, si_mtime = {tv_sec = -2401050962867404578, tv_nsec = -2401050962867404578}, si_uid = 3735929054, si_gid = 3735929054, si_mode = 49374, si_cred = 0xdeadc0dedeadc0de, si_drv0 = 3735929054, si_refcount = -559038242, si_list = { le_next = 0xdeadc0dedeadc0de, le_prev = 0xdeadc0dedeadc0de}, si_clone = {le_next = 0xdeadc0dedeadc0de, le_prev = 0xdeadc0dedeadc0de}, si_children = {lh_first = 0xdeadc0dedeadc0de}, si_siblings = { le_next = 0xdeadc0dedeadc0de, le_prev = 0xdeadc0dedeadc0de}, si_parent = 0xdeadc0dedeadc0de, si_name = 0xdeadc0dedeadc0de
, si_drv1 = 0xdeadc0dedeadc0de, si_drv2 = 0xdeadc0dedeadc0de, si_devsw = 0xdeadc0dedeadc0de, si_iosize_max = -559038242, ade629c0 "Ñ]@", pathseg=343718984, flags=1, From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 00:32:25 2010 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 9C623106566B; Fri, 5 Feb 2010 00:32:25 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from EXHUB015-4.exch015.msoutlookonline.net (exhub015-4.exch015.msoutlookonline.net [207.5.72.96]) by mx1.freebsd.org (Postfix) with ESMTP id 86B578FC13; Fri, 5 Feb 2010 00:32:25 +0000 (UTC) Received: from philip.hq.rws (174.79.184.239) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.2.176.0; Thu, 4 Feb 2010 16:22:19 -0800 Message-ID: <4B6B64BA.9020803@p6m7g8.com> Date: Fri, 5 Feb 2010 00:22:18 +0000 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Thunderbird 2.0.0.23 (X11/20091208) MIME-Version: 1.0 To: Mark Linimon References: <20100117213049.GA2259@kiwi.sharlinx.com> <877hr9ltym.fsf@kobe.laptop> <20100201072150.GD30608@kiwi.sharlinx.com> <20100204100948.GA11167@lonesome.com> In-Reply-To: <20100204100948.GA11167@lonesome.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: tyler@monkeypox.org, freebsd-bugbusters@freebsd.org, Giorgos Keramidas , freebsd-hackers@freebsd.org Subject: Re: Weekend PR smashing 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, 05 Feb 2010 00:32:25 -0000 Mark Linimon wrote: > [adding freebsd-bugbusters@ to the Cc:] > http://people.freebsd.org/~linimon/studies/prs/well_known_prs.html You also might find the following script that wraps all of Mark's work a tiny bit a little better to get a lot of information on one page. I use it for ports but should translate over to src quite well. http://people.freebsd.org/~pgollucci/myprs.pl.txt which in its current state makes this http://people.freebsd.org/~pgollucci/myprs.html -- ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 02:31:15 2010 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 68E98106566B for ; Fri, 5 Feb 2010 02:31:15 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 135C48FC1A for ; Fri, 5 Feb 2010 02:31:14 +0000 (UTC) Received: by vws11 with SMTP id 11so1486750vws.13 for ; Thu, 04 Feb 2010 18:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=+cgoX9ubAbl+4DiqQY+2T8WzJORfCRVaAimD2CBJfwo=; b=JgZP4o5EosYKD5HjGg1EGp+4ZtPFdlXZCzjnGXVVdMt7sXHT/4jNxWHRnts9Mpzme2 gRoRg7YvroJeBqSTqHXx7tdNn3QuiTTdv9UYQlxCqljR4wEmQVJIlGYI0g4tKmHcVYHV 4laRPJjIKdjxfAjIi/t/rrS0QTMLZC8jmawH0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=Rc2PUphIpkH03lZiHn8Z6JJabOF5fMwo3ft3GoHbtwX8ZNPQ2f6fz97PP/UmxihLqJ 6Nr7FK13Iak4N0cLltOEl0Vz8ykUf7hJfF3B/jjl8UTIPv6FxpE0yGHOHtT8QtKJi9zY uKxHQcPa2XOnZ1CWVwLSokxnx+WEEN4j/jFao= Received: by 10.220.124.106 with SMTP id t42mr3587060vcr.92.1265337074194; Thu, 04 Feb 2010 18:31:14 -0800 (PST) Received: from centel.dataix.local (ppp-23.227.dialinfree.com [209.172.23.227]) by mx.google.com with ESMTPS id 42sm6757090vws.12.2010.02.04.18.31.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 18:31:12 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 21:30:59 -0500 From: jhell To: Gleb Kurtsou In-Reply-To: <20100204115505.GA5272@tops.skynet.lt> Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Ed Schouten , eitanadlerlist@gmail.com, Xin LI , jasonspiro4@gmail.com, FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 02:31:15 -0000 On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > On (25/02/2009 17:24), Mel wrote: >> Hi, >> >> attached is a small patch to add threshold support to du(1). I've been using >> it on 7-STABLE machines for a while, cause I got tired of the noise I get >> when sorting and then reformatting to human-readable. Especially since >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a >> given size". >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. >> >> Example usage: >> # du -xht 20m . >> 29M ./contrib/binutils >> 52M ./contrib/gcc >> 237M ./contrib >> 35M ./crypto >> 28M ./lib >> 20M ./share >> 55M ./sys/dev >> 139M ./sys >> 545M . >> >> I'll file a PR for it, if there's no objections to this feature / >> implementation, the style(9) or the usage of -t. >> -- >> Mel > > Hi, > > I've cleaned up original patch: > * fixed style and some bugs > * as suggested changed it to use expand_number > * implemented support for negative threshold values > > I find the patch very useful. Does it look ok to be commited, or should > I file a PR so it won't get lost once again. > > Example usage: > src/sys/crypto % du -ht 100k > 137K ./des > 482K . > src/sys/crypto % du -A -ht +100k > 129K ./des > 446K . > src/sys/crypto % du -ht -100k > 56K ./camellia > 11K ./salsa20 > 38K ./sha2 > 9.0K ./rc4 > 68K ./des/arch/i386 > 70K ./des/arch > 88K ./rijndael > 37K ./via > 8.0K ./hmac > 36K ./blowfish/arch/i386 > 37K ./blowfish/arch > 85K ./blowfish > > I like it!. This certainly reduces some piping but as long as it is not integrated upstream it will only become more of a responsibility on FreeBSD's behalf to maintain it. If someone has the original authors email address I would say lets include him on this and see what he thinks. This would probably be the same for the pkill thread that I am involved in to. CC'ing responsible party for that thread. Best regards. This message was supposed to arrive 9 hours ago but there was some ISP problems that prevented me from sending it. -- jhell From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 03:55:30 2010 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 A55361065695 for ; Fri, 5 Feb 2010 03:55:30 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f190.google.com (mail-qy0-f190.google.com [209.85.221.190]) by mx1.freebsd.org (Postfix) with ESMTP id 54F8E8FC14 for ; Fri, 5 Feb 2010 03:55:29 +0000 (UTC) Received: by qyk28 with SMTP id 28so1585047qyk.25 for ; Thu, 04 Feb 2010 19:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=WEeZjmpku2MVehQ1s/aY4JhLjU1MaGKqX1iKrS7VUYw=; b=NCHEOJt1xsMlkwXG/w1B6d+6RcHJ14oWvZ5xaTCNuAsmwVsY7WjXVl4EwBzfiqdrI6 HVCuUjHocg357SnK5pE1BDwM3YyRaQihF3kLJXZpRD3d7Tzp4oc243xBpSgDuXnijphY vH10jZRvQvUMidtpggXu3MoRVZ1Ku0OoNGHVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=tXWyOGZHpZCh4u3S0CUn2IpMPwco9ZydfoywNNnya/mwOTyqbBCprghWleCInrLioc um7xNht8TE94jN506Cg5+EPcZdeMFLejI6+IkXZmr0UN42qgs9WPhGDsYLiIFoao5APN OOn6V1L3TcF2h22YYeVNGPQkuG0h1FoI1PrzQ= Received: by 10.224.72.96 with SMTP id l32mr691443qaj.127.1265342129503; Thu, 04 Feb 2010 19:55:29 -0800 (PST) Received: from centel.dataix.local (ppp-21.112.dialinfree.com [209.172.21.112]) by mx.google.com with ESMTPS id 5sm2860142qwg.48.2010.02.04.19.55.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 19:55:28 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 22:55:21 -0500 From: jhell To: Gleb Kurtsou In-Reply-To: <20100204115505.GA5272@tops.skynet.lt> Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , Xin LI , freebsd-hackers@freebsd.org Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 03:55:30 -0000 On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > On (25/02/2009 17:24), Mel wrote: >> Hi, >> >> attached is a small patch to add threshold support to du(1). I've been using >> it on 7-STABLE machines for a while, cause I got tired of the noise I get >> when sorting and then reformatting to human-readable. Especially since >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a >> given size". >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. >> >> Example usage: >> # du -xht 20m . >> 29M ./contrib/binutils >> 52M ./contrib/gcc >> 237M ./contrib >> 35M ./crypto >> 28M ./lib >> 20M ./share >> 55M ./sys/dev >> 139M ./sys >> 545M . >> >> I'll file a PR for it, if there's no objections to this feature / >> implementation, the style(9) or the usage of -t. >> -- >> Mel > > Hi, > > I've cleaned up original patch: > * fixed style and some bugs > * as suggested changed it to use expand_number > * implemented support for negative threshold values > > I find the patch very useful. Does it look ok to be commited, or should > I file a PR so it won't get lost once again. > > Example usage: > src/sys/crypto % du -ht 100k > 137K ./des > 482K . > src/sys/crypto % du -A -ht +100k > 129K ./des > 446K . > src/sys/crypto % du -ht -100k > 56K ./camellia > 11K ./salsa20 > 38K ./sha2 > 9.0K ./rc4 > 68K ./des/arch/i386 > 70K ./des/arch > 88K ./rijndael > 37K ./via > 8.0K ./hmac > 36K ./blowfish/arch/i386 > 37K ./blowfish/arch > 85K ./blowfish > > I would recommend generating this patch as a unified diff or a svn or cvs diff whichever version you checked out your tree with. -- jhell From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 04:25:00 2010 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 00DD7106566C for ; Fri, 5 Feb 2010 04:25:00 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id A64F78FC12 for ; Fri, 5 Feb 2010 04:24:59 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so377982qwd.7 for ; Thu, 04 Feb 2010 20:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=1uep3KX5X3nSlFcyJHNzUNJx2j08OBcJQAOMi8TnmYM=; b=IyrOY09st2xMfwGtqPSKafWbkzVprNP+6HPfFpnTOHCdzQUiB0EChWNi6r1ppPItvB HHHnWwXfq0DKkOXlv02yJQGF9JhVW6OdRQl8Q42Ev32bm3+TbVpHnv4O0X6glIjW9FK6 1ZlXvSWaI5adY4iE1ZSdYFMvP2vSOAAxtInoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=rUME8IXQSq8bmqjdVaXn69aYh/OLajk2dpAay3cP+dTHUIB0y7S57cubCHkQxnpn1E Ydvuw4q/VgZiLith4hbImBzwNZzPhlv6eN3Q0NeEuvuhDKfWtlIbJLh861UkFQ1BxAC7 t+vV2a0zWqA8KnbJVib/CXU3kut6ZwsGivln0= Received: by 10.224.54.198 with SMTP id r6mr115863qag.383.1265343898903; Thu, 04 Feb 2010 20:24:58 -0800 (PST) Received: from centel.dataix.local (ppp-21.112.dialinfree.com [209.172.21.112]) by mx.google.com with ESMTPS id 5sm3080463qwg.58.2010.02.04.20.24.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 20:24:57 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 23:24:51 -0500 From: jhell To: Gleb Kurtsou In-Reply-To: <20100204115505.GA5272@tops.skynet.lt> Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , Xin LI , FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 04:25:00 -0000 On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > On (25/02/2009 17:24), Mel wrote: >> Hi, >> >> attached is a small patch to add threshold support to du(1). I've been using >> it on 7-STABLE machines for a while, cause I got tired of the noise I get >> when sorting and then reformatting to human-readable. Especially since >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a >> given size". >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. >> >> Example usage: >> # du -xht 20m . >> 29M ./contrib/binutils >> 52M ./contrib/gcc >> 237M ./contrib >> 35M ./crypto >> 28M ./lib >> 20M ./share >> 55M ./sys/dev >> 139M ./sys >> 545M . >> >> I'll file a PR for it, if there's no objections to this feature / >> implementation, the style(9) or the usage of -t. >> -- >> Mel > > Hi, > > I've cleaned up original patch: > * fixed style and some bugs > * as suggested changed it to use expand_number > * implemented support for negative threshold values > > I find the patch very useful. Does it look ok to be commited, or should > I file a PR so it won't get lost once again. > > Example usage: > src/sys/crypto % du -ht 100k > 137K ./des > 482K . > src/sys/crypto % du -A -ht +100k > 129K ./des > 446K . > src/sys/crypto % du -ht -100k > 56K ./camellia > 11K ./salsa20 > 38K ./sha2 > 9.0K ./rc4 > 68K ./des/arch/i386 > 70K ./des/arch > 88K ./rijndael > 37K ./via > 8.0K ./hmac > 36K ./blowfish/arch/i386 > 37K ./blowfish/arch > 85K ./blowfish > Also not to be picky but I can see this being raised in another email at a later time. For Each du -ht +1.5{M,G,T,P} Would be something nice to compliment this so you do not have to revert back to say "1440k" when wanting to say 1.5m and so on for larger sizes. Also I think to be fully supportive it should have the capability to do at the least -N bits & +-N bytes. Thanks for the work that you have done on this. -- jhell From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 04:36:27 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 822D6106566C for ; Fri, 5 Feb 2010 04:36:27 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id 472678FC14 for ; Fri, 5 Feb 2010 04:36:27 +0000 (UTC) Received: by pxi13 with SMTP id 13so632873pxi.3 for ; Thu, 04 Feb 2010 20:36:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Y96FKBvefmiia90rqGi9NZaH1u1GSa3AgwMSx74i9po=; b=dpIU4XVzWLK0PYupMA/F8PYkZ8le3Tf/cQMR1oPvxKo7/dhNT1TUZQmQDCXSaMAr5D OJz547BDMqvHz/4Id6c2/HIwMK4LcyHpbc7Hpo0hNj/TkqZ5ka87pcH85gY4zeX8YOql OCharpa32CnAOmGu88V1hKASyLOienHgvtF2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=B48keY/rRCS3kDzc/iclfTJmYBNsskRHfozxfRbDC4YW1PFTUtj0eiJmQwvvrnbyim 3OpVGq3q/CwrKee+xGRpJtkpnuoAxVqV3u1K8CHCRakJ9Z6rBAiMcal+aZxm305i4sE3 K5WyByZI4qopfiPEwT5SLLnTamT4zB6tvnz8c= MIME-Version: 1.0 Received: by 10.142.151.35 with SMTP id y35mr1335237wfd.310.1265344586725; Thu, 04 Feb 2010 20:36:26 -0800 (PST) Date: Thu, 4 Feb 2010 20:36:26 -0800 Message-ID: <7d6fde3d1002042036g66fedfcbsd56c712eadb39178@mail.gmail.com> From: Garrett Cooper To: FreeBSD-Hackers Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: pmake .ORDER bug with -j 1 or misuse? 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, 05 Feb 2010 04:36:27 -0000 Hi hackers, I'm getting used to pmake after using GNU make for the past couple years, and I'm used to `in-order prerequisites', where if I specified a list of targets a specific way, then it would execute the targets serially in-order. I tried to do the following with .ORDER, but it doesn't appear to be working as I expect it to: [gcooper@optimus /scratch]$ make do something [gcooper@optimus /scratch]$ cat BSDmakefile .ORDER: something do all: do something do something: @echo ${.TARGET} [gcooper@optimus /scratch]$ make -j 2 something do It does function as I expect it to via -j 2 (executes the `something', then `do' goals), but not with -j 1 -- could someone help me understand what behavior is correct so I can adjust my behavior and/or get a fix started? Thanks! -Garrett From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 04:51:42 2010 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 E036110656A4 for ; Fri, 5 Feb 2010 04:51:42 +0000 (UTC) (envelope-from jasonspiro@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id B4A9D8FC13 for ; Fri, 5 Feb 2010 04:51:42 +0000 (UTC) Received: by pxi13 with SMTP id 13so645466pxi.3 for ; Thu, 04 Feb 2010 20:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=6bnMIC/1Dc6DAjMTIq8zcbZKpA9T6vnW5lozeuek59w=; b=ID057HKFhOLSC1yAp1Vypt2zCfyfcPgo54Ivy6xDu22sz/A4ltf3IvGo84vbGQyQe5 3//v+sgFJRGsC45yBxBfK36C4D8poZnAn5cB7fofmlVZxnX6MnPT1pp7cZkcYW9vYkz9 zxZRfQZuHfuFj7m+xkVv4GtsGB9ZvUjSwgj+8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=KPimMwa3NxIrd/S4d6y1iCLeWIpumXt8POdoZLyMWFlMjXN9TDasnO2vODTX+hHhtN pRrbHP+2RhJm5K/tvL/h/eVla3cwj7ONbuVNjVfKHVpronLzpaBbdj78BW4+R8YU1d6B OPlLiOgv+x05DnxzXdPetIRbY3FBb7eCXkbKM= MIME-Version: 1.0 Sender: jasonspiro@gmail.com Received: by 10.141.107.19 with SMTP id j19mr1446934rvm.257.1265345502064; Thu, 04 Feb 2010 20:51:42 -0800 (PST) In-Reply-To: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> From: "Jason A. Spiro" Date: Thu, 4 Feb 2010 23:51:13 -0500 X-Google-Sender-Auth: 0ea4810b16f1ca22 Message-ID: To: jhell Content-Type: text/plain; charset=ISO-8859-1 Cc: Ed Schouten , Gleb Kurtsou , Xin LI , eitanadlerlist@gmail.com, FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 04:51:43 -0000 On Thu, Feb 4, 2010 at 9:30 PM, jhell wrote: > I like it!. It looks like a really useful option. Though if you really need to free up a lot of space, try a Freshmeat search[1] for [ disk usage ]. It reveals many tools that look even better, including ncdu[2] which doesn't require Xorg. But I doubt that any of them ship with FreeBSD by default. I think the du manpage[3]'s "SEE ALSO" section should be revised to include ncdu(1), xdiskusage(1), baobab(1), and kdirstat(1). (Baobab requires Gnome, and KDirStat requires KDE.) What do you think? > This certainly reduces some piping but as long as it is not > integrated upstream it will only become more of a responsibility on > FreeBSD's behalf to maintain it. If someone has the original authors email > address I would say lets include him on this and see what he thinks. > > This would probably be the same for the pkill thread that I am involved in > to. CC'ing responsible party for that thread. What do you mean? Do you mean that maintaining half a dozen lines of extra code added to pkill(1) would be a burden for the FreeBSD team? :) ^ [1]. http://freshmeat.net/search/?q=disk+usage ^ [2]. http://freshmeat.net/projects/ncdu ^ [3]. http://www.freebsd.org/cgi/man.cgi?query=du&manpath=FreeBSD+9.0-CURRENT From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 05:53:55 2010 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 ECAAB1065672 for ; Fri, 5 Feb 2010 05:53:55 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id C0F1C8FC17 for ; Fri, 5 Feb 2010 05:53:55 +0000 (UTC) Received: by pxi13 with SMTP id 13so694325pxi.3 for ; Thu, 04 Feb 2010 21:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xt+PLRhTmuMODJn5XTUezEoI/llp6BO1kaFOjFHO72c=; b=YabqUyzosg5txjk2AX/5WK4XRFYShwVl2GDctcHfu43YkzlsX/8ZWvenBY2Iuv1rNP hFbEhnKYqPgLvEC2ysYdw/jCMRHsqCEbJ0roazQwoB8VjaTb+S2S/eJQ3QTJW05vGMWO U+3h5gzRiCMmItk4KW65KVx1xvCLtHRBuZ7RI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=IozGRbPQ2WknYgPFS1aOVKkOxyNE7OU+i2WSFjir7vmDxbhWrqgVQbZV48qJN4bDt3 fvqgfuIMEhix/ncV/yLXY4h+5QwMtd2wB3g59uJZjIi5H/s1JaTWuawqTfeEmdLutwIM h72nwwoatGC+zr5LiP98rxT8go0ikxd/XWmV4= MIME-Version: 1.0 Received: by 10.142.250.19 with SMTP id x19mr1417353wfh.23.1265347902936; Thu, 04 Feb 2010 21:31:42 -0800 (PST) In-Reply-To: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> Date: Thu, 4 Feb 2010 21:31:42 -0800 Message-ID: <7d6fde3d1002042131i3eb08f22s86a1c94be0a563d@mail.gmail.com> From: Garrett Cooper To: "Jason A. Spiro" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: jhell , Gleb Kurtsou , Ed Schouten , FreeBSD Hackers , eitanadlerlist@gmail.com, Xin LI Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 05:53:56 -0000 On Thu, Feb 4, 2010 at 8:51 PM, Jason A. Spiro wrot= e: > On Thu, Feb 4, 2010 at 9:30 PM, jhell wrote: > >> I like it!. > > It looks like a really useful option. =A0Though if you really need to > free up a lot of space, try a Freshmeat search[1] for [ disk usage ]. > It reveals many tools that look even better, including ncdu[2] which > doesn't require Xorg. =A0But I doubt that any of them ship with FreeBSD > by default. > > I think the du manpage[3]'s "SEE ALSO" section should be revised to > include ncdu(1), xdiskusage(1), baobab(1), and kdirstat(1). =A0(Baobab > requires Gnome, and KDirStat requires KDE.) =A0What do you think? > >> This certainly reduces some piping but as long as it is not >> integrated upstream it will only become more of a responsibility on >> FreeBSD's behalf to maintain it. If someone has the original authors ema= il >> address I would say lets include him on this and see what he thinks. >> >> This would probably be the same for the pkill thread that I am involved = in >> to. CC'ing responsible party for that thread. > > What do you mean? =A0Do you mean that maintaining half a dozen lines of > extra code added to pkill(1) would be a burden for the FreeBSD team? > :) Shouldn't, but as I've learned before a few times -- it only takes one line of code to fubar a one man-rockfight (or screw up a system :)...)... Cheers, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 05:59:25 2010 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 2330D106566B for ; Fri, 5 Feb 2010 05:59:25 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C238D8FC15 for ; Fri, 5 Feb 2010 05:59:24 +0000 (UTC) Received: by vws11 with SMTP id 11so1555159vws.13 for ; Thu, 04 Feb 2010 21:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=vjADO+wtgGNBiCuMlbENcZ9wARCVyhrOBICHsXME7ig=; b=xuPKfBdNqoHF0Uk2+7uN8+FRioMo+lBrO60koJOItokruTp1H422aWQ9lzFrBmrfA4 oUCtVH8iq+9MH2/Na9sMWpDwzSxQe+LAl3oJG+RueOkjyQtIUUUVOvOhu39LEPFSE9wO XGpYOIHC3rO2+rP0ebXn1IoS7QyuwyJwVlTN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=SyEBRflzgJEn4AYeRZPbIiviQyde4UO9jiGMH10qy/DVoRvn+qnxw4qRGFnOz356Jj qKGJRVZS0ULuEYdG9SMbWhgBgSdDtvj+W+u8l58BN+9gnOfJuoFksGv5LDzI58aNIdk7 ScZCDfhU3l382lcnv0irDJ8dPGsYCiUO7CYIw= Received: by 10.220.122.169 with SMTP id l41mr4136973vcr.115.1265349562833; Thu, 04 Feb 2010 21:59:22 -0800 (PST) Received: from centel.dataix.local (ppp-21.177.dialinfree.com [209.172.21.177]) by mx.google.com with ESMTPS id 28sm8348520vws.1.2010.02.04.21.59.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 21:59:21 -0800 (PST) Sender: "J. Hellenthal" Date: Fri, 5 Feb 2010 00:59:06 -0500 From: jhell To: "Jason A. Spiro" In-Reply-To: Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , Gleb Kurtsou , Xin LI , eitanadlerlist@gmail.com, FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 05:59:25 -0000 On Thu, 4 Feb 2010 23:51, jasonspiro4@ wrote: > On Thu, Feb 4, 2010 at 9:30 PM, jhell wrote: > >> I like it!. > > It looks like a really useful option. Though if you really need to > free up a lot of space, try a Freshmeat search[1] for [ disk usage ]. > It reveals many tools that look even better, including ncdu[2] which > doesn't require Xorg. But I doubt that any of them ship with FreeBSD > by default. > > I think the du manpage[3]'s "SEE ALSO" section should be revised to > include ncdu(1), xdiskusage(1), baobab(1), and kdirstat(1). (Baobab > requires Gnome, and KDirStat requires KDE.) What do you think? > To me it is a annoyance when I see a man page reference something that is not already installed on the system especially if it does not reference a URL. Back end utilities should really only list their friends in see also and not friends of friends and their friends. ;) My favorite that can run on anything that can run java jre/jdk is sysutils/jdiskreport. Although certain WM's do not work well with java this is a very portable utility. >> This certainly reduces some piping but as long as it is not >> integrated upstream it will only become more of a responsibility on >> FreeBSD's behalf to maintain it. If someone has the original authors email >> address I would say lets include him on this and see what he thinks. >> >> This would probably be the same for the pkill thread that I am involved in >> to. CC'ing responsible party for that thread. > > What do you mean? Do you mean that maintaining half a dozen lines of > extra code added to pkill(1) would be a burden for the FreeBSD team? > :) > Yeah. I am more of a lean practitioner so I try to always look for the best way or if you will the least hands on way of managing things. In this case the less code that has to be merged upon update the better and more time that is available to developers to work on much needed other tasks. Five minutes not opening a editor and merging code could better be used getting a cup of coffee to stay awake while hacking on ZFS or utmpx rather than pkill or du. ;) > ^ [1]. http://freshmeat.net/search/?q=disk+usage > ^ [2]. http://freshmeat.net/projects/ncdu > ^ [3]. http://www.freebsd.org/cgi/man.cgi?query=du&manpath=FreeBSD+9.0-CURRENT > -- jhell From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 10:06:53 2010 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 31AAB106566B for ; Fri, 5 Feb 2010 10:06:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7945C8FC13 for ; Fri, 5 Feb 2010 10:06:51 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o15A6iJx002934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Feb 2010 12:06:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id o15A6il5003635; Fri, 5 Feb 2010 12:06:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o15A6hAR003634; Fri, 5 Feb 2010 12:06:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 5 Feb 2010 12:06:43 +0200 From: Kostik Belousov To: Andrew Gallatin Message-ID: <20100205100643.GQ15587@deviant.kiev.zoral.com.ua> References: <4B6B30BC.7030107@cs.duke.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U+NfgObvpQT1Q9Yq" Content-Disposition: inline In-Reply-To: <4B6B30BC.7030107@cs.duke.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org Subject: Re: devfs panic w/INVARIANTS 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, 05 Feb 2010 10:06:53 -0000 --U+NfgObvpQT1Q9Yq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 04, 2010 at 03:40:28PM -0500, Andrew Gallatin wrote: > I've got a commercial driver that uses device cloning. > At unload time, the driver calls clone_cleanup(). When I unload > the driver when the kernel is built with INVARIANTS, I'll see a > panic in devfs_populate_loop(). This happens in 6-stable, > as well as 8-stable. >=20 > From what I can see the clone has been freed, but it > remains on the devfs cdevp_list. Then the next time > devfs_populate_loop() is called, it trips over the bad > entry (cdp->cdp_dirents points to 0xdeadc0dedeadc0de) > See appended kgdb session. >=20 > If I trace the code path, it looks like clone_cleanup() > calls destroy_devl(). And destroy_devl() will eventually > call devfs_free() if the si_refcnt is zero. But I don't > see anything which will get the cdev removed from > the cdevp_list prior to it being freed. >=20 > The only code I see which will get the cdev removed from > the cdevp_list() seems to be the "GC any lingering devices" > block in devfs_populate_loop >=20 > What am I missing? You did not mentioned it, but my guess is that you create clones from the dev_clone event handler. Please note that devfs_lookup() that fires dev_clone event, consumes a device reference. Thus clone handlers shall do dev_ref(). Due to races with cleanup, you should use MAKEDEV_REF flag for make_dev_credv(9) KPI instead of doing make_dev()/dev_ref() pair. That said, do you really need clones at all ? --U+NfgObvpQT1Q9Yq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktr7bMACgkQC3+MBN1Mb4jGpgCg3IgMWZSS8Y5S5VoYdizbL5Zg 6xIAoLj2BoZxbjtThCVR+lG1uWtttqkk =i4F5 -----END PGP SIGNATURE----- --U+NfgObvpQT1Q9Yq-- From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 10:58:15 2010 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 C1CF11065676 for ; Fri, 5 Feb 2010 10:58:15 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 5050E8FC14 for ; Fri, 5 Feb 2010 10:58:14 +0000 (UTC) Received: by ewy3 with SMTP id 3so1354661ewy.13 for ; Fri, 05 Feb 2010 02:58:13 -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:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=D1RZYsRMHWIQmL0iOjy/v4nuu/qKwNCWFprjTq0x29w=; b=EWIWF0hKs0/sy3RuLv6j2zhbYVWTKxY2U4DIGc4yMw/SjriHnH6Z1qKaajVXaPNoDg T/lbyTaqTMlDA3tjkOXJfsQpP/pLh9PN8KKif50//TZwXdImD00FEpqC0TKqUHZa5Xxc ttP23UKL/n935DY6G0XB+qzMo9VlfQm1IiJ3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=DZ04evblfmkZ7KjQdfMITb7AqO8PhXAdfsGcMH+aNnIJjmGfnY2cVqA+Xigtnaej2R iTMOOSAG0lXEhQSl8UHZ5FFI1v6SCLdUxUaNDrDZLyCbaHERAUvayJMyplWTm/s93zU0 WQPjoziRRbSYNETL7OfbISGGP8KmnACwf9z+A= Received: by 10.213.100.161 with SMTP id y33mr1046877ebn.27.1265367493378; Fri, 05 Feb 2010 02:58:13 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 24sm4785932eyx.46.2010.02.05.02.58.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Feb 2010 02:58:12 -0800 (PST) Date: Fri, 5 Feb 2010 12:58:06 +0200 From: Gleb Kurtsou To: jhell Message-ID: <20100205105806.GB1786@tops.skynet.lt> References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Ed Schouten , Xin LI , FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 10:58:15 -0000 On (04/02/2010 23:24), jhell wrote: > > On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > > On (25/02/2009 17:24), Mel wrote: > >> Hi, > >> > >> attached is a small patch to add threshold support to du(1). I've been using > >> it on 7-STABLE machines for a while, cause I got tired of the noise I get > >> when sorting and then reformatting to human-readable. Especially since > >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a > >> given size". > >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. > >> > >> Example usage: > >> # du -xht 20m . > >> 29M ./contrib/binutils > >> 52M ./contrib/gcc > >> 237M ./contrib > >> 35M ./crypto > >> 28M ./lib > >> 20M ./share > >> 55M ./sys/dev > >> 139M ./sys > >> 545M . > >> > >> I'll file a PR for it, if there's no objections to this feature / > >> implementation, the style(9) or the usage of -t. > >> -- > >> Mel > > > > Hi, > > > > I've cleaned up original patch: > > * fixed style and some bugs > > * as suggested changed it to use expand_number > > * implemented support for negative threshold values > > > > I find the patch very useful. Does it look ok to be commited, or should > > I file a PR so it won't get lost once again. > > > > Example usage: > > src/sys/crypto % du -ht 100k > > 137K ./des > > 482K . > > src/sys/crypto % du -A -ht +100k > > 129K ./des > > 446K . > > src/sys/crypto % du -ht -100k > > 56K ./camellia > > 11K ./salsa20 > > 38K ./sha2 > > 9.0K ./rc4 > > 68K ./des/arch/i386 > > 70K ./des/arch > > 88K ./rijndael > > 37K ./via > > 8.0K ./hmac > > 36K ./blowfish/arch/i386 > > 37K ./blowfish/arch > > 85K ./blowfish > > > > > Also not to be picky but I can see this being raised in another email at a > later time. > > For Each > du -ht +1.5{M,G,T,P} > > Would be something nice to compliment this so you do not have to revert > back to say "1440k" when wanting to say 1.5m and so on for larger sizes. > > Also I think to be fully supportive it should have the capability to do at > the least -N bits & +-N bytes. Let's keep it simple, these features are are not hard to implement, but overcomplicate such simple utility as du(1). If one needs more sophisticated disk usage reporting he's likely to have 3rd party utils installed already. > Thanks for the work that you have done on this. > > -- > > jhell > From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 08:37:08 2010 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 0958E106568B; Fri, 5 Feb 2010 08:37:08 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (lefty.soaustin.net [66.135.55.46]) by mx1.freebsd.org (Postfix) with ESMTP id DDCEF8FC12; Fri, 5 Feb 2010 08:37:07 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 4A58D8C060; Fri, 5 Feb 2010 02:37:07 -0600 (CST) Date: Fri, 5 Feb 2010 02:37:07 -0600 From: Mark Linimon To: tyler@monkeypox.org Message-ID: <20100205083707.GA30463@lonesome.com> References: <20100117213049.GA2259@kiwi.sharlinx.com> <877hr9ltym.fsf@kobe.laptop> <20100201072150.GD30608@kiwi.sharlinx.com> <20100204100948.GA11167@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100204100948.GA11167@lonesome.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Mailman-Approved-At: Fri, 05 Feb 2010 12:34:21 +0000 Cc: freebsd-hackers@freebsd.org, Giorgos Keramidas , freebsd-bugbusters@FreeBSD.org Subject: Re: Weekend PR smashing 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, 05 Feb 2010 08:37:08 -0000 On Thu, Feb 04, 2010 at 04:09:48AM -0600, Mark Linimon wrote: > Reports that are duplicates indicate that various users are being affected > by one underlying problem. At one point I was trying to gather them all > into a page. I was hoping more people would do the analysis and send me > additions for it. However, it looks as though the script that generates > that page has rotted. I'll re-add it to my list of things-to-do ... > > http://people.freebsd.org/~linimon/studies/prs/well_known_prs.html This report is now fixed. > We have more kern/ PRs than any other category. This category is > overloaded to mean both kernel, libraries, networking, and device > drivers. http://people.freebsd.org/~linimon/studies/prs/pr_tag_index.html > makes this much more tractable. I forgot to mention the 2-level hierarchy that I have set up, where you can look at PRs starting with e.g. "disk/driver" and then drill down to a page that references all the related PRs by manpage. It may have been just as well, since the report had also gotten stale. However, it is once again up-to-date: http://people.freebsd.org/~linimon/studies/prs/prs_for_all_groups.html > There would also a slightly different way of looking at things, the ones > with '[panic]' in the Synopsis. Hmm, I thought there was such a page, > but it doesn't seem so. I'll put it on my list to create one. Now created: http://people.freebsd.org/~linimon/studies/prs/prs_for_tag_panic.html Finally, I have fixed other problems, such as broken links, in other various pages under http://people.freebsd.org/~linimon/studies/prs/ mcl From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 13:51:33 2010 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 03BE4106566B for ; Fri, 5 Feb 2010 13:51:33 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id B36C08FC14 for ; Fri, 5 Feb 2010 13:51:32 +0000 (UTC) Received: from [172.31.193.10] (rrcs-98-101-145-84.midsouth.biz.rr.com [98.101.145.84]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id o15DpVKY005825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Feb 2010 08:51:31 -0500 (EST) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu o15DpVKY005825 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1265377892; bh=/Df+diuvmun2N8mkk9vAyN6TU65gEBl9YXLPNQ6h0/w=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=C/X3VhKXLtaF5j1slLazLkZLrQiqyPGjLJjVA2PzyLWlicHFZTrtPQQBDblGOOBTP 5KHuHftO7IWJJBYRdDV/mYxIhhPIPNtpwTrzpmhJ4StriFS/bwwHKwUyv/m6G6DQ7A bYfdu3AdnG2GlC48bQ+Yos520U1wMwyVuQx5H9KA= Message-ID: <4B6C225D.3020306@cs.duke.edu> Date: Fri, 05 Feb 2010 08:51:25 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Kostik Belousov References: <4B6B30BC.7030107@cs.duke.edu> <20100205100643.GQ15587@deviant.kiev.zoral.com.ua> In-Reply-To: <20100205100643.GQ15587@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devfs panic w/INVARIANTS 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, 05 Feb 2010 13:51:33 -0000 Kostik Belousov wrote: > On Thu, Feb 04, 2010 at 03:40:28PM -0500, Andrew Gallatin wrote: >> I've got a commercial driver that uses device cloning. >> At unload time, the driver calls clone_cleanup(). When I unload >> the driver when the kernel is built with INVARIANTS, I'll see a >> panic in devfs_populate_loop(). This happens in 6-stable, >> as well as 8-stable. >> >> From what I can see the clone has been freed, but it >> remains on the devfs cdevp_list. Then the next time >> devfs_populate_loop() is called, it trips over the bad >> entry (cdp->cdp_dirents points to 0xdeadc0dedeadc0de) >> See appended kgdb session. >> >> If I trace the code path, it looks like clone_cleanup() >> calls destroy_devl(). And destroy_devl() will eventually >> call devfs_free() if the si_refcnt is zero. But I don't >> see anything which will get the cdev removed from >> the cdevp_list prior to it being freed. >> >> The only code I see which will get the cdev removed from >> the cdevp_list() seems to be the "GC any lingering devices" >> block in devfs_populate_loop >> >> What am I missing? > > You did not mentioned it, but my guess is that you create clones from > the dev_clone event handler. Please note that devfs_lookup() that fires Yes, I do. > dev_clone event, consumes a device reference. Thus clone handlers shall > do dev_ref(). > > Due to races with cleanup, you should use MAKEDEV_REF flag for > make_dev_credv(9) KPI instead of doing make_dev()/dev_ref() pair. I need to support FreeBSD going all the way back to 6, so that's not an option in some versions. But, I'm talking about device removal time. If I call clone_cleanup() where the clones have dev->si_refcount==1, then I get the use-after-free panic. If I hack things to elevate the reference count (such that dev->si_refcount==2 when clone_cleanup() is called), then I don't get the panic. Are you saying I should have been taking the extra reference via my dev_clone eventhandler? Won't having the extra reference lead to a memory leak? Or am I just mis-reading the code, and this will lead to things being freed normally? > That said, do you really need clones at all ? I need to support FreeBSD back to 6.x, and I need to support the linux-like model of opening the "same" /dev/node multiple times and getting unique handles. So I think I need clones. Thanks for the help! Drew From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 14:00:47 2010 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 AA7951065670 for ; Fri, 5 Feb 2010 14:00:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 218BF8FC23 for ; Fri, 5 Feb 2010 14:00:46 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o15E0dqm023260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Feb 2010 16:00:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id o15E0d3h070024; Fri, 5 Feb 2010 16:00:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o15E0di6070023; Fri, 5 Feb 2010 16:00:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 5 Feb 2010 16:00:38 +0200 From: Kostik Belousov To: Andrew Gallatin Message-ID: <20100205140038.GR15587@deviant.kiev.zoral.com.ua> References: <4B6B30BC.7030107@cs.duke.edu> <20100205100643.GQ15587@deviant.kiev.zoral.com.ua> <4B6C225D.3020306@cs.duke.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vIXBmblrD40XNCy4" Content-Disposition: inline In-Reply-To: <4B6C225D.3020306@cs.duke.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org Subject: Re: devfs panic w/INVARIANTS 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, 05 Feb 2010 14:00:47 -0000 --vIXBmblrD40XNCy4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 05, 2010 at 08:51:25AM -0500, Andrew Gallatin wrote: > Kostik Belousov wrote: > >On Thu, Feb 04, 2010 at 03:40:28PM -0500, Andrew Gallatin wrote: > >>I've got a commercial driver that uses device cloning. > >>At unload time, the driver calls clone_cleanup(). When I unload > >>the driver when the kernel is built with INVARIANTS, I'll see a > >>panic in devfs_populate_loop(). This happens in 6-stable, > >>as well as 8-stable. > >> > >>From what I can see the clone has been freed, but it > >>remains on the devfs cdevp_list. Then the next time > >>devfs_populate_loop() is called, it trips over the bad > >>entry (cdp->cdp_dirents points to 0xdeadc0dedeadc0de) > >>See appended kgdb session. > >> > >>If I trace the code path, it looks like clone_cleanup() > >>calls destroy_devl(). And destroy_devl() will eventually > >>call devfs_free() if the si_refcnt is zero. But I don't > >>see anything which will get the cdev removed from > >>the cdevp_list prior to it being freed. > >> > >>The only code I see which will get the cdev removed from > >>the cdevp_list() seems to be the "GC any lingering devices" > >>block in devfs_populate_loop > >> > >>What am I missing? > > > >You did not mentioned it, but my guess is that you create clones from > >the dev_clone event handler. Please note that devfs_lookup() that fires >=20 > Yes, I do. >=20 > >dev_clone event, consumes a device reference. Thus clone handlers shall > >do dev_ref(). > > > >Due to races with cleanup, you should use MAKEDEV_REF flag for > >make_dev_credv(9) KPI instead of doing make_dev()/dev_ref() pair. >=20 > I need to support FreeBSD going all the way back to 6, so that's not an > option in some versions. >=20 > But, I'm talking about device removal time. If I call clone_cleanup() > where the clones have dev->si_refcount=3D=3D1, then I get the use-after-f= ree > panic. If I hack things to elevate the reference count (such that > dev->si_refcount=3D=3D2 when clone_cleanup() is called), then I don't > get the panic. >=20 > Are you saying I should have been taking the extra reference > via my dev_clone eventhandler? Won't having the extra reference > lead to a memory leak? Or am I just mis-reading the code, and > this will lead to things being freed normally? Yes, clone handler shall do dev_ref(). Either by doing race-free make_dev_credf(MAKEDEV_REF) call, or by using dev_ref() after make_dev(). >=20 > >That said, do you really need clones at all ? >=20 > I need to support FreeBSD back to 6.x, and I need to support the > linux-like model of opening the "same" /dev/node multiple times > and getting unique handles. So I think I need clones. Wouldn't it be cleaner to use cdevpriv for the 7/8/HEAD where it is present ? And have special #ifdef-ed code for 6, that could be eventually dropped. --vIXBmblrD40XNCy4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktsJIYACgkQC3+MBN1Mb4gZxwCfUVGiWLuSHITnOqzaTVAKE8K3 oBgAn1PJj+NO92S5+md5KAVxQ8Pn1DPH =R2Ko -----END PGP SIGNATURE----- --vIXBmblrD40XNCy4-- From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 14:31:49 2010 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 AD992106566C for ; Fri, 5 Feb 2010 14:31:49 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE188FC36 for ; Fri, 5 Feb 2010 14:31:49 +0000 (UTC) Received: from [172.31.193.10] (rrcs-98-101-145-84.midsouth.biz.rr.com [98.101.145.84]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id o15EVmWe007864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Feb 2010 09:31:48 -0500 (EST) X-DKIM: Sendmail DKIM Filter v2.8.3 duke.cs.duke.edu o15EVmWe007864 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1265380309; bh=3WvF5yHGwNkBvaAsAHpgn23MW5YfCBVM0ogEfGdmPAQ=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=mB1V2cjQMZ+zrFxlivDfffRoO+v5f6p6WfjRTG1iVSvxZSfmJSVlJNRBfV4NuDv6U YkW7zUFHPoI7eqGk66V/71HVe4M7zr16v8W8WP2B6ZMCWMMxAyX4EY4cL3otDpWpod ktYzLQCGP/cOAqFukCYNUJdi3E82f1uHXkEE1cik= Message-ID: <4B6C2BCF.7090104@cs.duke.edu> Date: Fri, 05 Feb 2010 09:31:43 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Kostik Belousov References: <4B6B30BC.7030107@cs.duke.edu> <20100205100643.GQ15587@deviant.kiev.zoral.com.ua> <4B6C225D.3020306@cs.duke.edu> <20100205140038.GR15587@deviant.kiev.zoral.com.ua> In-Reply-To: <20100205140038.GR15587@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devfs panic w/INVARIANTS 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, 05 Feb 2010 14:31:49 -0000 Kostik Belousov wrote: > On Fri, Feb 05, 2010 at 08:51:25AM -0500, Andrew Gallatin wrote: >> Kostik Belousov wrote: >>> On Thu, Feb 04, 2010 at 03:40:28PM -0500, Andrew Gallatin wrote: >>>> I've got a commercial driver that uses device cloning. >>>> At unload time, the driver calls clone_cleanup(). When I unload >>>> the driver when the kernel is built with INVARIANTS, I'll see a >>>> panic in devfs_populate_loop(). This happens in 6-stable, >>>> as well as 8-stable. >>>> >>> >From what I can see the clone has been freed, but it >>>> remains on the devfs cdevp_list. Then the next time >>>> devfs_populate_loop() is called, it trips over the bad >>>> entry (cdp->cdp_dirents points to 0xdeadc0dedeadc0de) >>>> See appended kgdb session. >>>> >>>> If I trace the code path, it looks like clone_cleanup() >>>> calls destroy_devl(). And destroy_devl() will eventually >>>> call devfs_free() if the si_refcnt is zero. But I don't >>>> see anything which will get the cdev removed from >>>> the cdevp_list prior to it being freed. >>>> >>>> The only code I see which will get the cdev removed from >>>> the cdevp_list() seems to be the "GC any lingering devices" >>>> block in devfs_populate_loop >>>> >>>> What am I missing? >>> You did not mentioned it, but my guess is that you create clones from >>> the dev_clone event handler. Please note that devfs_lookup() that fires >> Yes, I do. >> >>> dev_clone event, consumes a device reference. Thus clone handlers shall >>> do dev_ref(). >>> >>> Due to races with cleanup, you should use MAKEDEV_REF flag for >>> make_dev_credv(9) KPI instead of doing make_dev()/dev_ref() pair. >> I need to support FreeBSD going all the way back to 6, so that's not an >> option in some versions. >> >> But, I'm talking about device removal time. If I call clone_cleanup() >> where the clones have dev->si_refcount==1, then I get the use-after-free >> panic. If I hack things to elevate the reference count (such that >> dev->si_refcount==2 when clone_cleanup() is called), then I don't >> get the panic. >> >> Are you saying I should have been taking the extra reference >> via my dev_clone eventhandler? Won't having the extra reference >> lead to a memory leak? Or am I just mis-reading the code, and >> this will lead to things being freed normally? > Yes, clone handler shall do dev_ref(). Either by doing race-free > make_dev_credf(MAKEDEV_REF) call, or by using dev_ref() after make_dev(). OK, cool. The man pages are handy. When I started this back in the FreeBSD 5 days, the man pages didn't exist :) >>> That said, do you really need clones at all ? >> I need to support FreeBSD back to 6.x, and I need to support the >> linux-like model of opening the "same" /dev/node multiple times >> and getting unique handles. So I think I need clones. > > Wouldn't it be cleaner to use cdevpriv for the 7/8/HEAD where it is > present ? And have special #ifdef-ed code for 6, that could be > eventually dropped. Yes, the cdevpriv() is a much cleaner interface. I'll probably add support for that soon. Thanks for the help, Drew From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 16:57:21 2010 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 424E6106566C for ; Fri, 5 Feb 2010 16:57:21 +0000 (UTC) (envelope-from linda.messerschmidt@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id D11378FC1A for ; Fri, 5 Feb 2010 16:57:20 +0000 (UTC) Received: by ewy3 with SMTP id 3so1716658ewy.13 for ; Fri, 05 Feb 2010 08:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=eqbz0w7pKI75xFLS3OiLFp5F10qAnXhGgpzhsb6Kz2M=; b=dKr9q+i7v+w8aDTCVHglaJxRP0/fKl19vtlLRqZRwQ+CWttUB9QJVQvwgeC0DV+NNX LDhhQDXmr0m7RZRNectlE+f+e5mmJc+U/6T+zHrzf82EdIpLqHq2k3m+b6CtSoRWG1ka frj1msqpq5bemJjtNeV8oJWF7akM4Ca1mxTYc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qnpU6hPA7aKkRTkBmX8hy1xPtQLyMe8EgkMyQtnauaEqDDutOt49BQ7Dx1m7zAk+jw 9ohnmoX1inxrrvRBF5nNggFUeNpRvEFFLncZ+dzpT1+bSzI1pJGlBWGA6hvJzaxDuPq7 2M1UvragWOdXmXCmc4OLLkdvujIsoBG4fpwZ0= MIME-Version: 1.0 Received: by 10.216.87.80 with SMTP id x58mr1618959wee.92.1265389039630; Fri, 05 Feb 2010 08:57:19 -0800 (PST) Date: Fri, 5 Feb 2010 11:57:19 -0500 Message-ID: <237c27101002050857r78003779mb41eae44f850829b@mail.gmail.com> From: Linda Messerschmidt To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: ps "time" field jumps backward 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, 05 Feb 2010 16:57:21 -0000 Hi all, For most of 7.2, on up to a 7.3-PRERELEASE built yesterday, I've noticed that the "time" field reported by ps and top jumps around for some processes. I've particularly noticed it with MySQL. Here are some repeated ps results (ps axo pid,time,wchan,comm) for the same process over a few minutes: 1647 0:08.06 ucond mysqld 1647 0:08.06 ucond mysqld 1647 0:08.06 ucond mysqld 1647 0:08.06 ucond mysqld 1647 0:08.07 ucond mysqld 1647 0:10.24 wdrain mysqld 1647 0:08.08 ucond mysqld 1647 0:09.25 - mysqld 1647 0:08.08 ucond mysqld 1647 0:08.91 - mysqld 1647 0:09.13 wdrain mysqld 1647 0:09.76 wdrain mysqld 1647 0:08.10 ucond mysqld 1647 0:08.11 ucond mysqld 1647 0:08.12 ucond mysqld 1647 0:08.12 ucond mysqld 1647 0:08.12 ucond mysqld 1647 0:08.12 ucond mysqld 1647 0:08.38 wdrain mysqld 1647 0:08.13 ucond mysqld 1647 0:09.47 - mysqld 1647 0:08.13 ucond mysqld 1647 0:08.13 ucond mysqld It's like when it starts working it builds up time, but as soon as it goes back to ucond, it resets back to the earlier value. This particular machine is an 8-core amd64, but I've seen it on quad-core i386 as well. Does anybody have an idea what's going on here? Thanks for any suggestions! From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 19:05:40 2010 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 E28701065679 for ; Fri, 5 Feb 2010 19:05:40 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 8140C8FC2B for ; Fri, 5 Feb 2010 19:05:40 +0000 (UTC) Received: from park.js.berklix.net (p549A7909.dip.t-dialin.net [84.154.121.9]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id o15J5aob020398; Fri, 5 Feb 2010 19:05:37 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id o15J5QBi083208; Fri, 5 Feb 2010 20:05:26 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id o15J5A2Z093692; Fri, 5 Feb 2010 20:05:16 +0100 (CET) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201002051905.o15J5A2Z093692@fire.js.berklix.net> To: Kirk McKusick , Christoph Kukulies , freebsd-hackers@freebsd.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Tue, 02 Feb 2010 23:36:21 +0100." Date: Fri, 05 Feb 2010 20:05:10 +0100 Sender: jhs@berklix.com Cc: Subject: Re: our little daemon abused as symbol of the evil 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, 05 Feb 2010 19:05:41 -0000 Hi Kirk, Christoph, Hackers, "Julian H. Stacey" wrote: > Kirk McKusick wrote: > > Thanks for the pointer. As you note, the damage (or benefit :-) is > > done. Still I have sent an email to the editor at Spiegel notifying > > them of my copyright in the hopes that they will at least ask in the > > future. > > > > Kirk McKusick > > Good idea. You might want to contact authors of that PDF paper too. > In case, as my browser still is fails on URL I posted earlier: > http://www.iseclab.org/papers/sonda-TR.pdf > I'll send you an off list copy of what I downloaded earlier > at 2nd Feb 18:14 TZ=GMT+01:00. National German TV (WDR was showing the BSD Daemon graphic in close up, as part of that PDF report, just now, about 19:10 GMT+02:00 Fri 5th Feb. They quoted http://www.aktuelle-stunde.de/ I clicked to http://www.wdr.de/tv/aks/sendungsbeitraege/2010/kw05/0205/angeklickt.jsp Big Browser is watching you! Freitag, 05. Februar 2010, 18.50 - 19.30 Uhr "Kein Versprecher, sondern wie es scheint, zunehmend ein Problem. Irgendwie wussten wir es ja schon immer: Wer sich viel in sozialen Netzwerken wie Facebook, SchuelerVZ, Xing, Stayfriends und Co. aufhält, der gibt so oder so schon eine Menge von und über sich preis, bewusst in der Regel. Aber wer hätte gedacht, dass man beim Ansteuern anderer Netzseiten zum gläsernen Surfer werden könnte? Genau das kann aber passieren, sagen Forscher in einer Studie. Wer sich viel in sozialen Netzwerken aufhält, muss damit rechnen, künftig beim Surfen erkannt zu werden. Jörg Schieb erklärt uns nun, was das bedeutet, wie das funktioniert und worum es eigentlich geht." "Haben Sie Fragen oder Anregungen? Dann schicken Sie uns eine E-Mail. angeklickt@wdr.de The BSD symbol was used IMO totaly out of all context on the TV clip. Though the Firefox symbol has more relevance. Kirk, you may want to remind the chaps in Wien/Vienna Uni who wrote the report, that the copyright on that symbol is yours, as report was written in English, no problem for you to do that. If you want to write the TV company: I'm British, I merely read German, don't write it well, There's numerous native German speakers on this list can translate to German much better than I ever could. I suspect this may be front edge of a wave, so it's perhaps worth trying to ensure the BSD daemon is not riding that wave. The more so, as if others realise this is about data harvesting, & there was another German court ruling about data harvesting recently http://www.berklix.com/~jhs/free/scam_fees.html BSD being seen with harvesting not so good. PS an undefended trade mark loses its right to further defence or some such, (I'm not a lawyer). > > =-=-=-= > > > > From: "Julian H. Stacey" > > Date: Tue, 02 Feb 2010 19:30:29 +0100 > > To: Christoph Kukulies > > Subject: Re: our little daemon abused as symbol of the evil > > Cc: freebsd-hackers@freebsd.org, Kirk McKusick > > Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany > > > > Christoph Kukulies wrote: > > > Look here: > > > > > > http://www.spiegel.de/fotostrecke/fotostrecke-51396-2.html > > > > ( Well spotted Christoph ! ) > > For those that don't read German, tracing back, > > Text article starts here > > http://www.spiegel.de/netzwelt/web/0,1518,675395,00.html > > > > That is in German, > > (some might like a translator web, eg http://babelfish.org ) > > I did read the german article (but skipped graphics). > > > > Key paragraph: > > Es ist ein Horrorszenario für Datenschützer, was Thorsten > > Holz, Gilbert Wondracek, Engin Kirda und Christopher Kruegel > > in ihrem 15-seitigen Aufsatz beschreiben ( PDF-Datei hier, > > 803 KB): Die Experten vom Isec-Forschungslabor für > > IT-Sicherheit, einer Kooperation der Technischen Universität > > Wien, dem Institute Eurcom und der University of California, > > dokumentieren einen technisch eher simplen Angriff, der > > eine seit zehn Jahren bekannte Sicherheitslücke ausnutzt. > > > > In key para there I could click & download > > sonda-TR.pdf > > (though now I can't seem to redownload > > http://www.iseclab.org/papers/sonda-TR.pdf ) > > A 15 page article in Engish. > > Page 4 uses the Firefox & BSD logos. > > > > I havent read that English [yet], but with it, any interested here > > can now read & form own opinions if it seems fair to use the Daemon > > logo, especially cc'd copyright holder of BSD daemon holder: > > Kirk McKusick > > > > IMO The German article by weekly magazine Spiegel.de didnt really seem > > to have anything to do with BSD, they just copied the graphics. > > > > Personaly my 2c: > > Initial reaction was I'd be a happier if a generic PC graphic had > > been used in the spiegel.de web, but maybe its the price of fame, > > I guess tests were done using BSD, & Spiegel thought it was nice > > colourful graphic. (Politicians never looked good on British TV > > Spitting Image programme, but they learnt it was better to look > > bad there, & be talked about, than not seen, not recognised & > > ignored). > > Cheers, > Julian > -- > Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com > Mail plain text not quoted-printable, HTML or Base64 http://www.asciiribbon.org Cheers, Julian -- Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text not quoted-printable, HTML or Base64 http://www.asciiribbon.org From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 19:19:43 2010 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 10897106566B for ; Fri, 5 Feb 2010 19:19:43 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id E2CBB8FC1B for ; Fri, 5 Feb 2010 19:19:42 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id o15JJd6s065664; Fri, 5 Feb 2010 11:19:39 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201002051919.o15JJd6s065664@chez.mckusick.com> To: "Julian H. Stacey" In-reply-to: <201002051905.o15J5A2Z093692@fire.js.berklix.net> Date: Fri, 05 Feb 2010 11:19:39 -0800 From: Kirk McKusick X-Mailman-Approved-At: Fri, 05 Feb 2010 20:22:33 +0000 Cc: freebsd-hackers@freebsd.org, Christoph Kukulies Subject: Re: our little daemon abused as symbol of the evil 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, 05 Feb 2010 19:19:43 -0000 I have gotten word from the authors that they are aware of the problem and are correcting it (e.g., taking out the daemon). Kirk McKusick =-=-=-= From: Engin Kirda Date: Wed, 3 Feb 2010 19:03:49 +0100 To: mckusick@mckusick.com Subject: BSD logo misuse Cc: Gilbert Wondracek , Thorsten Holz , Christopher Kruegel Kirk, I colleague from Symantec pointed out the discussion about the BSD logo that we have, apparently, misused in our paper without realizing that it was the BSD logo :-/ We'd like to apologize for this. It was not intentional. The PDF we put up is a technical report and we can easily correct this. We'll make sure that we do not use it in the camera-ready version of the published paper. Best regards, --Engin From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 21:28:45 2010 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 713FD106566B for ; Fri, 5 Feb 2010 21:28:45 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id 38E4F8FC13 for ; Fri, 5 Feb 2010 21:28:44 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o15LSfeG027729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 5 Feb 2010 15:28:41 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o15LSeBI005597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 5 Feb 2010 15:28:40 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o15LSeEk005595; Fri, 5 Feb 2010 15:28:40 -0600 (CST) (envelope-from dan) Date: Fri, 5 Feb 2010 15:28:40 -0600 From: Dan Nelson To: Linda Messerschmidt Message-ID: <20100205212837.GA43582@dan.emsphone.com> References: <237c27101002050857r78003779mb41eae44f850829b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <237c27101002050857r78003779mb41eae44f850829b@mail.gmail.com> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Fri, 05 Feb 2010 15:28:41 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-hackers@freebsd.org Subject: Re: ps "time" field jumps backward 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, 05 Feb 2010 21:28:45 -0000 In the last episode (Feb 05), Linda Messerschmidt said: > For most of 7.2, on up to a 7.3-PRERELEASE built yesterday, I've noticed > that the "time" field reported by ps and top jumps around for some > processes. I've particularly noticed it with MySQL. > > Here are some repeated ps results (ps axo pid,time,wchan,comm) for the > same process over a few minutes: > > 1647 0:08.06 ucond mysqld > 1647 0:08.06 ucond mysqld > 1647 0:08.06 ucond mysqld > 1647 0:08.06 ucond mysqld > 1647 0:08.07 ucond mysqld > 1647 0:10.24 wdrain mysqld > 1647 0:08.08 ucond mysqld > 1647 0:09.25 - mysqld > > It's like when it starts working it builds up time, but as soon as it > goes back to ucond, it resets back to the earlier value. By default, ps only lists one thread when listing threaded processes, and if it's anything like top, the CPU column seems to be randomly picked from one thread. Try running "ps axHo pid,lwp,time,wchan,comm" instead (add H and lwp). That will print the individual threads, plus the thread id so you can track them across runs. You should see one thread with a CPU value of "8.08" (or so), and other values for the rest. Ideally, top and ps would total up all the per-thread CPU counts when displaying the per-process numbers, but it doesn't seem to. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 22:45:03 2010 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 3ECAE106566B for ; Fri, 5 Feb 2010 22:45:03 +0000 (UTC) (envelope-from linda.messerschmidt@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id CB5818FC19 for ; Fri, 5 Feb 2010 22:45:02 +0000 (UTC) Received: by ewy3 with SMTP id 3so2056382ewy.13 for ; Fri, 05 Feb 2010 14:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=3KKe+gmkKPb5boj5UHPmJB2wovt7cQfpfsAyTd7RVP8=; b=ZPaVDD1CSiWkjR1n9VB0kWi6BEuyF7X9cgQG2E9FfdVPrbCpVyZCvVtbJCAN78hvOi O5DhGNJlq99A2djuMSU6u/8BYlkedR/OFS4RLYupTuWXABdKfSpDQDNraLRU62uK2mbx EpjLpaElmzzROGx6Wnpy1DZ+8V3F8dJoap4Rc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=LKBU2OYOmdqqCwH6r3osWMSVZCVrmwG9P/n+0cQ/anKUojI0mVysYGDIwltdpGdVAC FapZVraJUJ1vsp0n39m8tV/hDKwX84K4wsN/xzTBos1xYb/rvFKS9+7qtgtbGuFEoyKJ +w/61I8LSnSsrS1JgoIiy6hVFasXNtKD/mVtE= MIME-Version: 1.0 Received: by 10.216.86.11 with SMTP id v11mr1857875wee.220.1265409901626; Fri, 05 Feb 2010 14:45:01 -0800 (PST) In-Reply-To: <20100205212837.GA43582@dan.emsphone.com> References: <237c27101002050857r78003779mb41eae44f850829b@mail.gmail.com> <20100205212837.GA43582@dan.emsphone.com> Date: Fri, 5 Feb 2010 17:45:01 -0500 Message-ID: <237c27101002051445m3392115bhf8ed2ae61d56e0fa@mail.gmail.com> From: Linda Messerschmidt To: Dan Nelson Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: ps "time" field jumps backward 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, 05 Feb 2010 22:45:03 -0000 On Fri, Feb 5, 2010 at 4:28 PM, Dan Nelson wrote: > Ideally, top and ps would total up all > the per-thread CPU counts when displaying the per-process numbers, but it > doesn't seem to. It does seem to total them: $ ps axHo pid,lwp,time,wchan,comm | awk '$1 == 1647' 1647 100401 0:00.63 select mysqld 1647 100466 0:11.08 sigwai mysqld 1647 100521 0:00.00 ucond mysqld $ ps axo pid,lwp,time,wchan,comm | awk '$1 == 1647' 1647 100521 0:11.71 ucond mysqld But you put me on the right track. I ran both side by side for awhile, and found that ps/top only sums up those threads that haven't already exited. I.e., once a thread has exited, it's as if its usage never happened from the perspective of ps and top's total calculation. That seems like undesirable behavior, particularly if it conceals CPU-churning behavior by short-lived threads, but possibly very hard to change. :( I wonder if the system accounting records are more accurate? Thanks for pointing me in the right direction!