From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 10:13:28 2011 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 A485D106566B; Sun, 21 Aug 2011 10:13:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C26CB8FC15; Sun, 21 Aug 2011 10:13:27 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA19412; Sun, 21 Aug 2011 13:13:26 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Qv51x-0000qJ-K4; Sun, 21 Aug 2011 13:13:25 +0300 Message-ID: <4E50DA45.3010809@FreeBSD.org> Date: Sun, 21 Aug 2011 13:13:25 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110819 Thunderbird/6.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201107312128.29322.lobo@bsd.com.br> <201108011548.03059.jkim@FreeBSD.org> <4E370823.4000707@FreeBSD.org> <201108011706.14163.jkim@FreeBSD.org> In-Reply-To: <201108011706.14163.jkim@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: Phenom II 975 BE shows 0 celsius X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 10:13:28 -0000 on 02/08/2011 00:06 Jung-uk Kim said the following: > On Monday 01 August 2011 04:10 pm, Andriy Gapon wrote: >> on 01/08/2011 22:48 Jung-uk Kim said the following: >>> I have mixed feeling about this because I own a system with such >>> CPU/motherboard combo, too. I also believe it works well but >>> errata is errata. If vendor says we shouldn't use it, then we >>> shouldn't. In fact, I am just following Linux as an example here >>> but I have no problem with turning this into a warning message, >>> either. >> >> Let's cut a deal :-) >> If we start using amdtemp for fan control, emergency system >> shutdown or similar, then we follow the strict path. Until then, >> while we use amdtemp to amuse users with numbers, let's just print >> a warning :-) > > Okay, here is the new patch (not tested on the affected system yet): > > http://people.freebsd.org/~jkim/amdtemp2.diff Tested the patch - looks good! One comment though: it seems that sensor_offset defaults to zero now. Would it be a good idea to default it to what it previously used to be? On my system the hardware reports the offset correctly (as verified by using independent hardware monitoring logic in Super I/O), so defaulting it to zero is kind of a regression. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 12:39:00 2011 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 67020106566B for ; Sun, 21 Aug 2011 12:39:00 +0000 (UTC) (envelope-from kklimek@uos.de) Received: from smtp-auth.serv.Uni-Osnabrueck.DE (vm136.rz.uni-osnabrueck.de [131.173.16.11]) by mx1.freebsd.org (Postfix) with ESMTP id E8D6B8FC16 for ; Sun, 21 Aug 2011 12:38:59 +0000 (UTC) Received: from localhost (dslb-088-071-200-036.pools.arcor-ip.net [88.71.200.36]) (authenticated bits=0) by smtp-auth.serv.Uni-Osnabrueck.DE (8.13.8/8.13.8) with ESMTP id p7LCFiaN027944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 21 Aug 2011 14:15:46 +0200 Date: Sun, 21 Aug 2011 14:15:10 +0200 From: kilian To: freebsd-hackers@freebsd.org Message-ID: <20110821121509.GA27730@crane.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.8.21.114814 (Univ. Osnabrueck) X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report= FROM_NAME_ONE_WORD 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, __ANY_URI 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __RDNS_BROADBAND_4 0, __RDNS_POOLED_10 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0 X-PMX-Spam-Level: IIIIIIII Subject: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 12:39:00 -0000 Hello, the idea to start services concurrently during boot isn't new and the question why FreeBSD doesn't do it has popped up on the forum and mailing list occasionally. So, why not give it a shot? rcorder(8) is normally used during boot to bring the rc-scripts into a particular order, so when they are executed linearly by /etc/rc, all constraints will be satisfied. I modified rcorder(8) to enable it to run rc-scripts concurrently, while keeping track of the constraints as rc-scripts start and finish. You can find the code at https://github.com/kil/rcorder. As it works now, it will fall back to the current mode of execution if anything goes wrong. So, if worst comes to worst, booting takes a bit longer. If you feel brave, give it a try (Actually, not too much bravery is needed: on all boots of my machine it worked perfectly every time.) I haven't done any measurements yet on how large the speedup is, but booting feels a bit faster with it. Also, there probably is room for improvement. Any ideas and feedback are very welcome! -kilian From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 13:42:55 2011 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 86E311065677 for ; Sun, 21 Aug 2011 13:42:55 +0000 (UTC) (envelope-from vmagerya@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 49A128FC0C for ; Sun, 21 Aug 2011 13:42:54 +0000 (UTC) Received: by vws18 with SMTP id 18so4428798vws.13 for ; Sun, 21 Aug 2011 06:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Bv9a6d3wnFXgAnQqcvDEZhr+vGyGxLPrNOXDw/R/Vl8=; b=B6nntfZqhuGmna2fnCJ8pD356PVho2aCmb7KpqoU0sUQgF/90X9Ko+qz13Uxax/NaA uphjTs7vIim5//GtTkAbdyToy1Yfuad7H9e2thlFwAKDU+M5aooA563c6wnE+V/xspqw 3GHxUS11W5E6r9up1g+Z50FSBm+/2+Wlb7ttY= MIME-Version: 1.0 Received: by 10.52.27.10 with SMTP id p10mr1241800vdg.180.1313932442524; Sun, 21 Aug 2011 06:14:02 -0700 (PDT) Received: by 10.52.160.39 with HTTP; Sun, 21 Aug 2011 06:14:02 -0700 (PDT) In-Reply-To: <20110821121509.GA27730@crane.none> References: <20110821121509.GA27730@crane.none> Date: Sun, 21 Aug 2011 16:14:02 +0300 Message-ID: From: Vitaly Magerya To: kilian Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 13:42:55 -0000 > I haven't done any measurements yet on how large the speedup is, but booting > feels a bit faster with it. FWIW, my laptop's boot time (from pressing "power" to seeing login prompt) is reduced from 44s to 37s (out of which, first 20-25s are kernel booting). From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 14:31:33 2011 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 B949A1065672 for ; Sun, 21 Aug 2011 14:31:33 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 871608FC14 for ; Sun, 21 Aug 2011 14:31:33 +0000 (UTC) Received: by iye7 with SMTP id 7so16921292iye.17 for ; Sun, 21 Aug 2011 07:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bJWVvmDQszbW9sD4kseK4qeC/e/ZEAX5FfDBNDN0RKg=; b=Go/Jusx3P6RsUNXFiJj8xWG/xq3L7Z+iBuQqhnuRDUZhG4cb6oyvyraOtIwH9/0op7 N1HdY8rclbrWufLdLvhtCXmH1qUI324Qju+daYzQGIEzKN+U5zxvN59DjB60WZFhHifW dqOHE9mHPHrkeowC+EfsnKlUrVMD8Yr8AMMIA= MIME-Version: 1.0 Received: by 10.231.84.196 with SMTP id k4mr3451506ibl.45.1313935619900; Sun, 21 Aug 2011 07:06:59 -0700 (PDT) Received: by 10.231.13.133 with HTTP; Sun, 21 Aug 2011 07:06:59 -0700 (PDT) In-Reply-To: References: <20110821121509.GA27730@crane.none> Date: Sun, 21 Aug 2011 22:06:59 +0800 Message-ID: From: Buganini To: Vitaly Magerya Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, kilian Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 14:31:33 -0000 Here is another approach: https://github.com/buganini/rcexecr -- Buganini From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 14:45:54 2011 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 AD0BE106566B for ; Sun, 21 Aug 2011 14:45:54 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 79FA48FC08 for ; Sun, 21 Aug 2011 14:45:54 +0000 (UTC) Received: by iye7 with SMTP id 7so16950677iye.17 for ; Sun, 21 Aug 2011 07:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=4rDj0hwSWos6NqaPf2jEonN0PZpOMokltifsKMWqtCM=; b=O5W2ReqRMk9+VqwiKLNi5/70Nd25uqf3dv/aZoVAmf9ZGGln5BiLqRjCKQYsdv9a8n Bk+h+GRXDZIQpYfCLntNugvr2Xl+x3qXzV0cn+DRWmo09w+N6mV2b/GFze99HxztgPCY wO7aDSPzbTU3YsRyJBUy9fR7JG0KTVX8mt8yg= Received: by 10.42.79.206 with SMTP id s14mr1767177ick.348.1313937954078; Sun, 21 Aug 2011 07:45:54 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.182.77 with HTTP; Sun, 21 Aug 2011 07:45:24 -0700 (PDT) In-Reply-To: References: <20110821121509.GA27730@crane.none> From: Chris Rees Date: Sun, 21 Aug 2011 15:45:24 +0100 X-Google-Sender-Auth: 9dQ76456i6-EJKQI5Uovh-dt_uM Message-ID: To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 14:45:54 -0000 *** Sorry, emailed from wrong address and it bounced from hackers ***: I might suggest moving this to rc@. I'll try it later, looks interesting. Chris From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 14:48:08 2011 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 5CD22106566B for ; Sun, 21 Aug 2011 14:48:08 +0000 (UTC) (envelope-from joris.dedieu@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2C15A8FC16 for ; Sun, 21 Aug 2011 14:48:08 +0000 (UTC) Received: by iye7 with SMTP id 7so16955192iye.17 for ; Sun, 21 Aug 2011 07:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tKjZ5b2S+IdgtYvfHnjTq/ZZ23hNP8+lvjEENeFOPOk=; b=bClurpqpDv4Y+cVcyP/21Y12xqugfkdiyuyF6hitGd/GRsvFxQyDkGATOmiaBsLiSC W+MzWNjI4AZP2QKFnEDMH8TJMaN+j778gydKfufIIDYi55CAcPCE7hk7BCJXlDJ/raOi 710hF0rvH2qABO22Hg4oCPjFq+bNcrX/+UF/w= MIME-Version: 1.0 Received: by 10.231.54.104 with SMTP id p40mr3668813ibg.39.1313936290803; Sun, 21 Aug 2011 07:18:10 -0700 (PDT) Received: by 10.231.37.76 with HTTP; Sun, 21 Aug 2011 07:18:10 -0700 (PDT) In-Reply-To: <20110821121509.GA27730@crane.none> References: <20110821121509.GA27730@crane.none> Date: Sun, 21 Aug 2011 16:18:10 +0200 Message-ID: From: joris dedieu To: kilian Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 14:48:08 -0000 2011/8/21 kilian : > Hello, > > the idea to start services concurrently during boot isn't new and the > question why FreeBSD doesn't do it has popped up on the forum and > mailing list occasionally. So, why not give it a shot? > > rcorder(8) is normally used during boot to bring the rc-scripts into a > particular order, so when they are executed linearly by /etc/rc, all > constraints will be satisfied. I modified rcorder(8) to enable it to > run rc-scripts concurrently, while keeping track of the constraints as > rc-scripts start and finish. You can find the code at > https://github.com/kil/rcorder. As it works now, it will fall back to the > current mode of execution if anything goes wrong. So, if worst comes to > worst, booting takes a bit longer. > > If you feel brave, give it a try (Actually, not too much bravery is needed: > on all boots of my machine it worked perfectly every time.) > > I haven't done any measurements yet on how large the speedup is, but booting > feels a bit faster with it. Also, there probably is room for improvement. > Any ideas and feedback are very welcome! There is another implementation which had been posted here (maybe) some times ago. Maybe a good thing to compare. https://github.com/buganini/rcexecr Joris > > -kilian > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 18:14:39 2011 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 70958106564A for ; Sun, 21 Aug 2011 18:14:39 +0000 (UTC) (envelope-from kklimek@uos.de) Received: from smtp-auth.serv.Uni-Osnabrueck.DE (vm135.rz.uni-osnabrueck.de [131.173.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id ECFF08FC15 for ; Sun, 21 Aug 2011 18:14:38 +0000 (UTC) Received: from localhost (dslb-088-071-200-036.pools.arcor-ip.net [88.71.200.36]) (authenticated bits=0) by smtp-auth.serv.Uni-Osnabrueck.DE (8.13.8/8.13.8) with ESMTP id p7LIEZxs018790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 21 Aug 2011 20:14:36 +0200 Date: Sun, 21 Aug 2011 20:13:59 +0200 From: kilian To: freebsd-hackers@freebsd.org Message-ID: <20110821181359.GA58700@crane.none> References: <20110821121509.GA27730@crane.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.8.21.180315 (Univ. Osnabrueck) X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report= FROM_NAME_ONE_WORD 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CANPHARM_UNSUB_LINK 0, __CD 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __RDNS_BROADBAND_4 0, __RDNS_POOLED_10 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __USER_AGENT 0 X-PMX-Spam-Level: IIIIIIII Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 18:14:39 -0000 On Sun, Aug 21, 2011 at 04:18:10PM +0200, joris dedieu wrote: > 2011/8/21 kilian : > > Hello, > > > > the idea to start services concurrently during boot isn't new and the > > question why FreeBSD doesn't do it has popped up on the forum and > > mailing list occasionally. So, why not give it a shot? > > > > rcorder(8) is normally used during boot to bring the rc-scripts into a > > particular order, so when they are executed linearly by /etc/rc, all > > constraints will be satisfied. I modified rcorder(8) to enable it to > > run rc-scripts concurrently, while keeping track of the constraints as > > rc-scripts start and finish. You can find the code at > > https://github.com/kil/rcorder. As it works now, it will fall back to the > > current mode of execution if anything goes wrong. So, if worst comes to > > worst, booting takes a bit longer. > > > > If you feel brave, give it a try (Actually, not too much bravery is needed: > > on all boots of my machine it worked perfectly every time.) > > > > I haven't done any measurements yet on how large the speedup is, but booting > > feels a bit faster with it. Also, there probably is room for improvement. > > Any ideas and feedback are very welcome! > > There is another implementation which had been posted here (maybe) > some times ago. Maybe a good thing to compare. > > https://github.com/buganini/rcexecr Didn't know someone else already implemented this. I had a (quick) look at the source code and tried it out, too. Seems to do its job quite well. I'm (obviously) biased in my opinion but what might be considered a drawback of the rcexecr implementation is that it requires modifications to some files in /etc/rc.d. The modifications to /etc/rc are also more invasive. rcexecr is a whole new program, based on rcorder. My implementation requires changes only to /etc/rc and adds features to rcorder (preserving compatibility, I might add). - kilian > > Joris > > > > -kilian > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 21:31:14 2011 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 A1F78106564A for ; Sun, 21 Aug 2011 21:31:13 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 69EAF8FC13 for ; Sun, 21 Aug 2011 21:31:13 +0000 (UTC) Received: by iye7 with SMTP id 7so17777709iye.17 for ; Sun, 21 Aug 2011 14:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Sc5Vq/mXGnLJ1msbW4pWZ+q8Q6pmyHSqDniM7zKG+ho=; b=aW273dX+ZjmX6twhyxHBqbAWcVq9V4Clet+1A0xVOFF2+CLsT1XQetM5aDzX539jOE ybS5A1PMOqGFC7dHg9ntBoROw4AtgJPleAWw2vMlkGcIhmo+EbDIx05dnOVuKNZF+b8l lRnwsLdrbRKlzL39zrwpb32c+pWWvwMBVIQPE= MIME-Version: 1.0 Received: by 10.231.56.160 with SMTP id y32mr4098816ibg.68.1313962271576; Sun, 21 Aug 2011 14:31:11 -0700 (PDT) Received: by 10.231.15.205 with HTTP; Sun, 21 Aug 2011 14:31:11 -0700 (PDT) In-Reply-To: References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> Date: Sun, 21 Aug 2011 16:31:11 -0500 Message-ID: From: Zhihao Yuan To: Test Rat Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, timp Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2011 21:31:14 -0000 A new patch is uploaded. https://github.com/downloads/lichray/nvi2/nvi2-freebsd-2011-08-21.diff.gz There is no functional change in this patch. I just wrote a cmake script and regenerated config.h and pathnames.h; I also removed usr.bin/vi/port.h, so please make sure you applied the patch with patch -p0 -E < /path/to/nvi2-freebsd-2011-08-21.diff If usr.bin/vi/port.h still exists, just rm it; and if you see a usr.bin/vi/config.h.rej, you can get a clean copy with wget --no-check-certificate 'https://socsvn.freebsd.org/socsvn/soc2011/zy/nvi-iconv/head/usr.bin/vi/con= fig.h' And replace usr.bin/vi/config.h with the one you downloaded. After the src tree is patched, please issue a make WITH_ICONV=3D1 depend first under usr.bin/vi/ if you just want to test nvi instead of to rebuild the world. For the new config.h, the FreeBSD-only SYSV_CURSES macro is removed, since we only have ncurses in -stable and -current. And the SYS5_TTY is enabled, since we support it in -stable and -current. On Thu, Aug 18, 2011 at 10:15 PM, Zhihao Yuan wrote: > On Thu, Aug 18, 2011 at 9:26 PM, Test Rat wrote: >> timp writes: >> >>> Hi! >>> I just tried you patch on latest current with clang. >>> >>> [root@current64 /usr/src]# uname -a >>> FreeBSD current64 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Aug 18 03:56:45 M= SK >>> 2011 =C2=A0 =C2=A0 mox@current64:/usr/obj/usr/src/sys/GENERIC =C2=A0amd= 64 >>> >>> [root@current64 /usr/src]# patch < ~/nvi2-freebsd-2011-08-17.diff >> [...] >>> =3D=3D=3D> usr.bin/vi (depend) >>> make: don't know how to make cl_bsd.c. Stop >>> *** Error code 2 >> >> Use `-p0' otherwise new directories won't be created. This is documented >> in patch(1). And cl_bsd.c ended up in current directory (/usr/src) >> >> =C2=A0$ diffstat ~/nvi2-freebsd-2011-08-17.diff.gz | fgrep cl_bsd.c >> =C2=A0 contrib/nvi2/cl/cl_bsd.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0346 +++ > > zzz... I always use -p0 but I did not know what it does... > >> >> Zhihao Yuan writes: >>> The patch will create contrib/nvi2, and it will not remove the unused >>> contrib/nvi (patch(1) can not really remove files anyway). >> >> patch(1) can remove *empty* files with `-E', e.g. >> >> =C2=A0$ svn rm UPDATING >> =C2=A0$ svn di UPDATING | patch -E -d /usr/src > > Got it. But removing contrib/nvi with patch will just double the patch > size anyway. A svn rm will do it if some day the patch got committed. > >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.or= g" >> > > > > -- > Zhihao Yuan, nickname lichray > The best way to predict the future is to invent it. > ___________________________________________________ > 4BSD -- http://4bsd.biz/ > --=20 Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 21:55:26 2011 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 10470106566B for ; Sun, 21 Aug 2011 21:55:26 +0000 (UTC) (envelope-from kklimek@uos.de) Received: from smtp-auth.serv.Uni-Osnabrueck.DE (vm135.rz.uni-osnabrueck.de [131.173.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7418FC14 for ; Sun, 21 Aug 2011 21:55:24 +0000 (UTC) Received: from localhost (dslb-088-071-200-036.pools.arcor-ip.net [88.71.200.36]) (authenticated bits=0) by smtp-auth.serv.Uni-Osnabrueck.DE (8.13.8/8.13.8) with ESMTP id p7LLtL2J005227 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 21 Aug 2011 23:55:22 +0200 Date: Sun, 21 Aug 2011 23:54:45 +0200 From: kilian To: freebsd-hackers@freebsd.org Message-ID: <20110821215445.GA3994@crane.none> References: <20110821121509.GA27730@crane.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.8.21.212714 (Univ. Osnabrueck) X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report= FROM_NAME_ONE_WORD 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_700_799 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CANPHARM_UNSUB_LINK 0, __CD 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __INT_PROD_COMP 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __RDNS_BROADBAND_4 0, __RDNS_POOLED_10 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0 X-PMX-Spam-Level: IIIIIIII Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 21 Aug 2011 21:55:26 -0000 On Sun, Aug 21, 2011 at 04:14:02PM +0300, Vitaly Magerya wrote: > > I haven't done any measurements yet on how large the speedup is, but booting > > feels a bit faster with it. > > FWIW, my laptop's boot time (from pressing "power" to seeing login > prompt) is reduced from 44s to 37s (out of which, first 20-25s are > kernel booting). Thats about the same speedup I'm seeing. Also, today I found a bug in the /etc/rc patch that caused too many scripts to be run. I doubt it has a large impact but it maybe worth a try. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 11:00:32 2011 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 535351065697 for ; Mon, 22 Aug 2011 11:00:32 +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 370F38FC28 for ; Mon, 22 Aug 2011 11:00:25 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QvS0R-0004QN-1n for freebsd-hackers@freebsd.org; Mon, 22 Aug 2011 12:45:23 +0200 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 ; Mon, 22 Aug 2011 12:45:22 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Aug 2011 12:45:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Mon, 22 Aug 2011 12:45:08 +0200 Lines: 31 Message-ID: References: <4E4D50CD.5080806@rawbw.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.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.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: X-Enigmail-Version: 1.1.2 Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 22 Aug 2011 11:00:32 -0000 On 19/08/2011 14:21, Aled Morris wrote: > On 19 August 2011 11:15, Tom Evans wrote: > >> On Thu, Aug 18, 2011 at 6:50 PM, Yuri wrote: >>> Some latest hard drives have logical sectors of 512 byte when they >> actually >>> have 4k physical sectors. >> > ... >> Shouldn't UFS and ZFS drivers be able to either read the right sector size > >>> from the underlying device or at least issue a warning? >> >> The device never reports the actual sector size, so unless FreeBSD >> keeps a database of 4k sector hard drives that report as 512 byte >> sector hard drives, there is nothing that can be done. >> > At what point should we change the default in newfs/zfs to 4k? It is already changed for UFS in 9. > I guess formatting the filesystem for 4k sectors on a 512b drive would still > work but it would be suboptimal. What would the performance penalty be in > reality? It would be suboptimal but only for the slight waste of space that would have otherwise been reclaimed if the block or fragment size remained 512 or 2K. This waste of space is insignificant for the vast majority of users and there are no performance penalties, so it seems that switching to 4K sectors by default for all file systems would actually be a good idea. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 05:15:20 2011 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 AE4D21065670 for ; Mon, 22 Aug 2011 05:15:20 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mx1.freebsd.org (Postfix) with ESMTP id 867588FC0C for ; Mon, 22 Aug 2011 05:15:20 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QvMr2-0001fT-2R for freebsd-hackers@freebsd.org; Sun, 21 Aug 2011 22:15:20 -0700 Date: Sun, 21 Aug 2011 22:15:20 -0700 (PDT) From: timp To: freebsd-hackers@freebsd.org Message-ID: <1313990120065-4722191.post@n5.nabble.com> In-Reply-To: References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 22 Aug 2011 11:15:52 +0000 Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2011 05:15:20 -0000 I'm very sorry. Thanks to all! -p0 was the problem. Now it compiles and works. I tried new vi with russian text and everything is fine. Thank you! And I'll try new patch -- View this message in context: http://freebsd.1045724.n5.nabble.com/nvi-iconv-Call-for-test-tp4698373p4722191.html Sent from the freebsd-hackers mailing list archive at Nabble.com. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 12:27:13 2011 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 9A0081065670 for ; Mon, 22 Aug 2011 12:27:13 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mx1.freebsd.org (Postfix) with ESMTP id 719778FC19 for ; Mon, 22 Aug 2011 12:27:13 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QvTay-0007L8-Nw for freebsd-hackers@freebsd.org; Mon, 22 Aug 2011 05:27:12 -0700 Date: Mon, 22 Aug 2011 05:27:12 -0700 (PDT) From: timp To: freebsd-hackers@freebsd.org Message-ID: <1314016032734-4723231.post@n5.nabble.com> In-Reply-To: References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 22 Aug 2011 12:48:39 +0000 Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2011 12:27:13 -0000 Just checked your new patch. Works too. Thanks! -- View this message in context: http://freebsd.1045724.n5.nabble.com/nvi-iconv-Call-for-test-tp4698373p4723231.html Sent from the freebsd-hackers mailing list archive at Nabble.com. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 15:31:52 2011 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 BA41A1065673 for ; Mon, 22 Aug 2011 15:31:52 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 65B238FC1D for ; Mon, 22 Aug 2011 15:31:52 +0000 (UTC) Received: (qmail 5357 invoked by uid 0); 22 Aug 2011 15:31:50 -0000 Received: from 67.206.161.243 by rms-us013.v300.gmx.net with HTTP Content-Type: text/plain; charset="utf-8" Date: Mon, 22 Aug 2011 15:31:48 +0000 From: "Dieter BSD" Message-ID: <20110822153149.227910@gmx.com> MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: XURhem0Q+Uf1dUjTB2Vyu5x/SDc4NMzy Subject: optimum fs param sizes (was: ZFS installs on HD with 4k physical...) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 22 Aug 2011 15:31:52 -0000 >> I guess formatting the filesystem for 4k sectors on a 512b drive would still >> work but it would be suboptimal.  What would the performance penalty be in >> reality? > > It would be suboptimal but only for the slight waste of space that would > have otherwise been reclaimed if the block or fragment size remained 512 > or 2K. This waste of space is insignificant for the vast majority of > users and there are no performance penalties, so it seems that switching > to 4K sectors by default for all file systems would actually be a good idea. If you have large files, then large block/frag sizes waste less space than small ones.  Remember that keeping track of all those blocks and frags has overhead, and that overhead can waste more space than you save at the end of files. Is anyone looking at extending the range of tuning variables for FFS? Allowing even larger block/frag sizes would be useful, as well as larger cylinder groups and fewer inodes.  Fsck runs a *lot* faster with fewer inodes.  The expected average file size and expected average number of files per directory limits could use work as well. newfs -e 100000000 -b 16384 -f 2048 -g 67108864 -h 16 -i 67108864 -U -o space -L 58data /dev/ada9p1 density reduced from 67108864 to 3676160 /dev/ada9p1: 2861588.5MB (5860533100 sectors) block size 16384, fragment size 2048        using 12754 cylinder groups of 224.38MB, 14360 blks, 64 inodes.        with soft updates A cylinder group size of 224.38MB is just insanely small with today's disk and file sizes. IIRC the block size limit is 64K, but there was some bug with using block/frag larger than 16K/2K.  Even 64K is too small. From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 16:21:40 2011 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 21707106567A; Mon, 22 Aug 2011 16:21:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D68998FC08; Mon, 22 Aug 2011 16:21:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 59DFF46B09; Mon, 22 Aug 2011 12:21:39 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E4A698A02F; Mon, 22 Aug 2011 12:21:38 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 22 Aug 2011 12:21:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <4E3CC033.6070604@rawbw.com> <4E3D808F.1030101@rawbw.com> <201108160925.20568.jhb@freebsd.org> In-Reply-To: <201108160925.20568.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108221221.34447.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 22 Aug 2011 12:21:39 -0400 (EDT) Cc: Yuri , Alexander Best Subject: Re: top(1) loses process user time count when threads end X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 22 Aug 2011 16:21:40 -0000 On Tuesday, August 16, 2011 9:25:20 am John Baldwin wrote: > On Saturday, August 06, 2011 1:57:35 pm Yuri wrote: > > On 08/06/2011 02:11, Alexander Best wrote: > > > On Fri Aug 5 11, Yuri wrote: > > >> I have the process that first runs in 3 threads but later two active > > >> threads exit. > > >> > > >> top(1) shows this moment this way (1 sec intervals): > > >> 30833 yuri 3 76 0 4729M 4225M nanslp 4 0:32 88.62% app > > >> 30833 yuri 3 76 0 4729M 4225M nanslp 6 0:34 90.92% app > > >> 30833 yuri 1 96 0 4729M 4225M CPU1 1 0:03 1.17% app > > >> 30833 yuri 1 98 0 4729M 4226M CPU1 1 0:04 12.89% app > > >> > > >> Process time goes down: 0:34 -> 0:03. Also WCPU goes down 90.92% -> > > >> 1.17% even though this process is CPU bound and does intense things > > >> right after threads exit. > > >> > > >> getrusage(2) though, called in the process, shows the correct user time. > > >> > > >> I think this is the major bug in the process time accounting. > > > could you check, whether kern/128177 or kern/140892 describe your situation? > > > > I have ULE scheduler. kern/128177 talks about single thread with ULE > > scheduler, and my issue is with threads. So I am not sure if it is > > related. There have been no motion on kern/128177 since Feb 9, 2009. > > kern/140892 is probably the same as mine. > > > > In any case, both these PRs have to be fixed since they are very user > > visible, not just some obscure issues. I am not able to reproduce this issue on 8-stable (this is without my suggested patch). I wrote a simple program to fire off 4 CPU bound threads that were signalled to exit when I hit a key on stdin. After that the main thread started doing CPU intensive work. While my CPU % dropped (the main thread was idle in getchar() while the worker threads ran), I did not see a similar drop in the process time: 7644 jhb 5 83 0 10664K 1492K CPU3 3 0:18 150.29% threadtime 7644 jhb 5 85 0 10664K 1492K CPU3 3 0:22 175.05% threadtime 7644 jhb 5 86 0 10664K 1492K CPU3 3 0:26 197.46% threadtime 7644 jhb 5 88 0 10664K 1492K CPU3 3 0:30 217.97% threadtime 7644 jhb 5 89 0 10664K 1492K CPU3 3 0:34 236.72% threadtime 7644 jhb 5 91 0 10664K 1492K CPU3 3 0:38 253.52% threadtime 7644 jhb 5 92 0 10664K 1492K CPU3 3 0:42 269.14% threadtime 7644 jhb 1 73 0 10664K 1432K CPU0 0 0:45 6.40% threadtime 7644 jhb 1 76 0 10664K 1432K CPU4 0 0:46 15.28% threadtime 7644 jhb 1 78 0 10664K 1432K CPU0 0 0:46 23.39% threadtime 7644 jhb 1 81 0 10664K 1432K CPU0 0 0:47 30.76% threadtime 7644 jhb 1 83 0 10664K 1432K CPU0 0 0:48 37.50% threadtime 7644 jhb 1 85 0 10664K 1432K CPU0 0 0:49 43.55% threadtime 7644 jhb 1 86 0 10664K 1432K CPU0 0 0:50 49.07% threadtime Can you come up with a simple test case that shows the bug for you? Also, can you try the patch I posted earlier? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 20:47:48 2011 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 606C7106566B for ; Mon, 22 Aug 2011 20:47:48 +0000 (UTC) (envelope-from elman_syah@yahoo.com) Received: from nm30-vm0.bullet.mail.ac4.yahoo.com (nm30-vm0.bullet.mail.ac4.yahoo.com [98.139.52.250]) by mx1.freebsd.org (Postfix) with SMTP id E0CB68FC12 for ; Mon, 22 Aug 2011 20:47:47 +0000 (UTC) Received: from [98.139.52.191] by nm30.bullet.mail.ac4.yahoo.com with NNFMP; 22 Aug 2011 20:33:58 -0000 Received: from [98.139.52.164] by tm4.bullet.mail.ac4.yahoo.com with NNFMP; 22 Aug 2011 20:33:58 -0000 Received: from [127.0.0.1] by omp1047.mail.ac4.yahoo.com with NNFMP; 22 Aug 2011 20:33:58 -0000 X-Yahoo-Newman-Id: 652136.18021.bm@omp1047.mail.ac4.yahoo.com Received: (qmail 41437 invoked from network); 22 Aug 2011 20:33:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:X-rim-org-msg-ref-id:Message-ID:Content-Transfer-Encoding:Reply-To:X-Priority:Sensitivity:Importance:Subject:To:From:Date:Content-Type:MIME-Version; b=3hmQBV8CqHhY8aOJEcv6+dZzXkQ85arLvfoW3rWftsQAocErEYcM6zmHMPhGZcoToAxMUkFJRJ5dxozy+hCfrfx1HU134Voxt3w27miLUY0UUto74t4KLYUCOJpOmiEx6X/Bko8DD41WKr1SfFi/SwqD/Licuwf1C9KV9+kyjNQ= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1314045238; bh=Ld9rGj4+6ZLoGutby6shZuGURRKe6+gtefKXR6OVs3I=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:X-rim-org-msg-ref-id:Message-ID:Content-Transfer-Encoding:Reply-To:X-Priority:Sensitivity:Importance:Subject:To:From:Date:Content-Type:MIME-Version; b=qIRMR+NgagzxuuEhUsYtm6eeY7phPfS1GauxWHC9YhY2bgzn0Gx1dXpTlepylgPINzJ8JRIAfe55+uQRBhPWq7pXH0btO/d6/vRf765aHpXBBMToO87/W1aa29EL7xLpf2FreoNv5csAxnVipPnHrPNc+CNSoiyLBNmOZdkUYrk= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: QxEwdjAVM1lrw6x4v_gBsP1NVOz0yL8e8ZP3kjbSwAGz0lY Ki8D9UBmosPWJG24MV4zWjMb_oPC825xCd6FL1Wvu09yQoS6Jv1q2V5d5prL StJ1X.tEHBqnuKtpyzRjUbjkmmGOEX7tKL7KnrIpC8LfdXDrOlEhq44TIvan mzHPayrav_H8v.DLH74ymbayIt_bw3bfmIZZAhyXwwyF6rwpfw1HEy6rYJB6 AdCdrjTlphMQ9u1Ov8SkWsT4kl.48s2wl.7Y9I5BZO0KR.sfzd9LXZzep9Kw bbV6uX7rigbNCpTj0ZzVibfCwywgTdgXIR9aMW1_uMKJc_B4aHRba4SRLR_Q 53mF7_TWL0QSMO1UdVjS7gGQSzlYpw6jThSud8Go6cymLy8vhDIaA4k6weiz Ihsm8NdMEhZdfMYANE_ehvgIihLATRow7 X-Yahoo-SMTP: q_7iUPaswBAP9nwhgF_vqEtO2hoAqIY- Received: from b14.c1.bise3.blackberry (elman_syah@216.9.249.193 with xymcookie) by smtp108-mob.biz.mail.ac4.yahoo.com with SMTP; 22 Aug 2011 13:33:58 -0700 PDT X-rim-org-msg-ref-id: 335698072 Message-ID: <335698072-1314045236-cardhu_decombobulator_blackberry.rim.net-1847968792-@b13.c1.bise3.blackberry> Content-Transfer-Encoding: base64 X-Priority: Normal Sensitivity: Normal Importance: Normal To: freebsd-hackers@freebsd.org From: "elman" Date: Mon, 22 Aug 2011 20:33:48 +0000 Content-Type: text/plain; charset="Windows-1252" MIME-Version: 1.0 Subject: Report Kernel log X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: elman_syah@yahoo.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2011 20:47:48 -0000 SGFpIGhhY2tlciwNCg0KSSBoYXZlIHJlY2VpdmVkIHRoZSBrZXJuZWwgbG9nIG9uIGZyZWVic2Qg OC4yDQoNCmtlcm5lbCBsb2cgbWVzc2FnZXM6DQorKysgL3RtcC9zZWN1cml0eS5xSGxtYkNSdjIw MTEtMDgtMjMgMDM6MDU6MjUuMDAwMDAwMDAwICswNzAwDQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDUgRGVwdGggMTIyDQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDUgRGVwdGggMTIyDQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDUgRGVwdGggMTIyDQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDUgRGVwdGggMTIyDQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDYgRGVwdGggMTE5DQorbXB0MDogUVVFVUUgRlVMTCBFVkVO VDogQnVzIDB4MDAgVGFyZ2V0IDB4MDYgRGVwdGggMTE5DQoNCldoYXQgdGhlIGlzc3VlPw0KQ2Vl cnMuDQpFbG1hbg0KUG93ZXJlZCBieSBUZWxrb21zZWwgQmxhY2tCZXJyea4= From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 20:52:57 2011 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 30CE4106564A for ; Mon, 22 Aug 2011 20:52:57 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id DD6F58FC08 for ; Mon, 22 Aug 2011 20:52:56 +0000 (UTC) Received: by vxh11 with SMTP id 11so5868841vxh.13 for ; Mon, 22 Aug 2011 13:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=AH+TjVNqnndpK8dXghLm6IT5rntAeGp2agUb8ZrAiac=; b=DqkihMtkaBb9s4v2fLyElKgleOpZbjJ6AswigbY7D63tPK3ZXKy2K8oAY31ukRauWM oNJjrTdblpM0OOz5SBeubfRmY8Lj0ZP4g7SeXZlpXF1SvEFeZFFT0zPWCPVvmFySFpVU WFgKnLcwmspXTgPN8kRIFnVKBk7CjCTbdDvII= Received: by 10.52.92.67 with SMTP id ck3mr2711451vdb.421.1314046376289; Mon, 22 Aug 2011 13:52:56 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id fn5sm2441076vdc.45.2011.08.22.13.52.55 (version=SSLv3 cipher=OTHER); Mon, 22 Aug 2011 13:52:55 -0700 (PDT) Date: Mon, 22 Aug 2011 16:52:46 -0400 From: Alexander Kabaev To: elman_syah@yahoo.com Message-ID: <20110822165246.634ea408@kan.dnsalias.net> In-Reply-To: <335698072-1314045236-cardhu_decombobulator_blackberry.rim.net-1847968792-@b13.c1.bise3.blackberry> References: <335698072-1314045236-cardhu_decombobulator_blackberry.rim.net-1847968792-@b13.c1.bise3.blackberry> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/m+9zvjn8szucJ=3+HJVu0Yh"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: Report Kernel log X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 22 Aug 2011 20:52:57 -0000 --Sig_/m+9zvjn8szucJ=3+HJVu0Yh Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable On Mon, 22 Aug 2011 20:33:48 +0000 "elman" wrote: > Hai hacker, >=20 > I have received the kernel log on freebsd 8.2 >=20 > kernel log messages: > +++ /tmp/security.qHlmbCRv2011-08-23 03:05:25.000000000 +0700 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x05 Depth 122 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x05 Depth 122 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x05 Depth 122 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x05 Depth 122 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x06 Depth 119 > +mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x06 Depth 119 >=20 > What the issue? > Ceers. > Elman > Powered by Telkomsel BlackBerry=AE The device is telling us back that it cannot hold as many open tags as we are trying to feed it. This is not fatal, CAM will scale back and will settle on some smaller value that will keep the device happy. --=20 Alexander Kabaev --Sig_/m+9zvjn8szucJ=3+HJVu0Yh Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOUsGmQ6z1jMm+XZYRAniHAJ4kGniDquH25RhZpR6UEIQDslJ1PgCguiA4 qNzMfyhzvlccCv4OYAqGLQI= =X7TW -----END PGP SIGNATURE----- --Sig_/m+9zvjn8szucJ=3+HJVu0Yh-- From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 22:46:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D7811106566C; Mon, 22 Aug 2011 22:46:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Mon, 22 Aug 2011 18:45:56 -0400 User-Agent: KMail/1.6.2 References: <201107312128.29322.lobo@bsd.com.br> <201108011706.14163.jkim@FreeBSD.org> <4E50DA45.3010809@FreeBSD.org> In-Reply-To: <4E50DA45.3010809@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108221846.05841.jkim@FreeBSD.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Phenom II 975 BE shows 0 celsius X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 22 Aug 2011 22:46:42 -0000 On Sunday 21 August 2011 06:13 am, Andriy Gapon wrote: > on 02/08/2011 00:06 Jung-uk Kim said the following: > > On Monday 01 August 2011 04:10 pm, Andriy Gapon wrote: > >> on 01/08/2011 22:48 Jung-uk Kim said the following: > >>> I have mixed feeling about this because I own a system with > >>> such CPU/motherboard combo, too. I also believe it works well > >>> but errata is errata. If vendor says we shouldn't use it, then > >>> we shouldn't. In fact, I am just following Linux as an example > >>> here but I have no problem with turning this into a warning > >>> message, either. > >> > >> Let's cut a deal :-) > >> If we start using amdtemp for fan control, emergency system > >> shutdown or similar, then we follow the strict path. Until > >> then, while we use amdtemp to amuse users with numbers, let's > >> just print a warning :-) > > > > Okay, here is the new patch (not tested on the affected system > > yet): > > > > http://people.freebsd.org/~jkim/amdtemp2.diff > > Tested the patch - looks good! > One comment though: it seems that sensor_offset defaults to zero > now. Would it be a good idea to default it to what it previously > used to be? On my system the hardware reports the offset correctly > (as verified by using independent hardware monitoring logic in > Super I/O), so defaulting it to zero is kind of a regression. If we want to preserve the previous default, we have to reintroduce DiodeOffset or to define more quirks. :-/ Jung-uk Kim From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 01:23:31 2011 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 4D5F81065672 for ; Tue, 23 Aug 2011 01:23:31 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au [211.29.133.218]) by mx1.freebsd.org (Postfix) with ESMTP id CD1758FC0A for ; Tue, 23 Aug 2011 01:23:30 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p7N1NRFZ008157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Aug 2011 11:23:28 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p7N1NQIp029788; Tue, 23 Aug 2011 11:23:26 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p7N1NQIu029787; Tue, 23 Aug 2011 11:23:26 +1000 (EST) (envelope-from peter) Date: Tue, 23 Aug 2011 11:23:26 +1000 From: Peter Jeremy To: Ivan Voras Message-ID: <20110823012326.GA29658@server.vk2pj.dyndns.org> References: <4E4D50CD.5080806@rawbw.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 01:23:31 -0000 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Aug-22 12:45:08 +0200, Ivan Voras wrote: >It would be suboptimal but only for the slight waste of space that would= =20 >have otherwise been reclaimed if the block or fragment size remained 512= =20 >or 2K. This waste of space is insignificant for the vast majority of=20 >users and there are no performance penalties, so it seems that switching= =20 >to 4K sectors by default for all file systems would actually be a good ide= a. This is heavily dependent on the size distribution. I can't quickly check for ZFS but I've done some quick checks on UFS. The following are sizes in MB for my copies of the listed trees with different UFS frag size. These include directories but not indirect blocks: 1b 512b 1024b 2048b 4096b 4430 4511 4631 4875 5457 /usr/ncvs 4910 5027 5181 5499 6133 Old FreeBSD SVN repo 299 370 485 733 1252 /usr/ports cheched out from CVS 467 485 509 557 656 /usr/src 8-stable checkout from CVS Note that the ports tree grew by 50% going from 1K to 2K frags and will grow by another 70% going to 4KB frags. Similar issues will be seen when you have lots of small file. --=20 Peter Jeremy --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk5TAQ4ACgkQ/opHv/APuIexBACgrI4ba5mIgbTq/D5fRcQJfyiY F7QAoJxa5P+dDu6kbpUdUoE/LwllWFUJ =4nIA -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl-- From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 09:52:25 2011 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 27F36106564A for ; Tue, 23 Aug 2011 09:52:25 +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 A864D8FC0A for ; Tue, 23 Aug 2011 09:52:24 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qvneh-0004W1-KA for freebsd-hackers@freebsd.org; Tue, 23 Aug 2011 11:52:23 +0200 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 ; Tue, 23 Aug 2011 11:52:23 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Aug 2011 11:52:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 23 Aug 2011 11:52:09 +0200 Lines: 30 Message-ID: References: <4E4D50CD.5080806@rawbw.com> <20110823012326.GA29658@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.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.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: <20110823012326.GA29658@server.vk2pj.dyndns.org> X-Enigmail-Version: 1.1.2 Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 09:52:25 -0000 On 23/08/2011 03:23, Peter Jeremy wrote: > On 2011-Aug-22 12:45:08 +0200, Ivan Voras wrote: >> It would be suboptimal but only for the slight waste of space that would >> have otherwise been reclaimed if the block or fragment size remained 512 >> or 2K. This waste of space is insignificant for the vast majority of >> users and there are no performance penalties, so it seems that switching >> to 4K sectors by default for all file systems would actually be a good idea. > > This is heavily dependent on the size distribution. I can't quickly > check for ZFS but I've done some quick checks on UFS. The following > are sizes in MB for my copies of the listed trees with different UFS > frag size. These include directories but not indirect blocks: > > 1b 512b 1024b 2048b 4096b > 4430 4511 4631 4875 5457 /usr/ncvs > 4910 5027 5181 5499 6133 Old FreeBSD SVN repo > 299 370 485 733 1252 /usr/ports cheched out from CVS > 467 485 509 557 656 /usr/src 8-stable checkout from CVS > > Note that the ports tree grew by 50% going from 1K to 2K frags and > will grow by another 70% going to 4KB frags. Similar issues will > be seen when you have lots of small file. I agree but there are at least two things going for making the increase anyway: 1) 2 TB drives cost $80 2) Where the space is really important, the person in charge usually knows it and can choose a non-default size like 512b fragments. From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 09:59:28 2011 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 965661065670 for ; Tue, 23 Aug 2011 09:59:28 +0000 (UTC) (envelope-from aled.w.morris@googlemail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 331AD8FC0C for ; Tue, 23 Aug 2011 09:59:27 +0000 (UTC) Received: by vxh11 with SMTP id 11so6379142vxh.13 for ; Tue, 23 Aug 2011 02:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=qR13ELR5nM0SXksvSC4UXNJjKSM8S/uDJkpzMpxBfVM=; b=fhUw3VmH5wNdxN//DFG+P0MhB0+lF5B+HE3uOXoZGmEbNakkVa/MqKVwfBXd908ofI LrEkb3K8VAieNjw2oKNExCVlluDA2Nm7yedOaLYAUrT0lV3I5mbpvWN1dKu+VTOc/KPo PnW5j2CLvQ5FXxFTtQyZNzderUue80mCxg6aE= MIME-Version: 1.0 Received: by 10.52.72.161 with SMTP id e1mr3159349vdv.277.1314093567211; Tue, 23 Aug 2011 02:59:27 -0700 (PDT) Sender: aled.w.morris@googlemail.com Received: by 10.52.188.196 with HTTP; Tue, 23 Aug 2011 02:59:27 -0700 (PDT) In-Reply-To: References: <4E4D50CD.5080806@rawbw.com> <20110823012326.GA29658@server.vk2pj.dyndns.org> Date: Tue, 23 Aug 2011 10:59:27 +0100 X-Google-Sender-Auth: VvRj0MSBXueaiUtayzspUc99C_0 Message-ID: From: Aled Morris To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 09:59:28 -0000 On 23 August 2011 10:52, Ivan Voras wrote: > > I agree but there are at least two things going for making the increase > anyway: > > 1) 2 TB drives cost $80 > 2) Where the space is really important, the person in charge usually knows > it and can choose a non-default size like 512b fragments. > > > helpers like sysinstall should help with choosing the smaller blocks for smaller drives (especially SSD) Aled From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 10:04:06 2011 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 C0F5210656E9 for ; Tue, 23 Aug 2011 10:04:06 +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 76A408FC0A for ; Tue, 23 Aug 2011 10:04:06 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qvnq1-000081-6b for freebsd-hackers@freebsd.org; Tue, 23 Aug 2011 12:04:05 +0200 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 ; Tue, 23 Aug 2011 12:04:05 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Aug 2011 12:04:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 23 Aug 2011 12:03:52 +0200 Lines: 20 Message-ID: References: <4E4D50CD.5080806@rawbw.com> <20110823012326.GA29658@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.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.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: X-Enigmail-Version: 1.1.2 Subject: Re: ZFS installs on HD with 4k physical blocks without any warning as on 512 block size device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 10:04:06 -0000 On 23/08/2011 11:59, Aled Morris wrote: > On 23 August 2011 10:52, Ivan Voras wrote: > >> >> I agree but there are at least two things going for making the increase >> anyway: >> >> 1) 2 TB drives cost $80 >> 2) Where the space is really important, the person in charge usually knows >> it and can choose a non-default size like 512b fragments. >> > helpers like sysinstall should help with choosing the smaller blocks for > smaller drives (especially SSD) Only via hints and help text. Too much magic in the installer leads to awkward choices :) (e.g. first you need to distinguish between a VM with a small drive, a SSD small drive, or a SAN small volume... it quickly turns into an AI-class problem). From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 11:56:28 2011 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 AD839106566C for ; Tue, 23 Aug 2011 11:56:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8404C8FC08 for ; Tue, 23 Aug 2011 11:56:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 368D046B98; Tue, 23 Aug 2011 07:56:28 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B56A28A02E; Tue, 23 Aug 2011 07:56:27 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 23 Aug 2011 07:56:27 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108230756.27259.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 23 Aug 2011 07:56:27 -0400 (EDT) Cc: Garrett Cooper , Sergey Kandaurov Subject: Re: module_register_init fails, but driver is still loaded? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 11:56:28 -0000 On Thursday, August 04, 2011 12:23:15 pm Garrett Cooper wrote: > Hi hackers, > I noticed that if anything fails while initializing a driver, the > driver stays attached to the kernel as a module instead of being > kicked when all references to the driver go to 0. Is this desired > behavior (it doesn't seem like it, but I can see potential pros and > cons of kicking the driver out of the kernel immediately when a > failure state occurs)? I've seen this on 7.2 ~ 9-CURRENT. Example > sourcecode and invocation attached below. This is sort of a feature actually. Consider the hard cases avg@ mentioned such as a kld that contains multiple modules. What one could possibly do is notice that all modules failed MOD_LOAD and do an unload in that case. This untested patch tries to do that: Index: kern_linker.c =================================================================== --- kern_linker.c (revision 225077) +++ kern_linker.c (working copy) @@ -378,7 +378,7 @@ linker_load_file(const char *filename, linker_file { linker_class_t lc; linker_file_t lf; - int foundfile, error; + int foundfile, error, modules; /* Refuse to load modules if securelevel raised */ if (prison0.pr_securelevel > 0) @@ -417,11 +417,22 @@ linker_load_file(const char *filename, linker_file linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (error); } + modules = !TAILQ_EMPTY(&lf->modules); KLD_UNLOCK(); linker_file_register_sysctls(lf); linker_file_sysinit(lf); KLD_LOCK(); lf->flags |= LINKER_FILE_LINKED; + + /* + * If all of the modules in this file failed + * to load, unload the file and return an + * error of ENOEXEC. + */ + if (modules && TAILQ_EMPTY(&lf->modules)) { + linker_file_unload(lf, LINKER_UNLOAD_FORCE); + return (ENOEXEC); + } *result = lf; return (0); } @@ -625,7 +636,7 @@ linker_file_unload(linker_file_t file, int flags) /* * Inform any modules associated with this file that they are - * being be unloaded. + * being unloaded. */ MOD_XLOCK; for (mod = TAILQ_FIRST(&file->modules); mod; mod = next) { -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 12:09:19 2011 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 B13FC106566C; Tue, 23 Aug 2011 12:09:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 44E0D8FC0C; Tue, 23 Aug 2011 12:09:17 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA25743; Tue, 23 Aug 2011 15:09:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E53986B.5000804@FreeBSD.org> Date: Tue, 23 Aug 2011 15:09:15 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-arch@FreeBSD.org X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 23 Aug 2011 12:29:15 +0000 Cc: Subject: skipping locks, mutex_owned, usb X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 12:09:19 -0000 Yes, the subject sounds quite hairy, so please let me try to explain it. First, let's consider one concrete function: static int ukbd_poll(keyboard_t *kbd, int on) { struct ukbd_softc *sc = kbd->kb_data; if (!mtx_owned(&Giant)) { /* XXX cludge */ int retval; mtx_lock(&Giant); retval = ukbd_poll(kbd, on); mtx_unlock(&Giant); return (retval); } if (on) { sc->sc_flags |= UKBD_FLAG_POLLING; sc->sc_poll_thread = curthread; } else { sc->sc_flags &= ~UKBD_FLAG_POLLING; ukbd_start_timer(sc); /* start timer */ } return (0); } This "XXX cludge" [sic] pattern is scattered around a few functions in the ukbd code and perhaps other usb code: func() { if (!mtx_owned(&Giant)) { mtx_lock(&Giant); func(); mtx_unlock(&Giant); return; } // etc ... } I have a few question directly and indirectly related to this pattern. I. [Why] do we need this pattern? Can the code be re-written in a smarter (if not to say proper) way? II. ukbd_poll() in particular can be called from the kdb context (kdb_trap -> db_trap -> db_command_loop -> etc). What would happen if the Giant is held by a thread on some other CPU (which would be hard-stopped by kdp_trap)? Won't we get a lockup here? So shouldn't this code actually check for kdb_active? III. With my stop_scheduler_on_panic patch ukbd_poll() produces infinite chains of 'infinite' recursion because mtx_owned() always returns false. This is because I skip all lock/unlock/etc operations in the post-panic context. I think that it's a good philosophical question: what operations like mtx_owned(), mtx_recursed(), mtx_trylock() 'should' return when we actually act as if no locks exist at all? My first knee-jerk reaction was to change mtx_owned() to return true in this "lock-less" context, but _hypothetically_ there could exist some symmetric code that does something like: func() { if (mtx_owned(&Giant)) { mtx_unlock(&Giant); func(); mtx_lock(&Giant); return; } // etc ... What do you think about this problem? Should we re-write ukbd_poll() (and possibly usb code) or should mutex_owned() be adjusted? That question III actually brings another thought: perhaps the whole of idea of skipping locks in a certain context is not a correct direction? Perhaps, instead we should identify all the code that could be legitimately executed in the after-panic and/or kdb contexts and make that could explicitly aware of its execution context. That is, instead of trying to make _lock, _unlock, _owned, _trylock, etc do the right thing auto-magically, we should try to make the calling code check panicstr and kdb_active and do the right thing on that level (which would include not invoking those lock-related operations or other inappropriate operations). Thank you very much in advance for your insights and help! -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 17:51:35 2011 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 6A027106566B for ; Tue, 23 Aug 2011 17:51:35 +0000 (UTC) (envelope-from ulrich@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id EF79E8FC12 for ; Tue, 23 Aug 2011 17:51:34 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p7NHpXJU040129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 23 Aug 2011 19:51:33 +0200 (CEST) (envelope-from ulrich@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1314121894; bh=HAwoKq2G6MzBC85/B1HpoAuLLVg+RfTeWITwra/tZmQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=k6WEXjy/Hx0FuFH2bcfp/Epybuz9PMxXPr+4mRKPOKfOV7glZ+3chiWLS0wHNq7bh 5LSkGuqQ6RJUWiHS9Iq7CoXIEHQ3mPOOyr+m5QZ1ur9wYxLF7PwbcWJJ5qMIYXAW8M SoQ2rtnfaNLDYZQVBUOWQIALCJ+N9+yDYEjYRnKo= Date: Tue, 23 Aug 2011 19:51:33 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Zhihao Yuan Message-ID: <20110823175133.GK18091@acme.spoerlein.net> Mail-Followup-To: Zhihao Yuan , Test Rat , freebsd-hackers@freebsd.org References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 23 Aug 2011 19:04:46 +0000 Cc: Test Rat , freebsd-hackers@freebsd.org Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2011 17:51:35 -0000 On Thu, 2011-08-18 at 22:15:47 -0500, Zhihao Yuan wrote: > On Thu, Aug 18, 2011 at 9:26 PM, Test Rat wrote: > > timp writes: > > > >> Hi! > >> I just tried you patch on latest current with clang. > >> > >> [root@current64 /usr/src]# uname -a > >> FreeBSD current64 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Aug 18 03:56:45 MSK > >> 2011     mox@current64:/usr/obj/usr/src/sys/GENERIC  amd64 > >> > >> [root@current64 /usr/src]# patch < ~/nvi2-freebsd-2011-08-17.diff > > [...] > >> ===> usr.bin/vi (depend) > >> make: don't know how to make cl_bsd.c. Stop > >> *** Error code 2 > > > > Use `-p0' otherwise new directories won't be created. This is documented > > in patch(1). And cl_bsd.c ended up in current directory (/usr/src) > > > >  $ diffstat ~/nvi2-freebsd-2011-08-17.diff.gz | fgrep cl_bsd.c > >   contrib/nvi2/cl/cl_bsd.c                |  346 +++ > > zzz... I always use -p0 but I did not know what it does... > > > > > Zhihao Yuan writes: > >> The patch will create contrib/nvi2, and it will not remove the unused > >> contrib/nvi (patch(1) can not really remove files anyway). > > > > patch(1) can remove *empty* files with `-E', e.g. > > > >  $ svn rm UPDATING > >  $ svn di UPDATING | patch -E -d /usr/src > > Got it. But removing contrib/nvi with patch will just double the patch > size anyway. A svn rm will do it if some day the patch got committed. Since you already use github.com, why not clone https://github.com/freebsd/freebsd-head/ and do your work in a separate branch? People already using one of the github or gitorious clones can then easily download your branch and don't have to fight patch(1). just fyi, Uli From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 20:19:40 2011 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 94FA6106564A for ; Tue, 23 Aug 2011 20:19:40 +0000 (UTC) (envelope-from kklimek@uos.de) Received: from smtp-auth.serv.Uni-Osnabrueck.DE (vm135.rz.uni-osnabrueck.de [131.173.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 1F18D8FC1C for ; Tue, 23 Aug 2011 20:19:39 +0000 (UTC) Received: from localhost (dslb-088-071-200-036.pools.arcor-ip.net [88.71.200.36]) (authenticated bits=0) by smtp-auth.serv.Uni-Osnabrueck.DE (8.13.8/8.13.8) with ESMTP id p7NKJaAZ025657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Aug 2011 22:19:37 +0200 Date: Tue, 23 Aug 2011 22:18:59 +0200 From: kilian To: freebsd-hackers@freebsd.org, freebsd-rc@freebsd.org Message-ID: <20110823201859.GA78110@crane.none> References: <20110821121509.GA27730@crane.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.8.23.200014 (Univ. Osnabrueck) X-PMX-Spam: Gauge=X, Probability=10%, Report= TO_IN_SUBJECT 0.5, FROM_NAME_ONE_WORD 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1500_1599 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __RDNS_BROADBAND_4 0, __RDNS_POOLED_10 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0 X-PMX-Spam-Level: X Cc: Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 23 Aug 2011 20:19:40 -0000 On Sun, Aug 21, 2011 at 02:54:15PM +0100, Chris Rees wrote: > On 21 Aug 2011 13:39, "kilian" wrote: > > > > Hello, > > > > the idea to start services concurrently during boot isn't new and the > > question why FreeBSD doesn't do it has popped up on the forum and > > mailing list occasionally. So, why not give it a shot? > > > > rcorder(8) is normally used during boot to bring the rc-scripts into a > > particular order, so when they are executed linearly by /etc/rc, all > > constraints will be satisfied. I modified rcorder(8) to enable it to > > run rc-scripts concurrently, while keeping track of the constraints as > > rc-scripts start and finish. You can find the code at > > https://github.com/kil/rcorder. As it works now, it will fall back to the > > current mode of execution if anything goes wrong. So, if worst comes to > > worst, booting takes a bit longer. > > > > If you feel brave, give it a try (Actually, not too much bravery is > needed: > > on all boots of my machine it worked perfectly every time.) > > > > I haven't done any measurements yet on how large the speedup is, but > booting > > feels a bit faster with it. Also, there probably is room for improvement. > > Any ideas and feedback are very welcome! > > > > -kilian > > > > I might suggest moving this to rc@. I'll try it later, looks interesting. > > Chris For anyone who is interested, updated the README[1] with some numbers, detailing the influence on booting time. [1] https://github.com/kil/rcorder/blob/master/README#L30 From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 23 20:33:41 2011 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 72FC3106564A for ; Tue, 23 Aug 2011 20:33:41 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB1A8FC15 for ; Tue, 23 Aug 2011 20:33:41 +0000 (UTC) Received: by iye7 with SMTP id 7so1473807iye.17 for ; Tue, 23 Aug 2011 13:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=XDBRasUGpYDlxXikV4ui+vtrfvGrVg1ozrIuOhTwphw=; b=vQ+d9TwzGCS0dIrDGCk4qeiAI/cyw6ifn1qalMZm9QNt2eK7CmuegWbSpkJ6m+WY4x 9vj8VjFeil1L3fNgaWYfrHLXM2IuC1nLcr+7jbG6fDiMAxcaoli0sd0r5S8Il7r2IW3c rPAk2YLDGwHBiAa9RZwDfRf10Iu+v0KAgumNQ= MIME-Version: 1.0 Received: by 10.231.28.33 with SMTP id k33mr8461312ibc.81.1314131620815; Tue, 23 Aug 2011 13:33:40 -0700 (PDT) Received: by 10.231.34.198 with HTTP; Tue, 23 Aug 2011 13:33:40 -0700 (PDT) In-Reply-To: <20110823175133.GK18091@acme.spoerlein.net> References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> <20110823175133.GK18091@acme.spoerlein.net> Date: Tue, 23 Aug 2011 15:33:40 -0500 Message-ID: From: Zhihao Yuan To: Zhihao Yuan , Test Rat , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2011 20:33:41 -0000 On Tue, Aug 23, 2011 at 12:51 PM, Ulrich Sp=C3=B6rlein wrote: > On Thu, 2011-08-18 at 22:15:47 -0500, Zhihao Yuan wrote: >> On Thu, Aug 18, 2011 at 9:26 PM, Test Rat wrote: >> > timp writes: >> > >> >> Hi! >> >> I just tried you patch on latest current with clang. >> >> >> >> [root@current64 /usr/src]# uname -a >> >> FreeBSD current64 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Aug 18 03:56:45= MSK >> >> 2011 =C2=A0 =C2=A0 mox@current64:/usr/obj/usr/src/sys/GENERIC =C2=A0a= md64 >> >> >> >> [root@current64 /usr/src]# patch < ~/nvi2-freebsd-2011-08-17.diff >> > [...] >> >> =3D=3D=3D> usr.bin/vi (depend) >> >> make: don't know how to make cl_bsd.c. Stop >> >> *** Error code 2 >> > >> > Use `-p0' otherwise new directories won't be created. This is document= ed >> > in patch(1). And cl_bsd.c ended up in current directory (/usr/src) >> > >> > =C2=A0$ diffstat ~/nvi2-freebsd-2011-08-17.diff.gz | fgrep cl_bsd.c >> > =C2=A0 contrib/nvi2/cl/cl_bsd.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0346 +++ >> >> zzz... I always use -p0 but I did not know what it does... >> >> > >> > Zhihao Yuan writes: >> >> The patch will create contrib/nvi2, and it will not remove the unused >> >> contrib/nvi (patch(1) can not really remove files anyway). >> > >> > patch(1) can remove *empty* files with `-E', e.g. >> > >> > =C2=A0$ svn rm UPDATING >> > =C2=A0$ svn di UPDATING | patch -E -d /usr/src >> >> Got it. But removing contrib/nvi with patch will just double the patch >> size anyway. A svn rm will do it if some day the patch got committed. > > Since you already use github.com, why not clone > https://github.com/freebsd/freebsd-head/ and do your work in a separate > branch? People already using one of the github or gitorious clones can > then easily download your branch and don't have to fight patch(1). > FreeBSD's nvi code is frozen for a long time, so my patch should not meet conflict. But since I touched rcsid recently, I'll upload non-rcsid (git-friendly) patches recently. > just fyi, > Uli > --=20 Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 24 09:08:43 2011 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 0EDDD106566C for ; Wed, 24 Aug 2011 09:08:43 +0000 (UTC) (envelope-from vmagerya@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 A3DAE8FC17 for ; Wed, 24 Aug 2011 09:08:42 +0000 (UTC) Received: by vws18 with SMTP id 18so1077314vws.13 for ; Wed, 24 Aug 2011 02:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kc+2lkLFzpRMfD+lWpnZpmPwCitv+4UwdXC+hKL4tXk=; b=cJiEukFrDI8Vb3DAh02IGX1bYWDZ7S07cl4C/z9s5DQtqlCjty8VW7qWp9mX1s+6rw 95tb5R/nVhsI4pwrhBqYaT8syrDVO8GUW86Iprb/FAARDkMI8KNcQaEU6LYuTarYFMK6 KchQF5TIue15OBy/Tx9JLXMyZj98qMspsYDxM= MIME-Version: 1.0 Received: by 10.52.175.164 with SMTP id cb4mr4675212vdc.381.1314176921782; Wed, 24 Aug 2011 02:08:41 -0700 (PDT) Received: by 10.52.160.39 with HTTP; Wed, 24 Aug 2011 02:08:41 -0700 (PDT) In-Reply-To: <20110821121509.GA27730@crane.none> References: <20110821121509.GA27730@crane.none> Date: Wed, 24 Aug 2011 12:08:41 +0300 Message-ID: From: Vitaly Magerya To: kilian Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, freebsd-rc@freebsd.org Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 24 Aug 2011 09:08:43 -0000 > the idea to start services concurrently during boot isn't new and the > question why FreeBSD doesn't do it has popped up on the forum and > mailing list occasionally. So, why not give it a shot? As someone who uses FreeBSD on hist laptop and is constantly annoyed by the lack of suspend-to-disk, every second trimmed of from boot time is a win. In line of the recent FreeBSD problems & solutions discussion, would any commiter take time to review and commit this? "FreeBSD 9.1 introduces concurrent startup, improves boot speed" is the kind of buzz we're after. > Any ideas and feedback are very welcome! One thing to try is to attach a diagnostics feature that will produce data about rc script dependencies and execution times, which can be used to visualize which scripts take most time, and how to reorganize dependencies to improve boot time (one example I noticed is moused: it is only started after network is up, which is a shame, since it could easily start while DHCP negotiation is in progress). From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 24 09:12:00 2011 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 4A667106566B; Wed, 24 Aug 2011 09:12:00 +0000 (UTC) (envelope-from dirkx@webweaving.org) Received: from pikmeer.webweaving.org (unknown [IPv6:2001:1af8:4100:b040::20]) by mx1.freebsd.org (Postfix) with ESMTP id DFF2E8FC12; Wed, 24 Aug 2011 09:11:59 +0000 (UTC) Received: from neep.home (host81-159-211-94.range81-159.btcentralplus.com [81.159.211.94]) (authenticated bits=0) by pikmeer.webweaving.org (8.14.4/8.14.4) with ESMTP id p7O9BrdR048866 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 24 Aug 2011 09:11:53 GMT (envelope-from dirkx@webweaving.org) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Dirk-Willem van Gulik In-Reply-To: Date: Wed, 24 Aug 2011 10:11:59 +0100 Content-Transfer-Encoding: 7bit Message-Id: <236FDE42-804C-4ADE-AD3C-2EF8D43522EA@webweaving.org> References: <20110821121509.GA27730@crane.none> To: Vitaly Magerya X-Mailer: Apple Mail (2.1244.3) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (pikmeer.webweaving.org [178.18.23.51]); Wed, 24 Aug 2011 09:11:54 +0000 (UTC) Cc: freebsd-rc@freebsd.org, freebsd-hackers@freebsd.org, kilian Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 24 Aug 2011 09:12:00 -0000 On 24 Aug 2011, at 10:08, Vitaly Magerya wrote: > One thing to try is to attach a diagnostics feature that will produce > data about rc script dependencies and execution times, which can > be used to visualize which scripts take most time, and how to > reorganize dependencies to improve boot time (one example I noticed > is moused: it is only started after network is up, which is a shame, > since it could easily start while DHCP negotiation is in progress). Perhaps https://github.com/buganini/rcexecr may be a good start. Dw From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 24 13:32:01 2011 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 C3C6D1065674 for ; Wed, 24 Aug 2011 13:32:01 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 8264F8FC20 for ; Wed, 24 Aug 2011 13:32:01 +0000 (UTC) Received: by iye7 with SMTP id 7so4254043iye.17 for ; Wed, 24 Aug 2011 06:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8oKn6Vuc2tGXMy4TwvE0Cfz9iFCRNnniH55D2gZ+zRo=; b=cTXhGXs31uNZPXZA9QWFAEmRGpB4XKZS5++xIJ/9s1Mim/woF/0PY7LhTQ+S55WyqF AVvaFK2xrhBOB9ZR0T1+7RxdBpo339JgbiXRK5oOITaDHyaI4T9gM4h8zBxIa1LTDFiN ul/L940qb9hPW3BymPsKmDnQZYDuWP9Gf5Y1k= MIME-Version: 1.0 Received: by 10.231.20.136 with SMTP id f8mr10432347ibb.32.1314192720844; Wed, 24 Aug 2011 06:32:00 -0700 (PDT) Received: by 10.231.31.140 with HTTP; Wed, 24 Aug 2011 06:32:00 -0700 (PDT) In-Reply-To: <236FDE42-804C-4ADE-AD3C-2EF8D43522EA@webweaving.org> References: <20110821121509.GA27730@crane.none> <236FDE42-804C-4ADE-AD3C-2EF8D43522EA@webweaving.org> Date: Wed, 24 Aug 2011 21:32:00 +0800 Message-ID: From: Buganini To: Dirk-Willem van Gulik Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, kilian , freebsd-rc@freebsd.org, Vitaly Magerya Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 24 Aug 2011 13:32:01 -0000 rcexecr generate time table like this: # env ARG0=\? ARG1=start rcexecr /etc/rc.d/* 1 beg /etc/rc.d/dhclient start 1 beg /etc/rc.d/rctl start 1 beg /etc/rc.d/natd start 1 beg /etc/rc.d/ugidfw start 1 beg /etc/rc.d/sysctl start 2 end /etc/rc.d/sysctl 3 beg /etc/rc.d/hostid start 4 end /etc/rc.d/hostid 5 beg /etc/rc.d/zvol start 6 end /etc/rc.d/zvol 7 beg /etc/rc.d/dumpon start 8 end /etc/rc.d/dumpon 9 beg /etc/rc.d/ddb start 10 end /etc/rc.d/ddb 11 beg /etc/rc.d/initrandom start 12 end /etc/rc.d/initrandom 13 beg /etc/rc.d/gbde start 13 beg /etc/rc.d/ccd start 13 beg /etc/rc.d/encswap start 13 beg /etc/rc.d/geli start 14 end /etc/rc.d/gbde 14 end /etc/rc.d/encswap 14 end /etc/rc.d/geli 14 end /etc/rc.d/ccd 15 beg /etc/rc.d/swap1 start 16 end /etc/rc.d/swap1 17 beg /etc/rc.d/fsck start 18 end /etc/rc.d/fsck 19 beg /etc/rc.d/root start 20 end /etc/rc.d/root 21 beg /etc/rc.d/serial start 21 beg /etc/rc.d/mdconfig start 21 beg /etc/rc.d/sppp start 21 beg /etc/rc.d/nsswitch start 21 beg /etc/rc.d/gssd start 21 beg /etc/rc.d/hostid_save start 21 beg /etc/rc.d/atm1 start 22 end /etc/rc.d/hostid_save 22 end /etc/rc.d/mdconfig 23 beg /etc/rc.d/mountcritlocal start 24 end /etc/rc.d/mountcritlocal 25 beg /etc/rc.d/zfs start 26 end /etc/rc.d/zfs 27 beg /etc/rc.d/FILESYSTEMS start 28 end /etc/rc.d/FILESYSTEMS 29 beg /etc/rc.d/hostname start 29 beg /etc/rc.d/ip6addrctl start 29 beg /etc/rc.d/geli2 start 29 beg /etc/rc.d/kldxref start 29 beg /etc/rc.d/kld start 29 beg /etc/rc.d/ipfilter start 29 beg /etc/rc.d/netoptions start 29 beg /etc/rc.d/addswap start 29 beg /etc/rc.d/ipsec start 30 end /etc/rc.d/ipfilter 30 end /etc/rc.d/kld 31 beg /etc/rc.d/ipnat start 31 beg /etc/rc.d/var start 32 end /etc/rc.d/ipnat 32 end /etc/rc.d/var 33 beg /etc/rc.d/ipfs start 33 beg /etc/rc.d/random start 33 beg /etc/rc.d/cleanvar start 34 end /etc/rc.d/hostname 34 end /etc/rc.d/random 35 beg /etc/rc.d/ipmon start 35 beg /etc/rc.d/adjkerntz start 35 beg /etc/rc.d/mixer start 36 end /etc/rc.d/atm1 36 end /etc/rc.d/serial 36 end /etc/rc.d/ip6addrctl 36 end /etc/rc.d/netoptions 36 end /etc/rc.d/adjkerntz 36 end /etc/rc.d/kldxref 36 end /etc/rc.d/sppp 36 end /etc/rc.d/ipfs 36 end /etc/rc.d/cleanvar 37 beg /etc/rc.d/netif start 38 end /etc/rc.d/netif 39 beg /etc/rc.d/ppp start 39 beg /etc/rc.d/rtsold start 39 beg /etc/rc.d/faith start 39 beg /etc/rc.d/pfsync start 39 beg /etc/rc.d/pflog start 39 beg /etc/rc.d/devd start 39 beg /etc/rc.d/static_arp start 39 beg /etc/rc.d/stf start 39 beg /etc/rc.d/bridge start 39 beg /etc/rc.d/resolv start 39 beg /etc/rc.d/atm2 start 40 end /etc/rc.d/devd 40 end /etc/rc.d/atm2 40 end /etc/rc.d/pfsync 40 end /etc/rc.d/pflog 41 beg /etc/rc.d/defaultroute start 41 beg /etc/rc.d/atm3 start 41 beg /etc/rc.d/pf start 41 beg /etc/rc.d/ipfw start 42 end /etc/rc.d/faith 42 end /etc/rc.d/ppp 42 end /etc/rc.d/stf 42 end /etc/rc.d/pf 43 beg /etc/rc.d/routing start 44 end /etc/rc.d/routing 45 beg /etc/rc.d/mroute6d start 45 beg /etc/rc.d/route6d start 45 beg /etc/rc.d/routed start 45 beg /etc/rc.d/mrouted start 46 end /etc/rc.d/routed 46 end /etc/rc.d/resolv 46 end /etc/rc.d/rtsold 46 end /etc/rc.d/ipfw 46 end /etc/rc.d/mroute6d 46 end /etc/rc.d/nsswitch 46 end /etc/rc.d/defaultroute 46 end /etc/rc.d/mrouted 46 end /etc/rc.d/route6d 47 beg /etc/rc.d/NETWORKING start 48 end /etc/rc.d/NETWORKING 49 beg /etc/rc.d/pppoed start 49 beg /etc/rc.d/kerberos start 49 beg /etc/rc.d/netwait start 49 beg /etc/rc.d/nfsuserd start 50 end /etc/rc.d/kerberos 50 end /etc/rc.d/ipsec 50 end /etc/rc.d/netwait 51 beg /etc/rc.d/mountcritremote start 51 beg /etc/rc.d/nfscbd start 51 beg /etc/rc.d/kadmind start 52 end /etc/rc.d/kadmind 52 end /etc/rc.d/mountcritremote 53 beg /etc/rc.d/motd start 53 beg /etc/rc.d/wpa_supplicant start 53 beg /etc/rc.d/tmp start 53 beg /etc/rc.d/newsyslog start 53 beg /etc/rc.d/mdconfig2 start 53 beg /etc/rc.d/ldconfig start 53 beg /etc/rc.d/kpasswdd start 53 beg /etc/rc.d/hostapd start 53 beg /etc/rc.d/gptboot start 53 beg /etc/rc.d/dmesg start 53 beg /etc/rc.d/devfs start 53 beg /etc/rc.d/archdep start 53 beg /etc/rc.d/accounting start 54 end /etc/rc.d/newsyslog 54 end /etc/rc.d/tmp 54 end /etc/rc.d/archdep 55 beg /etc/rc.d/virecover start 55 beg /etc/rc.d/syslogd start 55 beg /etc/rc.d/cleartmp start 55 beg /etc/rc.d/abi start 56 end /etc/rc.d/syslogd 57 beg /etc/rc.d/savecore start 57 beg /etc/rc.d/localpkg start 57 beg /etc/rc.d/power_profile start 57 beg /etc/rc.d/auditd start 57 beg /etc/rc.d/pwcheck start 57 beg /etc/rc.d/bsnmpd start 57 beg /etc/rc.d/hastd start 58 end /etc/rc.d/mdconfig2 58 end /etc/rc.d/savecore 58 end /etc/rc.d/abi 58 end /etc/rc.d/devfs 58 end /etc/rc.d/ldconfig 58 end /etc/rc.d/ipmon 59 beg /etc/rc.d/SERVERS start 60 end /etc/rc.d/SERVERS 61 beg /etc/rc.d/ipxrouted start 61 beg /etc/rc.d/named start 62 end /etc/rc.d/named 63 beg /etc/rc.d/ntpdate start 64 end /etc/rc.d/ntpdate 65 beg /etc/rc.d/rpcbind start 66 end /etc/rc.d/rpcbind 67 beg /etc/rc.d/nisdomain start 67 beg /etc/rc.d/nfsclient start 68 end /etc/rc.d/nisdomain 69 beg /etc/rc.d/ypserv start 70 end /etc/rc.d/ypserv 71 beg /etc/rc.d/ypxfrd start 71 beg /etc/rc.d/ypupdated start 71 beg /etc/rc.d/ypbind start 72 end /etc/rc.d/ypbind 73 beg /etc/rc.d/ypset start 74 end /etc/rc.d/ypset 74 end /etc/rc.d/nfsclient 75 beg /etc/rc.d/yppasswdd start 75 beg /etc/rc.d/keyserv start 75 beg /etc/rc.d/quota start 75 beg /etc/rc.d/amd start 76 end /etc/rc.d/quota 77 beg /etc/rc.d/mountd start 78 end /etc/rc.d/nfsuserd 78 end /etc/rc.d/gssd 78 end /etc/rc.d/mountd 79 beg /etc/rc.d/nfsd start 80 end /etc/rc.d/nfsd 81 beg /etc/rc.d/statd start 82 end /etc/rc.d/statd 83 beg /etc/rc.d/lockd start 84 end /etc/rc.d/virecover 84 end /etc/rc.d/cleartmp 84 end /etc/rc.d/hastd 84 end /etc/rc.d/dmesg 84 end /etc/rc.d/kpasswdd 84 end /etc/rc.d/keyserv 84 end /etc/rc.d/auditd 84 end /etc/rc.d/pppoed 84 end /etc/rc.d/pwcheck 84 end /etc/rc.d/lockd 84 end /etc/rc.d/amd 84 end /etc/rc.d/ipxrouted 84 end /etc/rc.d/accounting 84 end /etc/rc.d/atm3 85 beg /etc/rc.d/DAEMON start 86 end /etc/rc.d/DAEMON 87 beg /etc/rc.d/ftp-proxy start 87 beg /etc/rc.d/sdpd start 87 beg /etc/rc.d/rwho start 87 beg /etc/rc.d/rtadvd start 87 beg /etc/rc.d/timed start 87 beg /etc/rc.d/ubthidhci start 87 beg /etc/rc.d/hcsecd start 87 beg /etc/rc.d/rarpd start 87 beg /etc/rc.d/bootparams start 87 beg /etc/rc.d/watchdogd start 87 beg /etc/rc.d/powerd start 87 beg /etc/rc.d/ntpd start 87 beg /etc/rc.d/apm start 87 beg /etc/rc.d/nscd start 87 beg /etc/rc.d/moused start 87 beg /etc/rc.d/mountlate start 87 beg /etc/rc.d/lpd start 87 beg /etc/rc.d/local start 88 end /etc/rc.d/sdpd 88 end /etc/rc.d/apm 88 end /etc/rc.d/ubthidhci 88 end /etc/rc.d/hcsecd 89 beg /etc/rc.d/rfcomm_pppd_server start 89 beg /etc/rc.d/bthidd start 89 beg /etc/rc.d/apmd start 89 beg /etc/rc.d/bluetooth start 90 end /etc/rc.d/rfcomm_pppd_server 90 end /etc/rc.d/mountlate 90 end /etc/rc.d/motd 90 end /etc/rc.d/lpd 90 end /etc/rc.d/local 90 end /etc/rc.d/nscd 90 end /etc/rc.d/ntpd 90 end /etc/rc.d/powerd 90 end /etc/rc.d/rarpd 90 end /etc/rc.d/rctl 90 end /etc/rc.d/rtadvd 90 end /etc/rc.d/rwho 90 end /etc/rc.d/timed 90 end /etc/rc.d/ugidfw 90 end /etc/rc.d/bthidd 90 end /etc/rc.d/bootparams 90 end /etc/rc.d/apmd 90 end /etc/rc.d/yppasswdd 91 beg /etc/rc.d/LOGIN start 92 end /etc/rc.d/LOGIN 93 beg /etc/rc.d/othermta start 93 beg /etc/rc.d/ftpd start 93 beg /etc/rc.d/msgs start 93 beg /etc/rc.d/inetd start 93 beg /etc/rc.d/sshd start 93 beg /etc/rc.d/syscons start 93 beg /etc/rc.d/sendmail start 93 beg /etc/rc.d/cron start 93 beg /etc/rc.d/jail start 94 end /etc/rc.d/cron 94 end /etc/rc.d/localpkg 94 end /etc/rc.d/jail 95 beg /etc/rc.d/bgfsck start 95 beg /etc/rc.d/securelevel start 95 end /etc/rc.d/gptboot 95 end /etc/rc.d/hostapd 95 end /etc/rc.d/mixer 95 end /etc/rc.d/inetd 95 end /etc/rc.d/ypupdated 95 end /etc/rc.d/bsnmpd 95 end /etc/rc.d/bridge 95 end /etc/rc.d/bluetooth 95 end /etc/rc.d/bgfsck 95 end /etc/rc.d/power_profile 95 end /etc/rc.d/othermta 95 end /etc/rc.d/watchdogd 95 end /etc/rc.d/wpa_supplicant 95 end /etc/rc.d/ypxfrd 95 end /etc/rc.d/nfscbd 95 end /etc/rc.d/moused 95 end /etc/rc.d/addswap 95 end /etc/rc.d/natd 95 end /etc/rc.d/ftp-proxy 95 end /etc/rc.d/securelevel 95 end /etc/rc.d/sendmail 95 end /etc/rc.d/sshd 95 end /etc/rc.d/ftpd 95 end /etc/rc.d/dhclient 95 end /etc/rc.d/geli2 95 end /etc/rc.d/static_arp 95 end /etc/rc.d/syscons 95 end /etc/rc.d/msgs 2011/8/24 Dirk-Willem van Gulik : > > On 24 Aug 2011, at 10:08, Vitaly Magerya wrote: > >> One thing to try is to attach a diagnostics feature that will produce >> data about rc script dependencies and execution times, which can >> be used to visualize which scripts take most time, and how to >> reorganize dependencies to improve boot time (one example I noticed >> is moused: it is only started after network is up, which is a shame, >> since it could easily start while DHCP negotiation is in progress). > > Perhaps https://github.com/buganini/rcexecr may be a good start. > > Dw > > _______________________________________________ > 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 Wed Aug 24 15:47:19 2011 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 B55CF1065675; Wed, 24 Aug 2011 15:47:19 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 7394E8FC0A; Wed, 24 Aug 2011 15:47:19 +0000 (UTC) Received: by iye7 with SMTP id 7so4626891iye.17 for ; Wed, 24 Aug 2011 08:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Hl8Zsm8RU3vPdb99OpMbtWJz8zc8+yQtcfFdu0kJZ54=; b=q6qs71oMPHnHT0hDVVKMyN1Vxrc7rkmwfWk40ZRyJhuUszFL2J5iZ0M0mRnZX/bUGO WMP9vxZOcmRqAqf3u5ubFeBxUT8sCdGEjA8yDJhP7tbxVTX7vUcugEmsMGDXkLLoncW5 TETxF50edMsUer+I6TtvFPqN5yVpsefhCLv/U= MIME-Version: 1.0 Received: by 10.231.20.136 with SMTP id f8mr10662050ibb.32.1314200838933; Wed, 24 Aug 2011 08:47:18 -0700 (PDT) Received: by 10.231.31.140 with HTTP; Wed, 24 Aug 2011 08:47:18 -0700 (PDT) In-Reply-To: References: <20110821121509.GA27730@crane.none> <236FDE42-804C-4ADE-AD3C-2EF8D43522EA@webweaving.org> Date: Wed, 24 Aug 2011 23:47:18 +0800 Message-ID: From: Buganini To: Dirk-Willem van Gulik Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, kilian , freebsd-rc@freebsd.org, Vitaly Magerya Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 24 Aug 2011 15:47:19 -0000 Further optimization in rc.d: splitting non-networking DAEMON (eg. moused) Critical issue in rcexecr: stop_boot (in /etc/rc.subr) doesn't stop rcexecr it might need a check before involving /usr/local/etc/rc.d/*, or just kill child processes? --Buganini From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 11:28:01 2011 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 13AF51065672 for ; Thu, 25 Aug 2011 11:28:01 +0000 (UTC) (envelope-from dgre090@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id CB9768FC08 for ; Thu, 25 Aug 2011 11:28:00 +0000 (UTC) Received: by ywo32 with SMTP id 32so1934694ywo.13 for ; Thu, 25 Aug 2011 04:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=rmpUfi8L+8ocGHFu22wPIdpW83cvgxLNFbOmvvqF8Jo=; b=qHBYPPopWHIpv+CjBM3wYofh7fliirz4J/wUx0PEH24FxrihBsbssidqytmSanbV5P i+VvsWopKp6L5gBqDKexQ9XHrlONZbyr+fLYWPOWByr/TwPvtKZgMlWqSeOrjrgk3UzW kVu6Q4EpQN4I597y/DmPxfdrvyuVDSuRPG2a4= MIME-Version: 1.0 Received: by 10.231.52.16 with SMTP id f16mr12786892ibg.31.1314270266103; Thu, 25 Aug 2011 04:04:26 -0700 (PDT) Received: by 10.231.19.204 with HTTP; Thu, 25 Aug 2011 04:04:26 -0700 (PDT) Date: Thu, 25 Aug 2011 13:04:26 +0200 Message-ID: From: Daniel Grech To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: USB Stack Hooking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 11:28:01 -0000 Hi, I need to write a kernel module that would hook onto some function at a low level in the USB stack in order to have direct access to the raw data that is received from the USB Controller Hardware. Has this ever been done before ? Any ideas as to which function I could hook onto to have access to this data ? From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 12:00:45 2011 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 4A7A31065702 for ; Thu, 25 Aug 2011 12:00:45 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id C8EB08FC28 for ; Thu, 25 Aug 2011 12:00:44 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=Ic1eHMOXbQHcCvhs/sz3xt2crOpE4ZQ8e7+3c6x+FwY= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=M2B_LQOazjWGs0MlK5IA:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 2969296; Thu, 25 Aug 2011 14:00:36 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Thu, 25 Aug 2011 13:58:12 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108251358.12187.hselasky@c2i.net> Cc: Daniel Grech Subject: Re: USB Stack Hooking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 12:00:45 -0000 On Thursday 25 August 2011 13:04:26 Daniel Grech wrote: > Hi, I need to write a kernel module that would hook onto some function at a > low level in the USB stack in order to have direct access to the raw data > that is received from the USB Controller Hardware. Has this ever been done > before ? Any ideas as to which function I could hook onto to have access to > this data ? Hi, Recently there was an USB Packet Filter solution added, which can TAP data at the most common places. See /sys/dev/usb/usb_pf.c And: usbpf_xfertap() If you want to grab information lower than this, there is no formal API at the present moment. Are you thinking about USB Gadget/Device or USB Host data grabbing? --HPS From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 12:21:39 2011 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 6E6C2106567A for ; Thu, 25 Aug 2011 12:21:39 +0000 (UTC) (envelope-from joris.dedieu@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 18C348FC0A for ; Thu, 25 Aug 2011 12:21:38 +0000 (UTC) Received: by gyd10 with SMTP id 10so1991564gyd.13 for ; Thu, 25 Aug 2011 05:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=AyogGOCaUlRYaX/U5uz0oDr21Nw/8RtMwPyiKFZ0BRs=; b=onUSiwfcj3eSbd6OiTlkXPrbOBQ81jGFYnGCdwPp2KsPuuKwAvPF0VMB2EllFEXp7S PxHhdAC4r15Ivz0rwPhgrLm4T91w66vnrVYXyB7Cofw/acnq55cs0lsMS3z1y4u4C7W8 0rNGYPCo6tZwI+6Bm0+zEl/IWcPMRMlNmdq+s= MIME-Version: 1.0 Received: by 10.231.56.75 with SMTP id x11mr12649551ibg.98.1314274898239; Thu, 25 Aug 2011 05:21:38 -0700 (PDT) Received: by 10.231.37.76 with HTTP; Thu, 25 Aug 2011 05:21:38 -0700 (PDT) In-Reply-To: References: <20110821121509.GA27730@crane.none> Date: Thu, 25 Aug 2011 14:21:38 +0200 Message-ID: From: joris dedieu To: freebsd-hackers@freebsd.org, freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary=000e0cd3592e7261ed04ab5378bb Cc: Subject: Re: Concurrent execution of rc-scripts with rcorder(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 12:21:39 -0000 --000e0cd3592e7261ed04ab5378bb Content-Type: text/plain; charset=ISO-8859-1 2011/8/24 Vitaly Magerya : >> the idea to start services concurrently during boot isn't new and the >> question why FreeBSD doesn't do it has popped up on the forum and >> mailing list occasionally. So, why not give it a shot? > > As someone who uses FreeBSD on hist laptop and is constantly annoyed > by the lack of suspend-to-disk, every second trimmed of from boot > time is a win. > > In line of the recent FreeBSD problems & solutions discussion, would > any commiter take time to review and commit this? "FreeBSD 9.1 > introduces concurrent startup, improves boot speed" is the kind of > buzz we're after. > >> Any ideas and feedback are very welcome! > > One thing to try is to attach a diagnostics feature that will produce > data about rc script dependencies and execution times, which can > be used to visualize which scripts take most time, and how to > reorganize dependencies to improve boot time (one example I noticed > is moused: it is only started after network is up, which is a shame, > since it could easily start while DHCP negotiation is in progress). Perhaps background_dhclient="YES" should solve it ? I think background approach (which is current archlinux one [1] ) is not so bad. It's clearly less powerful than automagic parallelization but it's maybe less invasive and more flexible for sysadmins. I gave it a try with a little patch for rc.subr that introduces a background keyword (eg: moused_enable="background"). It's surly buggy with some variables like rc_quiet. I have to check more. [1] https://wiki.archlinux.org/index.php/DAEMONS Joris > _______________________________________________ > 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" > --000e0cd3592e7261ed04ab5378bb Content-Type: text/x-patch; charset=US-ASCII; name="rc.subr.patch" Content-Disposition: attachment; filename="rc.subr.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_grrp50nw0 LS0tIC9ldGMvcmMuc3VicgkyMDExLTA1LTAyIDA4OjQ5OjExLjAwMDAwMDAwMCArMDIwMAorKysg cmMuc3VicgkyMDExLTA4LTI1IDEzOjUwOjI5LjMwMDI3NTc4MyArMDIwMApAQCAtMTQyLDggKzE0 Miw5IEBACiAJZGVidWcgImNoZWNreWVzbm86ICQxIGlzIHNldCB0byAkX3ZhbHVlLiIKIAljYXNl ICRfdmFsdWUgaW4KIAotCQkjCSJ5ZXMiLCAidHJ1ZSIsICJvbiIsIG9yICIxIgotCVtZeV1bRWVd W1NzXXxbVHRdW1JyXVtVdV1bRWVdfFtPb11bTm5dfDEpCisJCSMJInllcyIsICJ0cnVlIiwgIm9u IiwgIjEiLCAiYmciIG9yICJiYWNrZ3JvdW5kIgorCVtZeV1bRWVdW1NzXXxbVHRdW1JyXVtVdV1b RWVdfFtPb11bTm5dfDF8W0JiXVtHZ118XAorW0JiXVtBYV1bQ2NdW0trXVtHZ11bUnJdW09vXVtV dV1bTm5dW0RkXSkKIAkJcmV0dXJuIDAKIAkJOzsKIApAQCAtMTU5LDYgKzE2MCwyNSBAQAogfQog CiAjCisjIGNoZWNrYmcgdmFyCisjCVRlc3QgJDEgdmFyaWFibGUsIGFuZCByZXR1cm4gMCBpZiBp dCdzIGJhY2tncm91bmQgb3IgYmcuCisjCVJldHVybiBub256ZXJvIG90aGVyd2lzZS4KKyMKK2No ZWNrYmcoKQoreworCWV2YWwgX3ZhbHVlPVwkJHsxfQorCWRlYnVnICJjaGVja2JnOiAkMSBpcyBz ZXQgdG8gJF92YWx1ZS4iCisJY2FzZSAkX3ZhbHVlIGluCisJW0JiXVtHZ118W0JiXVtBYV1bQ2Nd W0trXVtHZ11bUnJdW09vXVtVdV1bTm5dW0RkXSkKKwkJcmV0dXJuIDAKKwkJOzsKKwkqKQorCQly ZXR1cm4gMQorCQk7OworCWVzYWMKK30KKworIwogIyByZXZlcnNlX2xpc3QgbGlzdAogIwlwcmlu dCB0aGUgbGlzdCBpbiByZXZlcnNlIG9yZGVyCiAjCkBAIC03MzUsNTQgKzc1NSwxMSBAQAogCQkJ OzsKIAogCQlzdGFydCkKLQkJCWlmIFsgLXogIiRyY19mYXN0IiAtYSAtbiAiJHJjX3BpZCIgXTsg dGhlbgotCQkJCWVjaG8gMT4mMiAiJHtuYW1lfSBhbHJlYWR5IHJ1bm5pbmc/IChwaWQ9JHJjX3Bp ZCkuIgotCQkJCXJldHVybiAxCisJCQlpZiBjaGVja2JnICR7cmN2YXJ9OyB0aGVuCisJCQkJZXZh bCBfcnVuX3JjX3N0YXJ0ICYKKwkJCWVsc2UgCisJCQkJX3J1bl9yY19zdGFydAogCQkJZmkKLQot CQkJaWYgWyAhIC14ICR7X2Nocm9vdH0ke19jaHJvb3Q6KyIvIn0ke2NvbW1hbmR9IF07IHRoZW4K LQkJCQl3YXJuICJydW5fcmNfY29tbWFuZDogY2Fubm90IHJ1biAkY29tbWFuZCIKLQkJCQlyZXR1 cm4gMQotCQkJZmkKLQotCQkJaWYgISBfcnVuX3JjX3ByZWNtZDsgdGhlbgotCQkJCXdhcm4gImZh aWxlZCBwcmVjbWQgcm91dGluZSBmb3IgJHtuYW1lfSIKLQkJCQlyZXR1cm4gMQotCQkJZmkKLQot CQkJCQkjIHNldHVwIHRoZSBmdWxsIGNvbW1hbmQgdG8gcnVuCi0JCQkJCSMKLQkJCWNoZWNrX3N0 YXJ0bXNncyAmJiBlY2hvICJTdGFydGluZyAke25hbWV9LiIKLQkJCWlmIFsgLW4gIiRfY2hyb290 IiBdOyB0aGVuCi0JCQkJX2RvaXQ9IlwKLSR7X25pY2U6K25pY2UgLW4gJF9uaWNlIH1cCi1jaHJv b3QgJHtfdXNlcjorLXUgJF91c2VyIH0ke19ncm91cDorLWcgJF9ncm91cCB9JHtfZ3JvdXBzOist RyAkX2dyb3VwcyB9XAotJF9jaHJvb3QgJGNvbW1hbmQgJHJjX2ZsYWdzICRjb21tYW5kX2FyZ3Mi Ci0JCQllbHNlCi0JCQkJX2RvaXQ9IlwKLSR7X2NoZGlyOitjZCAkX2NoZGlyICYmIH1cCi0kY29t bWFuZCAkcmNfZmxhZ3MgJGNvbW1hbmRfYXJncyIKLQkJCQlpZiBbIC1uICIkX3VzZXIiIF07IHRo ZW4KLQkJCQkgICAgX2RvaXQ9InN1IC1tICRfdXNlciAtYyAnc2ggLWMgXCIkX2RvaXRcIiciCi0J CQkJZmkKLQkJCQlpZiBbIC1uICIkX25pY2UiIF07IHRoZW4KLQkJCQkJaWYgWyAteiAiJF91c2Vy IiBdOyB0aGVuCi0JCQkJCQlfZG9pdD0ic2ggLWMgXCIkX2RvaXRcIiIKLQkJCQkJZmkKLQkJCQkJ X2RvaXQ9Im5pY2UgLW4gJF9uaWNlICRfZG9pdCIKLQkJCQlmaQotCQkJZmkKLQotCQkJCQkjIHJ1 biB0aGUgZnVsbCBjb21tYW5kCi0JCQkJCSMKLQkJCWlmICEgX3J1bl9yY19kb2l0ICIkX2RvaXQi OyB0aGVuCi0JCQkJd2FybiAiZmFpbGVkIHRvIHN0YXJ0ICR7bmFtZX0iCi0JCQkJcmV0dXJuIDEK LQkJCWZpCi0KLQkJCQkJIyBmaW5hbGx5LCBydW4gcG9zdGNtZAotCQkJCQkjCi0JCQlfcnVuX3Jj X3Bvc3RjbWQKIAkJCTs7CiAKIAkJc3RvcCkKQEAgLTk4NSw2ICs5NjIsNTkgQEAKIAllY2hvICIk X2NtZCIKIH0KIAorX3J1bl9yY19zdGFydCgpCit7CisJaWYgWyAteiAiJHJjX2Zhc3QiIC1hIC1u ICIkcmNfcGlkIiBdOyB0aGVuCisJCWVjaG8gMT4mMiAiJHtuYW1lfSBhbHJlYWR5IHJ1bm5pbmc/ IChwaWQ9JHJjX3BpZCkuIgorCQlyZXR1cm4gMQorCWZpCisKKwlpZiBbICEgLXggJHtfY2hyb290 fSR7X2Nocm9vdDorIi8ifSR7Y29tbWFuZH0gXTsgdGhlbgorCQl3YXJuICJydW5fcmNfY29tbWFu ZDogY2Fubm90IHJ1biAkY29tbWFuZCIKKwkJcmV0dXJuIDEKKwlmaQorCisJaWYgISBfcnVuX3Jj X3ByZWNtZDsgdGhlbgorCQl3YXJuICJmYWlsZWQgcHJlY21kIHJvdXRpbmUgZm9yICR7bmFtZX0i CisJCXJldHVybiAxCisJZmkKKworCSMgc2V0dXAgdGhlIGZ1bGwgY29tbWFuZCB0byBydW4KKwkj CisJY2hlY2tfc3RhcnRtc2dzICYmIGVjaG8gIlN0YXJ0aW5nICR7bmFtZX0uIgorCWlmIFsgLW4g IiRfY2hyb290IiBdOyB0aGVuCisJCQkJX2RvaXQ9IlwKKyR7X25pY2U6K25pY2UgLW4gJF9uaWNl IH1cCitjaHJvb3QgJHtfdXNlcjorLXUgJF91c2VyIH0ke19ncm91cDorLWcgJF9ncm91cCB9JHtf Z3JvdXBzOistRyAkX2dyb3VwcyB9XAorJF9jaHJvb3QgJGNvbW1hbmQgJHJjX2ZsYWdzICRjb21t YW5kX2FyZ3MiCisJCQllbHNlCisJCQkJX2RvaXQ9IlwKKyR7X2NoZGlyOitjZCAkX2NoZGlyICYm IH1cCiskY29tbWFuZCAkcmNfZmxhZ3MgJGNvbW1hbmRfYXJncyIKKwkJaWYgWyAtbiAiJF91c2Vy IiBdOyB0aGVuCisJCQlfZG9pdD0ic3UgLW0gJF91c2VyIC1jICdzaCAtYyBcIiRfZG9pdFwiJyIK KwkJZmkKKwkJaWYgWyAtbiAiJF9uaWNlIiBdOyB0aGVuCisJCQlpZiBbIC16ICIkX3VzZXIiIF07 IHRoZW4KKwkJCQlfZG9pdD0ic2ggLWMgXCIkX2RvaXRcIiIKKwkJCWZpCisJCQlfZG9pdD0ibmlj ZSAtbiAkX25pY2UgJF9kb2l0IgorCQlmaQorCWZpCisKKwkjIHJ1biB0aGUgZnVsbCBjb21tYW5k CisJIworCWlmICEgX3J1bl9yY19kb2l0ICIkX2RvaXQiOyB0aGVuCisJCXdhcm4gImZhaWxlZCB0 byBzdGFydCAke25hbWV9IgorCXJldHVybiAxCisJZmkKKworCSMgZmluYWxseSwgcnVuIHBvc3Rj bWQKKwkjCisJX3J1bl9yY19wb3N0Y21kCit9CisKKwogIwogIyBydW5fcmNfc2NyaXB0IGZpbGUg YXJnCiAjCVN0YXJ0IHRoZSBzY3JpcHQgYGZpbGUnIHdpdGggYGFyZycsIGFuZCBjb3JyZWN0bHkg aGFuZGxlIHRoZQo= --000e0cd3592e7261ed04ab5378bb-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 21:36:02 2011 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 B9DCC106566B for ; Thu, 25 Aug 2011 21:36:02 +0000 (UTC) (envelope-from crmartin@sgi.com) Received: from relay.sgi.com (relay3.sgi.com [192.48.152.1]) by mx1.freebsd.org (Postfix) with ESMTP id A318B8FC08 for ; Thu, 25 Aug 2011 21:36:02 +0000 (UTC) Received: from xmail.sgi.com (pv-excas3-dc21.corp.sgi.com [137.38.102.206]) by relay3.corp.sgi.com (Postfix) with ESMTP id 41B27AC007 for ; Thu, 25 Aug 2011 14:16:12 -0700 (PDT) Received: from [10.3.0.220] (10.3.0.220) by xmail.sgi.com (137.38.102.30) with Microsoft SMTP Server (TLS) id 14.1.289.1; Thu, 25 Aug 2011 16:16:10 -0500 Message-ID: <4E56BB99.6030706@sgi.com> Date: Thu, 25 Aug 2011 15:16:09 -0600 From: Charlie Martin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.0.220] Subject: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 21:36:02 -0000 We're having a crash in some internal code running on FreeBSD 7.2 (specifically 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know it's quite a bit behind) in which after 18-30 hours of running load tests, the code panics with: panic: Bad link elm 0xffffff0044c09600 next->prev != elm cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff8019119a = db_trace_self_wrapper+0x2a panic() at 0xffffffff80307c72 = panic+0x182 devfs_populate_loop() at 0xffffffff802a43a8 = devfs_populate_loop+0x548 First question: where's the most appropriate place to ask about this kind of bug on a back version. Second: does this remind anyone of any bugs? Googling came up with a few somewhat similar things but hasn't provided much insight so far. Third: I tried compiling with the sys/queue.h QUEUE_MACRO_DEBUG defined in order to get more useful information from the panic. The kernel build fails in pmap.c when this macro is defined, giving an error saying the CTASSERT macro is resolving to a negative array size. Is there any particular secret to using this macro (like, no one goes there any more?) Thanks -- Charles R. (Charlie) Martin Senior Software Engineer SGI logo 1900 Pike Road Longmont, CO 80501 Phone: 303-532-0209 E-Mail: CRMartin@sgi.com Website: www.sgi.com From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 21:53:52 2011 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 DE88B1065675 for ; Thu, 25 Aug 2011 21:53:52 +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 5DC538FC0A for ; Thu, 25 Aug 2011 21:53: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 p7PLrncu008211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Aug 2011 00:53:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p7PLrnSY050262; Fri, 26 Aug 2011 00:53:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p7PLrnuP050261; Fri, 26 Aug 2011 00:53:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Aug 2011 00:53:49 +0300 From: Kostik Belousov To: Charlie Martin Message-ID: <20110825215348.GW17489@deviant.kiev.zoral.com.ua> References: <4E56BB99.6030706@sgi.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QWHkWXETW2F1vgkC" Content-Disposition: inline In-Reply-To: <4E56BB99.6030706@sgi.com> 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=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no 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: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 21:53:52 -0000 --QWHkWXETW2F1vgkC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: > We're having a crash in some internal code running on FreeBSD 7.2=20 > (specifically 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know=20 > it's quite a bit behind) in which after 18-30 hours of running load=20 > tests, the code panics with: >=20 > panic: Bad link elm 0xffffff0044c09600 next->prev !=3D elm > cpuid =3D 0 > KDB: stack backtrace: > db_trace_self_wrapper() at 0xffffffff8019119a =3D db_trace_self_wrapper+0= x2a > panic() at 0xffffffff80307c72 =3D panic+0x182 > devfs_populate_loop() at 0xffffffff802a43a8 =3D devfs_populate_loop+0x548 >=20 >=20 > First question: where's the most appropriate place to ask about this=20 > kind of bug on a back version. It is fine to ask there. >=20 > Second: does this remind anyone of any bugs? Googling came up with a=20 > few somewhat similar things but hasn't provided much insight so far. In 99% of the cases, it means that you forgot to dev_ref() some cdev. --QWHkWXETW2F1vgkC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk5WxGwACgkQC3+MBN1Mb4iOvgCg5v6t/Xmr7axl/G6cCBPFTD9k IzgAoKbFdo3Nj5cNcJP9XnX/wnQTbnNW =1nG/ -----END PGP SIGNATURE----- --QWHkWXETW2F1vgkC-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 22:20:05 2011 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 727C41065670 for ; Thu, 25 Aug 2011 22:20:05 +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 E48E38FC14 for ; Thu, 25 Aug 2011 22:20:04 +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 p7PMK1fq010528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Aug 2011 01:20:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p7PMK1CK051238; Fri, 26 Aug 2011 01:20:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p7PMK13Y051237; Fri, 26 Aug 2011 01:20:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Aug 2011 01:20:01 +0300 From: Kostik Belousov To: Brandon Gooch Message-ID: <20110825222001.GX17489@deviant.kiev.zoral.com.ua> References: <4E56BB99.6030706@sgi.com> <20110825215348.GW17489@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QtjeHm9oonoxWgqH" Content-Disposition: inline In-Reply-To: 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=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no 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, Charlie Martin Subject: Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 22:20:05 -0000 --QtjeHm9oonoxWgqH Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2011 at 05:12:09PM -0500, Brandon Gooch wrote: > On Thu, Aug 25, 2011 at 4:53 PM, Kostik Belousov wr= ote: > > On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: > >> We're having a crash in some internal code running on FreeBSD 7.2 > >> (specifically =9A7.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know > >> it's quite a bit behind) in which after 18-30 hours of running load > >> tests, the code panics with: > >> > >> panic: Bad link elm 0xffffff0044c09600 next->prev !=3D elm > >> cpuid =3D 0 > >> KDB: stack backtrace: > >> db_trace_self_wrapper() at 0xffffffff8019119a =3D db_trace_self_wrappe= r+0x2a > >> panic() at 0xffffffff80307c72 =3D panic+0x182 > >> devfs_populate_loop() at 0xffffffff802a43a8 =3D devfs_populate_loop+0x= 548 > >> > >> > >> First question: where's the most appropriate place to ask about this > >> kind of bug on a back version. > > It is fine to ask there. > > > >> > >> Second: does this remind anyone of any bugs? =9AGoogling came up with a > >> few somewhat similar things but hasn't provided much insight so far. > > In 99% of the cases, it means that you forgot to dev_ref() some cdev. >=20 > So dev_ref increments the reference count for a cdev. Even though the > work "loop" seems to indicate that we will iterate over a list of > objects (one of which we may be missing a reference to via a missing > dev_ref()), I'm not seeing how this can cause a panic from inside > devfs_populate_loop(). >=20 > Can you help me understand this? >=20 Missing dev_ref() means that the memory for the cdev (and cdev_priv) is freed prematurely. If this happens before destroy_dev() is called, then the list which is iterated over by populate_loop(), is corrupted. See e.g. MAKEDEV_REF flag for make_dev(9) and its use in the (old) clone handlers. --QtjeHm9oonoxWgqH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk5WypAACgkQC3+MBN1Mb4iO+ACdFJkL5BsS9uhMRInBVw0Mkj/G 0I0An0CAfxULXF/hEhf1aYsFjVul8mMF =d2bd -----END PGP SIGNATURE----- --QtjeHm9oonoxWgqH-- From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 22:25:32 2011 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 B30F1106566B for ; Thu, 25 Aug 2011 22:25:32 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 749118FC19 for ; Thu, 25 Aug 2011 22:25:32 +0000 (UTC) Received: by ywo32 with SMTP id 32so2584427ywo.13 for ; Thu, 25 Aug 2011 15:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=IJhVz3nIcXSGs5x5PUnhNXHGalyTFnx6wq1/fTqgyao=; b=ShzRmIBuvSSyUxl+7ucIdNAhVCBokbrtds00YGsoC6tFoAp3o/dSjv13lf8C6nvBom 9x8Ue8ZSZI2pZoYiNUtkNKZxNQfFC0ZnNBwcpyObbZzYG0JVrt7zLM8TGEEE+kbL2vuX 8rkkwjllYb5rHu4OJ2wlFluDg/wDs2T1Rh20Q= MIME-Version: 1.0 Received: by 10.42.168.72 with SMTP id v8mr232748icy.266.1314309371881; Thu, 25 Aug 2011 14:56:11 -0700 (PDT) Received: by 10.42.243.5 with HTTP; Thu, 25 Aug 2011 14:56:11 -0700 (PDT) In-Reply-To: <4E56BB99.6030706@sgi.com> References: <4E56BB99.6030706@sgi.com> Date: Thu, 25 Aug 2011 23:56:11 +0200 Message-ID: From: Kip Macy To: Charlie Martin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 22:25:32 -0000 On Thu, Aug 25, 2011 at 11:16 PM, Charlie Martin wrote: > We're having a crash in some internal code running on FreeBSD 7.2 > (specifically =A07.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know i= t's > quite a bit behind) in which after 18-30 hours of running load tests, the > code panics with: > > panic: Bad link elm 0xffffff0044c09600 next->prev !=3D elm > cpuid =3D 0 > KDB: stack backtrace: > db_trace_self_wrapper() at 0xffffffff8019119a =3D db_trace_self_wrapper+0= x2a > panic() at 0xffffffff80307c72 =3D panic+0x182 > devfs_populate_loop() at 0xffffffff802a43a8 =3D devfs_populate_loop+0x548 > > > First question: where's the most appropriate place to ask about this kind= of > bug on a back version. Probably -stable. I don't know how many developers are still running 7. Most are on 8 at this point. > Second: does this remind anyone of any bugs? =A0Googling came up with a f= ew > somewhat similar things but hasn't provided much insight so far. This panic is very common when list updates aren't adequately serialized. > Third: I tried compiling with the sys/queue.h QUEUE_MACRO_DEBUG defined i= n > order to get more useful information from the panic. =A0The kernel build = fails > in pmap.c when this macro is defined, giving an error saying the CTASSERT > macro is resolving to a negative array size. =A0Is there any particular s= ecret > to using this macro (like, no one goes there any more?) This is because you are running amd64 and the the pv_entry constants were defined assuming the default (smaller) list entry structure. I once fixed this in a local tree, but I think I was so dismayed at the "obviousness" of the bug I was tracking down that I neglected to commit the pmap update. It shouldn't be too hard to calculate the correct constants. Cheers From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 22:39:58 2011 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 3A272106566B for ; Thu, 25 Aug 2011 22:39:58 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id C62ED8FC0C for ; Thu, 25 Aug 2011 22:39:57 +0000 (UTC) Received: by wwe5 with SMTP id 5so5469460wwe.1 for ; Thu, 25 Aug 2011 15:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=GwsEcA3dYBcTWYpEA7yoE/VARm1JsSWB2ptw+HEZJtA=; b=Jkhqutdvvqk7eqdMI2VXJzjvPtajvRWlbLRUd+ccK98OcQZP0qRrpULJFCXkdzXUDC 6kU3ALdJTZRLXY/ZoymqQPjle39468yRqz1Sn6lf6Cx98GoV9gv/uF8UJcIzqQcOmzz4 loGPXU1O8GRXcoGdLpn02QfQcjRKjlMuDdBh4= MIME-Version: 1.0 Received: by 10.216.230.194 with SMTP id j44mr246474weq.28.1314310329452; Thu, 25 Aug 2011 15:12:09 -0700 (PDT) Received: by 10.216.208.158 with HTTP; Thu, 25 Aug 2011 15:12:09 -0700 (PDT) In-Reply-To: <20110825215348.GW17489@deviant.kiev.zoral.com.ua> References: <4E56BB99.6030706@sgi.com> <20110825215348.GW17489@deviant.kiev.zoral.com.ua> Date: Thu, 25 Aug 2011 17:12:09 -0500 Message-ID: From: Brandon Gooch To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Charlie Martin Subject: Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 25 Aug 2011 22:39:58 -0000 On Thu, Aug 25, 2011 at 4:53 PM, Kostik Belousov wrot= e: > On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: >> We're having a crash in some internal code running on FreeBSD 7.2 >> (specifically =A07.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know >> it's quite a bit behind) in which after 18-30 hours of running load >> tests, the code panics with: >> >> panic: Bad link elm 0xffffff0044c09600 next->prev !=3D elm >> cpuid =3D 0 >> KDB: stack backtrace: >> db_trace_self_wrapper() at 0xffffffff8019119a =3D db_trace_self_wrapper+= 0x2a >> panic() at 0xffffffff80307c72 =3D panic+0x182 >> devfs_populate_loop() at 0xffffffff802a43a8 =3D devfs_populate_loop+0x54= 8 >> >> >> First question: where's the most appropriate place to ask about this >> kind of bug on a back version. > It is fine to ask there. > >> >> Second: does this remind anyone of any bugs? =A0Googling came up with a >> few somewhat similar things but hasn't provided much insight so far. > In 99% of the cases, it means that you forgot to dev_ref() some cdev. So dev_ref increments the reference count for a cdev. Even though the work "loop" seems to indicate that we will iterate over a list of objects (one of which we may be missing a reference to via a missing dev_ref()), I'm not seeing how this can cause a panic from inside devfs_populate_loop(). Can you help me understand this? -Brandon From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 03:28:51 2011 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 32ED6106564A for ; Fri, 26 Aug 2011 03:28:51 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id B5BCD8FC15 for ; Fri, 26 Aug 2011 03:28:50 +0000 (UTC) Received: by wwi36 with SMTP id 36so3051007wwi.31 for ; Thu, 25 Aug 2011 20:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zMSS1uG9ogyi9hGObOdLI3YNcA+6Yn7EAlCR/yxoFuk=; b=kIYV82rILKmTKjRRa6+zB3+ucidY9DLmnWgZf+dLkYvPRs4UcuODxhTFhmuV43UcDS 8tjKJSBtys+zbzGz06R+9BzbQnlV+AOhDmbOmEFx20nWHLnbS4GZpqFOX4NJbFDdPTOL A/kVWNuSMoCEBLU2+jZJbKVPaimY/vlFitwUc= MIME-Version: 1.0 Received: by 10.216.157.135 with SMTP id o7mr1313097wek.28.1314329329516; Thu, 25 Aug 2011 20:28:49 -0700 (PDT) Received: by 10.216.208.158 with HTTP; Thu, 25 Aug 2011 20:28:49 -0700 (PDT) In-Reply-To: <20110825222001.GX17489@deviant.kiev.zoral.com.ua> References: <4E56BB99.6030706@sgi.com> <20110825215348.GW17489@deviant.kiev.zoral.com.ua> <20110825222001.GX17489@deviant.kiev.zoral.com.ua> Date: Thu, 25 Aug 2011 22:28:49 -0500 Message-ID: From: Brandon Gooch To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Charlie Martin Subject: Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 26 Aug 2011 03:28:51 -0000 2011/8/25 Kostik Belousov : > On Thu, Aug 25, 2011 at 05:12:09PM -0500, Brandon Gooch wrote: >> On Thu, Aug 25, 2011 at 4:53 PM, Kostik Belousov w= rote: >> > On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: >> >> We're having a crash in some internal code running on FreeBSD 7.2 >> >> (specifically =A07.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I kn= ow >> >> it's quite a bit behind) in which after 18-30 hours of running load >> >> tests, the code panics with: >> >> >> >> panic: Bad link elm 0xffffff0044c09600 next->prev !=3D elm >> >> cpuid =3D 0 >> >> KDB: stack backtrace: >> >> db_trace_self_wrapper() at 0xffffffff8019119a =3D db_trace_self_wrapp= er+0x2a >> >> panic() at 0xffffffff80307c72 =3D panic+0x182 >> >> devfs_populate_loop() at 0xffffffff802a43a8 =3D devfs_populate_loop+0= x548 >> >> >> >> >> >> First question: where's the most appropriate place to ask about this >> >> kind of bug on a back version. >> > It is fine to ask there. >> > >> >> >> >> Second: does this remind anyone of any bugs? =A0Googling came up with= a >> >> few somewhat similar things but hasn't provided much insight so far. >> > In 99% of the cases, it means that you forgot to dev_ref() some cdev. >> >> So dev_ref increments the reference count for a cdev. Even though the >> work "loop" seems to indicate that we will iterate over a list of >> objects (one of which we may be missing a reference to via a missing >> dev_ref()), I'm not seeing how this can cause a panic from inside >> devfs_populate_loop(). >> >> Can you help me understand this? >> > Missing dev_ref() means that the memory for the cdev (and cdev_priv) is > freed prematurely. If this happens before destroy_dev() is called, > then the list which is iterated over by populate_loop(), is corrupted. > > See e.g. MAKEDEV_REF flag for make_dev(9) and its use in the (old) clone > handlers. > Ahhh, thanks Kostik. Reading make_dev(9) (and more source code) now... -Brandon From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 10:45:35 2011 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 04CB9106564A for ; Fri, 26 Aug 2011 10:45:35 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id C00A18FC08 for ; Fri, 26 Aug 2011 10:45:34 +0000 (UTC) Received: by ywo32 with SMTP id 32so3217251ywo.13 for ; Fri, 26 Aug 2011 03:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=jj3f+mFCESUGksmSPvBnIHGBomDVCwyrx3SwdFWNicQ=; b=qhJFj07jFaS0DJnvQUWbe3T7pqCIzK+sTCGSbsctLMK034A4uYtdLyMTs56ux5l/Bl U3swRBaWSfjmFT/TvsV4WgtH8a/2QojQ/hZ3sErd8gREuJJVTfFBjqtp7uuIrH9lgc77 lu0MEMdMqqgkUS4JYHpvtLoIZkQieQUiK6Tf8= MIME-Version: 1.0 Received: by 10.150.166.3 with SMTP id o3mr2029955ybe.200.1314353836938; Fri, 26 Aug 2011 03:17:16 -0700 (PDT) Received: by 10.150.137.16 with HTTP; Fri, 26 Aug 2011 03:17:16 -0700 (PDT) Date: Fri, 26 Aug 2011 12:17:16 +0200 Message-ID: From: Monthadar Al Jaberi To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Dynamic kernel module linking problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2011 10:45:35 -0000 Hi, I have written a dynamic loadable module using DECLARE_MODULE in FreeBSD-Current. And I want to iterate through the ifnet list using following code snippet: extern struct ifnethead ifnet; ... struct ifnet *ifp, *ifp_temp; TAILQ_FOREACH_SAFE(ifp, &ifnet, if_link, ifp_temp) { printf("%s\n", ifp->if_dname); } Compilation is fine, but when I load the module I get the following error: ... /sbin/kldload -v module.ko link_elf: symbol ifnet undefined ... What am I doing wrong? Shouldn't kernel be able to link it on its own? Grateful for any advice. -- //Monthadar Al Jaberi From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 13:21:38 2011 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 9F0971065670 for ; Fri, 26 Aug 2011 13:21:38 +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 77EC48FC16 for ; Fri, 26 Aug 2011 13:21:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D624146B0D; Fri, 26 Aug 2011 09:21:37 -0400 (EDT) Date: Fri, 26 Aug 2011 14:21:37 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Monthadar Al Jaberi In-Reply-To: Message-ID: References: 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: Dynamic kernel module linking problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2011 13:21:38 -0000 On Fri, 26 Aug 2011, Monthadar Al Jaberi wrote: > I have written a dynamic loadable module using DECLARE_MODULE in > FreeBSD-Current. > > And I want to iterate through the ifnet list using following code snippet: If this is on a recent version of FreeBSD (8.x and later), then you probably mean to be using V_ifnet, and you should include if_var.h rather than using an extern in order to ensure virtualisation is handled properly. Robert > > extern struct ifnethead ifnet; > ... > struct ifnet *ifp, *ifp_temp; > TAILQ_FOREACH_SAFE(ifp, &ifnet, if_link, ifp_temp) { > printf("%s\n", ifp->if_dname); > } > > Compilation is fine, but when I load the module I get the following error: > > ... > /sbin/kldload -v module.ko > link_elf: symbol ifnet undefined > ... > > What am I doing wrong? Shouldn't kernel be able to link it on its own? > > Grateful for any advice. > -- > //Monthadar Al Jaberi > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 17:36:52 2011 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 B4D5A106564A for ; Fri, 26 Aug 2011 17:36:52 +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 732718FC08 for ; Fri, 26 Aug 2011 17:36:52 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qx0Ko-0003Ca-Mx for freebsd-hackers@freebsd.org; Fri, 26 Aug 2011 19:36:50 +0200 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 ; Fri, 26 Aug 2011 19:36:50 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 26 Aug 2011 19:36:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Fri, 26 Aug 2011 19:36:37 +0200 Lines: 9 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.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.2.12) Gecko/20101102 Thunderbird/3.1.6 X-Enigmail-Version: 1.1.2 Subject: Large machine test ideas X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 26 Aug 2011 17:36:52 -0000 I'll have a 8x8x2 (128 logical CPUs) machine to test for an afternoon next week and I'm just wondering if any of you have something they want tested. The opportunities are limited: it would have to be a self-contained test (no network, drives, etc.) and fairly short. Of course, I'll do some of my own tests just to get a feel of the machine. I think that I'll need a 9-CURRENT snapshot on it to run all 128 CPUs, right? From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 17:44:37 2011 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 E26FC106566B for ; Fri, 26 Aug 2011 17:44:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9F58FC15 for ; Fri, 26 Aug 2011 17:44:37 +0000 (UTC) Received: by qyk9 with SMTP id 9so2926643qyk.13 for ; Fri, 26 Aug 2011 10:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kOC9tZ6aMo1ffBuh/urBwJ5qQrpBrBqpcdtg7hlUivc=; b=FGkBBpQz9tH4BjtGGVfMC/E7ykJ9WxleD4eyL3HefRj6kiqK2Wa5ekRAEZ09BgoDEd zzlt7w87TrPbWLnKY7+BCiiMTQp55HRChOKqEpsaF29qoYPtuvzlkqtbbGEfY9xT0xCW unR/dRr7zks35qKghy+3u1fdrvQdbGLsvSq1M= MIME-Version: 1.0 Received: by 10.229.64.80 with SMTP id d16mr1841229qci.169.1314380676773; Fri, 26 Aug 2011 10:44:36 -0700 (PDT) Received: by 10.224.19.131 with HTTP; Fri, 26 Aug 2011 10:44:36 -0700 (PDT) In-Reply-To: References: Date: Fri, 26 Aug 2011 10:44:36 -0700 Message-ID: From: Garrett Cooper To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Large machine test ideas X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.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, 26 Aug 2011 17:44:38 -0000 On Fri, Aug 26, 2011 at 10:36 AM, Ivan Voras wrote: ... > I think that I'll need a 9-CURRENT snapshot on it to run all 128 CPUs, > right? A 9.0-BETA1 snapshot, yes. -Garrett From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 27 01:25:08 2011 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 161A91065670 for ; Sat, 27 Aug 2011 01:25:08 +0000 (UTC) (envelope-from hilfialkaff@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1988FC15 for ; Sat, 27 Aug 2011 01:25:07 +0000 (UTC) Received: by fxe4 with SMTP id 4so3849891fxe.13 for ; Fri, 26 Aug 2011 18:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=AIQdFC40JeCYXDmBeK9sSU/LmRePCdf1X+r6qpljqfw=; b=Gdu+Nyj7EAZfLrEMtDALAFY6ENZBLYtQssX4Dozh/6Zw4TEcv1QRtSdCmFmJCGP8ei NbAKMXGBczx9scOJsG9y04IRFsdMGGb4GLAU634ZYtuL1MWcnBY13fW/JnthdVdyA/wf c241KzweUj7cgZ373K30zIrn2bt5lREpxKs1A= MIME-Version: 1.0 Received: by 10.223.43.23 with SMTP id u23mr2617198fae.82.1314406954829; Fri, 26 Aug 2011 18:02:34 -0700 (PDT) Received: by 10.223.101.132 with HTTP; Fri, 26 Aug 2011 18:02:34 -0700 (PDT) Date: Fri, 26 Aug 2011 18:02:34 -0700 Message-ID: From: hilfi alkaff To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: pcie initialization with acpi X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2011 01:25:08 -0000 Hi, I would like to learn more of the above matter. After the MCFG table gets discovered with acpi, what does the address given by the ACPI_MCFG_ALLOCATION* tells you? Does that tell you the address of the extended configuration space of pci express? Also, is BSD distinguishing between reading from pcie config & pci config? Because there's this pciereg_cfgread() function that seem to do that. I thought pcie config space is just at the offset of 0x100 from pci config space? -- Thanks in advance, ~Hilfi Alkaff~ From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 27 01:38:30 2011 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 7E4741065672 for ; Sat, 27 Aug 2011 01:38:30 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3908E8FC08 for ; Sat, 27 Aug 2011 01:38:29 +0000 (UTC) Received: by gwb15 with SMTP id 15so4042194gwb.13 for ; Fri, 26 Aug 2011 18:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=MJafMWaguIkBmMFRLtkbpGq9dKEmsJ5aokYyBGJ0780=; b=VeSU4wYUHatr+YHD1M/5cHVfzLmTlrFH3CiQ3qtm1qqRub/3IN8rDtey7ho1ZQwsup /au7+sOhbWDeosj9OFr+M6qYeZ5bTNUnOpVrUqFXfuIw4dHRGTsoXjdjNmdeLrPYi4Zh 7cqoN7CPRkvDNNIam8l9CGhMIdUnuoV04sQiw= MIME-Version: 1.0 Received: by 10.231.75.77 with SMTP id x13mr3681217ibj.55.1314409108823; Fri, 26 Aug 2011 18:38:28 -0700 (PDT) Received: by 10.231.37.68 with HTTP; Fri, 26 Aug 2011 18:38:28 -0700 (PDT) In-Reply-To: References: <868vqt0xuc.fsf@gmail.com> <1313663436600-4711635.post@n5.nabble.com> <86hb5euofp.fsf@gmail.com> <20110823175133.GK18091@acme.spoerlein.net> Date: Fri, 26 Aug 2011 20:38:28 -0500 Message-ID: From: Zhihao Yuan To: Zhihao Yuan , Test Rat , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: [nvi-iconv]Call for test X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2011 01:38:30 -0000 A new version is uploaded. SVN users can download the patch at https://github.com/downloads/lichray/nvi2/nvi2-freebsd-2011-08-26-svn.diff.= gz A rcsid-free version (for git users) is available at https://github.com/downloads/lichray/nvi2/nvi2-freebsd-2011-08-26.diff.gz I did a "revision by revision" code review in this version, to make sure all FreeBSD changes on nvi are all considered. And, the catalogs are updated. Typically, Pavel Timofeev finished the Russian translation. I think the new nvi is stable enough, and I want to know what we should do next to get this into FreeBSD's base system, if it's possible. On Tue, Aug 23, 2011 at 3:33 PM, Zhihao Yuan wrote: > On Tue, Aug 23, 2011 at 12:51 PM, Ulrich Sp=C3=B6rlein wrote: >> On Thu, 2011-08-18 at 22:15:47 -0500, Zhihao Yuan wrote: >>> On Thu, Aug 18, 2011 at 9:26 PM, Test Rat wrote: >>> > timp writes: >>> > >>> >> Hi! >>> >> I just tried you patch on latest current with clang. >>> >> >>> >> [root@current64 /usr/src]# uname -a >>> >> FreeBSD current64 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Aug 18 03:56:4= 5 MSK >>> >> 2011 =C2=A0 =C2=A0 mox@current64:/usr/obj/usr/src/sys/GENERIC =C2=A0= amd64 >>> >> >>> >> [root@current64 /usr/src]# patch < ~/nvi2-freebsd-2011-08-17.diff >>> > [...] >>> >> =3D=3D=3D> usr.bin/vi (depend) >>> >> make: don't know how to make cl_bsd.c. Stop >>> >> *** Error code 2 >>> > >>> > Use `-p0' otherwise new directories won't be created. This is documen= ted >>> > in patch(1). And cl_bsd.c ended up in current directory (/usr/src) >>> > >>> > =C2=A0$ diffstat ~/nvi2-freebsd-2011-08-17.diff.gz | fgrep cl_bsd.c >>> > =C2=A0 contrib/nvi2/cl/cl_bsd.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0| =C2=A0346 +++ >>> >>> zzz... I always use -p0 but I did not know what it does... >>> >>> > >>> > Zhihao Yuan writes: >>> >> The patch will create contrib/nvi2, and it will not remove the unuse= d >>> >> contrib/nvi (patch(1) can not really remove files anyway). >>> > >>> > patch(1) can remove *empty* files with `-E', e.g. >>> > >>> > =C2=A0$ svn rm UPDATING >>> > =C2=A0$ svn di UPDATING | patch -E -d /usr/src >>> >>> Got it. But removing contrib/nvi with patch will just double the patch >>> size anyway. A svn rm will do it if some day the patch got committed. >> >> Since you already use github.com, why not clone >> https://github.com/freebsd/freebsd-head/ and do your work in a separate >> branch? People already using one of the github or gitorious clones can >> then easily download your branch and don't have to fight patch(1). >> > > FreeBSD's nvi code is frozen for a long time, so my patch should not > meet conflict. But since I touched rcsid recently, I'll upload > non-rcsid (git-friendly) patches recently. > >> just fyi, >> Uli >> > > > > -- > Zhihao Yuan, nickname lichray > The best way to predict the future is to invent it. > ___________________________________________________ > 4BSD -- http://4bsd.biz/ > --=20 Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 27 16:02:30 2011 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 DABC1106564A for ; Sat, 27 Aug 2011 16:02:30 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by mx1.freebsd.org (Postfix) with ESMTP id 73ED78FC17 for ; Sat, 27 Aug 2011 16:02:30 +0000 (UTC) Received: by eye4 with SMTP id 4so2825390eye.31 for ; Sat, 27 Aug 2011 09:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=EEd2+lLQUDhehn3hIwAyvqtFwSNQQ+lKX7aCrjhGr/4=; b=HBZsfxsfxBbC3tkBW0QiUSsN8htIj9Iwx17oUnVYP1xD9cejOeOaLit7x0rXTeUylC Rd+meXtWjH71XxdiUzeLYT5rne5GCRmG04Yyg/2XEeJD1xpjpBnp2COuXlmpoB72sNON CLz+tUaYgwduPRpiiLwnT3EfCh9APQIJ9i0Jo= MIME-Version: 1.0 Received: by 10.14.2.147 with SMTP id 19mr967119eef.59.1314459550742; Sat, 27 Aug 2011 08:39:10 -0700 (PDT) Received: by 10.14.27.132 with HTTP; Sat, 27 Aug 2011 08:39:10 -0700 (PDT) Date: Sat, 27 Aug 2011 11:39:10 -0400 Message-ID: From: Aryeh Friedman To: FreeBSD Mailing List , Steven Platt , Dustyn Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: best way to get distfiles added to ports.tgz during make release X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2011 16:02:30 -0000 I have made a custom install USB drive from R/cdrom/dvd1 and pkg_add works fine for everything but xorg/nvidia-driver so part of the post install script I made is "portmaster xorg/nvidia-driver" the only problem is it then needs to fetch the distfiles (the target install machine{s) will not have nic's attached)... so my questoin is whats the best way to make it so when sysinstall unpacks ./8.2-NHK_KIOSK/ports/ports.tgz that the distfiles are also unpacked? From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 27 18:03:42 2011 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 C0C491065672; Sat, 27 Aug 2011 18:03:42 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 84D2C8FC13; Sat, 27 Aug 2011 18:03:42 +0000 (UTC) Received: from SBHFISLREXT03 ([10.132.254.62]) by SCSFISLTC02 (8.14.3/8.14.3) with ESMTP id p7RHlGYR023236; Sat, 27 Aug 2011 12:47:16 -0500 Received: from sbhfisltcgw01.FNFIS.COM (Not Verified[10.132.248.121]) by SBHFISLREXT03 with MailMarshal (v6, 5, 4, 7535) id ; Sat, 27 Aug 2011 12:47:43 -0500 Received: from smtp.fisglobal.com ([10.132.206.31]) by sbhfisltcgw01.FNFIS.COM with Microsoft SMTPSVC(6.0.3790.4675); Sat, 27 Aug 2011 12:47:15 -0500 Received: from [10.0.0.104] (10.14.152.54) by smtp.fisglobal.com (10.132.206.31) with Microsoft SMTP Server (TLS) id 14.1.289.1; Sat, 27 Aug 2011 12:47:08 -0500 From: Devin Teske Content-Type: multipart/mixed; boundary="Apple-Mail-25--994899661" Date: Sat, 27 Aug 2011 10:47:12 -0700 Message-ID: To: FreeBSD Hackers MIME-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) X-Originating-IP: [10.14.152.54] X-OriginalArrivalTime: 27 Aug 2011 17:47:15.0198 (UTC) FILETIME=[5B7909E0:01CC64E1] Cc: Devin Teske , FreeBSD Jail , FreeBSD RC , Dave Robison Subject: [PATCH] Add /etc/rc.d/vimage startup script for creating vnet jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2011 18:03:42 -0000 --Apple-Mail-25--994899661 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" Hi All, I'd like to submit a patch for review (attached) that adds a new /etc/rc.d = script named "vimage". _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. _____________ --Apple-Mail-25--994899661 Content-Disposition: attachment; filename="vimage_rc.20110827104104.patch" Content-Type: application/octet-stream; name="vimage_rc.20110827104104.patch" Content-Transfer-Encoding: 7bit --- etc/defaults/rc.conf.orig Fri Aug 26 20:36:52 2011 +++ etc/defaults/rc.conf Sat Aug 27 10:34:54 2011 @@ -697,6 +697,43 @@ #jail_example_flags="-l -U root" # flags for jail(8) ############################################################## +### Vimage Configuration ##################################### +############################################################## +vimage_enable="NO" # Set to NO to disable starting of any vimages +vimage_parallel_start="NO" # Start vimages in the background +vimage_list="" # Space separated list of names of vimages +vimage_set_hostname_allow="YES" # Allow root user in a vimage to change its hostname +vimage_socket_unixiproute_only="NO" # Route only TCP/IP within a vimage +vimage_sysvipc_allow="YES" # Allow SystemV IPC use from within a vimage + +# +# To use rc's built-in vimage infrastructure create entries for +# each vimage, specified in vimage_list, with the following variables. +# NOTES: +# - replace 'example' with the vimage's name. +# - except rootdir, and hostname, all of the following variables may be made +# global vimage variables if you don't specify a vimage name (ie. +# vimage_fib, vimage_devfs_ruleset). +# +#vimage_example_rootdir="/usr/jail/default" # Vimage's root directory +#vimage_example_hostname="default.domain.com" # Vimage's hostname +#vimage_example_vnets="epair0b" # Vimage's vnet interfaces +#vimage_example_exec_start="/bin/sh /etc/rc" # command to execute in vimage for starting +#vimage_example_services="sshd ipfw zfs" # services to start after starting vimage +#vimage_example_exec_afterstart0="/bin/sh command" # command to execute after the one for + # starting the vimage. More than one can + # be specified using a trailing number +#vimage_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in vimage for stopping +#vimage_example_devfs_enable="NO" # mount devfs in the vimage +#vimage_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to vimage - + # usually you want "devfsrules_jail". +#vimage_example_fdescfs_enable="NO" # mount fdescfs in the vimage +#vimage_example_procfs_enable="NO" # mount procfs in vimage +#vimage_example_mount_enable="NO" # mount/umount vimage's fs +#vimage_example_fstab="" # fstab(5) for mount/umount +#vimage_example_flags="-l -U root" # flags for jail(8) + +############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## ### scripts to source rc_conf_files overrides safely. ## ############################################################## --- etc/rc.d/vimage.orig Sat Aug 27 10:26:53 2011 +++ etc/rc.d/vimage Sat Aug 27 10:36:03 2011 @@ -0,0 +1,551 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: vimage +# REQUIRE: LOGIN cleanvar +# BEFORE: securelevel +# KEYWORD: nojail shutdown + +# WARNING: This script deals with untrusted data (the data and +# processes inside the vimage) and care must be taken when changing the +# code related to this! If you have any doubt whether a change is +# correct and have security impact, please get the patch reviewed by +# the FreeBSD Security Team prior to commit. + +. /etc/rc.subr + +name="vimage" +rcvar=`set_rcvar` + +start_precmd="vimage_prestart" +start_cmd="vimage_start" +stop_cmd="vimage_stop" + +# init_variables _v +# Initialize the various vimage variables for vimage _v. +# +init_variables() +{ + _v="$1" + + if [ -z "$_v" ]; then + warn "init_variables: you must specify a vimage" + return + fi + + eval _rootdir=\"\$vimage_${_v}_rootdir\" + _devdir="${_rootdir}/dev" + _fdescdir="${_devdir}/fd" + _procdir="${_rootdir}/proc" + eval _hostname=\"\$vimage_${_v}_hostname\" + eval _vnets=\"\$vimage_${_v}_vnets\" + eval _exec=\"\$vimage_${_v}_exec\" + + i=0 + while : ; do + eval _exec_prestart${i}=\"\${vimage_${_v}_exec_prestart${i}:-\${vimage_exec_prestart${i}}}\" + [ -z "$(eval echo \"\$_exec_prestart${i}\")" ] && break + i=$((i + 1)) + done + + eval _exec_start=\"\${vimage_${_v}_exec_start:-${vimage_exec_start}}\" + eval _services=\"\${vimage_${_v}_services:-${vimage_services}}\" + + i=1 + while : ; do + eval _exec_afterstart${i}=\"\${vimage_${_v}_exec_afterstart${i}:-\${vimage_exec_afterstart${i}}}\" + [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && break + i=$((i + 1)) + done + + i=0 + while : ; do + eval _exec_poststart${i}=\"\${vimage_${_v}_exec_poststart${i}:-\${vimage_exec_poststart${i}}}\" + [ -z "$(eval echo \"\$_exec_poststart${i}\")" ] && break + i=$((i + 1)) + done + + i=0 + while : ; do + eval _exec_prestop${i}=\"\${vimage_${_v}_exec_prestop${i}:-\${vimage_exec_prestop${i}}}\" + [ -z "$(eval echo \"\$_exec_prestop${i}\")" ] && break + i=$((i + 1)) + done + + eval _exec_stop=\"\${vimage_${_v}_exec_stop:-${vimage_exec_stop}}\" + + i=0 + while : ; do + eval _exec_poststop${i}=\"\${vimage_${_v}_exec_poststop${i}:-\${vimage_exec_poststop${i}}}\" + [ -z "$(eval echo \"\$_exec_poststop${i}\")" ] && break + i=$((i + 1)) + done + + if [ -n "${_exec}" ]; then + # simple/backward-compatible execution + _exec_start="${_exec}" + _exec_stop="" + else + # flexible execution + if [ -z "${_exec_start}" ]; then + _exec_start="/bin/sh /etc/rc" + if [ -z "${_exec_stop}" ]; then + _exec_stop="/bin/sh /etc/rc.shutdown" + fi + fi + fi + + # The default jail ruleset will be used by rc.subr if none is specified. + eval _ruleset=\"\${vimage_${_v}_devfs_ruleset:-${vimage_devfs_ruleset}}\" + eval _devfs=\"\${vimage_${_v}_devfs_enable:-${vimage_devfs_enable}}\" + [ -z "${_devfs}" ] && _devfs="NO" + eval _fdescfs=\"\${vimage_${_v}_fdescfs_enable:-${vimage_fdescfs_enable}}\" + [ -z "${_fdescfs}" ] && _fdescfs="NO" + eval _procfs=\"\${vimage_${_v}_procfs_enable:-${vimage_procfs_enable}}\" + [ -z "${_procfs}" ] && _procfs="NO" + + eval _mount=\"\${vimage_${_v}_mount_enable:-${vimage_mount_enable}}\" + [ -z "${_mount}" ] && _mount="NO" + # "/etc/fstab.${_v}" will be used for {,u}mount(8) if none is specified. + eval _fstab=\"\${vimage_${_v}_fstab:-${vimage_fstab}}\" + [ -z "${_fstab}" ] && _fstab="/etc/fstab.${_v}" + eval _flags=\"\${vimage_${_v}_flags:-${vimage_flags}}\" + [ -z "${_flags}" ] && _flags="-l -U root" + eval _consolelog=\"\${vimage_${_v}_consolelog:-${vimage_consolelog}}\" + [ -z "${_consolelog}" ] && _consolelog="/var/log/vimage_${_v}_console.log" + + # Debugging aid + # + debug "$_v devfs enable: $_devfs" + debug "$_v fdescfs enable: $_fdescfs" + debug "$_v procfs enable: $_procfs" + debug "$_v mount enable: $_mount" + debug "$_v hostname: $_hostname" + debug "$_v vnets: $_vnets" + debug "$_v services: $_services" + debug "$_v root: $_rootdir" + debug "$_v devdir: $_devdir" + debug "$_v fdescdir: $_fdescdir" + debug "$_v procdir: $_procdir" + debug "$_v ruleset: $_ruleset" + debug "$_v fstab: $_fstab" + + i=0 + while : ; do + eval out=\"\${_exec_prestart${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_v exec pre-start #${i}: ${out}" + i=$((i + 1)) + done + + debug "$_v exec start: $_exec_start" + + i=1 + while : ; do + eval out=\"\${_exec_afterstart${i}:-''}\" + + if [ -z "$out" ]; then + break; + fi + + debug "$_v exec after start #${i}: ${out}" + i=$((i + 1)) + done + + i=0 + while : ; do + eval out=\"\${_exec_poststart${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_v exec post-start #${i}: ${out}" + i=$((i + 1)) + done + + i=0 + while : ; do + eval out=\"\${_exec_prestop${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_v exec pre-stop #${i}: ${out}" + i=$((i + 1)) + done + + debug "$_v exec stop: $_exec_stop" + + i=0 + while : ; do + eval out=\"\${_exec_poststop${i}:-''}\" + if [ -z "$out" ]; then + break + fi + debug "$_v exec post-stop #${i}: ${out}" + i=$((i + 1)) + done + + debug "$_v flags: $_flags" + debug "$_v consolelog: $_consolelog" + + if [ -z "${_hostname}" ]; then + err 3 "$name: No hostname has been defined for ${_v}" + fi + if [ -z "${_rootdir}" ]; then + err 3 "$name: No root directory has been defined for ${_v}" + fi +} + +# set_sysctl rc_knob mib msg +# If the mib sysctl is set according to what rc_knob +# specifies, this function does nothing. However if +# rc_knob is set differently than mib, then the mib +# is set accordingly and msg is displayed followed by +# an '=" sign and the word 'YES' or 'NO'. +# +set_sysctl() +{ + _knob="$1" + _mib="$2" + _msg="$3" + + _current=`${SYSCTL} -n $_mib 2>/dev/null` + if checkyesno $_knob ; then + if [ "$_current" -ne 1 ]; then + echo -n " ${_msg}=YES" + ${SYSCTL} 1>/dev/null ${_mib}=1 + fi + else + if [ "$_current" -ne 0 ]; then + echo -n " ${_msg}=NO" + ${SYSCTL} 1>/dev/null ${_mib}=0 + fi + fi +} + +# is_current_mountpoint() +# Is the directory mount point for a currently mounted file +# system? +# +is_current_mountpoint() +{ + local _dir _dir2 + + _dir=$1 + + _dir=`echo $_dir | sed -Ee 's#//+#/#g' -e 's#/$##'` + [ ! -d "${_dir}" ] && return 1 + _dir2=`df ${_dir} | tail +2 | awk '{ print $6 }'` + [ "${_dir}" = "${_dir2}" ] + return $? +} + +# is_symlinked_mountpoint() +# Is a mount point, or any of its parent directories, a symlink? +# +is_symlinked_mountpoint() +{ + local _dir + + _dir=$1 + + [ -L "$_dir" ] && return 0 + [ "$_dir" = "/" ] && return 1 + is_symlinked_mountpoint `dirname $_dir` + return $? +} + +# secure_umount +# Try to unmount a mount point without being vulnerable to +# symlink attacks. +# +secure_umount() +{ + local _dir + + _dir=$1 + + if is_current_mountpoint ${_dir}; then + umount -f ${_dir} >/dev/null 2>&1 + else + debug "Nothing mounted on ${_dir} - not unmounting" + fi +} + + +# vimage_umount_fs +# This function unmounts certain special filesystems in the +# currently selected vimage. The caller must call the init_variables() +# routine before calling this one. +# +vimage_umount_fs() +{ + local _device _mountpt _rest + + if checkyesno _fdescfs; then + if [ -d "${_fdescdir}" ] ; then + secure_umount ${_fdescdir} + fi + fi + if checkyesno _devfs; then + if [ -d "${_devdir}" ] ; then + secure_umount ${_devdir} + fi + fi + if checkyesno _procfs; then + if [ -d "${_procdir}" ] ; then + secure_umount ${_procdir} + fi + fi + if checkyesno _mount; then + [ -f "${_fstab}" ] || warn "${_fstab} does not exist" + tail -r ${_fstab} | while read _device _mountpt _rest; do + case ":${_device}" in + :#* | :) + continue + ;; + esac + secure_umount ${_mountpt} + done + fi +} + +# vimage_mount_fstab() +# Mount file systems from a per vimage fstab while trying to +# secure against symlink attacks at the mount points. +# +# If we are certain we cannot secure against symlink attacks we +# do not mount all of the file systems (since we cannot just not +# mount the file system with the problematic mount point). +# +# The caller must call the init_variables() routine before +# calling this one. +# +vimage_mount_fstab() +{ + local _device _mountpt _rest + + while read _device _mountpt _rest; do + case ":${_device}" in + :#* | :) + continue + ;; + esac + if is_symlinked_mountpoint ${_mountpt}; then + warn "${_mountpt} has symlink as parent - not mounting from ${_fstab}" + return + fi + done <${_fstab} + mount -a -F "${_fstab}" +} + +vimage_prestart() +{ + if checkyesno vimage_parallel_start; then + command_args="&" + fi +} + +vimage_start() +{ + echo -n 'Configuring vimages:' + set_sysctl vimage_set_hostname_allow \ + security.jail.set_hostname_allowed \ + set_hostname_allow + set_sysctl vimage_socket_unixiproute_only \ + security.jail.socket_unixiproute_only unixiproute_only + set_sysctl vimage_sysvipc_allow security.jail.sysvipc_allowed \ + sysvipc_allow + echo '.' + + echo -n 'Starting vimages:' + _tmp_dir=`mktemp -d /tmp/vimage.XXXXXXXX` || \ + err 3 "$name: Can't create temp dir, exiting..." + for _vimage in ${vimage_list} + do + init_variables $_vimage + if [ -f /var/run/vimage_${_vimage}.id ]; then + echo -n " [${_hostname} already running (/var/run/vimage_${_vimage}.id exists)]" + continue; + fi + if checkyesno _mount; then + info "Mounting fstab for vimage ${_vimage} (${_fstab})" + if [ ! -f "${_fstab}" ]; then + err 3 "$name: ${_fstab} does not exist" + fi + vimage_mount_fstab + fi + if checkyesno _devfs; then + # If devfs is already mounted here, skip it. + df -t devfs "${_devdir}" >/dev/null + if [ $? -ne 0 ]; then + if is_symlinked_mountpoint ${_devdir}; then + warn "${_devdir} has symlink as parent - not starting vimage ${_vimage}" + continue + fi + info "Mounting devfs on ${_devdir}" + devfs_mount_jail "${_devdir}" ${_ruleset} + # Transitional symlink for old binaries + if [ ! -L "${_devdir}/log" ]; then + __pwd="`pwd`" + cd "${_devdir}" + ln -sf ../var/run/log log + cd "$__pwd" + fi + fi + + # XXX - It seems symlinks don't work when there + # is a devfs(5) device of the same name. + # Jail console output + # __pwd="`pwd`" + # cd "${_devdir}" + # ln -sf ../var/log/console console + # cd "$__pwd" + fi + if checkyesno _fdescfs; then + if is_symlinked_mountpoint ${_fdescdir}; then + warn "${_fdescdir} has symlink as parent, not mounting" + else + info "Mounting fdescfs on ${_fdescdir}" + mount -t fdescfs fdesc "${_fdescdir}" + fi + fi + if checkyesno _procfs; then + if is_symlinked_mountpoint ${_procdir}; then + warn "${_procdir} has symlink as parent, not mounting" + else + info "Mounting procfs onto ${_procdir}" + if [ -d "${_procdir}" ] ; then + mount -t procfs proc "${_procdir}" + fi + fi + fi + _tmp_vimage=${_tmp_dir}/vimage.$$ + + i=0 + while : ; do + eval out=\"\${_exec_prestart${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + + eval jail ${_flags} -i -c vnet name=\"${_vimage}\" \ + host.hostname=\"${_hostname}\" \ + path=\"${_rootdir}\" persist > ${_tmp_vimage} 2>&1 + + if [ "$?" -eq 0 ] ; then + _vimage_id=$(head -1 ${_tmp_vimage}) + + for _vnet in ${_vnets}; do + ifconfig ${_vnet} vnet "${_vimage_id}" \ + > /dev/null 2>&1 + + case ${_vnet} in + epair[0-9]*[ab]) + ifconfig ${_vnet%?}a up \ + > /dev/null 2>&1;; + esac + done + + eval jexec \"${_vimage_id}\" \ + ${_exec_start} >> ${_tmp_vimage} 2>&1 + + for _service in netif routing ${_services}; do + eval jexec \"${_vimage_id}\" /bin/sh \ + /usr/sbin/service ${_service} start \ + >> ${_tmp_vimage} 2>&1 + done + + i=1 + while : ; do + eval out=\"\${_exec_afterstart${i}:-''}\" + + if [ -z "$out" ]; then + break; + fi + + jexec "${_vimage_id}" ${out} + i=$((i + 1)) + done + + echo -n " $_hostname" + tail +2 ${_tmp_vimage} >${_consolelog} + echo ${_vimage_id} > /var/run/vimage_${_vimage}.id + + i=0 + while : ; do + eval out=\"\${_exec_poststart${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + else + vimage_umount_fs + echo " cannot start vimage \"${_vimage}\": " + tail +2 ${_tmp_vimage} + fi + rm -f ${_tmp_vimage} + done + rmdir ${_tmp_dir} + echo '.' +} + +vimage_stop() +{ + echo -n 'Stopping vimages:' + for _vimage in ${vimage_list} + do + if [ -f "/var/run/vimage_${_vimage}.id" ]; then + _vimage_id=$(cat /var/run/vimage_${_vimage}.id) + if [ ! -z "${_vimage_id}" ]; then + init_variables $_vimage + + i=0 + while : ; do + eval out=\"\${_exec_prestop${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + + if [ -n "${_exec_stop}" ]; then + eval env -i /usr/sbin/jexec ${_vimage_id} ${_exec_stop} \ + >> ${_consolelog} 2>&1 + fi + killall -j ${_vimage_id} -TERM > /dev/null 2>&1 + sleep 1 + killall -j ${_vimage_id} -KILL > /dev/null 2>&1 + vimage_umount_fs + echo -n " $_hostname" + + i=0 + while : ; do + eval out=\"\${_exec_poststop${i}:-''}\" + [ -z "$out" ] && break + ${out} + i=$((i + 1)) + done + fi + rm /var/run/vimage_${_vimage}.id + jail -r ${_vimage} + else + echo " cannot stop vimage ${_vimage}. No vimage id in /var/run" + fi + done + echo '.' +} + +load_rc_config $name +cmd="$1" +if [ $# -gt 0 ]; then + shift +fi +if [ -n "$*" ]; then + vimage_list="$*" +fi + +run_rc_command "${cmd}" --Apple-Mail-25--994899661 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Essentially, a hand-tweaked version of /etc/rc.d/jail with added/removed = features. Here's how we're using it in /etc/rc.conf to successfully start up = vimage jails at boot time: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BEGIN EXCERPT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= # # Vimages # vimage_enable=3D"YES" # Set to NO to disable starting of any vimages vimage_list=3D" vnettest " # Space-separated list of names of vimages clone_interfaces=3D"" # Initialize list of epair/bridge interfaces = to create # # Global settings for all Vimages # vimage_services=3D"sshd" ####################### VIMAGE: vnettest cloned_interfaces=3D"$cloned_interfaces epair0 bridge0" ifconfig_bridge0=3D"addm fxp0 addm epair0a" vimage_vnettest_rootdir=3D"/usr/jails/vnettest" # root = directory vimage_vnettest_hostname=3D"vnettest.jbsd.vicor.com" # hostname vimage_vnettest_devfs_enable=3D"YES" # mount devfs vimage_vnettest_vnets=3D"epair0b" # network = interfaces ####################### VIMAGE: {name} #cloned_interfaces=3D"$cloned_interfaces epair{N} bridge{N}" #ifconfig_bridge{N}=3D"addm {iface} addm epair{N}a" #vimage_{name}_rootdir=3D"/usr/jails/{name}" # root = directory #vimage_{name}_hostname=3D"{hostname}" # hostname #vimage_{name}_devfs_enable=3D"YES" # mount devfs #vimage_{name}_vnets=3D"epair{N}b" # network = interfaces =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D END EXCERPT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 Cheers, Devin= --Apple-Mail-25--994899661--