From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 12:23:15 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 F17E11065670 for ; Sun, 6 Nov 2011 12:23:15 +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 49F3D8FC14 for ; Sun, 6 Nov 2011 12:23:14 +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 OAA09264; Sun, 06 Nov 2011 14:23:10 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RN1kj-0001CG-UK; Sun, 06 Nov 2011 14:23:09 +0200 Message-ID: <4EB67C2A.4000906@FreeBSD.org> Date: Sun, 06 Nov 2011 14:23:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111002 Thunderbird/7.0.1 MIME-Version: 1.0 To: Russell Cattelan References: <4DFA4C47.8060503@digitalelves.com> <4EA5A676.5040500@thebarn.com> In-Reply-To: <4EA5A676.5040500@thebarn.com> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: kexec or similar for FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 12:23:16 -0000 on 24/10/2011 20:55 Russell Cattelan said the following: > So it has been a while and a lot of hair pulling but kload is sorta alive > and kicking. It can now load the kernel from userspace, copy it over the > running kernel and jump the the kernel entry point. > > I'm still having problems getting through the boot process due to > interrupts arriving for unconfigured handlers. Fatal Trap (30) Just in case, is your original kernel running SMP? -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 14:20:50 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 1B8A2106566C; Sun, 6 Nov 2011 14:20:50 +0000 (UTC) (envelope-from to.my.trociny@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 742918FC12; Sun, 6 Nov 2011 14:20:49 +0000 (UTC) Received: by faar19 with SMTP id r19so6234550faa.13 for ; Sun, 06 Nov 2011 06:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=lBax5Ynpq8OEUBILzqhURN+Tna3T7JouTkkGZEyYX6w=; b=c6K626Rvk1h7cM29lCDQNyGmJvf0w69kvACsh5NVWnrOWv2s5oCUgArda2pP+63Bht pM36dlK7YFSAQyg/06IJ5/fA/4hI0EQpUL7EjD4CcLMRV2WM5RBAsYyzy3Mlsae90o3/ R5Ks2nNVH8Np35kqJ9SMGWfrexWID2jthQ5jo= Received: by 10.223.65.83 with SMTP id h19mr21837640fai.1.1320589248401; Sun, 06 Nov 2011 06:20:48 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id a21sm26803943fao.18.2011.11.06.06.20.45 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Nov 2011 06:20:45 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov References: <86y5wkeuw9.fsf@kopusha.home.net> <20111016171005.GB50300@deviant.kiev.zoral.com.ua> <86aa8qozyx.fsf@kopusha.home.net> <20111025082451.GO50300@deviant.kiev.zoral.com.ua> <86aa8k2im0.fsf@kopusha.home.net> <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> X-Comment-To: Kostik Belousov Sender: Mikolaj Golub Date: Sun, 06 Nov 2011 16:20:43 +0200 In-Reply-To: <20111105135801.GT50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Sat, 5 Nov 2011 15:58:01 +0200") Message-ID: <86aa89nxhg.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 14:20:50 -0000 On Sat, 5 Nov 2011 15:58:01 +0200 Kostik Belousov wrote: KB> procfs_doproccmdline() can benefit from your work. Patch for procfs: http://people.freebsd.org/~trociny/procfs.patch -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 16:33:33 2011 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02328106566B; Sun, 6 Nov 2011 16:33:33 +0000 (UTC) (envelope-from ahuete.devel@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 A56798FC08; Sun, 6 Nov 2011 16:33:32 +0000 (UTC) Received: by qyk9 with SMTP id 9so3438205qyk.13 for ; Sun, 06 Nov 2011 08:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=M9G1cVZEwze3MYfK8GaYTK8HwigQJUwX7oH6V/n3U/Q=; b=eS5Ie39AYvs4c0AysJLvdMoL0oUkCWsxmoGZhdhT6LxkwXBLTeWydQZzyObDAaJbWT 6duAUhoM+e9XTuD0JOGCun3ZwfUrwtgYbm4azLs3p+VQ78eHv8LYKI+87cSqwlyENA+0 uCDVuJuEZwoFMDABf6dPznjG0o6HfT3DHCh9Y= MIME-Version: 1.0 Received: by 10.229.217.9 with SMTP id hk9mr2682908qcb.175.1320595830294; Sun, 06 Nov 2011 08:10:30 -0800 (PST) Received: by 10.229.21.6 with HTTP; Sun, 6 Nov 2011 08:10:30 -0800 (PST) Date: Sun, 6 Nov 2011 17:10:30 +0100 Message-ID: From: Antonio Huete Jimenez To: andre@freebsd.org X-Mailman-Approved-At: Sun, 06 Nov 2011 17:08:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: hackers@FreeBSD.org Subject: vmstat(8) changes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 16:33:33 -0000 Hi, After change in: http://svnweb.freebsd.org/base/head/usr.bin/vmstat/vmstat.c?r1=151417&r2=151416&pathrev=151417 I see that X_BOOTTIME is still kept in the namelist in vmstat.c, and I would like to know if there's any reason for that. Cheers, Antonio Huete From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 18:10:49 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 9B57C106564A; Sun, 6 Nov 2011 18:10:49 +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 362468FC08; Sun, 6 Nov 2011 18:10:44 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pA6IAfHO040588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Nov 2011 20:10:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pA6IAfo9056094; Sun, 6 Nov 2011 20:10:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pA6IAfAF056093; Sun, 6 Nov 2011 20:10:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 6 Nov 2011 20:10:41 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20111106181041.GH50300@deviant.kiev.zoral.com.ua> References: <20111025082451.GO50300@deviant.kiev.zoral.com.ua> <86aa8k2im0.fsf@kopusha.home.net> <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y9J5124L7u056RQu" Content-Disposition: inline In-Reply-To: <8662iyjof9.fsf@kopusha.home.net> 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:10:49 -0000 --Y9J5124L7u056RQu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: >=20 > On Sat, 5 Nov 2011 21:45:53 +0200 Kostik Belousov wrote: >=20 > KB> On Sat, Nov 05, 2011 at 08:59:21PM +0200, Mikolaj Golub wrote: > >>=20 > >> On Sat, 5 Nov 2011 17:44:43 +0200 Kostik Belousov wrote: > >>=20 > >> >> KB> I think that the aux vector must be naturally aligned. You c= an return > >> >> KB> ENOEXEC early if vptr is not aligned. > >> >>=20 > >> >> Not sure I see what you mean. vptr for auxv is calculated just co= uple lines > >> >> above, and I check the result here, in the part common for all ve= ctor types. > >> KB> You do not check for the alignment. Am I wrong ? > >>=20 > >> I see now. If natural alignment means "addr % sizeof(aux) =3D=3D 0" t= hen the aux > >> vectors are not naturally aligned. After adding this check: > >>=20 > >> if (vptr % sizeof(aux) !=3D 0) > >> return (ENOEXEC); > KB> No, the natural alignment of the structure is the alignment of the m= ost > KB> demanding member. So it is 4 bytes on 32bit, and 8 bytes on 64. >=20 > >>=20 > >> I started to observe many ENOEXEC errors. Adding printf showed that t= he > >> vectors are half size aligned. > >>=20 > >> On i386: > >>=20 > >> get_proc_vector(pid =3D getty[3442], type =3D 2): vptr (2143284876) %= sizeof(aux) (8) =3D 4) > >>=20 > >> On amd64: > >>=20 > >> get_proc_vector(pid =3D getty[2425], type =3D 2): vptr (1407374883465= 68) % sizeof(aux) (16) =3D 8) > >>=20 > >> Looking at exec_copyout_strings() from kern_exec.c, how destp is calc= ulated, I > >> think they are sizeof(char *) aligned. > >>=20 > >> Do you think it is worth adding the check for sizeof(char *) alignmen= t? > >>=20 > >> if (vptr % (sizeof(char *) !=3D 0) > >> return (ENOEXEC); > KB> I suggest to use #if __ELF_WORD_SIZE =3D=3D 32 or 64. >=20 > Thanks. The updated patch: >=20 > http://people.freebsd.org/~trociny/env.sys.3.patch Oops, I missed this in the previous review. You cannot use fubyte in proc_read_mem(). fubyte reads a byte from the address space of the current process. The fix is easy, use proc_rwmem for 1 byte. I do not think that fall back to single byte read is warranted for proc_read_mem calls e.g. for ps_strings. Add a flag to indicate whether the proc_read_mem should fall back to byte read ? I would prefer using sizeof(uint64_t) and sizeof(uint32_t) instead of 8 and 4 constants in the align checks. Might be, add PROC_ASSERT_HELD() to get_ps_string() ? procfs patch looks good. --Y9J5124L7u056RQu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk62zaEACgkQC3+MBN1Mb4icCACeJcDhyPfaGTk7frkifRXO5mUE nYYAoMf82kNB6RVH1dmMK+DRmmYTcehs =wxV9 -----END PGP SIGNATURE----- --Y9J5124L7u056RQu-- From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 21:26: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 1E9D5106564A for ; Sun, 6 Nov 2011 21:26:13 +0000 (UTC) (envelope-from darcsis@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id CEA668FC1B for ; Sun, 6 Nov 2011 21:26:12 +0000 (UTC) Received: by ggnk3 with SMTP id k3so4128639ggn.13 for ; Sun, 06 Nov 2011 13:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:organization:references:user-agent :x-envelope-to:mail-followup-to:date:message-id:mime-version :content-type; bh=i5QYT7ZbOCg+uIx3MfLhiar1RG9kLxMrGeH8zTLRZ24=; b=xVGPTfiafK9OTrVO1sMUNVs5LcLLcISE/UGKFH9AwxOBNTEiWNZp+Nt9iBFqNzWhfL w9Vpxv7RLt6KjJlrsNJPSYcmJUWjc6MYgqsePSvSy06zka0LF2hzj4SFK2DfOYkUM5kH M6agWzspyUYPcwlqF0r+m4OuEec3Cnr0Ljewg= Received: by 10.50.140.1 with SMTP id rc1mr37780564igb.25.1320613140863; Sun, 06 Nov 2011 12:59:00 -0800 (PST) Received: from localhost ([114.244.165.109]) by mx.google.com with ESMTPS id i10sm17956020pbn.10.2011.11.06.12.58.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Nov 2011 12:58:59 -0800 (PST) From: darcsis@gmail.com (Denise H. G.) To: Brandon Falk In-Reply-To: <20111105164212.GB50362@localhost> (Brandon Falk's message of "Sat, 5 Nov 2011 12:42:12 -0400") Organization: Pluto The Planet References: <20111105164212.GB50362@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) X-Envelope-To: falkman@gamozo.org Mail-Followup-To: Brandon Falk , freebsd-hackers@freebsd.org Date: Mon, 07 Nov 2011 04:58:53 +0800 Message-ID: <87r51lhss2.fsf@pluton.xbsd.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org Subject: Re: cdparanoia stuck in cbwait X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:26:13 -0000 Hi. Are you running FreeBSD 9.0? If yes, it seems that cdparanoia is broken because of some changes inside kernel, specifically, changes in scsi interfaces. If you have your system upgraded to 9.0, but not recompiled cdparanoia, you might run into some problems. Regards. -- Life is like an ice-cream cone: You have to learn to lick it. From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 6 22:14: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 156DE106564A for ; Sun, 6 Nov 2011 22:14:52 +0000 (UTC) (envelope-from falkman@gamozo.org) Received: from fireblade.netcore2k.net (fireblade.netcore2k.net [92.48.127.72]) by mx1.freebsd.org (Postfix) with ESMTP id 975F48FC1E for ; Sun, 6 Nov 2011 22:14:51 +0000 (UTC) Received: by fireblade.netcore2k.net with ESMTP id pA6MElis003213 ; Sun, 6 Nov 2011 22:14:50 GMT Date: Sun, 6 Nov 2011 17:14:43 -0500 From: Brandon Falk To: "Denise H. G." Message-ID: <20111106221443.GA2205@localhost> References: <20111105164212.GB50362@localhost> <87r51lhss2.fsf@pluton.xbsd.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r51lhss2.fsf@pluton.xbsd.name> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: cdparanoia stuck in cbwait X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 22:14:52 -0000 On Mon, Nov 07, 2011 at 04:58:53AM +0800, Denise H. G. wrote: > > Hi. > > Are you running FreeBSD 9.0? If yes, it seems that cdparanoia is > broken because of some changes inside kernel, specifically, changes in > scsi interfaces. If you have your system upgraded to 9.0, but not > recompiled cdparanoia, you might run into some problems. I'm running FreeBSD 10.0-CURRENT amd64 (r226909) everything built in clang. About as unstable as one can possibly get. -Brandon From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 00:19:54 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9639A106566B for ; Mon, 7 Nov 2011 00:19:54 +0000 (UTC) (envelope-from vijju.singh@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 1D7F98FC14 for ; Mon, 7 Nov 2011 00:19:53 +0000 (UTC) Received: by vcbfo14 with SMTP id fo14so3744660vcb.13 for ; Sun, 06 Nov 2011 16:19:53 -0800 (PST) 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=avCf6S6V4Q+sWfBa7nxD6DEvr4Gjk3KYNDMyYK/mDI0=; b=jFR6YRmpm5blikTZ4GBvqVnvFzQfICTT0K+fvtB4aoV2WdfNLjLxusNNtDrmNt/i+i c77WBErwwa+CqBKo6ryfY4icPCCqYzmqWUQjQS3TIu8vmKJIw8ncufMwmN18eYvOn+rF B7pwb09YwSY7iCg8qOVrzoeBOo1DSA2EDzdIc= MIME-Version: 1.0 Received: by 10.52.17.112 with SMTP id n16mr24098708vdd.70.1320623383295; Sun, 06 Nov 2011 15:49:43 -0800 (PST) Received: by 10.220.191.130 with HTTP; Sun, 6 Nov 2011 15:49:43 -0800 (PST) Date: Sun, 6 Nov 2011 15:49:43 -0800 Message-ID: From: Vijay Singh To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Mon, 07 Nov 2011 01:11:07 +0000 Cc: Subject: Panic in 8.1 in softclock(): mutex Giant not owned at ../../../../sys/kern/kern_mutex.c:185 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 00:19:54 -0000 Hackers. I am hitting a panic on 8.1 in the softclock() code. Anyone seen this? PANIC : mutex Giant not owned at ../../../../sys/kern/kern_mutex.c:185 (kgdb-amd64-6.8-71) bt #0 breakpoint () at ./machine/cpufunc.h:64 #1 0xffffffff803d8b82 in kdb_enter (why=0xffffffff806ca339 "panic", msg=0xffffffff806ca339 "panic") at ../../../../sys/kern/subr_kdb.c:365 #2 0xffffffff8039adf0 in panic (fmt=0xffffffff806c82d3 "mutex %s not owned at %s:%d") at ../../../../sys/kern/kern_shutdown.c:950 #3 0xffffffff80386b2e in _mtx_assert (m=0xffffffff80c8ed40, what=20, file=0xffffffff806c7d18 "../../../../sys/kern/kern_mutex.c", line=185) at ../../../../sys/kern/kern_mutex.c:827 #4 0xffffffff8038528e in unlock_mtx (lock=0xffffffff80c8ed40) at ../../../../sys/kern/kern_mutex.c:185 #5 0xffffffff803b73e6 in softclock (arg=0xffffffff80c90f40) at ../../../../sys/kern/kern_timeout.c:461 #6 0xffffffff8036436c in intr_event_execute_handlers (p=0xffffff000413a000, ie=0xffffff000414ad00) at ../../../../sys/kern/kern_intr.c:1244 #7 0xffffffff80364443 in ithread_execute_handlers (p=0xffffff000413a000, ie=0xffffff000414ad00) at ../../../../sys/kern/kern_intr.c:1257 #8 0xffffffff8036469f in ithread_loop (arg=0xffffff00021e92e0) at ../../../../sys/kern/kern_intr.c:1342 #9 0xffffffff80361d06 in fork_exit (callout=0xffffffff80364590 , arg=0xffffff00021e92e0, frame=0xffffff80001e7c80) at ../../../../sys/kern/kern_fork.c:892 #10 (kgdb-amd64-6.8-71) f 5 #5 0xffffffff803b73e6 in softclock (arg=0xffffffff80c90f40) at ../../../../sys/kern/kern_timeout.c:461 461 class->lc_unlock(c_lock); (kgdb-amd64-6.8-71) l 456 lastfunc = c_func; 457 } 458 #endif 459 CTR1(KTR_CALLOUT, "callout %p finished", c); 460 if ((c_flags & CALLOUT_RETURNUNLOCKED) == 0) 461 class->lc_unlock(c_lock); 462 skip: 463 CC_LOCK(cc); 464 /* 465 * If the current callout is locally (kgdb-amd64-6.8-71) i local c_func = (void (*)(void *)) 0xffffffff8060d550 c_flags = 7 sharedlock = 1 c_arg = (void *) 0xffffffff80f50740 class = (struct lock_class *) 0xffffffff807543c0 c_lock = (struct lock_object *) 0xffffffff80c8ed40 cc = (struct callout_cpu *) 0xffffffff80c90f40 c = (struct callout *) 0xffffff800010ccc0 bucket = (struct callout_tailq *) 0xffffff800012f450 curticks = 8811 steps = 0 depth = 2 mpcalls = 1 lockcalls = 0 gcalls = 1 From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 04:52:45 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6CF106566C for ; Mon, 7 Nov 2011 04:52:45 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E84D8FC0C for ; Mon, 7 Nov 2011 04:52:45 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so942305bkb.13 for ; Sun, 06 Nov 2011 20:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=reply-to:from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language; bh=k1e5Jrr9pCRHUXtqUmjsnRikZq9oeUQDfjb1VRzJnX0=; b=JZD/56ih6AQTHfnE1fHPsZUI0PtFB85bwEYx2EbxNKkwMLMpI6/Y5mASz+JXzKN2F7 80057SdV9fxUfjQNKl0LYpXITlsaas9Ams5u60vU2s/Hmu9rsgpzpektPOgIclrD3MvO taV+yLOqHaS28ObpeojjLC3Luwah2VoULxBHE= Received: by 10.204.142.28 with SMTP id o28mr4350594bku.21.1320639850268; Sun, 06 Nov 2011 20:24:10 -0800 (PST) Received: from rimwks1x64 ([92.124.24.86]) by mx.google.com with ESMTPS id e14sm16231995bka.0.2011.11.06.20.24.07 (version=SSLv3 cipher=OTHER); Sun, 06 Nov 2011 20:24:09 -0800 (PST) From: rozhuk.im@gmail.com To: Date: Mon, 7 Nov 2011 13:24:05 +0900 Message-ID: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcydBRYEIGE765jkSU6Jou04mHgiPQ== Content-Language: ru Cc: Subject: limits do not apply X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk.IM@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 04:52:45 -0000 At system startup, the init script is run with limits calculated on the basis of the core MAXFILES. After you run sysctl limits of the system may be altered, for example "kern.maxfilesperproc", but the script will continue to work with the old values. This is bad in two ways: 1. When using the "chroot", so that the command does not execute logon for the user: limits and environmental variables remain the same, just replaced the uid and gid of the running process. 2. When not specified "user" - the process starts with the limits of the environment and startup script. # limits Resource limits (current): ... openfiles 200000 ... # sysctl kern.maxfilesperproc=200001 kern.maxfilesperproc: 200000 -> 200001 # limits Resource limits (current): ... openfiles 200000 ... # su -m root -c 'limits' Resource limits (current): ... openfiles 200001 # chroot -u root / /usr/bin/limits Resource limits (current): ... openfiles 200000 ... Scripts for which the specified user inherit it from the startup script, rather than generate it based on the settings for the user. #su -m mysql -c '/bin/sh -c "/usr/bin/env"' ... USER=root MAIL=/var/mail/root HOME=/root LOGNAME=root PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin :/root/bin ... To run the scripts with the correct limits, the environment, the priority and chroot - need a tool combines the chroot, su, nice, chdir but deprived of their shortcomings. su - is focused on a shell chroot - does not make the logon nice - there is no overlap in the chroot or su "SHELL" should be inherited from a parent script, because many accounts is established: SHELL="/usr/sbin/nologin" -- Rozhuk Ivan From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 07:46:29 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 4AFED1065730 for ; Mon, 7 Nov 2011 07:46:28 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 60CB88FC14 for ; Mon, 7 Nov 2011 07:46:28 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pA77kPCa007396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Nov 2011 18:46:26 +1100 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.5/8.14.4) with ESMTP id pA77kPxq091437; Mon, 7 Nov 2011 18:46:25 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id pA77kOEP091436; Mon, 7 Nov 2011 18:46:24 +1100 (EST) (envelope-from peter) Date: Mon, 7 Nov 2011 18:46:24 +1100 From: Peter Jeremy To: Alexander Best Message-ID: <20111107074624.GB91353@server.vk2pj.dyndns.org> References: <20111105223021.GA52651@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <20111105223021.GA52651@freebsd.org> 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: reducing compiler instances during buildkernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 07:46:29 -0000 --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Nov-05 22:30:21 +0000, Alexander Best wrote: >wouldn't it be possible to somehow spawn N gcc or clang instances >(make -jN buildkernel) and then pipe the src to one of those N instances? >just like with something like multics N processes were started and then pe= ople >used the job control language to load binaries into those processes. This is likely to require very non-trivial changes to gcc or clang. The major issue is that the process needs to be in a known initial state before beginning a compile - and it's very unlikely that the compiler cleans itself up enough to return to that state. If you really want to trim low-hanging fruit, try disposing of libtool and GNU configure instead - their overheads are _many_ orders of magnitude higher than make exec()ing gcc. --=20 Peter Jeremy --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk63jNAACgkQ/opHv/APuIcl+QCgiX+g1iNm47KV5GIA+yaJ474r CVUAoKQJQXVAkJfvFBhqbB1iUV5DAy/U =G+sz -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1-- From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 09:16: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 E534E106566C for ; Mon, 7 Nov 2011 09:16:02 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6E68FC1A for ; Mon, 7 Nov 2011 09:16:02 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lvXv2GOaWqU= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-130-214.web.vodafone.de [2.207.130.214]) by post.strato.de (mrclete mo5) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id Y01c93nA79CuMO for ; Mon, 7 Nov 2011 10:15:49 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Mon, 07 Nov 2011 10:15:44 +0100 Date: Mon, 7 Nov 2011 10:15:44 +0100 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20111107091544.GB9484@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20111105223021.GA52651@freebsd.org> <20111107074624.GB91353@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111107074624.GB91353@server.vk2pj.dyndns.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: reducing compiler instances during buildkernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:16:03 -0000 On Mon, Nov 07, 2011 at 06:46:24PM +1100, Peter Jeremy wrote: > On 2011-Nov-05 22:30:21 +0000, Alexander Best wrote: > >wouldn't it be possible to somehow spawn N gcc or clang instances > >(make -jN buildkernel) and then pipe the src to one of those N instances? > >just like with something like multics N processes were started and then people > >used the job control language to load binaries into those processes. > > This is likely to require very non-trivial changes to gcc or clang. > The major issue is that the process needs to be in a known initial > state before beginning a compile - and it's very unlikely that the > compiler cleans itself up enough to return to that state. Actually, the real problem is that a full cleanup is likely to be as expensive as fork+exec. Joerg From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 09:20:02 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 022FC106566B; Mon, 7 Nov 2011 09:20:02 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB1D8FC15; Mon, 7 Nov 2011 09:20:01 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lvXv2GOaWqU= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-130-214.web.vodafone.de [2.207.130.214]) by smtp.strato.de (klopstock mo40) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id L067acnA77xceX ; Mon, 7 Nov 2011 10:19:53 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Mon, 07 Nov 2011 10:19:51 +0100 Date: Mon, 7 Nov 2011 10:19:51 +0100 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org, hackers@freebsd.org Message-ID: <20111107091951.GC9484@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org, hackers@freebsd.org References: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: limits do not apply X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:20:02 -0000 On Mon, Nov 07, 2011 at 01:24:05PM +0900, rozhuk.im@gmail.com wrote: > Scripts for which the specified user inherit it from the startup script, > rather than generate it based on the settings for the user. > > #su -m mysql -c '/bin/sh -c "/usr/bin/env"' Try to use su -c default -m mysql ... Joerg From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 09:20: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 022FC106566B; Mon, 7 Nov 2011 09:20:02 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB1D8FC15; Mon, 7 Nov 2011 09:20:01 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lvXv2GOaWqU= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-130-214.web.vodafone.de [2.207.130.214]) by smtp.strato.de (klopstock mo40) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id L067acnA77xceX ; Mon, 7 Nov 2011 10:19:53 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Mon, 07 Nov 2011 10:19:51 +0100 Date: Mon, 7 Nov 2011 10:19:51 +0100 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org, hackers@freebsd.org Message-ID: <20111107091951.GC9484@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org, hackers@freebsd.org References: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: limits do not apply X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:20:02 -0000 On Mon, Nov 07, 2011 at 01:24:05PM +0900, rozhuk.im@gmail.com wrote: > Scripts for which the specified user inherit it from the startup script, > rather than generate it based on the settings for the user. > > #su -m mysql -c '/bin/sh -c "/usr/bin/env"' Try to use su -c default -m mysql ... Joerg From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 7 12:23:39 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640301065679 for ; Mon, 7 Nov 2011 12:23:39 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id E3BDF8FC17 for ; Mon, 7 Nov 2011 12:23:38 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so1240241bkb.13 for ; Mon, 07 Nov 2011 04:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=reply-to:from:to:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; bh=9BYxC/MwaWEJGWbju/7R4f74TIZJC6OBBpuip8Zj/9k=; b=Ll0A+ZQ7UmHyFf4Oe7Bk6UlZ1tpBi00LHB8GlmB4C9X6Idf2RS+Auj7mId6Bv+dMyD 2Q5n+vOZ2pkjLzD130BdyqJzMJpk0si5n5sWXN/VzO7ED3nSf/sSPHiOZ7zFswETxOFe WzJ5A0h/WqIIkYgw2tz4F/wp5i4CY8GH02RiU= Received: by 10.204.45.65 with SMTP id d1mr19375408bkf.9.1320668617525; Mon, 07 Nov 2011 04:23:37 -0800 (PST) Received: from rimwks1x64 ([92.124.24.86]) by mx.google.com with ESMTPS id q6sm5508258bka.6.2011.11.07.04.23.36 (version=SSLv3 cipher=OTHER); Mon, 07 Nov 2011 04:23:37 -0800 (PST) From: rozhuk.im@gmail.com To: "'Joerg Sonnenberger'" , , References: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> <20111107091951.GC9484@britannica.bec.de> In-Reply-To: <20111107091951.GC9484@britannica.bec.de> Date: Mon, 7 Nov 2011 21:23:34 +0900 Message-ID: <4eb7cdc9.0611cc0a.3bf2.ffff9a92@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcydLqF4GU+hpllzR9eeRNk9Hk3eNAAGSCgw Content-Language: ru Cc: Subject: RE: limits do not apply X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk.IM@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 12:23:39 -0000 This is not my personal problem, this in: /etc/rc.subr if [ -n "$_user" ]; then _doit=3D"su -m $_user -c 'sh -c \"$_doit\"'" fi =A0 -- Rozhuk Ivan =A0=20 > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] On Behalf Of Joerg Sonnenberger > Sent: Monday, November 07, 2011 6:20 PM > To: freebsd-hackers@freebsd.org; hackers@freebsd.org > Subject: Re: limits do not apply >=20 > On Mon, Nov 07, 2011 at 01:24:05PM +0900, rozhuk.im@gmail.com wrote: > > Scripts for which the specified user inherit it from the startup > script, > > rather than generate it based on the settings for the user. > > > > #su -m mysql -c '/bin/sh -c "/usr/bin/env"' >=20 > Try to use su -c default -m mysql ... >=20 > Joerg > _______________________________________________ > 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 Nov 7 12:47: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 3F9F8106564A for ; Mon, 7 Nov 2011 12:47:43 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id BE5248FC1C for ; Mon, 7 Nov 2011 12:47:42 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so1264659bkb.13 for ; Mon, 07 Nov 2011 04:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=reply-to:from:to:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; bh=9BYxC/MwaWEJGWbju/7R4f74TIZJC6OBBpuip8Zj/9k=; b=Ll0A+ZQ7UmHyFf4Oe7Bk6UlZ1tpBi00LHB8GlmB4C9X6Idf2RS+Auj7mId6Bv+dMyD 2Q5n+vOZ2pkjLzD130BdyqJzMJpk0si5n5sWXN/VzO7ED3nSf/sSPHiOZ7zFswETxOFe WzJ5A0h/WqIIkYgw2tz4F/wp5i4CY8GH02RiU= Received: by 10.204.45.65 with SMTP id d1mr19375408bkf.9.1320668617525; Mon, 07 Nov 2011 04:23:37 -0800 (PST) Received: from rimwks1x64 ([92.124.24.86]) by mx.google.com with ESMTPS id q6sm5508258bka.6.2011.11.07.04.23.36 (version=SSLv3 cipher=OTHER); Mon, 07 Nov 2011 04:23:37 -0800 (PST) From: rozhuk.im@gmail.com To: "'Joerg Sonnenberger'" , , References: <4eb75d69.0e0ecc0a.29ec.3380@mx.google.com> <20111107091951.GC9484@britannica.bec.de> In-Reply-To: <20111107091951.GC9484@britannica.bec.de> Date: Mon, 7 Nov 2011 21:23:34 +0900 Message-ID: <4eb7cdc9.0611cc0a.3bf2.ffff9a92@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcydLqF4GU+hpllzR9eeRNk9Hk3eNAAGSCgw Content-Language: ru Cc: Subject: RE: limits do not apply X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk.IM@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 12:47:43 -0000 This is not my personal problem, this in: /etc/rc.subr if [ -n "$_user" ]; then _doit=3D"su -m $_user -c 'sh -c \"$_doit\"'" fi =A0 -- Rozhuk Ivan =A0=20 > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] On Behalf Of Joerg Sonnenberger > Sent: Monday, November 07, 2011 6:20 PM > To: freebsd-hackers@freebsd.org; hackers@freebsd.org > Subject: Re: limits do not apply >=20 > On Mon, Nov 07, 2011 at 01:24:05PM +0900, rozhuk.im@gmail.com wrote: > > Scripts for which the specified user inherit it from the startup > script, > > rather than generate it based on the settings for the user. > > > > #su -m mysql -c '/bin/sh -c "/usr/bin/env"' >=20 > Try to use su -c default -m mysql ... >=20 > Joerg > _______________________________________________ > 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 Nov 7 16:39:31 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA8ED1065675 for ; Mon, 7 Nov 2011 16:39:31 +0000 (UTC) (envelope-from rank1seeker@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 72F9A8FC15 for ; Mon, 7 Nov 2011 16:39:31 +0000 (UTC) Received: by faar19 with SMTP id r19so7529079faa.13 for ; Mon, 07 Nov 2011 08:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; bh=D+iR3Ib5q0xBrBD/ZRDMHm81Hwdpl3oHBK5Mr7F5Whk=; b=wpREzyXG37t+amPQMMrKVKMmjgsTTICYMKFmuupNHDhcg4CuGpmo5UtsxTf1L+zSPy JbqTbfvtxPULb0+ccbmPG63mCvgr7d0VePSKwWHmOMmz4RbR/RyE3NEH1FPOX7/FbQ3Q XNgMH/1qkL7BGjVziQp8HmF3mNYxLzy/NkOLg= Received: by 10.223.77.66 with SMTP id f2mr47759688fak.24.1320683970380; Mon, 07 Nov 2011 08:39:30 -0800 (PST) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id k26sm31845967fab.8.2011.11.07.08.39.25 (version=SSLv3 cipher=OTHER); Mon, 07 Nov 2011 08:39:28 -0800 (PST) Message-ID: <20111107.163922.409.1@DOMY-PC> From: rank1seeker@gmail.com To: "Lucas Holt" , hackers@freebsd.org Date: Mon, 07 Nov 2011 17:39:22 +0100 In-Reply-To: <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> X-Mailer: POP Peeper (3.8.0.0) Cc: Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 16:39:31 -0000 ----- Original Message ----- From: Lucas Holt To: rank1seeker@gmail.com Cc: hackers@freebsd.org Date: Sat, 5 Nov 2011 10:24:04 -0400 Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn > > On Nov 5, 2011, at 7:02 AM, rank1seeker@gmail.com wrote: > > > 8.2R p4 both i386/amd64 > > > > > > Supplied name of 16 chars > > -- > > # glabel label -v swap_679592d048a ada0s3b > > Metadata value stored on ada0s3b. > > Done. > > -- > > > > Truncated to 15 chars > > -- > > # ll /dev/label > > total 0 > > crw-r----- 1 root operator - 0, 133 Nov 5 11:41:54 2011 swap_679592d048 > > -- > > > > > The maximum size for the field is 16 so that explains the behavior you're seeing. It's strlcpy'd in. Something like the following patch would work: > > --- src/sbin/geom/class/label/geom_label.c 2008/11/21 21:05:31 1.3 > +++ src/sbin/geom/class/label/geom_label.c 2011/11/05 14:15:23 1.4 > @@ -118,6 +118,12 @@ label_label(struct gctl_req *req) > return; > } > > + label = gctl_get_ascii(req, "arg0"); > + if (strlen(label) > 15) { > + gctl_error(req, "Label cannot exceed 15 characters"); > + return; > + } > + > /* > * Clear last sector first to spoil all components if device exists. > */ > @@ -131,7 +137,6 @@ label_label(struct gctl_req *req) > > strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); > md.md_version = G_LABEL_VERSION; > - label = gctl_get_ascii(req, "arg0"); > strlcpy(md.md_label, label, sizeof(md.md_label)); > md.md_provsize = g_get_mediasize(name); > if (md.md_provsize == 0) { > > Lucas Holt > Luke@FoolishGames.com > ________________________________________________________ > MidnightBSD.org (Free OS) > JustJournal.com (Free blogging) > Thanks. Well, yes. Limit isn't a problem, but a silent ignore. From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 09:55:09 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442B11065672; Tue, 8 Nov 2011 09:55:09 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 265258FC17; Tue, 8 Nov 2011 09:55:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA89t9ZN081491; Tue, 8 Nov 2011 09:55:09 GMT (envelope-from danger@freefall.freebsd.org) Received: (from danger@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA89t9Zu081490; Tue, 8 Nov 2011 09:55:09 GMT (envelope-from danger) Date: Tue, 8 Nov 2011 09:55:09 +0000 From: Daniel Gerzo To: stable@freebsd.org Message-ID: <20111108095508.GA81445@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: hackers@freebsd.org, current@freebsd.org Subject: FreeBSD Status Report July-September, 2011 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: monthly@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 09:55:09 -0000 FreeBSD Quarterly Status Report - Q3/2011 Introduction This report covers FreeBSD-related projects between July and September 2011. It is the third of the four reports planned for 2011. This quarter was mainly devoted to polishing the bits for the next major version of FreeBSD, 9.0, which is to be released by then end of this year. Thanks to all the reporters for the excellent work! This report contains 28 entries and we hope you enjoy reading it. Please note that the deadline for submissions covering the period between October and December 2011 is January 15th, 2012. __________________________________________________________________ Projects * GELI status update * HAST (Highly Available Storage) status update * pfSense * Tool for providing FreeBSD VM Images * ZFSguru * ZRouter.org project -- a FreeBSD-based firmware for embedded devices FreeBSD Team Reports * Ports Collection * The FreeBSD Foundation * The FreeBSD Release Engineering Team Network Infrastructure * 802.11n / atheros * DIstributed Firewall and Flow-shaper Using Statistical Evidence (DIFFUSE) * Ethernet Switch Framework Kernel * The new CARP * VM layer for allocations larger than a page Documentation * Doc sprint on IRC, September 5, 2011 * The FreeBSD German Documentation Project Status Report * The FreeBSD Greek Documentation Project * The FreeBSD Japanese Documentation Project Architectures * FreeBSD/arm on Marvell Armada XP * FreeBSD/powerpc on AppliedMicro APM86290 Ports * FreeBSD Haskell Ports * KDE-FreeBSD * OpenAFS port * Portmaster Miscellaneous * bsd_day(2011) * EuroBSDcon 2011 * FreeBSD Developer Summit, Maarssen Google Summer of Code * Multibyte Encoding Support in Nvi __________________________________________________________________ 802.11n / atheros URL: http://wiki.FreeBSD.org/AdrianChadd/AtherosTxAgg Contact: Adrian Chadd AR5416, AR9160, and AR9280 functions in both station and hostap mode. Performance is good. Software retry of frames is implemented. Aggregation is implemented. BAR TX is not yet handled. HT protection is not implemented; neither is MIMO powersave. Open tasks: 1. BAR TX 2. MIMO powersave 3. Correct handling of flushing TX queues during interface reset/reconfigure 4. Correct handling of 20<->20/40mhz transitions (without dropping frames) 5. More intelligent rate control __________________________________________________________________ bsd_day(2011) URL: http://bsdday.eu/2011 Contact: Martin Matuska Contact: Gabor Pali The purpose of this one-day event was to gather Central European developers of today's open-source BSD systems to popularize their work and their organizations, and to meet each other in the real life. We wanted to motivate potential future developers and users, especially undergraduate university students, to work with BSD systems. This year's BSD-Day was be held in Bratislava, Slovakia at Slovak University of Technology, Faculty of Electrical Engineering and Information Technology on November 5, 2011. __________________________________________________________________ DIstributed Firewall and Flow-shaper Using Statistical Evidence (DIFFUSE) URL: http://caia.swin.edu.au/freebsd/diffused/ URL: http://www.FreeBSDFoundation.org/project%20announcements.shtml#diffuse URL: http://caia.swin.edu.au/urp/diffuse/ URL: http://caia.swin.edu.au/urp/diffuse/downloads.html Contact: Sebastian Zander Contact: Lawrence Stewart Contact: Grenville Armitage DIFFUSE enables FreeBSD's IPFW firewall subsystem to classify IP traffic based on statistical traffic properties. With DIFFUSE, IPFW computes statistics (such as packet lengths or inter-packet time intervals) for observed flows, and uses ML (machine learning) to classify flows into classes. In addition to traditional packet inspection rules, IPFW rules may now also be expressed in terms of traffic statistics or classes identified by ML classification. This can be helpful when direct packet inspection is problematic (perhaps for administrative reasons, or because port numbers do not reliably identify applications). DIFFUSE also enables one instance of IPFW to send flow information and classes to other IPFW instances, which then can act on such traffic (e.g. prioritise, accept, deny, etc.) according to its class. This allows for distributed architectures, where classification at one location in your network is used to control fire-walling or rate-shaping actions at other locations. The FreeBSD Foundation has funded the Centre for Advanced Internet Architectures at Swinburne University of Technology to undertake the DIFFUSED (DIFFUSE for freebsD) project, which aims to refine our publicly released DIFFUSE prototype and integrate all components of the architecture into FreeBSD. The project is progressing well in the diffused_head project branch of the FreeBSD Subversion repository, and is due to be completed by the end of October 2011. Once the project is completed, the code will be merged from the project branch into the head branch. An MFC of the code to 8.x and 9.x should be possible after an appropriate amount of soak time has elapsed. __________________________________________________________________ Doc sprint on IRC, September 5, 2011 URL: http://people.FreeBSD.org/~bcr/doc/sprints/20110905-final.html Contact: Benedict Reuschling Contact: Dru Lavigne On September 5, we held another documentation sprint on IRC channel #bsddocs to discuss various issues that are important for the whole FreeBSD documentation community. We talked about the status of the planned documentation repository conversion to SVN and the status of the XML docbook conversion. At that point in time, we did not have any documentation regarding the new bsdinstaller in the upcoming release, which would have been very bad for users that were trying to install the release. Luckily, a small team formed quickly to start working on a new bsdinstall chapter from scratch using a separate google code repository that gjb@ had set up. Some of the topics we discussed were moved forward and their status was revisited at EuroBSDcon's devsummit documentation session. Before the end of the conference, we had a new bsdinstall chapter committed into the official documentation tree, thanks to the efforts put into the new chapter by Gavin Atkinson, Warren Block, and Glen Barber. Garrett Cooper provided valuable instructions on the various installation methods that are possible with the new bsdinstaller. Thanks to all who helped make this a reality. It is nice to see that the things we talked about at the documentation sprint developed further, which is why we are trying to do these sprints in regular intervalls. Open tasks: 1. Plan the next documentation sprint 2. Continue working on the issues that are still open like the conversion of the repository to SVN __________________________________________________________________ Ethernet Switch Framework URL: http://zrouter.org/hg/FreeBSD/head/file/default/head/sys/dev/switch Contact: Aleksandr Rybalko Many embedded devices have an Ethernet switch on board; such switches are even embedded on some multiport NICs. This embedded switch framework is designed to give users the ability to easily control basic features present in managed switches, such as VLANs, QoS, port mirroring, etc. Currently we are able to control only VLANs on: * Atheros AR8216/AR8316 (standalone and embedded in AR724X) * Broadcom BCM5325 switch family (also embedded in BCM5354 SoC) * Ralink RT3050F/RT3052F internal switch * Realtek RTL8309 * IP175X * IP178X Open tasks: 1. Fix AR8216/AR8316 driver 2. Fix BCM5325 driver, not all ports pass data 3. Add tick handler for RTL8309 to automatically unisolate ports 4. Unify MIB statistic counters access 5. Add mii read/write bus methods 6. Implement pseudo interfaces for switch PHYs __________________________________________________________________ EuroBSDcon 2011 URL: http://2011.eurobsdcon.org/ Contact: EuroBSDcon Organizers Contact: Gabor Pali The 10th anniversary European BSD Conference was organized in Maarssen, The Netherlands with more than 250 registered visitors. There were many interesting tutorials, including introductions to DTrace and working with Netgraph. It featured 26 high-quality talks and 2 keynote speakers on various topics related to FreeBSD, OpenBSD, NetBSD, or even MINIX: OpenBSD PF, NetBSD NPF, IPv6 support in FreeBSD, virtualization in the BSD domain, recent developments in OpenSSH, exploration of the recent FreeNAS, system management with ZFS, practical capabilities for UNIX known as Capsicum. It also had a dedicated track for the attendees of the FreeBSD developer summit, where one could learn more about what is happening currently in the Project. We had presentations on the new package management solution, Google Summer of Code 2011, a stacked cryptographic file system, conversion of documents of different formats, and status reports on the sparc64 port and the NAND flash support. __________________________________________________________________ FreeBSD Developer Summit, Maarssen URL: http://wiki.FreeBSD.org/201110DevSummit Contact: Gabor Pali We had 60 FreeBSD developers and invited guests attending the FreeBSD Developer Summit organized as part of EuroBSDcon 2011 in Maarssen, The Netherlands. This year EuroBSDcon organizers offered us their generous support in handling the details, like registrations, renting the venue, and providing food for keeping attendees happy. The Maarssen developer summit spanned over 3 days. It is generally a workshop-style event that has now adopted the layout of the developer summit organized successfully in Canada earlier in May. On the first day, there were working groups on various topics, e.g. Capsicum, toolchain issues, ports, and documentation. On the second day, there were various plenary discussions, like how FreeBSD relates to virtualization or how vendors relate to FreeBSD. Finally, on the third day, there were many interesting work-in-progress reports given in a dedicated developer summit track at the main conference. Photos and slides for the most of the talks are available on the home page of the summit. __________________________________________________________________ FreeBSD Haskell Ports Contact: Gabor Janos PaLI Contact: Ashish SHUKLA We updated existing ports to their latest versions and hunted down a bug in the 9-CURRENT rtld which was causing GHC to crash intermittently. We also started work on Haskell Platform 2011.3.0.0 (development version) in a separate git branch in our development repository. Open tasks: 1. Test GHC to work with clang/LLVM. 2. Add an option to the GHC port to be able to build it with already installed GHC instead of requiring a separate GHC boostrap tarball. 3. Update Haskell Platform (along with GHC) to 2011.4.0.0 as soon as it gets out. 4. Add more ports to the Ports collection. __________________________________________________________________ FreeBSD/arm on Marvell Armada XP Contact: Grzegorz Bernacki Contact: Rafal Jaworowski Marvell Armada XP is a complete system-on-chip solution based on the Sheeva embedded CPUs. These devices integrate up to four ARMv6/v7 compliant Sheeva CPU cores with shared L2 cache. This work is extending FreeBSD/arm infrastructure towards support for recent ARM architecture variations along with a basic set of device drivers for integrated peripherals. The following code has been implemented since the last status report: * PCI-Express support * SMP support * + Created framework for ARM platform dependent code. + Initialization and starting of Application Processor. + Implementation of sending/handling IPI Next steps: * Finalize SMP support (TLB/cache operation broadcast, etc.) * L2 cache support * SATA driver __________________________________________________________________ FreeBSD/powerpc on AppliedMicro APM86290 Contact: Grzegorz Bernacki Contact: Rafal Jaworowski The APM86290 system-on-chip device is a member of AppliedMicro's PACKETpro family of embedded processors. The chip includes two Power Architecture PPC465 processor cores, which are compliant with the Book-E specification of the architecture, and a number of integrated peripherals. This work is extending current Book-E support in FreeBSD towards PPC4xx processor variants along with device drivers for integrated peripherials. The following drivers have been created since the last report: * Interrupt controller * EHCI USB driver attachment * Queue Manager/Traffic Manager support * Initial support of Ethernet controller * GPIO, I2C Next steps: * Finalize Ethernet controller driver * L2 cache support __________________________________________________________________ GELI status update Contact: Pawel Jakub Dawidek Selected GELI (disk encryption GEOM class) changes since 2010/Q3 report: * Implementation of suspend/resume functionality. * New version subcommand to check GELI providers version. * New -V option for init subcommand, which allows to create GELI providers for older FreeBSD versions. * Significant aesni(4) performance improvements for AES-XTS algorithm. __________________________________________________________________ HAST (Highly Available Storage) status update Contact: Pawel Jakub Dawidek Contact: Mikolaj Golub HAST is under active development. Some changes since Q1 report: * Async replication mode. Unfortunately it will not make it into 9.0-RELEASE (pjd@). * IPv6 support (pjd@). * Activemap fix that significantly reduces number of metadata updates (trociny@). * Provider's write cache flush after metadata updates (pjd@). * Possibility to specify pidfile in configuration file (pjd@). * Many bug fixes and other improvments. __________________________________________________________________ KDE-FreeBSD URL: FreeBSD.kde.org URL: http://dot.kde.org/2011/06/29/platform-frameworks-kde-hackers-meet-swit zerland URL: http://blogs.FreeBSDish.org/avilla/2011/06/14/call-for-tests-kde-pim-4- 6-0 URL: http://FreeBSD.kde.org/area51.php Contact: KDE FreeBSD Alberto Villa and Raphael Kubo da Costa went to Randa, Switzerland, to attend, respectively, the KDE Multimedia/Kdenlive sprint and the Platform 11 sprint. The sprints afforded them the opportunity to form closer bonds with the upstream KDE community, to learn about the future of Qt and KDE and make sure FreeBSD's needs are taken into account. For more information see the article "From Platform to Frameworks -- KDE hackers meet in Switzerland" at dot.kde.org. The KDE on FreeBSD team have continued to improve the experience of KDE and Qt under FreeBSD. The latest round of improvements include: * Qt supports Clang as a compiler The team has also made many releases and upstreamed many fixes and patches. The latest round of releases include: * Qt: 4.7.3 * KDE: 4.6.3; 4.6.4; 4.6.5 * Amarok: 2.4.1 * Digikam (and KIPI-plugins): 1.9.0 Further testing is requested for KDE PIM 4.6.0 and Calligra 2.3.72 before the ports are committed. To test the ports please visit Alberto Villa's call for test and area51. The team is always looking for more testers and porters so please visit us at kde-freebsd@kde.org and our homepage. Open tasks: 1. Testing KDE PIM 4.6.0 __________________________________________________________________ Multibyte Encoding Support in Nvi URL: http://wiki.FreeBSD.org/ZhihaoSoC2011 URL: https://github.com/lichray/nvi2 Contact: Zhihao Yuan nvi-iconv keeps the behaviors and the license of nvi-1.79 in the base system and adopts the multibyte encoding support from nvi-1.8x. Status: * Known memory leaks, bugs are fixed. make buildworld clear, under WARNS=1 (the old one was WARNS=0). * UTF-16 is supported with less hacks. * The 'windowname' option now restores the xterm title through xprop. * The file encoding detection modified from file(1) is finished and considered stable. The detection is always on since nvi-iconv never change the actual encoding, and the detection failbacks to locale. * Pavel Timofeev provided a full Russian translation of the catalog. Thanks to him. * Now nvi-iconv is able to be compiled with widechar only and without iconv (inspired by a user on FreeBSDChina.org). In that case, it only supports your locale. Open tasks: 1. The wide character support in nvi's message (feedback over the last line) system. 2. Collect more testing results and get code review. __________________________________________________________________ OpenAFS port URL: http://openafs.org URL: http://wiki.FreeBSD.org/afs Contact: Benjamin Kaduk Contact: Derrick Brashear AFS is a distributed network filesystem that originated from the Andrew Project at Carnegie-Mellon University. OpenAFS 1.6.0 has released, and is available in the FreeBSD Ports Collection; it is usable under light load, but heavy usage reveals some issues that remain unresolved. The OpenAFS kernel module is now built using the bsd.kmod.mk infrastructure on the git master branch; unfortunately this change required a minor change in the OS-independent Makefiles and could not be merged in time for 1.6.0. Some attention has been given to memory leaks, but only one small leak has been patched so far. There are several known outstanding issues that are being worked on, but detailed bug reports are welcome at port-freebsd@openafs.org. Open tasks: 1. Update VFS locking to allow the use of disk-based client caches as well as memory-based caches. 2. Track down races and deadlocks that may appear under load. 3. Eliminate a moderate memory leak from the kernel module. 4. PAG (Process Authentication Group) support is not functional. __________________________________________________________________ pfSense URL: http://www.pfsense.org/ Contact: Scott Ullrich Contact: Chris Buechler pfSense 2.0 has been released to the world. This brings the past three years of new feature additions, with significant enhancements to almost every portion of the system. The changes and new features are summarized here. This is by far the most widely deployed release we have put out, thanks to the efforts of thousands of members of the community. Open tasks: 1. Work on 2.1 is underway with the biggest changes being IPV6 support and PBI packaged binaries for the package system. __________________________________________________________________ Portmaster URL: http://dougbarton.us/portmaster-proposal.html Contact: Doug Barton Portmaster offers several new features since the last quarterly update; some bug fixes for the package installation code, and various internal optimizations. The most exciting new feature is probably the ability to specify the -r option more than once for the same portmaster run. This greatly increases efficiency when several "branch" and/or "trunk" ports need updates at the same time, especially for package-building systems. Open tasks: 1. Splitting out the fetch code is still "on the list" of work to be done, but it was sidetracked by other priorities in the past months. I hope to complete it in the quarter to come. 2. Another new feature in the works is support for a list of files for portmaster to preserve and restore during upgrades of a port. __________________________________________________________________ Ports Collection URL: http://www.FreeBSD.org/ports/ URL: http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/contributing-ports/ URL: http://portsmon.FreeBSD.org/index.html URL: http://www.FreeBSD.org/portmgr/index.html URL: http://blogs.FreeBSDish.org/portmgr/ URL: http://www.twitter.com/freebsd_portmgr/ URL: http://www.facebook.com/group.php?gid=135441496471197 Contact: Thomas Abthorpe Contact: Port Management Team The ports tree slowly moves up closer to the 23,000 mark. The PR count still remains at about 1000. In Q2 we added 4 new committers, but took in 6 commit bits for safe keeping. The Ports Management team have been running -exp runs on an ongoing basis, verifying how base system updates may affect the ports tree, as well as providing QA runs for major ports updates. Of note, -exp runs were done for: * Python update * Boost updates * Gtk3 updates * clang testing * pkgng testing * testing ruby19 * setting the default fortran to lang/gcc46 * setting apache22 as default * setting the default LDFLAGS in CONFIGURE_ENV Work continues to refine the new build master pointyhat-west. An upgrade to -current done in September has proven problematic. We have enlisted ISC and Josh Paetzel to try to determine a fix. In the meantime, the source will be downgraded to RELENG_9. The portsmon instance is being re-homed at Yahoo. Users should not see any changes. The new instance is currently visible at portsmonj.FreeBSD.org but will soon take on the portsmon.FreeBSD.org name. The team would like to express its appreciation to TDC A/S for the loan of the existing machine for several years. Work is underway to create a new QAT instance at NYI/NJ. portmgr also assisted in setting up a sparc64 machine for general develop access at Yahoo. Thanks to on-site work by Sean Bruno and Ben Haga, we once again have access to the powerpc build machine at ISC, and powerpc builds have been restarted. They also helped us get one more i386 machine back online. linimon is working on a set of scripts to more quickly produce pre-configured PXEboot images for package build nodes. The update of __FreeBSD_version in param.h to 1000000 proved very disruptive to the ports tree, triggering lots of bad assumption in code that interpreted it as FreeBSD 1. A great deal of work has gone into identifying the instances of broken code and fixing and upstreaming them. While this is taking place, one recommended workaround is to set your version to 999999. Open tasks: 1. Looking for help getting ports to build with clang. 2. Looking for help fixing ports broken on CURRENT. (List needs updating, too) 3. Looking for help with Tier-2 architectures. (List needs updating, too) 4. Most ports PRs are assigned, we now need to focus on testing, committing and closing. __________________________________________________________________ The FreeBSD Foundation URL: http://www.FreeBSDFoundation.org/ Contact: Deb Goodkin The Foundation sponsored KyivBSD 2011 which was held in Kiev, Ukraine on September 24. We were represented at Ohio LinuxFest in Columbus, Ohio. And, we approved six travel grants for EuroBSDCon. Stop by and visit us at the FreeBSD booth during LISA '11, December 7-8, in Boston, MA. Three Foundation funded projects were completed during this period: implementing xlocale APIs to enable porting libc++ by David Chisnall, implementing DIFFUSE for FreeBSD by Swinburne University, and adding GEM, KMS, and DRI support for Intel drivers by Konstantin Belousov. We published our semi-annual newsletter. We purchased servers and other hardware for the FreeBSD co-location centers at Sentex and NYI. The work above, as well as many other tasks which we do for the FreeBSD Project, could not be done without donations. Please help us by making a donation or asking your company to make a donation. We would be happy to send marketing literature to you or your company. Find out how to make a donation at our donate page. Find out more up-to-date Foundation news by reading our blog and Facebook page. __________________________________________________________________ The FreeBSD German Documentation Project Status Report URL: https://doc.bsdgroup.de Contact: Johann Kois Contact: Benedict Reuschling We managed to update the German version of the documentation just in time to get it included in the upcoming 9.0-RELEASE. The website translations were also kept in sync with the ones on FreeBSD.org. We tried to re-activate committers who did not contribute for some time but most of them are currently unable to free up enough time. We hope to gain fresh contributor blood as we are getting occasional reports about bugs and grammar in the German translation. Open tasks: 1. Submit grammar, spelling or other errors you find in the German documents and the website 2. Translate more articles and other open handbook sections (especially the new chapter about the new FreeBSD installer). __________________________________________________________________ The FreeBSD Greek Documentation Project URL: http://www.FreeBSDgr.org URL: http://www.FreeBSD.org/doc/el/books/handbook Contact: Manolis Kiagias Contact: Giorgos Keramidas After a few rather quiet months, the FreeBSD Greek Documentation Project is back on track, translating and improving the Handbook, FAQ and FreeBSD articles. The new bsdinstall chapter has been translated and is now present in the Handbook. Our experimental Handbook builds are also available at the project's hub. Three new status pages have been added: * Merge Status for the en_US tree shows whether the local en_US repo is in sync with the official CVS * Merge Status for the el_GR tree - as above but for the Greek tree * Pending Commits shows newer yet to be committed versions of the Greek docs For more information, please visit http://www.freebsdgr.org. Patches, fixes and contributions are always welcome. Open tasks: 1. Translate the remaining chapters of the Handbook to Greek. 2. Complete the translation of the FreeBSD FAQ. 3. Keep the currently translated docs in sync with the English versions. __________________________________________________________________ The FreeBSD Japanese Documentation Project URL: http://www.FreeBSD.org/ja/ URL: http://www.jp.FreeBSD.org/doc-jp/ Contact: Hiroki Sato Contact: Ryusuke Suzuki The www/ja and doc/ja_JP.eucJP/books/handbook subtrees have constantly been updated since the last report. www/ja: During this period, many areas of outdated content in the www/ja subtree were updated to the latest versions in the English counterparts. The Japanese version of 8.2R release announcement was added and the upcoming 9.0R announcement will be translated in a timely manner. Handbook: The Japanese "kernelconfig" section finally caught up with the original English version. The next targets are "cutting-edge" and new installer section. Open tasks: 1. Further translation work for outdated documents in both doc/ja_JP.eucJP and www/ja. __________________________________________________________________ The FreeBSD Release Engineering Team URL: http://www.FreeBSD.org/releng/ Contact: Release Engineering Team The Release Engineering Team has been coordinating the upcoming FreeBSD 9.0-RELEASE. Thanks to work done by many of the developers. The release, though delayed, is taking the shape nicely. We have reached the stage of doing the second Release Candidate. At this time we expect to have one more Release Candidate, to be followed by the final release itself. __________________________________________________________________ The new CARP URL: http://people.FreeBSD.org/~glebius/newcarp/ Contact: Gleb Smirnoff I am now working on significant rewrite of CARP in FreeBSD. The reason for this work is that the CARP protocol actually does not bring a new interface, but is a property of interface address. Rewriting it in this way helps to remove several hacks from incoming packet processing, simplifies some code, makes CARP addresses more sane from the viewpoint of routing daemons such as quagga/zebra and closes many CARP-related PRs in GNATS. It also brings support for a single redundant address on the subnet, the thing that is called "carpdev feature" in OpenBSD, long awaited in FreeBSD. For this moment I have a patch against head/ that compiles and works in my test environment that I am going to deploy soon on some of servers under my control. The patch has been reviewed by Bjoern Zeeb (bz@). Open tasks: 1. More testing requested! 2. Implement arpbalance and ipbalance features. This requires a next step of rewriting, probably borrowing some ideas from OpenBSD. 3. Update documentation. __________________________________________________________________ Tool for providing FreeBSD VM Images URL: https://github.com/yerenkow/freebsd-vm-image Contact: Alexander Yerenkow A set of scripts to make building FreeBSD VM images easy. Providing a way to make regular build images of the latest version from SVN. Images currently can be copied with `dd` to USB flash (for testing on real hardware) and VirtualBox (.vdi). Open tasks: 1. Build images with ports-set from main port-tree 2. Build images with ports-set from main port-tree plus overrides form area51 (like experimental images) 3. Build images with special development branches included (like for testing drivers) __________________________________________________________________ VM layer for allocations larger than a page Contact: Alan Cox Contact: Davide Italiano The aim of this project is to create a new layer that sits between UMA and the virtual memory system managing chunks of kernel virtual memory on the order of 2 to 4 MB in size. At the end of the work, UMA page_alloc() would no longer call directly into the VM system. It would instead call into this new layer. Thus, uma_large_malloc() and uma_large_free() would no longer be immediately allocating and deallocating kernel virtual memory. This results in a gain in terms of performances (there is a relatively high cost in the approach adopted until now), and also in terms of reduction of fragmentation (the VM system uses a first-fit policy of allocation so there is room for improvements). __________________________________________________________________ ZFSguru URL: http://zfsguru.com URL: http://zfsguru.com Contact: Jason Edwards ZFSguru is a newly designed Network Attached Storage operating system, much like FreeNAS. The difference is that ZFSguru focuses heavily on ZFS and user friendly operation, and uses a full FreeBSD distribution with no elements stripped down. This allows people new to FreeBSD and UNIX in general to access the power of ZFS, while still allowing more advanced users to tweak their NAS with additional functionality and use it as a normal FreeBSD distribution. Started a little over a year ago, the ZFSguru project is making good progress. It should already be one of the most user friendly distributions focused on ZFS, and sports some very unique features. The advanced ZFS benchmarking and convenient Root-on-ZFS installation are good examples. Priority is given to finishing the missing core functionality, and extending the number of available service addons which currently are limited to iSCSI-target and VirtualBox extensions. Open tasks: 1. Finish ZFS and network related functionality in the web-interface. 2. Introduce new service addons, adding optional functionality to ZFSguru. 3. Extend the documentation. __________________________________________________________________ ZRouter.org project -- a FreeBSD-based firmware for embedded devices URL: http://zrouter.org URL: http://lists.zrouter.org URL: http://zrouter.org/hg/zrouter/ URL: http://zrouter.org/hg/FreeBSD/head/ Contact: Aleksandr Rybalko ZRouter.org is a young project that aims to produce FreeBSD-based firmware for small boxes such as SOHO router, APs, etc. At the present time ZRouter.org is able to build working firmware for: * D-Link DAP-1350 * D-Link DIR-320 * D-Link DIR-320-NRU * D-Link DIR-330 * D-Link DIR-615-E4 * D-Link DIR-620 * D-Link DIR-632 * D-Link DSA-3110-A1 * D-Link DSR-1000N * NorthQ NQ-900 * TPLink TL-WR941ND-v3_2 * Ubiquiti RSPRO Currently we are working on most parts of the core system but we are also in the planning phase for implementing a simple web-based GUI which we hope will have taken form before the next FreeBSD status report. We still have many items not done, so devices in that list cannot be called "Production Ready" yet. But we work on that. It is easy to add new devices, because we have separate definition of board and SoC(System on Chip), so if you have "Asus WL-500g Premium v2" for example, you can copy D-Link/DIR-320 directory and tweak to work for your device. We already have basic support for: * Broadcom BCM5354 * Broadcom BCM5836 * Ralink RT3052F * Ralink RT3050F * Ralink RT5350F * Atheros AR7161 * Atheros AR7242 * Atheros AR7241 * Atheros AR7240 * Atheros AR9132 * Intel ixp435 * Cavium CN5010 If you have ability and time, please join us at http://zrouter.org (Redmine iface and mailing lists) Open tasks: 1. Device drivers 2. Web UI 3. Control scripts 4. Watchdog 5. etc. __________________________________________________________________ (c) 1995-2011 The FreeBSD Project. All rights reserved. From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 11:51:58 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9601065672 for ; Tue, 8 Nov 2011 11:51:58 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4C28FC0C for ; Tue, 8 Nov 2011 11:51:58 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 85FA62A28CF1; Tue, 8 Nov 2011 12:33:49 +0100 (CET) Date: Tue, 8 Nov 2011 12:33:49 +0100 From: Ed Schouten To: Lucas Holt Message-ID: <20111108113349.GG2258@hoeg.nl> References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RdOi/MCTP6675j71" Content-Disposition: inline In-Reply-To: <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: rank1seeker@gmail.com, hackers@freebsd.org Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 11:51:58 -0000 --RdOi/MCTP6675j71 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Lucas Holt , 20111105 15:24: > --- src/sbin/geom/class/label/geom_label.c 2008/11/21 21:05:31 1.3 > +++ src/sbin/geom/class/label/geom_label.c 2011/11/05 14:15:23 1.4 > @@ -118,6 +118,12 @@ label_label(struct gctl_req *req) > return; > } > =20 > + label =3D gctl_get_ascii(req, "arg0"); > + if (strlen(label) > 15) { > + gctl_error(req, "Label cannot exceed 15 characters"); > + return; > + } > + > /* > * Clear last sector first to spoil all components if device exists. > */ > @@ -131,7 +137,6 @@ label_label(struct gctl_req *req) > =20 > strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); > md.md_version =3D G_LABEL_VERSION; > - label =3D gctl_get_ascii(req, "arg0"); > strlcpy(md.md_label, label, sizeof(md.md_label)); > md.md_provsize =3D g_get_mediasize(name); > if (md.md_provsize =3D=3D 0) { Why not simply perform the strlcpy and check whether if (strlcpy(...) >=3D sizeof(md.md_label) ? --=20 Ed Schouten WWW: http://80386.nl/ --RdOi/MCTP6675j71 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOuROdAAoJEG5e2P40kaK7cQEP/2CBbWwHYWaumvkEQ1amvAKl H9s+RATotDKucQhXLo61WOO9zKoZgU++pFlhg0fmxC/4/eESPSOx8WEuB4F3yqDA QX/GnInwCVQkpQA9mpmKOXs0WIDJ1OmmqGSAFz/5TRt3Wro8/Zf1ax6XhwBYDM/B CoVJnA2XsBeaW4V2CLZtzmh2XInAhSpm26meNgPR9Ya/WNvATbFcj0mfvEed26Vr Ovj8XJFWM/Kjwe8E7DHi5jF0++8W5fRSrlo9sEWIenVzE9Emonv1C+B8bLIWo0H3 DcBDn84UCbCzN2SNouBuxY0W60O+iuvi98EQNksIjKd0n+JE3m3Kn6O885Y0vZ/i RaIm9S3IuyNpiEZ3olY6uFV+hVS6BO/8bZ2DvvhP1xzI1Mq4kilr9X/niyezf7Ww 00eX7jBIN18Nq4pgkrlqYxrIltT6L9N8kBuAjfQIOJAeBkuM+1hcngbRTEumqdC+ irLEJaDVXcqc5fglP4pFs7J0yNr6PFhrotTylOleoFyC8SbK+uyEuopxap2+gYN/ ecig7WknAuyprc8SgqgQ2O7tMCuY0+ViLEf4irQ2rUtXwO7NcZTnNBzT2m8h/6g8 BTDMrY4LNPVemupqWdiV1nyl1qGlADOnphjC0a8KNc/EK8itDI4TguaqzLpy+uB1 WIF7ejPkn5i3EAR8Wv99 =lG+h -----END PGP SIGNATURE----- --RdOi/MCTP6675j71-- From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 15:22:15 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 D0D2010656E6 for ; Tue, 8 Nov 2011 15:22:14 +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 A6B9F8FC0A for ; Tue, 8 Nov 2011 15:22:14 +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 42F3446B06; Tue, 8 Nov 2011 10:22:14 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C35FB8A02F; Tue, 8 Nov 2011 10:22:13 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 8 Nov 2011 10:00:27 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111081000.27332.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 08 Nov 2011 10:22:13 -0500 (EST) Cc: Navdeep Parhar Subject: Re: incorrect parent refcounting in subr_firmware.c? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:22:15 -0000 On Wednesday, November 02, 2011 3:56:29 pm Navdeep Parhar wrote: > I built a KLD with multiple firmware images, as shown here: > > KMOD=foo > FIRMWS= foo.bin:foo:1.0.0.0 > FIRMWS+=bar.bin:bar:1.0.0.0 > FIRMWS+= ... > .include > > "foo" is the parent firmware and a firmware_get(foo) can autoload the > KLD. "bar" and the rest are available only if the KLD is loaded (by > whatever means). This is reasonable and works as expected. But if I > just get and then put "foo" back, the KLD is not unloaded automatically. > > The problem is that a reference is placed on the parent firmware when > the other firmwares are registered (during module load). I think this > reference should be placed during firmware_get on the child. > > What do people think about the attached patch? It fixes things for me. Hmm, what about the use case where a driver does: f = firmware_get("foo"); firmware_put(f) f = firmware_get("bar"); firmware_put(f) Is that going to trigger multiple loads/unloads with this change? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 15:22:15 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 97B74106571D for ; Tue, 8 Nov 2011 15:22:15 +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 6EA788FC12 for ; Tue, 8 Nov 2011 15:22:15 +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 245C546B09; Tue, 8 Nov 2011 10:22:15 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9A178A02E; Tue, 8 Nov 2011 10:22:14 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 8 Nov 2011 10:05:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; 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: <201111081005.43851.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 08 Nov 2011 10:22:14 -0500 (EST) Cc: Vijay Singh Subject: Re: Panic in 8.1 in softclock(): mutex Giant not owned at ../../../../sys/kern/kern_mutex.c:185 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:22:15 -0000 On Sunday, November 06, 2011 6:49:43 pm Vijay Singh wrote: > Hackers. I am hitting a panic on 8.1 in the softclock() code. Anyone seen this? > > PANIC : mutex Giant not owned at ../../../../sys/kern/kern_mutex.c:185 > > (kgdb-amd64-6.8-71) bt > #0 breakpoint () at ./machine/cpufunc.h:64 > #1 0xffffffff803d8b82 in kdb_enter (why=0xffffffff806ca339 "panic", > msg=0xffffffff806ca339 "panic") at ../../../../sys/kern/subr_kdb.c:365 > #2 0xffffffff8039adf0 in panic (fmt=0xffffffff806c82d3 "mutex %s not > owned at %s:%d") at ../../../../sys/kern/kern_shutdown.c:950 > #3 0xffffffff80386b2e in _mtx_assert (m=0xffffffff80c8ed40, what=20, > file=0xffffffff806c7d18 "../../../../sys/kern/kern_mutex.c", line=185) > at ../../../../sys/kern/kern_mutex.c:827 > #4 0xffffffff8038528e in unlock_mtx (lock=0xffffffff80c8ed40) at > ../../../../sys/kern/kern_mutex.c:185 > #5 0xffffffff803b73e6 in softclock (arg=0xffffffff80c90f40) at > ../../../../sys/kern/kern_timeout.c:461 > #6 0xffffffff8036436c in intr_event_execute_handlers > (p=0xffffff000413a000, ie=0xffffff000414ad00) at > ../../../../sys/kern/kern_intr.c:1244 > #7 0xffffffff80364443 in ithread_execute_handlers > (p=0xffffff000413a000, ie=0xffffff000414ad00) at > ../../../../sys/kern/kern_intr.c:1257 > #8 0xffffffff8036469f in ithread_loop (arg=0xffffff00021e92e0) at > ../../../../sys/kern/kern_intr.c:1342 > #9 0xffffffff80361d06 in fork_exit (callout=0xffffffff80364590 > , arg=0xffffff00021e92e0, frame=0xffffff80001e7c80) at > ../../../../sys/kern/kern_fork.c:892 > #10 > > (kgdb-amd64-6.8-71) f 5 > #5 0xffffffff803b73e6 in softclock (arg=0xffffffff80c90f40) at > ../../../../sys/kern/kern_timeout.c:461 > 461 class->lc_unlock(c_lock); > (kgdb-amd64-6.8-71) l > 456 lastfunc = c_func; > 457 } > 458 #endif > 459 CTR1(KTR_CALLOUT, "callout %p finished", c); > 460 if ((c_flags & CALLOUT_RETURNUNLOCKED) == 0) > 461 class->lc_unlock(c_lock); > 462 skip: > 463 CC_LOCK(cc); > 464 /* > 465 * If the current callout is locally > (kgdb-amd64-6.8-71) i local > c_func = (void (*)(void *)) 0xffffffff8060d550 You'll need to see if there is a way that this routine can drop the lock. If you can reproduce this panic easily, then perhaps try building with KTR and KTR_LOCK traces enabled and use 'show ktr' in ddb to see when this thread dropped Giant. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 15:41:17 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA39E106566B for ; Tue, 8 Nov 2011 15:41:17 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id A7D888FC08 for ; Tue, 8 Nov 2011 15:41:17 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id C53242A28CF0; Tue, 8 Nov 2011 16:40:46 +0100 (CET) Date: Tue, 8 Nov 2011 16:40:46 +0100 From: Ed Schouten To: Andrew Duane Message-ID: <20111108154046.GK2258@hoeg.nl> References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> <20111108113349.GG2258@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E9lJRGffXdNhqRfL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "rank1seeker@gmail.com" , Lucas Holt , "hackers@freebsd.org" Subject: Re: BUG: 'glabel label' name's lenght, is truncated without err/warn X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:41:18 -0000 --E9lJRGffXdNhqRfL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andrew, * Andrew Duane , 20111108 16:22: > Checking the return code of strlcpy won't say if the entire string fit > (exactly) correctly, or if it was truncated. It seems they do: RETURN VALUES The strlcpy() and strlcat() functions return the total length of the string they tried to create. For strlcpy() that means the length of s= rc. For strlcat() that means the initial length of dst plus the length of src. While this may seem somewhat confusing, it was done to make trun= ca=E2=80=90 tion detection simple. --=20 Ed Schouten WWW: http://80386.nl/ --E9lJRGffXdNhqRfL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOuU1+AAoJEG5e2P40kaK7bPUQAJZHsAXmT8ikeQRNl7Q3OvhG +8NuYcjX84ek79RlMX/usJkKDYybKd0aQh0cVI9PdPBbGDAzR83EgQYtSattj9Zk 4jAQX26Z+kvW6YZptrv9g2IOAPCw2bZBy+H4J0vJ8flGs1VqPu5FJbCiXKFb8Mk9 elz2DW8FGmBTNzNC3JHlXPLNT2tqnK8c7NivL8vcXt8vbbEBWh4M4rqs4vtLokoR l5v5HzmvXeyxSJp4tG1N4ZbahngNFB6mPrBfuCagHT4xcYdBLeK/KQXBtOPZRP0i +eZunhpf5N4wslR8wqhVNt5QoF2OinV5xjchv1UUNzbYPUmLb2o+sY2gAGKs6yvk 6GmQz5POEhs/16PhDK+KZMCE++PzOCURSUE8xgFDTALqkDLHXvV46dBRl4bwbjAq IslotOLZ6JSq3ozjerBP8zlWFVpaTHcwg5ICVqYjwMd36qQwJ6Q5ADk1aIchQkeg f81sooAQUEXkDA0h+cJ8F+fxVEe+mlJU+16c/MuRdtsb0KdMMhPC8VDCttsehWa7 VuFvqG5hJM0ej6U7f2na73p2RWFVVwcLPpc8nNHDxrYNyG8jOt+CzNtfhCMBSyj6 C9nPawYDJrHtWK9EsCVRYBddZVsGecWMKuW8APWyDlt4tL9hl6gJUnmYAfGtCJMF bi3CKiUzdgauciL+6ty/ =OHEQ -----END PGP SIGNATURE----- --E9lJRGffXdNhqRfL-- From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 15:42:12 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 172081065673 for ; Tue, 8 Nov 2011 15:42:12 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og125.obsmtp.com (exprod7og125.obsmtp.com [64.18.2.28]) by mx1.freebsd.org (Postfix) with ESMTP id B98958FC08 for ; Tue, 8 Nov 2011 15:42:11 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob125.postini.com ([64.18.6.12]) with SMTP; Tue, 08 Nov 2011 07:42:11 PST Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 8 Nov 2011 07:22:11 -0800 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Tue, 8 Nov 2011 10:22:10 -0500 From: Andrew Duane To: Ed Schouten , Lucas Holt Date: Tue, 8 Nov 2011 10:22:09 -0500 Thread-Topic: BUG: 'glabel label' name's lenght, is truncated without err/warn Thread-Index: AcyeDNoJ2+/g+OgQRmWXvUFbC7g84QAHRQ8w Message-ID: References: <20111105.110247.867.1@DOMY-PC> <1859A0FF-C3BF-4EC3-9CC6-FA97B9AF5C99@foolishgames.com> <20111108113349.GG2258@hoeg.nl> In-Reply-To: <20111108113349.GG2258@hoeg.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "rank1seeker@gmail.com" , "hackers@freebsd.org" Subject: RE: BUG: 'glabel label' name's lenght, is truncated without err/warn X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:42:12 -0000 Checking the return code of strlcpy won't say if the entire string fit (exa= ctly) correctly, or if it was truncated. I think explicitly checking the le= ngth of label first is cleaner and more correct.=20 I would, however, replace "15" with "sizeof(md.md_label) - 1" both in the c= heck and the printf. =A0................................... Andrew Duane Juniper Networks o=A0=A0=A0+1 978 589 0551 m=A0 +1 603-770-7088 aduane@juniper.net =A0 > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] On Behalf Of Ed Schouten > Sent: Tuesday, November 08, 2011 6:34 AM > To: Lucas Holt > Cc: rank1seeker@gmail.com; hackers@freebsd.org > Subject: Re: BUG: 'glabel label' name's lenght, is truncated without > err/warn >=20 > * Lucas Holt , 20111105 15:24: > > --- src/sbin/geom/class/label/geom_label.c 2008/11/21 21:05:31 > 1.3 > > +++ src/sbin/geom/class/label/geom_label.c 2011/11/05 14:15:23 > 1.4 > > @@ -118,6 +118,12 @@ label_label(struct gctl_req *req) > > return; > > } > > > > + label =3D gctl_get_ascii(req, "arg0"); > > + if (strlen(label) > 15) { > > + gctl_error(req, "Label cannot exceed 15 characters"); > > + return; > > + } > > + > > /* > > * Clear last sector first to spoil all components if device > exists. > > */ > > @@ -131,7 +137,6 @@ label_label(struct gctl_req *req) > > > > strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); > > md.md_version =3D G_LABEL_VERSION; > > - label =3D gctl_get_ascii(req, "arg0"); > > strlcpy(md.md_label, label, sizeof(md.md_label)); > > md.md_provsize =3D g_get_mediasize(name); > > if (md.md_provsize =3D=3D 0) { >=20 > Why not simply perform the strlcpy and check whether >=20 > if (strlcpy(...) >=3D sizeof(md.md_label) >=20 > ? >=20 > -- > Ed Schouten > WWW: http://80386.nl/ From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 16:24:36 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 48CB01065672 for ; Tue, 8 Nov 2011 16:24:36 +0000 (UTC) (envelope-from dgre090@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 D49398FC18 for ; Tue, 8 Nov 2011 16:24:34 +0000 (UTC) Received: by faar19 with SMTP id r19so981357faa.13 for ; Tue, 08 Nov 2011 08:24:34 -0800 (PST) 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=/oO57oAf79ea3bzP/YAs/ME3r0pF8bGGwEhxI5+a51o=; b=RZMZOYR0R7+UJ9Yu07z4slH0mdClVA29849Zds8nUUFvU4fX6AOb3Svv7k7yZlnZv8 dqrpcKPLqvPf31yC7QaJ6kzIjfeer2qvrSCQEFrNrLKqoW6T2wBuZPOzODxWI0moNVyk N1xKN4XJCxw4SS0+oEhGjBHkaR8YiEtruzfxc= MIME-Version: 1.0 Received: by 10.152.105.226 with SMTP id gp2mr8967654lab.28.1320769473930; Tue, 08 Nov 2011 08:24:33 -0800 (PST) Received: by 10.152.42.35 with HTTP; Tue, 8 Nov 2011 08:24:33 -0800 (PST) Date: Tue, 8 Nov 2011 17:24:33 +0100 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 FS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 16:24:36 -0000 Hi, I am trying to write a program that makes use of the USB_FS ioctl calls to achieve it's functionality. Unfortunately I am encountering some difficulties with these ioctl calls and am not exactly sure which call is supposed to do what. Does anyone know of some resource which could help me understand these calls better ? Regards, Daniel From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 16:57: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 83305106566B for ; Tue, 8 Nov 2011 16:57:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id 164508FC17 for ; Tue, 8 Nov 2011 16:57:32 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 26228362; Tue, 08 Nov 2011 17:47:29 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Tue, 8 Nov 2011 17:44:37 +0100 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: <201111081744.37213.hselasky@c2i.net> Cc: Daniel Grech Subject: Re: USB FS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 16:57:33 -0000 On Tuesday 08 November 2011 17:24:33 Daniel Grech wrote: > Hi, > > I am trying to write a program that makes use of the USB_FS ioctl calls to > achieve it's functionality. Unfortunately I am encountering some > difficulties with these ioctl calls and am not exactly sure which call is > supposed to do what. Does anyone know of some resource which could help me > understand these calls better ? > Hi, You can look at the VirtualBox and libusb sources for examples. I recommend to use libusb and not the USB_FS inteface directly. --HPS From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 20:47:10 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 99990106564A for ; Tue, 8 Nov 2011 20:47:10 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6786E8FC17 for ; Tue, 8 Nov 2011 20:47:10 +0000 (UTC) Received: by pzk32 with SMTP id 32so4326591pzk.3 for ; Tue, 08 Nov 2011 12:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=yphAKVhJPVz/cCU6A8mNRtbWboiIH3cCHGaWNO0ksnI=; b=i9Eu/+K+2BlF4QMtqkDzXcqxw7Qqu1pulT8pKUEfZiY9r14Guw3ck3R/xn4HHVRmok oRjAMa98fDSStsRFnLHmku2y1QVVLGBbweib0cvU8WuMrF8uBlz4o1UkCN3ujWVsqV01 y4cr+4PrpNboHN+aBPCfrR1PbTfhYvYbuPElY= Received: by 10.68.33.227 with SMTP id u3mr3630106pbi.72.1320785229615; Tue, 08 Nov 2011 12:47:09 -0800 (PST) Received: from itx (c-107-3-142-221.hsd1.ca.comcast.net. [107.3.142.221]) by mx.google.com with ESMTPS id km16sm6930320pbb.9.2011.11.08.12.47.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Nov 2011 12:47:07 -0800 (PST) Date: Tue, 8 Nov 2011 12:47:00 -0800 From: Navdeep Parhar To: John Baldwin Message-ID: <20111108204700.GA1542@itx> Mail-Followup-To: John Baldwin , freebsd-hackers@freebsd.org References: <201111081000.27332.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111081000.27332.jhb@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: incorrect parent refcounting in subr_firmware.c? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 20:47:10 -0000 On Tue, Nov 08, 2011 at 10:00:27AM -0500, John Baldwin wrote: > On Wednesday, November 02, 2011 3:56:29 pm Navdeep Parhar wrote: > > I built a KLD with multiple firmware images, as shown here: > > > > KMOD=foo > > FIRMWS= foo.bin:foo:1.0.0.0 > > FIRMWS+=bar.bin:bar:1.0.0.0 > > FIRMWS+= ... > > .include > > > > "foo" is the parent firmware and a firmware_get(foo) can autoload the > > KLD. "bar" and the rest are available only if the KLD is loaded (by > > whatever means). This is reasonable and works as expected. But if I > > just get and then put "foo" back, the KLD is not unloaded automatically. > > > > The problem is that a reference is placed on the parent firmware when > > the other firmwares are registered (during module load). I think this > > reference should be placed during firmware_get on the child. > > > > What do people think about the attached patch? It fixes things for me. > > Hmm, what about the use case where a driver does: > > f = firmware_get("foo"); > firmware_put(f) > f = firmware_get("bar"); > firmware_put(f) > > Is that going to trigger multiple loads/unloads with this change? Without the patch, the get(bar) always works. But that's because the KLD is stuck in memory (it's not auto-unloaded even after the two puts and it can't be unloaded manually either). With the patch, get(bar) does not work after put(foo, FIRMWARE_UNLOAD). This is correct behaviour as documented in firmware(9) - the parent firmware is the only one that the kernel can locate with a simple name match. Once the KLD is unloaded, the kernel can't find bar. (The get would probably work after a put(foo, 0) because the KLD won't get unloaded without a FW_UNLOAD. But I'm not interested in keeping it around forever so I always specify FW_UNLOAD). As long as I put all the images back this way, the KLD is auto-unloaded at the end. Without the patch it just stays around forever. get(foo) /* autoloads foo.ko which has the "bar" image too. */ get(bar) put(bar, FIRMWARE_UNLOAD) put(foo, FIRMWARE_UNLOAD) /* KLD auto-unloaded, user happy. */ Regards, Navdeep From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 21:14:36 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 D71291065673 for ; Tue, 8 Nov 2011 21:14:36 +0000 (UTC) (envelope-from cattelan@thebarn.com) Received: from x.digitalelves.com (x.digitalelves.com [209.98.77.55]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9E98FC08 for ; Tue, 8 Nov 2011 21:14:36 +0000 (UTC) Received: from macpro00.x.thebarn.com (c-66-41-26-220.hsd1.mn.comcast.net [66.41.26.220]) (authenticated bits=0) by x.digitalelves.com (8.14.5/8.14.4) with ESMTP id pA8LEWLQ032215 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 8 Nov 2011 15:14:33 -0600 (CST) (envelope-from cattelan@thebarn.com) Message-ID: <4EB99BB8.3000401@thebarn.com> Date: Tue, 08 Nov 2011 15:14:32 -0600 From: Russell Cattelan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Andriy Gapon References: <4DFA4C47.8060503@digitalelves.com> <4EA5A676.5040500@thebarn.com> <4EB67C2A.4000906@FreeBSD.org> In-Reply-To: <4EB67C2A.4000906@FreeBSD.org> X-Enigmail-Version: 1.3.3 Content-Type: multipart/mixed; boundary="------------080504010206020701010605" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@FreeBSD.org Subject: Re: kexec or similar for FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:14:36 -0000 This is a multi-part message in MIME format. --------------080504010206020701010605 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/6/11 6:23 AM, Andriy Gapon wrote: > on 24/10/2011 20:55 Russell Cattelan said the following: >> So it has been a while and a lot of hair pulling but kload is >> sorta alive and kicking. It can now load the kernel from >> userspace, copy it over the running kernel and jump the the >> kernel entry point. >> >> I'm still having problems getting through the boot process due >> to interrupts arriving for unconfigured handlers. Fatal Trap >> (30) > > Just in case, is your original kernel running SMP? > I'm working on the SMP stuff now. Trying to get the processors in a state where the restart process can complete. For now I removed the panic call in the unknown interrupt case. What I finally figured out was that starting up the system was overwriting the page tables and caused any of AP's still looking at those locations to cause qemu / kvm to reset :-( - -Russell -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk65m7gACgkQNRmM+OaGhBjkaQCfS4rfmuKAyyPWyseEYJaHbq+G h1sAnjPgX2E6x7CEcvN11iR3qtJAfdPA =OgIO -----END PGP SIGNATURE----- --------------080504010206020701010605-- From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 21:44: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 6FF351065677 for ; Tue, 8 Nov 2011 21:44:32 +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 476AA8FC14 for ; Tue, 8 Nov 2011 21:44:32 +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 F328346B3C; Tue, 8 Nov 2011 16:44:31 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7D7BB8A02E; Tue, 8 Nov 2011 16:44:31 -0500 (EST) From: John Baldwin To: Navdeep Parhar Date: Tue, 8 Nov 2011 16:43:50 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111081000.27332.jhb@freebsd.org> <20111108204700.GA1542@itx> In-Reply-To: <20111108204700.GA1542@itx> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111081643.51080.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 08 Nov 2011 16:44:31 -0500 (EST) Cc: freebsd-hackers@freebsd.org Subject: Re: incorrect parent refcounting in subr_firmware.c? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:44:32 -0000 On Tuesday, November 08, 2011 3:47:00 pm Navdeep Parhar wrote: > On Tue, Nov 08, 2011 at 10:00:27AM -0500, John Baldwin wrote: > > On Wednesday, November 02, 2011 3:56:29 pm Navdeep Parhar wrote: > > > I built a KLD with multiple firmware images, as shown here: > > > > > > KMOD=foo > > > FIRMWS= foo.bin:foo:1.0.0.0 > > > FIRMWS+=bar.bin:bar:1.0.0.0 > > > FIRMWS+= ... > > > .include > > > > > > "foo" is the parent firmware and a firmware_get(foo) can autoload the > > > KLD. "bar" and the rest are available only if the KLD is loaded (by > > > whatever means). This is reasonable and works as expected. But if I > > > just get and then put "foo" back, the KLD is not unloaded automatically. > > > > > > The problem is that a reference is placed on the parent firmware when > > > the other firmwares are registered (during module load). I think this > > > reference should be placed during firmware_get on the child. > > > > > > What do people think about the attached patch? It fixes things for me. > > > > Hmm, what about the use case where a driver does: > > > > f = firmware_get("foo"); > > firmware_put(f) > > f = firmware_get("bar"); > > firmware_put(f) > > > > Is that going to trigger multiple loads/unloads with this change? > > Without the patch, the get(bar) always works. But that's because the > KLD is stuck in memory (it's not auto-unloaded even after the two puts > and it can't be unloaded manually either). > > With the patch, get(bar) does not work after put(foo, FIRMWARE_UNLOAD). > This is correct behaviour as documented in firmware(9) - the parent > firmware is the only one that the kernel can locate with a simple name > match. Once the KLD is unloaded, the kernel can't find bar. (The get > would probably work after a put(foo, 0) because the KLD won't get > unloaded without a FW_UNLOAD. But I'm not interested in keeping it > around forever so I always specify FW_UNLOAD). > > As long as I put all the images back this way, the KLD is auto-unloaded > at the end. Without the patch it just stays around forever. > > get(foo) /* autoloads foo.ko which has the "bar" image too. */ > get(bar) > put(bar, FIRMWARE_UNLOAD) > put(foo, FIRMWARE_UNLOAD) /* KLD auto-unloaded, user happy. */ Ahh, ok. I think this is fine. It might be worth updating the manpage to explicitly mention child firmware images and to explain this requirement (right now it doesn't mention extra firmware images at all). -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 21:48: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 4D8DA106564A; Tue, 8 Nov 2011 21:48:01 +0000 (UTC) (envelope-from to.my.trociny@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 9DDE98FC08; Tue, 8 Nov 2011 21:48:00 +0000 (UTC) Received: by faar19 with SMTP id r19so1421809faa.13 for ; Tue, 08 Nov 2011 13:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:message-id :user-agent:mime-version:content-type; bh=d8dg+SKBgqOGKquqmvgyD+6SngVWDR+CSt9Gg6nJb6Q=; b=l0t49fXR/e/u8k6uyYUH5I7BRxTJk0rJT6EtVgjqqpYdpoukZYpgKQRi2G03wJJccv pVSnLmaJgKhDAgFmF+7jX9W/iHHFvshCP2wLH30HJIBY+f7YwsKgWm3CxLMk8DJTYuzT ZJ3560bKG3i+eGJ+dS9pVykh20R2TEMKoiZ6A= Received: by 10.223.6.15 with SMTP id 15mr57480085fax.4.1320788879565; Tue, 08 Nov 2011 13:47:59 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id x19sm3884316fag.5.2011.11.08.13.47.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Nov 2011 13:47:57 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov References: <20111025082451.GO50300@deviant.kiev.zoral.com.ua> <86aa8k2im0.fsf@kopusha.home.net> <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> X-Comment-To: Kostik Belousov Sender: Mikolaj Golub Date: Tue, 08 Nov 2011 23:47:54 +0200 Message-ID: <86r51iqoad.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:48:01 -0000 On Sun, 6 Nov 2011 20:10:41 +0200 Kostik Belousov wrote: KB> On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: >> >> http://people.freebsd.org/~trociny/env.sys.3.patch KB> Oops, I missed this in the previous review. You cannot use fubyte in KB> proc_read_mem(). fubyte reads a byte from the address space of the current KB> process. The fix is easy, use proc_rwmem for 1 byte. KB> I do not think that fall back to single byte read is warranted for KB> proc_read_mem calls e.g. for ps_strings. Add a flag to indicate whether KB> the proc_read_mem should fall back to byte read ? KB> I would prefer using sizeof(uint64_t) and sizeof(uint32_t) instead of 8 KB> and 4 constants in the align checks. KB> Might be, add PROC_ASSERT_HELD() to get_ps_string() ? KB> procfs patch looks good. Thanks. The updated version: http://people.freebsd.org/~trociny/env.sys.4.patch Investigating cases when EFAULT was returned and if the fallback was successful I noticed that most of the cases were when p->p_comm changed during the read, so the process was in exec in that time. In order to avoid this error I added a check for P_INEXEC flag. After this I observed EFAULT (very rarely) only when reading arg or env strings and fallback was successful for those cases. So I modified the patch to do fallback only when reading strings (as it was in one of my earlier versions but with wrong fubyte), and returned your comment which explains why it may happen :-) Also in the procfs patch I have added the check for process state. The userland part has not been changed since my first report: http://people.freebsd.org/~trociny/env.user.patch -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 8 22:10: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 166E1106566C for ; Tue, 8 Nov 2011 22:10:40 +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 63EC88FC16 for ; Tue, 8 Nov 2011 22:10:39 +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 AAA29189; Wed, 09 Nov 2011 00:10:35 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RNtsJ-0008PG-7p; Wed, 09 Nov 2011 00:10:35 +0200 Message-ID: <4EB9A8D9.3090303@FreeBSD.org> Date: Wed, 09 Nov 2011 00:10:33 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111002 Thunderbird/7.0.1 MIME-Version: 1.0 To: Russell Cattelan References: <4DFA4C47.8060503@digitalelves.com> <4EA5A676.5040500@thebarn.com> <4EB67C2A.4000906@FreeBSD.org> <4EB99BB8.3000401@thebarn.com> In-Reply-To: <4EB99BB8.3000401@thebarn.com> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: kexec or similar for FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 22:10:40 -0000 on 08/11/2011 23:14 Russell Cattelan said the following: > On 11/6/11 6:23 AM, Andriy Gapon wrote: >> on 24/10/2011 20:55 Russell Cattelan said the following: >>> So it has been a while and a lot of hair pulling but kload is sorta >>> alive and kicking. It can now load the kernel from userspace, copy it >>> over the running kernel and jump the the kernel entry point. >>> >>> I'm still having problems getting through the boot process due to >>> interrupts arriving for unconfigured handlers. Fatal Trap (30) > >> Just in case, is your original kernel running SMP? > > I'm working on the SMP stuff now. Trying to get the processors in a state > where the restart process can complete. > > For now I removed the panic call in the unknown interrupt case. > > > What I finally figured out was that starting up the system was overwriting > the page tables and caused any of AP's still looking at those locations to > cause qemu / kvm to reset :-( Very interesting. You might also find the following information useful in case you haven't implemented that yet: http://www.intel.com/design/pentium/datashts/242016.htm specifically the Appendix B.5. That is something that we are not doing right now, but what I would prefer us doing even for a "normal" warm reboot. Namely: In order to do a complete system shutdown, followed by a warm restart if necessary, the operating system should return the system to a state similar to that at power-on. This includes disabling the Local APIC interrupts (LINT0/LINT1/Local APIC Timer/Error interrupt) on all processors, disabling the Local APIC on all APs and disabling all interrupts at all the I/O APICs in the system. I believe that this could be a reason for the spurious interrupts that you get. BTW, I am not completely sure, but it seems that we never disable the timer interrupt(s) during shutdown (unlike interrupts for all/most of other devices). You might also find OpenSolaris code interesting in this respect: http://fxr.watson.org/fxr/source/i86pc/io/pcplusmp/apic_common.c?v=OPENSOLARIS#L1160 http://fxr.watson.org/fxr/source/i86pc/os/machdep.c?v=OPENSOLARIS#L191 All the best! -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 02:55: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 B353A106566C; Wed, 9 Nov 2011 02:55:40 +0000 (UTC) (envelope-from cattelan@thebarn.com) Received: from x.digitalelves.com (x.digitalelves.com [209.98.77.55]) by mx1.freebsd.org (Postfix) with ESMTP id 8888D8FC15; Wed, 9 Nov 2011 02:55:40 +0000 (UTC) Received: from macpro00.x.thebarn.com (c-66-41-26-220.hsd1.mn.comcast.net [66.41.26.220]) (authenticated bits=0) by x.digitalelves.com (8.14.5/8.14.4) with ESMTP id pA92tb1B037439 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 8 Nov 2011 20:55:39 -0600 (CST) (envelope-from cattelan@thebarn.com) Message-ID: <4EB9EBA9.70903@thebarn.com> Date: Tue, 08 Nov 2011 20:55:37 -0600 From: Russell Cattelan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Andriy Gapon References: <4DFA4C47.8060503@digitalelves.com> <4EA5A676.5040500@thebarn.com> <4EB67C2A.4000906@FreeBSD.org> <4EB99BB8.3000401@thebarn.com> <4EB9A8D9.3090303@FreeBSD.org> In-Reply-To: <4EB9A8D9.3090303@FreeBSD.org> X-Enigmail-Version: 1.3.3 Content-Type: multipart/mixed; boundary="------------020106070600030000020606" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@FreeBSD.org Subject: Re: kexec or similar for FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 02:55:41 -0000 This is a multi-part message in MIME format. --------------020106070600030000020606 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/8/11 4:10 PM, Andriy Gapon wrote: > on 08/11/2011 23:14 Russell Cattelan said the following: >> On 11/6/11 6:23 AM, Andriy Gapon wrote: >>> on 24/10/2011 20:55 Russell Cattelan said the following: >>>> So it has been a while and a lot of hair pulling but kload is >>>> sorta alive and kicking. It can now load the kernel from >>>> userspace, copy it over the running kernel and jump the the >>>> kernel entry point. >>>> >>>> I'm still having problems getting through the boot process >>>> due to interrupts arriving for unconfigured handlers. Fatal >>>> Trap (30) >> >>> Just in case, is your original kernel running SMP? >> >> I'm working on the SMP stuff now. Trying to get the processors in >> a state where the restart process can complete. >> >> For now I removed the panic call in the unknown interrupt case. >> >> >> What I finally figured out was that starting up the system was >> overwriting the page tables and caused any of AP's still looking >> at those locations to cause qemu / kvm to reset :-( > > Very interesting. You might also find the following information > useful in case you haven't implemented that yet: > http://www.intel.com/design/pentium/datashts/242016.htm > specifically the Appendix B.5. That is something that we are not > doing right now, but what I would prefer us doing even for a > "normal" warm reboot. > > Namely: In order to do a complete system shutdown, followed by a > warm restart if necessary, the operating system should return the > system to a state similar to that at power-on. This includes > disabling the Local APIC interrupts (LINT0/LINT1/Local APIC > Timer/Error interrupt) on all processors, disabling the Local APIC > on all APs and disabling all interrupts at all the I/O APICs in the > system. Ya I have been slowing figuring that out. I have added a simple routine to tear down the ioapic handlers which seems to be doing the right thing. I do not get the unhandled interrupt message now. Sending an IPI cpustop didn't quite do what I expected in that the cpu is not really stop but just "pause"ed. So what ended up happening was the cpus 1 + were still using the initial page table the from the first boot, cpu 0 has a different page table set up by the kload process. BUT when the boot process / cpu 0 started setting up the page tables again in the same memory cpu 1+ was still referencing for their page tables qemu / kvm would reset and reboot the VM. It took forever with lots of debug prints in both the kernel and qemu to finally put the pieces together. Changing the cpususpend routine to actually halt the cpu has finally allowed the boot process to actually work using kload on a multi cpu qemu vm. Unfortunately it appears that VirtualBox does not handle things the same and now panics when trying to start the AP's. I'm guessing it has to do with exactly what you are saying and that the local APICs need to be shutdown properly. The linux kexec processes that. > > I believe that this could be a reason for the spurious interrupts > that you get. BTW, I am not completely sure, but it seems that we > never disable the timer interrupt(s) during shutdown (unlike > interrupts for all/most of other devices). > > You might also find OpenSolaris code interesting in this respect: > http://fxr.watson.org/fxr/source/i86pc/io/pcplusmp/apic_common.c?v=OPENSOLARIS#L1160 > > http://fxr.watson.org/fxr/source/i86pc/os/machdep.c?v=OPENSOLARIS#L191 Ahh good idea ... I've been trying to make sense of the linux apic code to see how to duplicate the functionality but more examples are always helpful. > > All the best! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6566gACgkQNRmM+OaGhBikggCfZMob4rbk9SQT+YGXksilCmpA ZnIAnjXyEa2uTVhYNP3SHMCpvWBPxCoP =pDTQ -----END PGP SIGNATURE----- --------------020106070600030000020606-- From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 05:42: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 7117C106566C for ; Wed, 9 Nov 2011 05:42:52 +0000 (UTC) (envelope-from sife.mailling@yahoo.com) Received: from nm19-vm0.bullet.mail.sp2.yahoo.com (nm19-vm0.bullet.mail.sp2.yahoo.com [98.139.91.216]) by mx1.freebsd.org (Postfix) with SMTP id 477F88FC0A for ; Wed, 9 Nov 2011 05:42:52 +0000 (UTC) Received: from [98.139.91.69] by nm19.bullet.mail.sp2.yahoo.com with NNFMP; 09 Nov 2011 05:30:11 -0000 Received: from [98.139.91.22] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 09 Nov 2011 05:30:10 -0000 Received: from [127.0.0.1] by omp1022.mail.sp2.yahoo.com with NNFMP; 09 Nov 2011 05:30:10 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 930263.16347.bm@omp1022.mail.sp2.yahoo.com Received: (qmail 13690 invoked by uid 60001); 9 Nov 2011 05:30:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1320816610; bh=u1F+m/FgzymposjoSFLfzltyNY4LLuSl6qMJ0wRfLH0=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=F6OCGW9K/1H/JxVf15y2ccY0CU4129I9hF26wygP1lQwU911WG1jPJR+h3FNPWI9KgE4zj6xAJJgcJSgEzYWNt8YXSAmMjfQlO1cA1uTikTydh46XZjkkT3K7IQbY3uYrh0cwBzZPbces/Cro21m/1WdI25lFNgqAfZMcEO4y8k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=1yhxoDoD6jTRgBxsZY4jji4MwwRBkNeW/Iu2WPmDFns8BP9xjAggYWMrNLxZxT9bLqNqEmrGrMVn9pzh+d1D+jYf4pE0HM1BALeJcQWLB5poNsTezF/Y+GEyOg7LhJctL+3ix+9tTyrvBpEAtlMyQiB5hw81MY3gWjH4I0y1GT0=; X-YMail-OSG: 8iIlBaUVM1lkHVJfOMyWUvg1aBxvcPskkvhmsYf6jJpj_hF 67J7ND2jUY4UxlrRDm0e9.T6CxfuOcp0bORIRSe.gSBoi34GbbpXB4NWS_vm NHXjs6h0sM7jdlIfiC9Mq7ihqy83AtUQJF6UYSvtpKf00xwvbJOKxg6Tfmap bnts07VElAK14aW29UlXlweLWLQVDU5LxV.DVez4G7JKjvDWwljZ0FPaemFy GeeIzg03RTklxRkZA8.Gqa6am8O5Wl.VTTtVvZeHuvZTZFfGFqudMjxyT6ri NX3hg_rQt1_jHBj_j5.270sD85vXysJl6182IRTAG5PWrNExoV9jVGZokMPJ f.55LAJYQjQwfY8WLquww6NXCB6kFVNxH5YcoZkEiENViDLIOxlNUorX6U0t psg1mD1Wqdy0iaWDU57eErrJsUDjwec_wSK2NkgDLdH.nM8Oq.0Dj.50ukv9 uC6VO3vlM7.0cFbxzmWTPTtgp6YtkzuoLnCv8MYG_hjDwhjiMYoXiImBuzou g_NruQLqd334HJW.oFzKuAPC2SDg- Received: from [41.100.65.10] by web113116.mail.gq1.yahoo.com via HTTP; Tue, 08 Nov 2011 21:30:10 PST X-Mailer: YahooMailWebService/0.8.115.325013 Message-ID: <1320816610.4259.YahooMailNeo@web113116.mail.gq1.yahoo.com> Date: Tue, 8 Nov 2011 21:30:10 -0800 (PST) From: Sife Mailling To: "freebsd-hackers@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Set mac address via ioctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sife Mailling List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:42:52 -0000 After reading ifconfig source code for hours, I end with this, witch was suppose to change mac address via a command line: #include #include #include #include #include #include #include /* IP */ #include #include #include #include #include #include #include #include #include #include #include #include struct afswtch { const char *af_name; /* as given on cmd line, e.g. "inet" */ short af_af; /* AF_* */ /* * Status is handled one of two ways; if there is an * address associated with the interface then the * associated address family af_status method is invoked * with the appropriate addressin info. Otherwise, if * all possible info is to be displayed and af_other_status * is defined then it is invoked after all address status * is presented. */ void (*af_status)(int, const struct ifaddrs *); void (*af_other_status)(int); /* parse address method */ void (*af_getaddr)(const char *, int); /* parse prefix method (IPv6) */ void (*af_getprefix)(const char *, int); void (*af_postproc)(int s, const struct afswtch *); u_long af_difaddr; /* set dst if address ioctl */ u_long af_aifaddr; /* set if address ioctl */ void *af_ridreq; /* */ void *af_addreq; /* */ struct afswtch *af_next; /* XXX doesn't fit model */ void (*af_status_tunnel)(int); void (*af_settunnel)(int s, struct addrinfo *srcres, struct addrinfo *dstres); }; int main(int argc, char **argv) { int s, error; struct ifreq ifr; //char name[IFNAMSIZ]; mac_t label; if (mac_from_text(&label, argv[1]) == -1) { perror(argv[1]); return; } ifr.ifr_addr.sa_family = AF_INET; if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, argv[2], sizeof(ifr.ifr_name)); ifr.ifr_ifru.ifru_data = (void *)label; error = ioctl(s, SIOCSIFMAC, &ifr); mac_free(label); if (error == -1) perror("setifmac"); return 0; } Now, if I try to change mac address of my card, I get this message: ./mactool dc0 00:10:22:33:44:77 mactool: socket(family 18,SOCK_DGRAM: Protocol not supported From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 12:45:03 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 9BA52106564A; Wed, 9 Nov 2011 12:45:03 +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 2E2938FC12; Wed, 9 Nov 2011 12:45:02 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pA9Cit6l024640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Nov 2011 14:44:55 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pA9Cit67068905; Wed, 9 Nov 2011 14:44:55 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pA9Citp0068904; Wed, 9 Nov 2011 14:44:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Nov 2011 14:44:55 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20111109124455.GW50300@deviant.kiev.zoral.com.ua> References: <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JIU8dMvCuAW53rIa" Content-Disposition: inline In-Reply-To: <86r51iqoad.fsf@kopusha.home.net> 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 12:45:03 -0000 --JIU8dMvCuAW53rIa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: >=20 > On Sun, 6 Nov 2011 20:10:41 +0200 Kostik Belousov wrote: >=20 > KB> On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: > >>=20 > >> http://people.freebsd.org/~trociny/env.sys.3.patch >=20 > KB> Oops, I missed this in the previous review. You cannot use fubyte in > KB> proc_read_mem(). fubyte reads a byte from the address space of the c= urrent > KB> process. The fix is easy, use proc_rwmem for 1 byte. >=20 > KB> I do not think that fall back to single byte read is warranted for > KB> proc_read_mem calls e.g. for ps_strings. Add a flag to indicate whet= her > KB> the proc_read_mem should fall back to byte read ? >=20 > KB> I would prefer using sizeof(uint64_t) and sizeof(uint32_t) instead o= f 8 > KB> and 4 constants in the align checks. >=20 > KB> Might be, add PROC_ASSERT_HELD() to get_ps_string() ? >=20 > KB> procfs patch looks good. >=20 > Thanks. The updated version: >=20 > http://people.freebsd.org/~trociny/env.sys.4.patch >=20 > Investigating cases when EFAULT was returned and if the fallback was > successful I noticed that most of the cases were when p->p_comm changed d= uring > the read, so the process was in exec in that time. In order to avoid this > error I added a check for P_INEXEC flag. And now you return success and nothing gets copied out for the process in P_INEXEC state. Either you should return an error like EAGAIN, or consider the P_INEXEC state as transitional and wait till process leaves it. Or, ignore the state as it was before, and return whatever error proc_rwmem generated (my preference). >=20 > After this I observed EFAULT (very rarely) only when reading arg or env > strings and fallback was successful for those cases. So I modified the pa= tch > to do fallback only when reading strings (as it was in one of my earlier > versions but with wrong fubyte), and returned your comment which explains= why > it may happen :-) >=20 > Also in the procfs patch I have added the check for process state. >=20 > The userland part has not been changed since my first report: >=20 > http://people.freebsd.org/~trociny/env.user.patch >=20 > --=20 > Mikolaj Golub --JIU8dMvCuAW53rIa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk66dccACgkQC3+MBN1Mb4iarACgvhzunOIjpRYaGRExe96olR3j BQgAnRIhrLZcozVy/okSIulpv+zrmM4+ =w/U9 -----END PGP SIGNATURE----- --JIU8dMvCuAW53rIa-- From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 12:53: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 01B411065674; Wed, 9 Nov 2011 12:53:38 +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 8F3888FC12; Wed, 9 Nov 2011 12:53:37 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pA9CrTK3025539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Nov 2011 14:53:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pA9CrTxL068949; Wed, 9 Nov 2011 14:53:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pA9CrTaV068948; Wed, 9 Nov 2011 14:53:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Nov 2011 14:53:29 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20111109125329.GX50300@deviant.kiev.zoral.com.ua> References: <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WN6YUpv1TkvwTGnb" Content-Disposition: inline In-Reply-To: <20111109124455.GW50300@deviant.kiev.zoral.com.ua> 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 12:53:38 -0000 --WN6YUpv1TkvwTGnb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 09, 2011 at 02:44:55PM +0200, Kostik Belousov wrote: > On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: > >=20 > > On Sun, 6 Nov 2011 20:10:41 +0200 Kostik Belousov wrote: > >=20 > > KB> On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: > > >>=20 > > >> http://people.freebsd.org/~trociny/env.sys.3.patch > >=20 > > KB> Oops, I missed this in the previous review. You cannot use fubyte = in > > KB> proc_read_mem(). fubyte reads a byte from the address space of the= current > > KB> process. The fix is easy, use proc_rwmem for 1 byte. > >=20 > > KB> I do not think that fall back to single byte read is warranted for > > KB> proc_read_mem calls e.g. for ps_strings. Add a flag to indicate wh= ether > > KB> the proc_read_mem should fall back to byte read ? > >=20 > > KB> I would prefer using sizeof(uint64_t) and sizeof(uint32_t) instead= of 8 > > KB> and 4 constants in the align checks. > >=20 > > KB> Might be, add PROC_ASSERT_HELD() to get_ps_string() ? > >=20 > > KB> procfs patch looks good. > >=20 > > Thanks. The updated version: > >=20 > > http://people.freebsd.org/~trociny/env.sys.4.patch > >=20 > > Investigating cases when EFAULT was returned and if the fallback was > > successful I noticed that most of the cases were when p->p_comm changed= during > > the read, so the process was in exec in that time. In order to avoid th= is > > error I added a check for P_INEXEC flag. > And now you return success and nothing gets copied out for the process > in P_INEXEC state. Either you should return an error like EAGAIN, or > consider the P_INEXEC state as transitional and wait till process > leaves it. Or, ignore the state as it was before, and return whatever > error proc_rwmem generated (my preference). Forgot to say that the check does not change much because you drop process lock immediately after the check, so the process may enter the INEXEC state right after the check. I believe you already tried to do this with P_WEXIT. >=20 > >=20 > > After this I observed EFAULT (very rarely) only when reading arg or env > > strings and fallback was successful for those cases. So I modified the = patch > > to do fallback only when reading strings (as it was in one of my earlier > > versions but with wrong fubyte), and returned your comment which explai= ns why > > it may happen :-) > >=20 > > Also in the procfs patch I have added the check for process state. > >=20 > > The userland part has not been changed since my first report: > >=20 > > http://people.freebsd.org/~trociny/env.user.patch > >=20 > > --=20 > > Mikolaj Golub --WN6YUpv1TkvwTGnb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk66d8kACgkQC3+MBN1Mb4hIiQCeN5R/OyDpj0fpaib4NDklEqGW f1MAnAv1fqRzd56yGcX+2toiTN0lLf4F =vYoF -----END PGP SIGNATURE----- --WN6YUpv1TkvwTGnb-- From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 13:06: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 5666A106566B; Wed, 9 Nov 2011 13:06:58 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id B12518FC0A; Wed, 9 Nov 2011 13:06:57 +0000 (UTC) Received: by eyd10 with SMTP id 10so1811673eyd.13 for ; Wed, 09 Nov 2011 05:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=DruClOduSGVVY/u6B0NxzAYa6fBrQISTsaip8uK2/U8=; b=Xu6Qadwo1O4YSJ/F/mJ/FXQdpM6dAli/Cm4JMfj6YJdy+hqVMxJNOSGrizu3EQGyV7 NzSoHOl4zQKp1jHaqQqyWBXCxEs90l3qNAfqRsXNeBE8ygxmxm5jWqywKk49cRoqa5dY Z71oCOKorNN85uwObQgWqW50hvEeQqANz6omc= Received: by 10.213.35.210 with SMTP id q18mr1737427ebd.94.1320844014842; Wed, 09 Nov 2011 05:06:54 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id z58sm13364033eea.3.2011.11.09.05.06.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 05:06:52 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> Sender: Mikolaj Golub Date: Wed, 09 Nov 2011 15:06:49 +0200 In-Reply-To: <20111109124455.GW50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 9 Nov 2011 14:44:55 +0200") Message-ID: <864nydigwm.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:06:58 -0000 On Wed, 9 Nov 2011 14:44:55 +0200 Kostik Belousov wrote: KB> On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: >> >> http://people.freebsd.org/~trociny/env.sys.4.patch >> >> Investigating cases when EFAULT was returned and if the fallback was >> successful I noticed that most of the cases were when p->p_comm changed during >> the read, so the process was in exec in that time. In order to avoid this >> error I added a check for P_INEXEC flag. KB> And now you return success and nothing gets copied out for the process KB> in P_INEXEC state. This looked ok for me: new arguments have not been created for the process yet, so return nothing :-) KB> Either you should return an error like EAGAIN, or consider the P_INEXEC KB> state as transitional and wait till process leaves it. Or, ignore the KB> state as it was before, and return whatever error proc_rwmem generated KB> (my preference). I prefer EAGAIN :-). Reading in the process space that is being currrently updated does not look good for me. And EAGAIN gives a hint that if I try it again I will probably get the result, while EFAULT looks mysterious. -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 13:31: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 41D8F1065674; Wed, 9 Nov 2011 13:31:35 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id A12898FC13; Wed, 9 Nov 2011 13:31:34 +0000 (UTC) Received: by eyd10 with SMTP id 10so1837781eyd.13 for ; Wed, 09 Nov 2011 05:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=hgCfT0Iy4+gRGqeGDsVM/rXVzVWStuXHX0KCnbTDog0=; b=Gfg+8o1QLh1OHvL3rReusd4527GOsMUXvOYGvwKVspUYYaeIHvH6DnOgbUmj74Uo8s Q4MzmYE6IjPEcn4lwEisuwnu35XSjv2PS2lCM8Y1LzR0br04aP7pW8R4luv49pR7zY3o QKqDBOHPiOFSiBtURMc1ha9CT80adQqK3WOyU= Received: by 10.213.14.12 with SMTP id e12mr15808eba.113.1320845493652; Wed, 09 Nov 2011 05:31:33 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id 54sm13508546eex.8.2011.11.09.05.31.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 05:31:32 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> <20111109125329.GX50300@deviant.kiev.zoral.com.ua> Sender: Mikolaj Golub Date: Wed, 09 Nov 2011 15:31:26 +0200 In-Reply-To: <20111109125329.GX50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 9 Nov 2011 14:53:29 +0200") Message-ID: <86zkg5h175.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:31:35 -0000 On Wed, 9 Nov 2011 14:53:29 +0200 Kostik Belousov wrote: >> And now you return success and nothing gets copied out for the process >> in P_INEXEC state. Either you should return an error like EAGAIN, or >> consider the P_INEXEC state as transitional and wait till process >> leaves it. Or, ignore the state as it was before, and return whatever >> error proc_rwmem generated (my preference). KB> Forgot to say that the check does not change much because you drop KB> process lock immediately after the check, so the process may enter KB> the INEXEC state right after the check. I believe you already tried KB> to do this with P_WEXIT. Good point :-). Although after adding the P_INEXEC I have not seen errors any more, while before they were often (when running 'procstat -ca' in loop and building world simultaneously). Thus it looks like the probability is much smaller. So, it still looks good for me to check for P_INEXEC and return EAGAIN, and add the comment why we do this and that it still racy. But if you still think that ignoring the state is the best option no problems for me to return it back. -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 14:08:41 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28EFE1065670 for ; Wed, 9 Nov 2011 14:08:41 +0000 (UTC) (envelope-from hosting@syscare.sk) Received: from services.syscare.sk (services.syscare.sk [188.40.39.36]) by mx1.freebsd.org (Postfix) with ESMTP id C85198FC15 for ; Wed, 9 Nov 2011 14:08:40 +0000 (UTC) Received: from services.syscare.sk (services [188.40.39.36]) by services.syscare.sk (Postfix) with ESMTP id D497B7BD8F; Wed, 9 Nov 2011 15:08:39 +0100 (CET) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.syscare.sk ([188.40.39.36]) by services.syscare.sk (services.rulez.sk [188.40.39.36]) (amavisd-new, port 10024) with ESMTP id GlMtf37hs2Ol; Wed, 9 Nov 2011 15:08:34 +0100 (CET) Received: from hosting.syscare.sk (hosting [188.40.39.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by services.syscare.sk (Postfix) with ESMTPS id 4DFD37BD5D; Wed, 9 Nov 2011 15:08:34 +0100 (CET) Received: (from www@localhost) by hosting.syscare.sk (8.14.4/8.14.4/Submit) id pA9E8Ytf076896; Wed, 9 Nov 2011 15:08:34 +0100 (CET) (envelope-from hosting@syscare.sk) X-Authentication-Warning: hosting.syscare.sk: www set sender to hosting@syscare.sk using -f To: X-PHP-Originating-Script: 0:func.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Nov 2011 15:08:34 +0100 From: Daniel Gerzo Organization: The FreeBSD Project Mail-Reply-To: In-Reply-To: <20111108095508.GA81445@freefall.freebsd.org> References: <20111108095508.GA81445@freefall.freebsd.org> Message-ID: <3cc153aa4fc398e3809ea826ebb9e3ad@rulez.sk> X-Sender: danger@FreeBSD.org User-Agent: Roundcube Webmail/0.5.4 Cc: stable@freebsd.org, hackers@freebsd.org Subject: Re: FreeBSD Status Report July-September, 2011 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: monthly@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 14:08:41 -0000 On Tue, 8 Nov 2011 09:55:09 +0000, Daniel Gerzo wrote: > FreeBSD Quarterly Status Report - Q3/2011 Unfortunately, I managed to use an old status report entry for KDE/FreeBSD, instead of the current one. I am sorry for any inconvenience; the current entry for KDE/FreeBSD is below: KDE/FreeBSD URL: http://FreeBSD.KDE.org URL: http://FreeBSD.KDE.org/area51.php Contact: KDE FreeBSD The KDE/FreeBSD team has continued to improve the experience of KDE software and Qt under FreeBSD. The latest round of improvements include: * Splitting some of the KDE modules into smaller ports * Reduced startup time by ~15 seconds * Allowed auto-login out-of-the-box * Kopete supports GoogleTalk * Kalzium installs with its molecular editor * Zeitgeist support added * Porting Calligra to FreeBSD (work-in-progress) The team has also made many releases and upstreamed many fixes and patches. The latest round of releases include: * Qt: 4.7.4 * PyQt: 4.8.5 (SIP: 4.12.4) * KDE SC: 4.7.2 * Amarok: 2.4.3 * KDevelop: 4.2.3 (KDevPlatform: 1.2.3) The team is always looking for more testers and porters so please contact us at kde-freebsd@KDE.org and visit our home page at http://FreeBSD.KDE.org. Open tasks: 1. Testing KDE PIM 4.7.2 2. Testing phonon-gstreamer and phonon-vlc as the phonon-xine backend was deprecated (and will remain in ports) -- Kind regards Daniel From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 17:09:16 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E2B1106566B for ; Wed, 9 Nov 2011 17:09:16 +0000 (UTC) (envelope-from onwahe@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 042328FC08 for ; Wed, 9 Nov 2011 17:09:15 +0000 (UTC) Received: by gyd5 with SMTP id 5so2749022gyd.13 for ; Wed, 09 Nov 2011 09:09:15 -0800 (PST) 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=KSLlPusoNLl8q2sjnDPJtf0JOkzyo2I5cjrThhXEwQ0=; b=fK1bYE+LAAqhwiqiUNzNtZPbitlbS5X8YSU5EQa2zpE8lVPv5ISlObAAcLBwx0WeKk f2RnqCzGIUctMJLDhRbh/MlB5/Sre5iHcXL4H43gLfdzOnKQoUUVKiPdq1GPeG6NatfH WwB1FEfV8+Q7hs/1M+uvmWdtzLfHO6cZBbz+s= MIME-Version: 1.0 Received: by 10.68.29.197 with SMTP id m5mr6831987pbh.9.1320858554924; Wed, 09 Nov 2011 09:09:14 -0800 (PST) Received: by 10.142.126.2 with HTTP; Wed, 9 Nov 2011 09:09:14 -0800 (PST) Date: Wed, 9 Nov 2011 18:09:14 +0100 Message-ID: From: Svatopluk Kraus To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: i386 - pmap_enter() & superpage promotion on kernel addresses X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:09:16 -0000 Hi, I'm tuning pmap code for arm11 mpcore port, which is inspired by i386 one. My question is about superpage promotions on kernel addresses in i386 pmap code. pmap_promote_pde() is called from pmap_enter() only and if following conditions are fulfilled: 1. promotions are enabled, 2. all pages in a superpage are allocated (physical space condition), and for user addresses, 3. all pages in a superpage are mapped (virtual space condition). For kernel addresses, the third condition is not checked. I understand that it is not easy to evaluate the third condition for kernel addresses. However, pmap_promote_pde() often can be called unnecessarily now and it's rather expensive call. Or is there any other reason for that? Moreover, there are many temporary mappings (pmap_qenter(),...) in kernel and if pmap_promote_pde() is called without 3th condition, the promotion can be successfull. As temporary mappings do nothing with promotions and demotions, it is a fault. Or a superpage with temporary kernel mapping never can be promoted because of locking or something else? The third condition is evaluated on page table bases (wire_count is used) for user addresses. Page tables for kernel addresses have wire count set to 0 or 1. Page tables preallocated during boot are post-initialized in pmap_init() but wire_count is left untouched (wire_count is 0). Page tables allocated in pmap_growkernel() are allocated wired (wire_count is 1). [branch] If a kernel superpage is demoted in pmap_demote_pde() and corresponding page table wire_count is 1, the page table is re-initialized uselessly as a newly allocated one. My idea is that kernel address mappings made in pmap_enter() can be marked 'stable' (as opposite to 'temporary') and counted by wire_count in same way as for user addresses and then third condition could be applied and will be fulfilled only for this 'stable' mappings (which know about promotions and demotions). Is anything wrong with this idea? Svata From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 10 18:29:54 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3161065670 for ; Thu, 10 Nov 2011 18:29:54 +0000 (UTC) (envelope-from rank1seeker@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 299418FC18 for ; Thu, 10 Nov 2011 18:29:53 +0000 (UTC) Received: by faar19 with SMTP id r19so4460790faa.13 for ; Thu, 10 Nov 2011 10:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:content-type :content-transfer-encoding:x-mailer; bh=aMylEZI9Clv1RvwuYq6L78alazKAdmznk1/mGkKwGJA=; b=vl9o5dctuL0xzvWQMmKq27mmpvXUMqIRbkhK/JAUSw54B7w/yhXWixOHtKD0IcFE/i DNPtfJEs8Mg+vMlLbZDC+M8hUOkCpsOShZipY8loMElkMaxvt7RMqLbz9SjWfxvmn0xe lfs8Au4uDLL3vhdrmCFmf+5giXuXy7SYsES/s= Received: by 10.223.94.143 with SMTP id z15mr13482889fam.32.1320949793019; Thu, 10 Nov 2011 10:29:53 -0800 (PST) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id l26sm12100431fad.17.2011.11.10.10.29.49 (version=SSLv3 cipher=OTHER); Thu, 10 Nov 2011 10:29:51 -0800 (PST) Message-ID: <20111110.182948.630.1@DOMY-PC> From: rank1seeker@gmail.com To: hackers@freebsd.org, freebsd-acpi@FreeBSD.org Date: Thu, 10 Nov 2011 19:29:48 +0100 Content-Type: text/plain; charset="Windows-1250" Content-Transfer-Encoding: quoted-printable X-Mailer: POP Peeper (3.8.0.0) Cc: Subject: Adventure into S3 state and back X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 18:29:54 -0000 8.2-p4 RELEASE amd64=0D=0A=0D=0AI've built a custom kernel, only with = drivers, that I need=0D=0AAfter resuming from S3 ...=0D=0A=0D=0AI = hit:=0D=0A# ifconfig=0D=0Aand all hells breaks = loose:=0D=0A----=0D=0Abge0: PHY read timed out (phy 1, reg 5, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 10, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 25, val = 0xffffffff)=0D=0A media: Ethernet autoselect=0D=0A status: = no carrier=0D=0Abge0: PHY read timed out (phy 1, reg 1, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 1, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 0, val = 0xffffffff)=0D=0Augen3.2: at usbus3 (disconnected)=0D=0Aukbd0: = at uhub3, port 1, addr 2 (disconnected)=0D=0Aums0: at uhub3, port 1, addr = 2 (disconnected)=0D=0Auhid0: at uhub3, port 1, addr 2 = (disconnected)=0D=0Abge0: PHY read timed out (phy 1, reg 4, val = 0xffffffff)=0D=0Augen3.2: at usbus3=0D=0Aukbd0: on usbus3=0D=0Akbd2 at = ukbd0=0D=0Aums0: on usbus3=0D=0Aums0: 16 buttons and [XYZT] coordinates = ID=3D2=0D=0Auhid0: on usbus3=0D=0Abge0: PHY read timed out (phy 1, reg 5, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 10, val = 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 25, val = 0xffffffff)=0D=0Apflog0: flags=3D141 metric 0 mtu = 33152=0D=0Alo0: flags=3D8049 metric 0 mtu = 16384=0D=0A options=3D3=0D=0A inet6 = fe80::1%lo0 prefixlen 64 scopeid 0x3=0D=0A inet6 ::1 prefixlen = 128=0D=0A inet 127.0.0.1 netmask 0xff000000=0D=0A nd6 = options=3D3=0D=0Acruiser# ifconfig=0D=0Abge0: = flags=3D8802 metric 0 mtu 1500=0D=0A = options=3D8009b=0D=0A = ether 00:21:70:70:01:df=0D=0Abge0: PHY read timed out (phy 1, reg = 1, val 0xffffffff)=0D=0Abge0: PHY read timed out (phy 1, reg 1, val = 0xffffffff)=0D=0A=0D=0A... ... ... =0D=0A----=0D=0A=0D=0ASo, taking into account:=0D=0A"A common = problem with suspend/resume is that many device drivers do not save, = restore, or reinitialize their firmware, registers, or device memory = properly."=0D=0A=0D=0ANext step was to get rid of 'bge' device from my = KERNCONF and recompile it.=0D=0AVoila! S3 works!=0D=0A=0D=0ABut another, = mouse problem, didn't go away!=0D=0AIn 9 out of 10 cases, mouse doesn't = resume.=0D=0AAs it is USB mouse, I've did:=0D=0A=0D=0A# camcontrol rescan = all=0D=0A didn't help=0D=0A=0D=0AI've also tried adding into = loader.conf and = nada:=0D=0A---=0D=0Ahint.psm.0.flags=3D"0x3000"=0D=0A---=0D=0ABut i think = it is PS/2 related=0D=0A=0D=0AWhat works 100% for a mouse is to unplug = and then plug back it's USB receiver=0D=0A=0D=0AThis is Dell D830 = laptop=0D=0A=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6 From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 10 21:15:17 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 2C0EA106564A; Thu, 10 Nov 2011 21:15:16 +0000 (UTC) (envelope-from to.my.trociny@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 46A958FC12; Thu, 10 Nov 2011 21:15:15 +0000 (UTC) Received: by faar19 with SMTP id r19so4707260faa.13 for ; Thu, 10 Nov 2011 13:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=4Dis4gGB2nXGMZW42eLhEpa4zZvxTMXS9kdVMU3134k=; b=FPD1WpComPMsWbNZENQq5p3sgYb5BrG8zGbu1zGGorxQb37f4tHs7Lo65rz2S3YBaC JkaVM+nUwILGuDfMXE0vdalhqL0G6Q3UdhihMBsHC9DFvfUf07gMSohHYakQBHoYRmbU OadlO7aXdC1voxcQn7+iVG4zq7dDZtLzPXgl4= Received: by 10.223.14.197 with SMTP id h5mr14485890faa.2.1320959715092; Thu, 10 Nov 2011 13:15:15 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id k13sm2917531fah.0.2011.11.10.13.15.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Nov 2011 13:15:11 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov References: <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> <20111109125329.GX50300@deviant.kiev.zoral.com.ua> <86zkg5h175.fsf@in138.ua3> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Thu, 10 Nov 2011 23:15:08 +0200 In-Reply-To: <86zkg5h175.fsf@in138.ua3> (Mikolaj Golub's message of "Wed, 09 Nov 2011 15:31:26 +0200") Message-ID: <867h378ysj.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 21:15:17 -0000 On Wed, 09 Nov 2011 15:31:26 +0200 Mikolaj Golub wrote: MG> On Wed, 9 Nov 2011 14:53:29 +0200 Kostik Belousov wrote: >>> And now you return success and nothing gets copied out for the process >>> in P_INEXEC state. Either you should return an error like EAGAIN, or >>> consider the P_INEXEC state as transitional and wait till process >>> leaves it. Or, ignore the state as it was before, and return whatever >>> error proc_rwmem generated (my preference). KB>> Forgot to say that the check does not change much because you drop KB>> process lock immediately after the check, so the process may enter KB>> the INEXEC state right after the check. I believe you already tried KB>> to do this with P_WEXIT. MG> Good point :-). Although after adding the P_INEXEC I have not seen errors any MG> more, while before they were often (when running 'procstat -ca' in loop and MG> building world simultaneously). Thus it looks like the probability is much MG> smaller. MG> So, it still looks good for me to check for P_INEXEC and return EAGAIN, and MG> add the comment why we do this and that it still racy. But if you still think MG> that ignoring the state is the best option no problems for me to return it MG> back. Realted to this, sysctl_kern_proc_kstack() looks like has the similar issue. But it returns ESRCH instead. /* XXXRW: Not clear ESRCH is the right error during proc execve(). */ if (p->p_flag & P_WEXIT || p->p_flag & P_INEXEC) { PROC_UNLOCK(p); return (ESRCH); } ... _PHOLD(p); PROC_UNLOCK(p); -- Mikolaj Golub From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 11 23:38:00 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0946106564A for ; Fri, 11 Nov 2011 23:38:00 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF918FC17 for ; Fri, 11 Nov 2011 23:37:59 +0000 (UTC) Received: by wyf23 with SMTP id 23so2951672wyf.13 for ; Fri, 11 Nov 2011 15:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QDfWA7hUByE4K4yMUkJTdbbxd6H3H4X4dkH8sYQLryY=; b=AwopgmZAKfr5EWMMqshJW+dWcqsR67uuclhmUNDBzMMIShPlADojnxcZTtfxaDif9t l3wPzJP8PKhk9wWIl8c9h383Zw5d96qH8A9KvkzIiU0vN+95hRFa3ViKAD/3NlvWT8IR qo/Krt+jYuga6aDIijR1tH3wk+/+zJw2cCPDI= Received: by 10.227.205.130 with SMTP id fq2mr9649660wbb.17.1321053025108; Fri, 11 Nov 2011 15:10:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.21.133 with HTTP; Fri, 11 Nov 2011 15:09:54 -0800 (PST) In-Reply-To: <4EAA8B4B.2090002@masterhost.ru> References: <4EAA8B4B.2090002@masterhost.ru> From: Eitan Adler Date: Fri, 11 Nov 2011 18:09:54 -0500 Message-ID: To: Daniil Cherednik Content-Type: text/plain; charset=UTF-8 Cc: hackers@freebsd.org Subject: Re: performance of fork() syscalls X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 23:38:00 -0000 Sorry for the delayed reply. On Fri, Oct 28, 2011 at 7:00 AM, Daniil Cherednik wrote: > Hello. > I have some questions about performance fork syscall. Great! > Result in FreeBSD (8.2, amd62): > > real 0m2.010s > user 0m0.053s > sys 0m1.946s > > Result in Linux (2.6.32-5-amd64): > > real 0m1.210s > user 0m0.008s > sys 0m1.200s > > Does this mean performance of fork() in Linux is better? No. It may be true that Linux's fork is faster than ours, but these numbers don't show that. >From my own (albeit limited) knowledge the numbers you gave above are statistically meaningless. You have one iteration of the sum of using time(1) on one machine 10000 times. This data can only provide the average of a single test case with many possible causes for the slowness. Additionally, time(1) includes time spent in system calls, running other programs, processing interrupts, etc. "sys" is a lie, as not every context switch is tracked for performance reasons. Use getrusage() instead. In order to have a meaningful comparison you would need to a) Run the results under the Student's T test to see if there is a significant different at p=95%. b) Do the benchmarks on a machine running nearly nothing else. Run your tests on Single User Mode, disable all services, remove the computer from the network, mount the disks read-only, etc. Without doing this there is too much noise, and it isn't possible to determine what is causing the slow down (if there is any difference at all, see part a) I understand that the numbers look bad, and that this is a lot of work to do to see if there is a difference, but benchmarking is a non-trivial exercise :) If I'm wrong here, please correct me. I am always open to learning new things. > And can you explain why? See above ;) -- Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 12 00:41:27 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345A51065675 for ; Sat, 12 Nov 2011 00:41:27 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-qw0-f47.google.com (mail-qw0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id E1DE48FC0A for ; Sat, 12 Nov 2011 00:41:26 +0000 (UTC) Received: by qabj40 with SMTP id j40so4756894qab.13 for ; Fri, 11 Nov 2011 16:41:26 -0800 (PST) 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=S7j3LQQRzDBratwkDolJd25tb0QSTlu/rfL7eiO13UI=; b=tPmOKZ5J9m/xWBp9DOtXHlDTwptsSIdEPaWQNYrqnpeTOmAq6W30QYMmBaImBV8G0x bl95d+z1+UEa6hBiyNN3YdUwsXZjL7dD8iBvO8Eok5tt/8bnKfyZzBsXnHRUBiM45av0 /h4CJY0dQzAymDCvVduMPKfAAGmuTZp4pEh+0= MIME-Version: 1.0 Received: by 10.224.182.196 with SMTP id cd4mr10501593qab.3.1321056978601; Fri, 11 Nov 2011 16:16:18 -0800 (PST) Received: by 10.224.73.195 with HTTP; Fri, 11 Nov 2011 16:16:18 -0800 (PST) In-Reply-To: References: <4EAA8B4B.2090002@masterhost.ru> Date: Fri, 11 Nov 2011 19:16:18 -0500 Message-ID: From: Mehmet Erol Sanliturk To: Eitan Adler Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Daniil Cherednik , hackers@freebsd.org Subject: Re: performance of fork() syscalls X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 00:41:27 -0000 On Fri, Nov 11, 2011 at 6:09 PM, Eitan Adler wrote: > Sorry for the delayed reply. > > On Fri, Oct 28, 2011 at 7:00 AM, Daniil Cherednik > wrote: > > Hello. > > I have some questions about performance fork syscall. > > Great! > > > Result in FreeBSD (8.2, amd62): > > > > real 0m2.010s > > user 0m0.053s > > sys 0m1.946s > > > > Result in Linux (2.6.32-5-amd64): > > > > real 0m1.210s > > user 0m0.008s > > sys 0m1.200s > > > > > Does this mean performance of fork() in Linux is better? > No. It may be true that Linux's fork is faster than ours, but these > numbers don't show that. > > >From my own (albeit limited) knowledge the numbers you gave above are > statistically meaningless. You have one iteration of the sum of using > time(1) on one machine 10000 times. > This data can only provide the average of a single test case with many > possible causes for the slowness. > > Additionally, time(1) includes time spent in system calls, running > other programs, processing interrupts, etc. "sys" is a lie, as not > every context switch is tracked for performance reasons. Use > getrusage() instead. > > In order to have a meaningful comparison you would need to > a) Run the results under the Student's T test to see if there is a > significant different at p=95%. > b) Do the benchmarks on a machine running nearly nothing else. Run > your tests on Single User Mode, disable all services, remove the > computer from the network, mount the disks read-only, etc. Without > doing this there is too much noise, and it isn't possible to determine > what is causing the slow down (if there is any difference at all, see > part a) > > I understand that the numbers look bad, and that this is a lot of work > to do to see if there is a difference, but benchmarking is a > non-trivial exercise :) > > If I'm wrong here, please correct me. I am always open to learning new > things. > > > > And can you explain why? > > See above ;) > > > -- > Eitan Adler > You may design an experiment like that : Take more than 15 FreeBSD ( the same operating system ) running computers with the same window manager . The computers need not to be similar . Take at least 60 ( to obtain a good Normal distribution approximation with respect to Central Limit Theorem ) Linux computers ( the same kernel , but different Linux distributions ) . Apply the same fork statement and measure the execution time . Apply the Student t test to check equality of means after applying a test of equality of variances . If the fork time means are different statistically , smaller mean fork time is better than the other ( FreeBSD versus Linux ) . If the variances are different , the systems are different . Smaller variance is better than the other . The computers need not to be similar . Thank you very much Mehmet Erol Sanliturk From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 12 00:51:29 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E432106566B; Sat, 12 Nov 2011 00:51:29 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4598FC0A; Sat, 12 Nov 2011 00:51:28 +0000 (UTC) Received: by yenl2 with SMTP id l2so3830216yen.13 for ; Fri, 11 Nov 2011 16:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=yvWvkYrvnHDGhDnI1G7tlpX4mgE02SLoFf1SOJwF03k=; b=of7GUa2FEd777r6eDFVaI+c1CeZZmRkYlD1j1YUvy+tvnCkReC6la4xIwxIXwuPMJ7 QzhQufkeYX6xtyI3Kb5oXkkB/lmdW1D2gYCHSv0cOECfYnCgGWkMBDHEHvNBQeBwjE4h DDMWcD2ZEbt2OoI7IBp7qoXnDdLbSMKA7vWag= Received: by 10.68.47.4 with SMTP id z4mr28625172pbm.39.1321057771134; Fri, 11 Nov 2011 16:29:31 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id wn14sm34132101pbb.5.2011.11.11.16.29.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Nov 2011 16:29:30 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Nov 2011 16:27:27 -0800 From: YongHyeon PYUN Date: Fri, 11 Nov 2011 16:27:27 -0800 To: rank1seeker@gmail.com Message-ID: <20111112002727.GD17792@michelle.cdnetworks.com> References: <20111110.182948.630.1@DOMY-PC> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111110.182948.630.1@DOMY-PC> User-Agent: Mutt/1.4.2.3i Cc: freebsd-acpi@freebsd.org, hackers@freebsd.org Subject: Re: Adventure into S3 state and back X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 00:51:29 -0000 On Thu, Nov 10, 2011 at 07:29:48PM +0100, rank1seeker@gmail.com wrote: > 8.2-p4 RELEASE amd64 > > I've built a custom kernel, only with drivers, that I need > After resuming from S3 ... > > I hit: > # ifconfig > and all hells breaks loose: > ---- > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff) > media: Ethernet autoselect > status: no carrier > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 0, val 0xffffffff) > ugen3.2: at usbus3 (disconnected) > ukbd0: at uhub3, port 1, addr 2 (disconnected) > ums0: at uhub3, port 1, addr 2 (disconnected) > uhid0: at uhub3, port 1, addr 2 (disconnected) > bge0: PHY read timed out (phy 1, reg 4, val 0xffffffff) > ugen3.2: at usbus3 > ukbd0: on usbus3 > kbd2 at ukbd0 > ums0: on usbus3 > ums0: 16 buttons and [XYZT] coordinates ID=2 > uhid0: on usbus3 > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff) > pflog0: flags=141 metric 0 mtu 33152 > lo0: flags=8049 metric 0 mtu 16384 > options=3 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 > inet6 ::1 prefixlen 128 > inet 127.0.0.1 netmask 0xff000000 > nd6 options=3 > cruiser# ifconfig > bge0: flags=8802 metric 0 mtu 1500 > options=8009b > ether 00:21:70:70:01:df > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > > ... ... ... Known issue. kern/136876. Mobile bge(4) controllers seem to have this issue. > ---- > > So, taking into account: > "A common problem with suspend/resume is that many device drivers do not save, restore, or reinitialize their firmware, registers, or device memory properly." > > Next step was to get rid of 'bge' device from my KERNCONF and recompile it. > Voila! S3 works! > > But another, mouse problem, didn't go away! > In 9 out of 10 cases, mouse doesn't resume. > As it is USB mouse, I've did: > > # camcontrol rescan all > didn't help > > I've also tried adding into loader.conf and nada: > --- > hint.psm.0.flags="0x3000" > --- > But i think it is PS/2 related > > What works 100% for a mouse is to unplug and then plug back it's USB receiver > > This is Dell D830 laptop > > > > Domagoj Smol?i? > _______________________________________________ > 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 Sat Nov 12 14:41:56 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B5E106564A; Sat, 12 Nov 2011 14:41:56 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5B08FC17; Sat, 12 Nov 2011 14:41:55 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so5926123bkb.13 for ; Sat, 12 Nov 2011 06:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; bh=h55dFzJP1qqQmJrMkhOEQ3d7DINNPTkq+QQ/DX0tW0o=; b=fiscKQ/eWSJu7+U3ETHlSZFOSHKzQZ3jYaCpRdqPoFCg8zaxqxHN2JInxfjNqdB70l qOpQzkJ7H9bNL0zLcNo24GhVshPNnlb8jKTeixghksMD0d/sYqUdc8CX4AsO5QuHWfJ0 by9KKU9NrZ7R1rxPoTuhuLhrXRAvJFciosVWg= Received: by 10.205.128.13 with SMTP id hc13mr4536673bkc.140.1321108914481; Sat, 12 Nov 2011 06:41:54 -0800 (PST) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id dq2sm17847929bkb.11.2011.11.12.06.41.07 (version=SSLv3 cipher=OTHER); Sat, 12 Nov 2011 06:41:52 -0800 (PST) Message-ID: <20111112.144149.725.1@DOMY-PC> From: rank1seeker@gmail.com To: pyunyh@gmail.com, hackers@freebsd.org, freebsd-acpi@freebsd.org Date: Sat, 12 Nov 2011 15:41:49 +0100 In-Reply-To: <20111112002727.GD17792@michelle.cdnetworks.com> References: <20111110.182948.630.1@DOMY-PC> <20111112002727.GD17792@michelle.cdnetworks.com> X-Mailer: POP Peeper (3.8.0.0) Cc: Subject: Re: Adventure into S3 state and back X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 14:41:56 -0000 ----- Original Message ----- From: YongHyeon PYUN To: rank1seeker@gmail.com Cc: hackers@freebsd.org, freebsd-acpi@freebsd.org Date: Fri, 11 Nov 2011 16:27:27 -0800 Subject: Re: Adventure into S3 state and back > On Thu, Nov 10, 2011 at 07:29:48PM +0100, rank1seeker@gmail.com wrote: > > 8.2-p4 RELEASE amd64 > > > > I've built a custom kernel, only with drivers, that I need > > After resuming from S3 ... > > > > I hit: > > # ifconfig > > and all hells breaks loose: > > ---- > > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff) > > media: Ethernet autoselect > > status: no carrier > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 0, val 0xffffffff) > > ugen3.2: at usbus3 (disconnected) > > ukbd0: at uhub3, port 1, addr 2 (disconnected) > > ums0: at uhub3, port 1, addr 2 (disconnected) > > uhid0: at uhub3, port 1, addr 2 (disconnected) > > bge0: PHY read timed out (phy 1, reg 4, val 0xffffffff) > > ugen3.2: at usbus3 > > ukbd0: on usbus3 > > kbd2 at ukbd0 > > ums0: on usbus3 > > ums0: 16 buttons and [XYZT] coordinates ID=2 > > uhid0: on usbus3 > > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff) > > pflog0: flags=141 metric 0 mtu 33152 > > lo0: flags=8049 metric 0 mtu 16384 > > options=3 > > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 > > inet6 ::1 prefixlen 128 > > inet 127.0.0.1 netmask 0xff000000 > > nd6 options=3 > > cruiser# ifconfig > > bge0: flags=8802 metric 0 mtu 1500 > > options=8009b > > ether 00:21:70:70:01:df > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff) > > > > ... ... ... > > Known issue. kern/136876. > Mobile bge(4) controllers seem to have this issue. I can see this has been reported, when 8.0-BETA1 was released. Now is almost 8.3 out and problem is still present > > ---- > > > > So, taking into account: > > "A common problem with suspend/resume is that many device drivers do not save, restore, or reinitialize their firmware, registers, or device memory properly." > > > > Next step was to get rid of 'bge' device from my KERNCONF and recompile it. > > Voila! S3 works! > > > > But another, mouse problem, didn't go away! > > In 9 out of 10 cases, mouse doesn't resume. > > As it is USB mouse, I've did: > > > > # camcontrol rescan all > > didn't help > > > > I've also tried adding into loader.conf and nada: > > --- > > hint.psm.0.flags="0x3000" > > --- > > But i think it is PS/2 related > > > > What works 100% for a mouse is to unplug and then plug back it's USB receiver > > > > This is Dell D830 laptop > > How do I solve mouse issue? It is annoying to unplug and then plug back it's USB receiver, each time.