From owner-freebsd-hackers@freebsd.org Sun Sep 11 16:50:09 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6AB5BD66E9 for ; Sun, 11 Sep 2016 16:50:09 +0000 (UTC) (envelope-from george+freebsd@m5p.com) Received: from mailhost.m5p.com (mailhost.m5p.com [IPv6:2001:418:3fd::f7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1AEB20 for ; Sun, 11 Sep 2016 16:50:09 +0000 (UTC) (envelope-from george+freebsd@m5p.com) Received: from [10.100.0.31] (haymarket.m5p.com [10.100.0.31]) by mailhost.m5p.com (8.14.5/8.14.5) with ESMTP id u8BGo1Vi028376 for ; Sun, 11 Sep 2016 12:50:07 -0400 (EDT) (envelope-from george+freebsd@m5p.com) To: freebsd-hackers@freebsd.org From: George Mitchell Subject: Laptop disk spindown Message-ID: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> Date: Sun, 11 Sep 2016 12:50:01 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.73 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (mailhost.m5p.com [10.100.0.247]); Sun, 11 Sep 2016 12:50:07 -0400 (EDT) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 16:50:09 -0000 Smartctl reports that my laptop disk has started and stopped 101,798 times in 2,027 hours of operation, or roughly once a minute. I imagine that saves wear and tear on the disk, but it also makes the laptop seem remarkably sluggish for an A8 based system. Isn't there some sysctl that will lengthen the idle time before stopping the disk? I don't see one in the ada man page. -- George From owner-freebsd-hackers@freebsd.org Sun Sep 11 16:55:29 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBF5DBD6A20 for ; Sun, 11 Sep 2016 16:55:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAB093D5 for ; Sun, 11 Sep 2016 16:55:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 52CF0181C for ; Sun, 11 Sep 2016 16:55:28 +0000 (UTC) Subject: Re: Laptop disk spindown To: freebsd-hackers@freebsd.org References: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> From: Allan Jude Message-ID: <384fd7ca-b779-3e66-eaa9-c2c27dca4dc0@freebsd.org> Date: Sun, 11 Sep 2016 12:55:27 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="We7RQDOLJxJTh1VIEhUnGaEPIjnBP4WnK" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 16:55:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --We7RQDOLJxJTh1VIEhUnGaEPIjnBP4WnK Content-Type: multipart/mixed; boundary="CLtaxLgLmgXN7peQ4l5m7RwnshSJtUmv0" From: Allan Jude To: freebsd-hackers@freebsd.org Message-ID: <384fd7ca-b779-3e66-eaa9-c2c27dca4dc0@freebsd.org> Subject: Re: Laptop disk spindown References: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> In-Reply-To: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> --CLtaxLgLmgXN7peQ4l5m7RwnshSJtUmv0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-09-11 12:50, George Mitchell wrote: > Smartctl reports that my laptop disk has started and stopped > 101,798 times in 2,027 hours of operation, or roughly once a > minute. I imagine that saves wear and tear on the disk, but > it also makes the laptop seem remarkably sluggish for an A8 > based system. Isn't there some sysctl that will lengthen the > idle time before stopping the disk? I don't see one in the > ada man page. -- George > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >=20 This is controlled by the drive firmware, not the OS, however, you can often use camcontrol(8) to adjust it. I don't have the exact command handy, sorry. --=20 Allan Jude --CLtaxLgLmgXN7peQ4l5m7RwnshSJtUmv0-- --We7RQDOLJxJTh1VIEhUnGaEPIjnBP4WnK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJX1Yx/AAoJEBmVNT4SmAt+sSEQAIJyzokleV6wg4LE0PvKQA6D RmvUPU9YnjYX/XpFEfJJdRP5cDZ4NGg+ETP3A+MbRg4n3QpTBHfwjD29fazJZWDa MYedNUDj8hJ2XCCVmXav1ysNhj/hASEsuahKc2R10ckfG3mRLMyfjiJhh2N/KpWu VMX0PfhN0ETew5Ln3owR9TjeSZb2/DyA8/5dNf2G4mI2mgEY0o/IzJ3qNXlM0m6H CdlAspq6OkxDgw6+5NjpsSZHdHVjKmpvd7aOJsRDURmtakLp4SPc9Ajk3CmGSwXz ud2+62FQYxYXI2/QDXLXj3lz2Af+h1+w7g+s7dzM3rNHke9McYTzMO3ycXm3+yWJ R6XiRsrqrpTmZQOAn+JJJ9O4Ufo/JHhg5pe893TIPEhLFL2MTyZ7l3SMAEEclZfh ksmwhYqIzE7XvvYNcxAPD36U0v5Yq/by4CC2e478n5gJi16dbJiSLXxC9qd5oDhc /ErD5SyQnEvQwnR+TBxX+aIBWaxXysVmbqn5TjzrEfK1d4vZIJaUMrNePcLlQGPI bu6fmSy7DFQ73dzVDx0hOu1ajWO/9/B3gvuFkxW6XlLx8Y/bmIaLCfXmqsgnhJKS b/KqnBotlRkTYEkDNYPFAKgb5qZIOp70S5xUvbsDB28pTZCcPiNt17RymO817KHn mLeJzU0QAbtGK40/0hRp =NVm4 -----END PGP SIGNATURE----- --We7RQDOLJxJTh1VIEhUnGaEPIjnBP4WnK-- From owner-freebsd-hackers@freebsd.org Sun Sep 11 17:04:22 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D08BBD6F7D for ; Sun, 11 Sep 2016 17:04:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D89E5B1B for ; Sun, 11 Sep 2016 17:04:21 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id u8BH4B8B050553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 11 Sep 2016 19:04:11 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: george+freebsd@m5p.com Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id u8BH47cB008638 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 12 Sep 2016 00:04:07 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: Laptop disk spindown To: George Mitchell , freebsd-hackers@freebsd.org References: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> From: Eugene Grosbein Message-ID: <57D58E82.4020605@grosbein.net> Date: Mon, 12 Sep 2016 00:04:02 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM autolearn=no version=3.3.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:04:22 -0000 11.09.2016 23:50, George Mitchell пишет: > Smartctl reports that my laptop disk has started and stopped > 101,798 times in 2,027 hours of operation, or roughly once a > minute. I imagine that saves wear and tear on the disk, but > it also makes the laptop seem remarkably sluggish for an A8 > based system. Isn't there some sysctl that will lengthen the > idle time before stopping the disk? I don't see one in the > ada man page. -- George Put the following to /usr/local/etc/rc.d/tune-spindown. Perhaps, we could have more clever and generalized version in base... #!/bin/sh # PROVIDE: tune-spindown # REQUIRE: FILESYSTEMS # BEFORE: DAEMON # KEYWORD: nojail case "$1" in *start) camcontrol standby ada0 -t 300 # dd if=/dev/ada0 of=/dev/null bs=512 count=1 >/dev/null 2>&1 ;; stop) camcontrol standby ada0 -t 0 ;; esac From owner-freebsd-hackers@freebsd.org Sun Sep 11 17:07:16 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F501BD6148 for ; Sun, 11 Sep 2016 17:07:16 +0000 (UTC) (envelope-from george+freebsd@m5p.com) Received: from mailhost.m5p.com (mailhost.m5p.com [IPv6:2001:418:3fd::f7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE8AE61 for ; Sun, 11 Sep 2016 17:07:15 +0000 (UTC) (envelope-from george+freebsd@m5p.com) Received: from [10.100.0.31] (haymarket.m5p.com [10.100.0.31]) by mailhost.m5p.com (8.14.5/8.14.5) with ESMTP id u8BH795p028474 for ; Sun, 11 Sep 2016 13:07:14 -0400 (EDT) (envelope-from george+freebsd@m5p.com) Subject: Re: Laptop disk spindown To: freebsd-hackers@freebsd.org References: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> <57D58E82.4020605@grosbein.net> From: George Mitchell Message-ID: Date: Sun, 11 Sep 2016 13:07:09 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <57D58E82.4020605@grosbein.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.73 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (mailhost.m5p.com [10.100.0.247]); Sun, 11 Sep 2016 13:07:14 -0400 (EDT) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:07:16 -0000 Thank you! -- George On 09/11/16 13:04, Eugene Grosbein wrote: > 11.09.2016 23:50, George Mitchell пишет: >> Smartctl reports that my laptop disk has started and stopped >> 101,798 times in 2,027 hours of operation, or roughly once a >> minute. I imagine that saves wear and tear on the disk, but >> it also makes the laptop seem remarkably sluggish for an A8 >> based system. Isn't there some sysctl that will lengthen the >> idle time before stopping the disk? I don't see one in the >> ada man page. -- George > > Put the following to /usr/local/etc/rc.d/tune-spindown. > Perhaps, we could have more clever and generalized version in base... > > #!/bin/sh > > # PROVIDE: tune-spindown > # REQUIRE: FILESYSTEMS > # BEFORE: DAEMON > # KEYWORD: nojail > > case "$1" in > *start) > camcontrol standby ada0 -t 300 > # dd if=/dev/ada0 of=/dev/null bs=512 count=1 >/dev/null 2>&1 > ;; > stop) > camcontrol standby ada0 -t 0 > ;; > esac > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@freebsd.org Sun Sep 11 17:10:27 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B8D8BD635C for ; Sun, 11 Sep 2016 17:10:27 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [199.15.120.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F256FDC; Sun, 11 Sep 2016 17:10:26 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 3sXHKr4n6Tz19k; Sun, 11 Sep 2016 12:02:08 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3sXHKq5XBDz2pc; Sun, 11 Sep 2016 12:02:07 -0500 (CDT) Date: Sun, 11 Sep 2016 12:02:07 -0500 From: "Matthew D. Fuller" To: Allan Jude Cc: freebsd-hackers@freebsd.org Subject: Re: Laptop disk spindown Message-ID: <20160911170207.GG79735@over-yonder.net> References: <50125b8f-f24d-6b78-f474-7e97017302e3@m5p.com> <384fd7ca-b779-3e66-eaa9-c2c27dca4dc0@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <384fd7ca-b779-3e66-eaa9-c2c27dca4dc0@freebsd.org> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.6.1-fullermd.4 (2016-04-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:10:27 -0000 On Sun, Sep 11, 2016 at 12:55:27PM -0400 I heard the voice of Allan Jude, and lo! it spake thus: > On 2016-09-11 12:50, George Mitchell wrote: > > Smartctl reports that my laptop disk has started and stopped > > 101,798 times in 2,027 hours of operation, or roughly once a > > minute. I imagine that saves wear and tear on the disk, Actually, it dramatically _increases_ the wear and tear on the disk... > This is controlled by the drive firmware, not the OS, however, you > can often use camcontrol(8) to adjust it. > > I don't have the exact command handy, sorry. In /etc/rc.local on a system whose drives I once had to do this on, I've got: # Shut off APM on the drives to stop the load cycle count from blowing # up. # x-ref: http://forums.freebsd.org/showthread.php?t=9885 #for i in 0 2; do #. /sbin/camcontrol cmd ada${i} -a "EF 85 00 00 00 00 00 00 00 00 00 00" #done (now, this is not a laptop, so "shut off APM" was a totally reasonable hammer to swing here; whether there's something more nuanced that would be preferable in the laptop case, I don't know) -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. From owner-freebsd-hackers@freebsd.org Sun Sep 11 22:34:59 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AFDABD6B60 for ; Sun, 11 Sep 2016 22:34:59 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D31A301 for ; Sun, 11 Sep 2016 22:34:59 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mandree.no-ip.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.freebsd.org (Postfix) with ESMTPS id 1E7F068B26; Sun, 11 Sep 2016 22:34:59 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id 7BD4B23CE7D; Mon, 12 Sep 2016 00:34:58 +0200 (CEST) To: freebsd-hackers@freebsd.org From: Matthias Andree Subject: User-space API to inquire block alignment requirements for open file descriptor? Message-ID: Date: Mon, 12 Sep 2016 00:34:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 22:34:59 -0000 Greetings, given an open file descriptor, do we have a system interface to inquire about the block size of the underlying devices? In the past, we used to deal with 512-byte blocks, but how about drives using 4096-byte blocks? Thanks, Matthias From owner-freebsd-hackers@freebsd.org Sun Sep 11 22:55:58 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E7A7BD70F0 for ; Sun, 11 Sep 2016 22:55:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E90E0DFA; Sun, 11 Sep 2016 22:55:57 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id m11so273080493oif.1; Sun, 11 Sep 2016 15:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=36Y31pC1CQAnm6amrPw+JsCndAsB21Mb9UJTos2VvXY=; b=yMy3tqSz32Edf38mqxYSkZCw76eFoTUrZ022BLK5Pr58LtifOKb7yGgpp837SYg/61 iGUBcOjAf0A1ov878oUA7ZXheX51cZ6kjylOOpeqcFGqJ4tV59YTvCwlrTxvqo9f2/OE CikfInGi3KdS7WASuOViP6S1bBvT//2htPF0vkkmlXHrbq+RGi2qmQo/0fKma4jTsXOC Ar/qcoJ5Q93j5CA+dK8GA51OF+QuVczuEyp7a/B4NTVLhkD+QUIEXifiH6BGwGPB9n60 uZ6m25hsu6KWbPPq88cTWra6Wns3Oy1XO+4G6IyQZ8J4zTO4W8u5kAuSs6YrGNlJl8Zz A6VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=36Y31pC1CQAnm6amrPw+JsCndAsB21Mb9UJTos2VvXY=; b=Vzvvi4zMk9zDaAhXT2TFRbKMNTH1sj/sRU+dcXyOG63D83lnNj4EDRtIRN+HYRcnva DqO6uFb0Cas4Dd2NvpWVU8vcOGC4RC1BF+NwNVUbc1ltDteCMB+tzNaV8+M62yp7Kt8S DqPWlms6WPAaD4FjhmxCU8uyydThZ7AhP6T76LbQm7ctffxuALfCy0k5u0n7n/V0ea0E 2/c52kSvl33U0+QlNEvJZueDmUYN5MWgQjLkKhXnLJ4ffXAWJ8ByCX5FrL2AG/bUErr2 iDG4zgGFy+IldhHpwQ+hrxksnHzMxGKjQd5D7D9h2wqYhkAdGE0O3LzO+sDdDiRZrr9/ W43Q== X-Gm-Message-State: AE9vXwMcwOWIgSRJFjGoS0oirW/Pk7/1DygsMx2KZRg2icyvIScXH/+zGHEeNvLwFm2OJM78nztQwWkpCM9E6g== X-Received: by 10.202.205.70 with SMTP id d67mr21005287oig.170.1473634556910; Sun, 11 Sep 2016 15:55:56 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.202.71.11 with HTTP; Sun, 11 Sep 2016 15:55:56 -0700 (PDT) In-Reply-To: References: From: Alan Somers Date: Sun, 11 Sep 2016 16:55:56 -0600 X-Google-Sender-Auth: BOehoVepokTPJB_BNN716jQNEaM Message-ID: Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? To: Matthias Andree Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 22:55:58 -0000 On Sun, Sep 11, 2016 at 4:34 PM, Matthias Andree wrote: > Greetings, > > given an open file descriptor, do we have a system interface to inquire > about the block size of the underlying devices? In the past, we used to > deal with 512-byte blocks, but how about drives using 4096-byte blocks? > > Thanks, > Matthias Does DIOCGSECTORSIZE do what you want? From the command line, you can see the result of this ioctl using "diskinfo -v ". int fd; unsigned sectorsize; int error = ioctl(fd, DIOCGSECTORSIZE, §orsize); -Alan From owner-freebsd-hackers@freebsd.org Sun Sep 11 22:57:25 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9039CBD7191 for ; Sun, 11 Sep 2016 22:57:25 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 26B0DF12; Sun, 11 Sep 2016 22:57:24 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id u8BMvJLm051425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 12 Sep 2016 00:57:20 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: mandree@FreeBSD.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id u8BMvGNG019925 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 12 Sep 2016 05:57:16 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? To: Matthias Andree , freebsd-hackers@freebsd.org References: From: Eugene Grosbein Message-ID: <57D5E147.1030802@grosbein.net> Date: Mon, 12 Sep 2016 05:57:11 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM autolearn=no version=3.3.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 22:57:25 -0000 12.09.2016 5:34, Matthias Andree пишет: > Greetings, > > given an open file descriptor, do we have a system interface to inquire > about the block size of the underlying devices? In the past, we used to > deal with 512-byte blocks, but how about drives using 4096-byte blocks? Take a look at system cat(1) sources. It uses several system interfaces and some logic to optimize its read buffer size: fstat(2)/sbuf.st_blksize for file descriptor, sysconf(_SC_PHYS_PAGES) for system having plenty of RAM, BUFSIZE_SMALL and BUFSIZE_MAX constanst for lower/upper limits. From owner-freebsd-hackers@freebsd.org Mon Sep 12 07:12:58 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B380BD74C0 for ; Mon, 12 Sep 2016 07:12:58 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 459398DF; Mon, 12 Sep 2016 07:12:57 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 56123273AC; Mon, 12 Sep 2016 07:12:50 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u8C7CmM9020587; Mon, 12 Sep 2016 07:12:49 GMT (envelope-from phk@phk.freebsd.dk) To: Matthias Andree cc: freebsd-hackers@freebsd.org Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20585.1473664368.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Sep 2016 07:12:48 +0000 Message-ID: <20586.1473664368@critter.freebsd.dk> X-Mailman-Approved-At: Mon, 12 Sep 2016 11:27:40 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 07:12:58 -0000 -------- In message , Matthias An= dree = writes: >Greetings, > >given an open file descriptor, do we have a system interface to inquire >about the block size of the underlying devices? In the past, we used to >deal with 512-byte blocks, but how about drives using 4096-byte blocks? DIOCGSECTORSIZE in sys/disk.h -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-freebsd-hackers@freebsd.org Tue Sep 13 20:02:34 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06F95BD7B5D for ; Tue, 13 Sep 2016 20:02:34 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from smtp14.openmailbox.org (smtp14.openmailbox.org [62.4.1.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C21B69DA for ; Tue, 13 Sep 2016 20:02:33 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail2.openmailbox.org (Postfix, from userid 1001) id 8D7E8101D28; Tue, 13 Sep 2016 21:54:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473796468; bh=/I/ww3bY2IMBs0XBpptQxqA2pYWQkuHypgeBDTGSoJc=; h=To:From:Subject:Date:From; b=ZP/k+Rl6BidleKqvHTdKmvYGVEjKB7uIieI0SzjeeG96zEpv8OCtpwhxyFonr4aDH 2ZSYjrmLPE25y7LxuKtCLb0BxfoQRCtCTKqNSOqPBPj35fALtUR8JOf37Yh/p6yP6R rGPrCpRwt887T05ufDYABXXXlLzAi/dolGDJ6Tno= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h4 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,PLING_QUERY,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 To: freebsd-hackers@FreeBSD.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473796468; bh=/I/ww3bY2IMBs0XBpptQxqA2pYWQkuHypgeBDTGSoJc=; h=To:From:Subject:Date:From; b=ZP/k+Rl6BidleKqvHTdKmvYGVEjKB7uIieI0SzjeeG96zEpv8OCtpwhxyFonr4aDH 2ZSYjrmLPE25y7LxuKtCLb0BxfoQRCtCTKqNSOqPBPj35fALtUR8JOf37Yh/p6yP6R rGPrCpRwt887T05ufDYABXXXlLzAi/dolGDJ6Tno= From: twilight Subject: What is the point in expression: !!var ? Message-ID: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> Date: Tue, 13 Sep 2016 19:54:31 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 20:02:34 -0000 Hello, I'm digging through FreeBSD cppcheck scan report with hope to catch some bugs. I've came along a line: c = cond(token, val, yylex(), noeval | !!a); What's the point in using !! twice? Can it be deleted? Here is the context: static arith_t cond(int token, union yystype *val, int op, int noeval) { arith_t a = or(token, val, op, noeval); arith_t b; arith_t c; if (last_token != ARITH_QMARK) return a; b = assignment(yylex(), noeval | !a); if (last_token != ARITH_COLON) yyerror("expecting ':'"); token = yylex(); *val = yylval; c = cond(token, val, yylex(), noeval | !!a); return a ? b : c; } -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. From owner-freebsd-hackers@freebsd.org Tue Sep 13 20:10:25 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8163FBD7E05 for ; Tue, 13 Sep 2016 20:10:25 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55661E18 for ; Tue, 13 Sep 2016 20:10:25 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: by mail-pa0-x22a.google.com with SMTP id wk8so10740627pab.1 for ; Tue, 13 Sep 2016 13:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AFmKxpfxlqHkI8n43YxdgAxPNJyVNpA2svoYNpIe0Hw=; b=akgGBh3WxPRXkUVU+zQA/n1jWRPY/S0iVZY25RrV6XMNm1Z8lPGkKxHuW/gGaCFic+ 1kV27qXGZ6KUlIsHKwavfJ2CuWC/6xnIHyYyi9o4sAgzEAz0PloznWyo/teClYHqKqfj owjApDodQ5theUXPRfRLLapqTTf9yIXZQ/wRe7itc4J68J7iRnxJggljig4cJXMBSG3X /tueUuFLjWEJfwC1VoQrT6VWqCSvdauQO7MeaoYoFvPxhWZKotShXZMhwV9BGrW2J0yi nOoNeOK5llpAOIqJnphTHZfIRDaGo+21La42OO8YyLV2pG4DUhEmONe9e1Z5muS6iUSp VYrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AFmKxpfxlqHkI8n43YxdgAxPNJyVNpA2svoYNpIe0Hw=; b=kCLQfolx8qxHdAiqwDixflnRWYg2ajDe/YpVQmYmC3EQTtg9ezOxHmf7UH75qozKD4 wEozx0vulyMxXoDp0AXGBUIq/s6ihuX/iGX2jcuWSQJ/rA088czwXhJI0Xm5mdFy33sl gRynSSW8q+/BOaeS1KjqTV9bvlNUYvvwXa8HYxhTH/CrP6KYWpMAYShr52tA4AkoFaOW i5FYwDJ13TdiIluyLm8VnhPsBH3UJbSXK+vswEaPCs4bJTF4uH3otPevsdek5kMdU764 SorX7upvyMvyORQwtZn9I3UWwskKLZhBYWe/TTD5LiunhBSUt3HT6k8icB7vZuO2XJIC 5Hvw== X-Gm-Message-State: AE9vXwPLo4ps88h+MBUCLKjRdC9cI+K3pK9zigUtdr2QEstJ2sa74L/LycChCTYgU8KvN47214rIE2yzBdio9A== X-Received: by 10.66.254.170 with SMTP id aj10mr4531026pad.124.1473797424945; Tue, 13 Sep 2016 13:10:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.217.137 with HTTP; Tue, 13 Sep 2016 13:10:24 -0700 (PDT) In-Reply-To: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> From: Cedric Blancher Date: Tue, 13 Sep 2016 22:10:24 +0200 Message-ID: Subject: Re: What is the point in expression: !!var ? To: twilight Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 20:10:25 -0000 The point is to transform the value of a (any kind, like pointer) to a Boolean value. Ancient C trick, goes back to dmr Ced On 13 September 2016 at 21:54, twilight wrote: > Hello, > > I'm digging through FreeBSD cppcheck scan report with hope to catch some > bugs. > > I've came along a line: > c = cond(token, val, yylex(), noeval | !!a); > > What's the point in using !! twice? Can it be deleted? > Here is the context: > > static arith_t cond(int token, union yystype *val, int op, int noeval) > { > arith_t a = or(token, val, op, noeval); > arith_t b; > arith_t c; > > if (last_token != ARITH_QMARK) > return a; > > b = assignment(yylex(), noeval | !a); > > if (last_token != ARITH_COLON) > yyerror("expecting ':'"); > > token = yylex(); > *val = yylval; > > c = cond(token, val, yylex(), noeval | !!a); > > return a ? b : c; > } > > > -- > Cheers~ > > PGP key fingerprint: > 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF > > You can retrieve my public key at pgp.mit.edu. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur From owner-freebsd-hackers@freebsd.org Tue Sep 13 20:45:27 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2B0BD906C for ; Tue, 13 Sep 2016 20:45:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 264E113DC for ; Tue, 13 Sep 2016 20:45:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id o3so14775574ita.1 for ; Tue, 13 Sep 2016 13:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hFeO41one3yiUtGwf2w4APE/C3D/PHR1RxDJm3bArLs=; b=OyGtVUhzXZpIJYcjMF2k/W8yUwnCaKV3Q6gtH93g0lVlh3jZYxooeelH3mqtqo8zZs W45SbUObffDfKXAoCR61qlAhl7LijdC5+umfRo53cOqR+K3B6V2WlMerxcz3IdOnzsdX wND+rcrxAkhOgKfxLE7iyKJAMbxb3Bac0cprr5vsTLRUgX5P/Dw7q3987T8R9R4z/lUm 12NgjVMbuecQahldO8SSNP+7fD8CEFfBsjxfV90GBo5vm5Jgwd2EYTv1idY61HvqsKDk SMu326nEP71fCZu/TlrOj3x8+RmcxAwwE13oS++UjFOPQtA8L0bIBKf0muOpACDuAUgh pQ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hFeO41one3yiUtGwf2w4APE/C3D/PHR1RxDJm3bArLs=; b=gMX01SizQqr+9OCTjmcG90fOrm1t1maUNRx7Yuv5cFbq7XpKYFl6RdnpV0xW3glRTh qfZvk9szQI873i4yTAt8dVBgcFE6g/9SY7k7sv1PJsBygjjGkI+M8xTwhRYMk4HFCXkU oH1zOPE/TJVJ7fIbG089OADDnN17ancCe9gz2fj3o8doW57PeiU1XdKYrBIFQv/Kx1d1 5UFqTMebpcI9lz36sZogq8AATGPkcWRvlYth4VCziciYZUJ30FuVp9In6MRZOSY1z+QQ FefwK0Mc/itQK9OSF56qf7e5D0L4CS8ZT6REWMq+Kqvwk8s259VnhylGoa9v2Atp2iz0 YLfA== X-Gm-Message-State: AE9vXwP05ZrM0Z0fypuyjJLxg2NhYpng48jF6SFqEXrWlvLTcBgPW5Ps7OdYuNJUO7A8Qi3iLBJCMTuxApvYXw== X-Received: by 10.107.200.3 with SMTP id y3mr4928568iof.73.1473799526505; Tue, 13 Sep 2016 13:45:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Tue, 13 Sep 2016 13:45:26 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> From: Warner Losh Date: Tue, 13 Sep 2016 13:45:26 -0700 X-Google-Sender-Auth: 8uMsXQEdK2Pz45r7Q4t5_xNCXzI Message-ID: Subject: Re: What is the point in expression: !!var ? To: twilight Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 20:45:27 -0000 On Tue, Sep 13, 2016 at 12:54 PM, twilight wrote: > c = cond(token, val, yylex(), noeval | !!a); !!foo converts the expression to 0 or 1. Since there's only one | here, it will set the low bit iff a != 0. Without it, it will or in whatever value a has, which may be wrong... Warner From owner-freebsd-hackers@freebsd.org Tue Sep 13 21:44:11 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E14ABD9700 for ; Tue, 13 Sep 2016 21:44:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC8EC8E for ; Tue, 13 Sep 2016 21:44:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 36945358C64; Tue, 13 Sep 2016 23:44:08 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 0BB5628494; Tue, 13 Sep 2016 23:44:08 +0200 (CEST) Date: Tue, 13 Sep 2016 23:44:07 +0200 From: Jilles Tjoelker To: twilight Cc: freebsd-hackers@FreeBSD.org Subject: Re: What is the point in expression: !!var ? Message-ID: <20160913214407.GA96125@stack.nl> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 21:44:11 -0000 On Tue, Sep 13, 2016 at 07:54:31PM +0000, twilight wrote: > I'm digging through FreeBSD cppcheck scan report with hope to catch some > bugs. > I've came along a line: > c = cond(token, val, yylex(), noeval | !!a); > What's the point in using !! twice? Can it be deleted? > Here is the context: > static arith_t cond(int token, union yystype *val, int op, int noeval) > { > arith_t a = or(token, val, op, noeval); > arith_t b; > arith_t c; > > if (last_token != ARITH_QMARK) > return a; > > b = assignment(yylex(), noeval | !a); > > if (last_token != ARITH_COLON) > yyerror("expecting ':'"); > > token = yylex(); > *val = yylval; > > c = cond(token, val, yylex(), noeval | !!a); > > return a ? b : c; > } The intent of the code is more accurately captured by c = cond(token, val, yylex(), noeval || a != 0); (omitting != 0 would match this file's style better) I think the author of this code did not write that because many compilers generate slightly smaller code for the version with |. With stable/10's clang 3.4.1 on amd64 the difference is 16 bytes if this change is applied to all conditions in arith_yacc.c. The code is from the dash shell, which contains many tricks to make the generated code smaller. As noted by others, just removing !! is wrong. For example, it would break echo "$((0x100000000 ? 2 : 1 / 0))". -- Jilles Tjoelker From owner-freebsd-hackers@freebsd.org Tue Sep 13 20:42:37 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24600BD9028 for ; Tue, 13 Sep 2016 20:42:37 +0000 (UTC) (envelope-from danielsh@apache.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0EEB1397 for ; Tue, 13 Sep 2016 20:42:36 +0000 (UTC) (envelope-from danielsh@apache.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1968A2093D; Tue, 13 Sep 2016 16:42:35 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 13 Sep 2016 16:42:35 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=sB8Qmp8vE98lYnP F0HMgHVo+OsA=; b=Fv67M39dxUULpPlQTYrlz3KPE7p8VdQixP6L8yQS81+VERW 0gqzgG+Ws4ZqkNs6QajKVsujWQL+wYwFs7dFFnC9UOD2xzX56jNIfzYiT+fU/GwV /q3JPt5YZx0Tx/fIbi+jC/SliouW/CIt6dYVUdNDiVkuQjc22ZBtK/7Byw0Y= X-Sasl-enc: 4x/hQxRNF8VxhPKDd7REqa2glvSItutJVZVZ/umgi5TM 1473799354 Received: from fujitsu.shahaf.local2 (bzq-109-64-145-250.red.bezeqint.net [109.64.145.250]) by mail.messagingengine.com (Postfix) with ESMTPA id B63C8F29D9; Tue, 13 Sep 2016 16:42:34 -0400 (EDT) Received: by fujitsu.shahaf.local2 (Postfix, from userid 1000) id 3sYc6J1G4bzjr; Tue, 13 Sep 2016 20:41:44 +0000 (UTC) Date: Tue, 13 Sep 2016 20:41:44 +0000 From: Daniel Shahaf To: Cedric Blancher Cc: twilight , freebsd-hackers@freebsd.org Subject: Re: What is the point in expression: !!var ? Message-ID: <20160913204144.GA13610@fujitsu.shahaf.local2> References: <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Tue, 13 Sep 2016 23:43:02 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 20:42:37 -0000 Cedric Blancher wrote on Tue, Sep 13, 2016 at 22:10:24 +0200: > The point is to transform the value of a (any kind, like pointer) to a > Boolean value. In more words: «!!x» is equivalent to «(x ? 1 : 0)». Daniel From owner-freebsd-hackers@freebsd.org Wed Sep 14 06:03:47 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94927BD9E3A for ; Wed, 14 Sep 2016 06:03:47 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 846E4916 for ; Wed, 14 Sep 2016 06:03:47 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mandree.no-ip.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.freebsd.org (Postfix) with ESMTPS id 190A13A5F; Wed, 14 Sep 2016 06:03:47 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id B492623D863; Wed, 14 Sep 2016 08:03:44 +0200 (CEST) Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? To: "freebsd-hackers@freebsd.org" References: <20586.1473664368@critter.freebsd.dk> From: Matthias Andree Message-ID: <69e12778-75d0-fd79-2dc4-a7727ccab522@FreeBSD.org> Date: Wed, 14 Sep 2016 08:03:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20586.1473664368@critter.freebsd.dk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 06:03:47 -0000 Am 12.09.2016 um 09:12 schrieb Poul-Henning Kamp: > -------- > In message , Matthias= Andree=20 > writes: >> Greetings, >> >> given an open file descriptor, do we have a system interface to inquir= e >> about the block size of the underlying devices? In the past, we used t= o >> deal with 512-byte blocks, but how about drives using 4096-byte blocks= ? > DIOCGSECTORSIZE in sys/disk.h > Thanks Alan, Eugene, Poul-Henning. Now for the next two interesting questions for file system utilities (think sysutils/e2fsprogs) running on advanced-format (4096-block) drives - many provide internal read-modify-write approaches to emulate 512-byte blocks at substantial performance impact. Ted Y. Ts'o, the upstream e2fsprogs maintainer, asked me this question: > So how to fill in this matrix? > > HDD Linux Mac OS = FreeBSD > Logical Block Size 512 BLKGETSSZGET DKIOCGETBLOCKSIZE = DIOCGSECTORSIZE > Physical Block Size 4096 BLKGETPSZGET DKIOCGETPHYSICALBLOCKSIZE = ? I have found one hint in the BSD forums that in certain situations the DIOCGSTRIPESIZE and DIOCGSTRIPEOFFSET can contain the latter, but on RAID it often does not. And while we're here, and for the records: how do we query the *erase block size* on flash (solid-state) drives? It's often much bigger than a sector size. Thanks, Matthias From owner-freebsd-hackers@freebsd.org Wed Sep 14 10:53:21 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7224FBD9BD7 for ; Wed, 14 Sep 2016 10:53:21 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from smtp1.openmailbox.org (smtp16.openmailbox.org [62.4.1.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39568145E for ; Wed, 14 Sep 2016 10:53:20 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail.openmailbox.org (Postfix, from userid 20002) id 1B28D202264; Wed, 14 Sep 2016 12:53:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473850392; bh=euWi7JueTeqGp8tOI2A2uogUFf+JCrB3rQUpmsJLPVQ=; h=To:From:Subject:Date:From; b=hEj0czvsbIfT6omtbmQd41BG17tLfgiTBQuZe9f28pgXRjroMMqEDcspjsjZTdP8H DnEcnaLkDH5HoHrqf+dZDFOK8goEIePjvzllkobZ31kBF9zozK+wWzD+0lcoA8x5fE C3QKCHmgaEzU9aq8ySg0KZIfSOss+X3IBhvSct0Y= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h4 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 To: freebsd-hackers@FreeBSD.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473850391; bh=euWi7JueTeqGp8tOI2A2uogUFf+JCrB3rQUpmsJLPVQ=; h=To:From:Subject:Date:From; b=Gs5KkUAiDJJhBm2E5wUyK79J6D7uqJbgutZy6mMtUng9sQDx7cO9FZ1eaL4JIo0YO Ysmp4Ry/Qe6un8voPAtB4rUlmL8zV/Av3vnQHe6ICffuquZ3cr20jQ8+BsxHeoejql QuwJ/k/QBQZUMTtF5ni127HbmPYzZBNBFvuCILCk= From: twilight Subject: Is replacing alloca(3) where possible a good thing to do? Message-ID: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> Date: Wed, 14 Sep 2016 10:53:24 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 10:53:21 -0000 Hello, I again, in cddl/* alloca(3) is used very intensively for creating dynamic arrays. But, well, it's kinda obsolete and sometimes not safe and portable. Is replacing alloca(3) with dynamic arrays a good thing? Or should everything be left as it is? Thanks in advance. -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. From owner-freebsd-hackers@freebsd.org Wed Sep 14 11:46:36 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE8DAC4FC5 for ; Wed, 14 Sep 2016 11:46:36 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9851A1FCB for ; Wed, 14 Sep 2016 11:46:36 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22a.google.com with SMTP id i129so15304214ywb.0 for ; Wed, 14 Sep 2016 04:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8hwzm+jFH0PYvPLe7Rwf7GXVZEYHX4RMg8dmDog1vTU=; b=MrSuhUqAm8ZeX94VK363uZ8vVCjM2F19O48Ti9d4851YuEFoGXBQrR1FqfHY2fksuh paSVTnuDh3giOryUdj+Ne626pc4XjdL5nvgHDHhMYTcxjUsl0nBDuSj0GGWkiHOgrKPr SpHFzmk5ygNLsL+k11RSbID3L9Z7aNY6FdeldUspFvu+uhYArDXZQwBB7/CVoQpBJ7Bz mYHt66TWpD24aZxDH3KFLIrMhiDH0ebNaumHdnL+9oartnZy8+qH3ttRfmLxg+P6yd5e ci4nWhEwWwwSTwGAxpmlEKDSA3TKqgniKem18W+y4pNiKm7Uh8u2bq3uqGD3X3GU6BJR 10KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8hwzm+jFH0PYvPLe7Rwf7GXVZEYHX4RMg8dmDog1vTU=; b=ILXS6XUTSNdca1EBtyYJlTiLcMlFUVRT7PYOIImU7YfjSU+Z/NGh4qvG1RpLrGBxke oDpJ/jcCVribTTAs6276CzwprcJmec+r5CbVD3NK6fjsmu4mAEd2l5XFSXhAvF2EPA91 wbVnZZyAZpBDw6fevolLeGVzZ/Krj3ngVezISdpPAeg+uBcX3BXzPMWznXGSF/IWkN+E hxe3y9/fw1wmTG4W2gQP2V5pzEAOZOf7BNpOobSpjRWWq5t4ZLzSmvxcH9ODWvtAiicA w2s0rTrjHPTV+IJmhklVOtigJQE6KJlZZihViJ8PHSU2kORoA3kgqJYL6UlbyodHF4dA Thrg== X-Gm-Message-State: AE9vXwP3j+hGVt3jijavv27PfCsizUk12K9JMXhnJAHB/kDysHeiXGQpq+DxvEOaBiT3CTBTvqbwOP/2nXa9eg== X-Received: by 10.129.147.130 with SMTP id k124mr1761790ywg.116.1473853595573; Wed, 14 Sep 2016 04:46:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Wed, 14 Sep 2016 04:46:35 -0700 (PDT) In-Reply-To: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> References: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> From: Ed Schouten Date: Wed, 14 Sep 2016 13:46:35 +0200 Message-ID: Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: twilight Cc: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 11:46:36 -0000 Hi, 2016-09-14 12:53 GMT+02:00 twilight : > I again, > in cddl/* alloca(3) is used very intensively for creating dynamic arrays. > But, well, it's kinda obsolete and sometimes not safe and portable. > Is replacing alloca(3) with dynamic arrays a good thing? Or should > everything be left as it is? With dynamic arrays you are referring to C99's Variable-Length Arrays (VLAs), right? The advantage of C99 VLAs is that they are standardised, unlike alloca(), which is good. What I also like about them compared to alloca() is that they are easier to implement from a compiler's point of view, as they are bound to a block scope and not to a function. alloca() can be called in a loop, for example, which is quite nasty. Still, C99 VLAs and alloca() both share the problem that as there is no upper bound on the allocated space, you may easily run into stack overflows. Especially for externally-facing APIs, you may have absolutely no idea whether it's safe to allocate a buffer having a size provided by the caller. This is one of the reasons why C11 made them optional again. So the best solution is to replace any use of alloca() with malloc()/free(). That said, as you were interested in making such changes in cddl/*, I guess you'll also have to go through the process of sending those patches to Illumos. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-freebsd-hackers@freebsd.org Wed Sep 14 11:58:32 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C84BDA333 for ; Wed, 14 Sep 2016 11:58:32 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:c:538::196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3D3615A1 for ; Wed, 14 Sep 2016 11:58:31 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p200300D2ABD048104639C4FFFE599710.dip0.t-ipconnect.de [IPv6:2003:d2:abd0:4810:4639:c4ff:fe59:9710]) (Authenticated sender: joerg@bec.de) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id EED2F1720C2 for ; Wed, 14 Sep 2016 13:58:21 +0200 (CEST) Date: Wed, 14 Sep 2016 13:58:20 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Subject: Re: Is replacing alloca(3) where possible a good thing to do? Message-ID: <20160914115820.GA12534@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 11:58:32 -0000 On Wed, Sep 14, 2016 at 01:46:35PM +0200, Ed Schouten wrote: > So the best solution is to replace any use of alloca() with > malloc()/free(). That said, as you were interested in making such > changes in cddl/*, I guess you'll also have to go through the process > of sending those patches to Illumos. Blindly replacing them makes little sense. alloca provides zero-cost freeing and is also much cheaper than malloc. It should be limited to reasonable sizes though, where reasonable is typically < 1MB per thread. Joerg From owner-freebsd-hackers@freebsd.org Wed Sep 14 12:54:46 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CDDBDA361 for ; Wed, 14 Sep 2016 12:54:46 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from smtp.rlwinm.de (smtp.rlwinm.de [148.251.233.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C67A1E4D for ; Wed, 14 Sep 2016 12:54:45 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from vader9.bultmann.eu (unknown [87.253.189.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.rlwinm.de (Postfix) with ESMTPSA id 6882B10D20 for ; Wed, 14 Sep 2016 14:54:37 +0200 (CEST) Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: freebsd-hackers@freebsd.org References: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> From: Jan Bramkamp Message-ID: Date: Wed, 14 Sep 2016 14:54:36 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <3fe9ba0e-0089-a59c-a09e-8c6f8b74b6bc@openmailbox.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 12:54:46 -0000 On 14/09/16 12:53, twilight wrote: > Hello, > > I again, > in cddl/* alloca(3) is used very intensively for creating dynamic arrays. > But, well, it's kinda obsolete and sometimes not safe and portable. > Is replacing alloca(3) with dynamic arrays a good thing? Or should > everything be left as it is? > > Thanks in advance. alloca() and VLAs aren't completely interchangeable e.g. alloca() should return pointers with the same alignment as malloc while a VLA is just correctly aligned for its member type. Some types can't be stored in VLAs without casting e.g. if you want to store an incomplete type like a struct ending with a zero sized array you can't put such a struct in a union with a char array to allocate space for the array elements. In such cases alloca() is easier to read and more portable. You won't notice the unaligned accesses on a x86 CPU but they would trap on a SPARC or ARM (<= ARMv5). Other CPUs silently round down your unaligned pointer to the next natural aligned address. From owner-freebsd-hackers@freebsd.org Wed Sep 14 14:50:59 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82E1BDA06A for ; Wed, 14 Sep 2016 14:50:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm27-vm1.bullet.mail.bf1.yahoo.com (nm27-vm1.bullet.mail.bf1.yahoo.com [98.139.213.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 938291A49 for ; Wed, 14 Sep 2016 14:50:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473864531; bh=RRKMmu+SnXY3W3rQ5S/CHi/508Kcy7o7xHvTLxwqh8Q=; h=To:From:Subject:Date:From:Subject; b=Ef2pwjBdPHK7gJzTvxuZi3NIb8DZl85t1H13vxEMID8DkqtlIizAKqrj+YJiQjlHlKIiRVUNEkPvn1LiRPdk15VvsNZ6owziGZEpumxQOsBqCJk8iCY8+zuQAYt3W7e9co296Wwsf9NIWvATv1Hj7xFGnLGrEy1hSie96S+Y3nVphwSmdPLEi8k7QWXJ2zIGJ5dgGTKLUuTsA0T15Dml8TUTg760EoQZK/unDUYwWvmndwFd8X7BAV98ZRJ9UUgfjxFa+dKxXJKKjAi8BhDLQCfi7gvaeNLcXsYNXNlAEyBG4YsngzMeNs8Nd75eZhZvmAvPOH5SQhTPL8nKlzohnA== Received: from [98.139.214.32] by nm27.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 14:48:51 -0000 Received: from [98.139.211.192] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 14:48:51 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 14:48:51 -0000 X-Yahoo-Newman-Id: 742976.20215.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6al9FSoVM1kdJZTEOlSDWDTbrHat1JAgrTkFI_7yw7QFBN1 6CDUzGlSCjUpSXX7bxxW0YIdgfgH0yiKjgE0hX9GqlJgG.K.xf_I1qj0jcoV pQLsNQWXRG2fcI061RMJYsLmCTzTNseBuUxrX706HyiKV93ahMSwEeSwvFDo G6kVPkrsx_pJQc6GvsinZhkYrlwWW2_0bDqQINea0PuyqQUjvvPQklQzb78P qX57sFe5v9UwHOHmzZg47WeAX8cPXgGp4Skm5aJZYW2GUfl_A9JA1jLZathE rNp0dndHpwUWrbFFo7idfDLZzeyrYw07RifE0GcZj4gBWLK20kMVDXjh.vDP xMjzyrUc_aTZorAZ3W1NaiX2kzexzjtLpSsQBGNJau8FeZxl22EYKOho9LaE vhTywpxgH6UzZVChDyJhbgrCt1Q3lfiEP7oXUalx6_eOg5E_PKsTDYAEuJDh _tfufA9IYYF4OEXCYxs851asD62ZC1fj4BCCSJEdZwEhYSYkdQZWGCryDlWX 5Y4Ra9KHBPFLHhvMTMuxxPARkjGCqyMODJgxtpz0RiHqX X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf To: FreeBSD Hackers From: Pedro Giffuni Subject: Re: Is replacing alloca(3) where possible a good thing to do? Message-ID: Date: Wed, 14 Sep 2016 09:48:59 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 14:50:59 -0000 FWIW, After some discussion with one of the principal Illumos developers it is clear that they won't accept replacing alloca(3) for the sake of "portability". You also can't always replace alloca(3) with VLAs anyways. Pedro. From owner-freebsd-hackers@freebsd.org Wed Sep 14 15:05:30 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D281BDA664 for ; Wed, 14 Sep 2016 15:05:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02342161A; Wed, 14 Sep 2016 15:05:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id m11so25695554oif.1; Wed, 14 Sep 2016 08:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=k6Tqn1gHXxEhHKL+Gkb+oc0MbpI8So5mNgLKMpH0iFo=; b=vgkaSo4rD+61bPq0xNvQ7A2HHDjc9jRyVFbCNvB+yRk48lavZPcFSHUd95p/Fjrarx 9g3Ae08477PP2nMoKw5KL/Yl4HFjSy5ju09vowyICajuPEEQB7womXHKd30b3JvHeVjS mSuikK/Pi8s5M2bMNsIH0VHgHYwAMEcITbtD1QvV8R26IJRDPpktIPsEG+DZAKcTY/xB 7vdZzLQP20NNTB4PkWNyv4WY3ei6+5OMFwphvVH6P+xO/e3hfM1Ym3P1R39ohdxhQivc jVacpyZvr6RKysY6SPw8oZDaMw0LLI5ZQCRsI4HiILnUJx+eXABv1BuHBYYK4YJI2OzN iQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=k6Tqn1gHXxEhHKL+Gkb+oc0MbpI8So5mNgLKMpH0iFo=; b=f4hlLWcUY0zoScNiCf9fgBWgPixSTwhr0l2ZMzuMF/ISz7u/1jYqa7+HHB1io/oD9f 1QAZI4EqgKBkazEZHhgLIS80TZS3SME5z4vK2tLkhZ4d0/YnD+hzh2q1j8E/4TkEYWYY 6LFJWijz4ofa9eS1/T2NFSQWaYeNn4OKW2fu+P7rGVgF3BIguCGHL9XQd3MYIyz2dV8Q iVzsESsvSCNf2hhNpZarPgyUsxuGtqntgWxC7fHMGhp9GFa5v4p58zkUEFU7AyacHgmY 3ahElToOiGiipai974eBCxYChoDLbC2sKTtICfmn3LE0muEW/GRG2hJYjj0nj79zyxRd 4jsw== X-Gm-Message-State: AE9vXwOLzYskat6lUKqBEkUVx5q0/3xVWn/ql4ehfe7kLliFT9fZz6NyB8v5Gxz5UV6/gRLxMbspsuVH+19F0A== X-Received: by 10.202.97.2 with SMTP id v2mr2827115oib.157.1473865528919; Wed, 14 Sep 2016 08:05:28 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.202.71.11 with HTTP; Wed, 14 Sep 2016 08:05:28 -0700 (PDT) In-Reply-To: <69e12778-75d0-fd79-2dc4-a7727ccab522@FreeBSD.org> References: <20586.1473664368@critter.freebsd.dk> <69e12778-75d0-fd79-2dc4-a7727ccab522@FreeBSD.org> From: Alan Somers Date: Wed, 14 Sep 2016 09:05:28 -0600 X-Google-Sender-Auth: szBvHcOlq9y4eatl0Yvt3sZAM6k Message-ID: Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? To: Matthias Andree Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 15:05:30 -0000 On Wed, Sep 14, 2016 at 12:03 AM, Matthias Andree wrote: > Am 12.09.2016 um 09:12 schrieb Poul-Henning Kamp: >> -------- >> In message , Matthias Andree >> writes: >>> Greetings, >>> >>> given an open file descriptor, do we have a system interface to inquire >>> about the block size of the underlying devices? In the past, we used to >>> deal with 512-byte blocks, but how about drives using 4096-byte blocks? >> DIOCGSECTORSIZE in sys/disk.h >> > Thanks Alan, Eugene, Poul-Henning. > > > Now for the next two interesting questions for file system utilities > (think sysutils/e2fsprogs) running on advanced-format (4096-block) > drives - many provide internal read-modify-write approaches to emulate > 512-byte blocks at substantial performance impact. > > Ted Y. Ts'o, the upstream e2fsprogs maintainer, asked me this question: > >> So how to fill in this matrix? >> >> HDD Linux Mac OS FreeBSD >> Logical Block Size 512 BLKGETSSZGET DKIOCGETBLOCKSIZE DIOCGSECTORSIZE >> Physical Block Size 4096 BLKGETPSZGET DKIOCGETPHYSICALBLOCKSIZE ? > > I have found one hint in the BSD forums that in certain situations the > DIOCGSTRIPESIZE and DIOCGSTRIPEOFFSET can contain the latter, but on > RAID it often does not. Correct. DIOCGSTRIPESIZE is what you want. A quick tests shows that it works correctly for both gmirror and zvols as well as native disks. > > > And while we're here, and for the records: > > how do we query the *erase block size* on flash (solid-state) drives? > It's often much bigger than a sector size. Sorry, I don't know. > > > Thanks, > > Matthias -Alan From owner-freebsd-hackers@freebsd.org Wed Sep 14 15:30:58 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310D2BDA078 for ; Wed, 14 Sep 2016 15:30:58 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 157BC12CA for ; Wed, 14 Sep 2016 15:30:57 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id E46461FD2 for ; Wed, 14 Sep 2016 15:30:55 +0000 (UTC) Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: freebsd-hackers@freebsd.org References: From: Allan Jude Message-ID: Date: Wed, 14 Sep 2016 11:30:55 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 15:30:58 -0000 On 2016-09-14 10:48, Pedro Giffuni wrote: > FWIW, > > After some discussion with one of the principal Illumos developers it is > clear that they won't accept replacing alloca(3) for the sake of > "portability". You also can't always replace alloca(3) with VLAs anyways. > > Pedro. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" The one time I tried to use it, it went very badly, as it returns a pointer, but the actual amount of memory was less than I had requested, and so it smashed everything. -- Allan Jude From owner-freebsd-hackers@freebsd.org Wed Sep 14 16:02:32 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65459BDAB27 for ; Wed, 14 Sep 2016 16:02:32 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from smtp1.openmailbox.org (smtp16.openmailbox.org [62.4.1.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0A61567 for ; Wed, 14 Sep 2016 16:02:31 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail.openmailbox.org (Postfix, from userid 20002) id 489FE202423; Wed, 14 Sep 2016 17:56:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473868591; bh=PHR8gWjoQMEqhs0G/qOMkNZJhnRIy9btSgO11P5O2a0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=QElH6FoQ3gJipShiNTrusA18H6No8tjzyqYlwn6T8N+V1xGv0qURtlAHFxmmJNMCi LIFiXNGA9vH5PuzZr76Te4NghAQBOl1+zb1pMahkJSUMERVyYI4XAhPtbC6rJkIIAu hWoltuDKERSsNx4TvJ9fBpdiuqr/7m4DAFP3NYug= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h4 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Subject: Re: Is replacing alloca(3) where possible a good thing to do? DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473868591; bh=PHR8gWjoQMEqhs0G/qOMkNZJhnRIy9btSgO11P5O2a0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=QElH6FoQ3gJipShiNTrusA18H6No8tjzyqYlwn6T8N+V1xGv0qURtlAHFxmmJNMCi LIFiXNGA9vH5PuzZr76Te4NghAQBOl1+zb1pMahkJSUMERVyYI4XAhPtbC6rJkIIAu hWoltuDKERSsNx4TvJ9fBpdiuqr/7m4DAFP3NYug= To: freebsd-hackers@freebsd.org References: From: twilight Message-ID: Date: Wed, 14 Sep 2016 15:56:49 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 16:02:32 -0000 > The one time I tried to use it, it went very badly, as it returns a > pointer, but the actual amount of memory was less than I had requested, > and so it smashed everything. That is a known issue with alloca, so it shouldn't be used with big amounts of memory (it creates objects on stack, so stack overflow can be reached easily). But, well, creating a really big array would do the same. Also, deep recursion will also smash the stack. So we don't have a deal like "remove alloca and your stack will be safe". But still, it's obsolete and compiler dependent. I'd better not stick to it. -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. From owner-freebsd-hackers@freebsd.org Wed Sep 14 17:08:01 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0CD7BDBFC2 for ; Wed, 14 Sep 2016 17:08:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61D981F0E for ; Wed, 14 Sep 2016 17:08:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id 186so33530869itf.0 for ; Wed, 14 Sep 2016 10:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AIQlezMGBheIFxqk917LYY33mPwVOghb0ed6evLrDlE=; b=pVHJ6RMcSXmoSlkVfswO3r2hGH26jUBakKyUGZe+DZjctKpbN2Zj471/DKh8YYqt49 MGNdvqJXSKZHG2Bwb+ReMY/flBW5cLeo1deTGfO6FLSCEDuXuUD1cpNsYqV1TFkGh2jr KYV0SbNKPEYQQ3IgQihObVzjkB5GHidr/xwNcE43GpxSl/Rh3kuz+0KuInMyywFdlVzX 3KKFkYFY9jcnavTuvBG76oPF7uFTlv/N3rw821lAyWwWFyBly9D7Ak9+DZmbDNitSPAi nhOK8K3Hvg4sfKTFEAsklNjbcRvCkUJgoIwDlgknBqkcbeLyyPaI/hBVoANU7t6laE4V rp6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AIQlezMGBheIFxqk917LYY33mPwVOghb0ed6evLrDlE=; b=F9CiE+IEtc8ZYVtXFga+YqCoJr9JF44lAoX9iaJdXrxMJcRk3OVwEfKF1lQqjFrFCd VJ+WMI1gHJRoYDKeuCbbVJjFZsCMLf9zS6HvI7BiZ4DE1Pph7T5z0A/BbN5Y84Fo7LNR lj+tKbMRk+qpQf+hEeuBKVSNklCBY05oK3mik5CoxkjGLvhdfcOkuOscn9FAixWzmmM0 HmE9/idHZt4oEq9KoA0qN1w7NAgq1VEcYdXlOtAY26iFPS+3X0RAodaiRmRVV2WAKbHL AERKOP80BLuaneeKmjKbp6hRSR/abJLqhxKRndJerLbU6MPVe6xNsiurN/iLbkVV/gsK aFog== X-Gm-Message-State: AE9vXwNsGkcXMV9U6pCiqRUS1pgT+yXnxpiUOUg50bdkF3MGzU9K5OKCNTK8V8n0Mpg0D1h9qJFMcJO6r5Me9w== X-Received: by 10.107.18.74 with SMTP id a71mr7857666ioj.126.1473872880495; Wed, 14 Sep 2016 10:08:00 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 14 Sep 2016 10:08:00 -0700 (PDT) X-Originating-IP: [64.31.104.179] In-Reply-To: References: <20586.1473664368@critter.freebsd.dk> <69e12778-75d0-fd79-2dc4-a7727ccab522@FreeBSD.org> From: Warner Losh Date: Wed, 14 Sep 2016 10:08:00 -0700 X-Google-Sender-Auth: W2j0TN_CwmZM_oilBk5xhBO_U9M Message-ID: Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? To: Alan Somers Cc: Matthias Andree , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 17:08:01 -0000 On Wed, Sep 14, 2016 at 8:05 AM, Alan Somers wrote: > On Wed, Sep 14, 2016 at 12:03 AM, Matthias Andree wrote: >> Am 12.09.2016 um 09:12 schrieb Poul-Henning Kamp: >>> -------- >>> In message , Matthias Andree >>> writes: >>>> Greetings, >>>> >>>> given an open file descriptor, do we have a system interface to inquire >>>> about the block size of the underlying devices? In the past, we used to >>>> deal with 512-byte blocks, but how about drives using 4096-byte blocks? >>> DIOCGSECTORSIZE in sys/disk.h >>> >> Thanks Alan, Eugene, Poul-Henning. >> >> >> Now for the next two interesting questions for file system utilities >> (think sysutils/e2fsprogs) running on advanced-format (4096-block) >> drives - many provide internal read-modify-write approaches to emulate >> 512-byte blocks at substantial performance impact. >> >> Ted Y. Ts'o, the upstream e2fsprogs maintainer, asked me this question: >> >>> So how to fill in this matrix? >>> >>> HDD Linux Mac OS FreeBSD >>> Logical Block Size 512 BLKGETSSZGET DKIOCGETBLOCKSIZE DIOCGSECTORSIZE >>> Physical Block Size 4096 BLKGETPSZGET DKIOCGETPHYSICALBLOCKSIZE ? >> >> I have found one hint in the BSD forums that in certain situations the >> DIOCGSTRIPESIZE and DIOCGSTRIPEOFFSET can contain the latter, but on >> RAID it often does not. > > Correct. DIOCGSTRIPESIZE is what you want. A quick tests shows that > it works correctly for both gmirror and zvols as well as native disks. > >> >> >> And while we're here, and for the records: >> >> how do we query the *erase block size* on flash (solid-state) drives? >> It's often much bigger than a sector size. > > Sorry, I don't know. This information isn't aways easily exported. But for SD/MMC cards where it is easy and reliable to get, we use it for the stripe size. Warner From owner-freebsd-hackers@freebsd.org Wed Sep 14 18:54:43 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC1FFBD66EB for ; Wed, 14 Sep 2016 18:54:43 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FDCF197F; Wed, 14 Sep 2016 18:54:43 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id id6so7914008pad.3; Wed, 14 Sep 2016 11:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XHRHSsOj5fcG2BsmOP2urjGbwFpIXvQHdynFTTv6CS8=; b=RGn12FgfqivsxeedkkwaK7mAmmWWSCzHmd4iO0uTBaSpIH3w9mzondgd4GeUwgK+8k GCSGucDZrQCW4D3EzlhfErP7GxcYB8lYfrDN4MOX48x3/eyzb0Hle9JETmiNmkALDTal cJJq4hbrI8cS2sszBmfV/XPuT6moZVOJpZw78lwMZDE5H27TNbFBXG613vpSi2QyNbGs DAvnIaoJ1gJoYvvkNBKe8fGfhN3BaSGza8p/4YpoCRG4m/qmfD21P/M4WzWFn3XOCQC2 5OW7ne5D1y57GiwzdnHtEw+1jO5rdaOG5PNhniwZEcp9pyV5JujXEAshspy+uhVWWkHW gBQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XHRHSsOj5fcG2BsmOP2urjGbwFpIXvQHdynFTTv6CS8=; b=GYXfv3m+IHcfVkriLjw8pLDHb6b1nT+/ZzCc5dtq9/ULymM44t1mFHqAS4hHyAubKB UWsSpdLHvicgiRkdiEoetkCxYwHhnSTem8SZNVbO7symEEzzAb+aFeUpzQvyGKNar7Zx noHGQ0MBtm7xyzJWnhL3/029xXfpPco5NaiNQtmNB8ej62ft0ppOiCxD/PGb5v+1CdNf sO2WRM6dFi/CfobdaSiQRTq36AjrB1q3HGegE04cVFXK9RPwvdtFe2nG5Hf0zsZei93n O3nWWnFRzMxHF5JeZSuXKVFg15aycLK8fQe0GhwFs9fgb4ILCWfAyxZe3zQ+WFv8GM1j Qong== X-Gm-Message-State: AE9vXwPAAyr5DxfD5m6n/Qhlch+MmEnSmaFoDwsn1s0f2tCbuPXI4oG7qCneWQjq8KB/iMfEX41VfeieVUgbKg== X-Received: by 10.66.0.99 with SMTP id 3mr7203970pad.109.1473879282859; Wed, 14 Sep 2016 11:54:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.217.137 with HTTP; Wed, 14 Sep 2016 11:54:42 -0700 (PDT) In-Reply-To: References: From: Cedric Blancher Date: Wed, 14 Sep 2016 20:54:42 +0200 Message-ID: Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Pedro Giffuni Cc: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 18:54:43 -0000 Who was the "principal Illumos developer"? I remember some heated discussions, mostly rooted in 'we stick with ANSI C' and because the CTF/dwarf tools in Illumos were unable to handle VLA and no one was interested in fixing the BUGS in their toolchain, so the cheapest solution was done: VLA was declared persona non grata. Saves company money. Typical Sun policy which was one of the reasons which sealed the downfall of Sun Microsystems. But this is NO ARGUMENT for FreeBSD... Ced On 14 September 2016 at 16:48, Pedro Giffuni wrote: > FWIW, > > After some discussion with one of the principal Illumos developers it is > clear that they won't accept replacing alloca(3) for the sake of > "portability". You also can't always replace alloca(3) with VLAs anyways. > > Pedro. > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur From owner-freebsd-hackers@freebsd.org Wed Sep 14 19:11:34 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E1CBD6AB5 for ; Wed, 14 Sep 2016 19:11:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm7.bullet.mail.bf1.yahoo.com (nm7.bullet.mail.bf1.yahoo.com [98.139.212.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9011FBE for ; Wed, 14 Sep 2016 19:11:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473880287; bh=xXD9EL329RdzEXOgGwy7Qp8KeZZA8SVCfQk1S9uTE40=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=KhIb27jGquBcH9oysSIZmlnnYcDAiweU6lACr5fcB3aVi77jOanIkusyk9dAdyhtU4KqpeLQg+8do9q3EEGg00V1LDoatDnKdaqsBRVM7TRg0YpkYHTcgYHrTN641odsJWCMbluY3ybuj5BtOK+9LJFMsLBs1aMS47pAgLAEwfHN4Rz7nKZvfpGl9DGvxNUh24eMvy3+6ea/pMv8KW1kTObRq+8+dD5J+XIA+PiY6GiuzqQfwCsC4mWxmMJtQ1z8RvfdlWGkNtsoC5gUQ4kgEuD87nXsGRAjxy8xlwQtZJBTR3fFzT5XZHEbvfrtfEISqBtSwgtVx+dF7u/7cIFO9Q== Received: from [98.139.214.32] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:11:27 -0000 Received: from [68.142.230.78] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:11:27 -0000 Received: from [127.0.0.1] by smtp235.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:11:27 -0000 X-Yahoo-Newman-Id: 111702.18710.bm@smtp235.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kBS7sGgVM1lj2FaQ24AYpiyaH.ylaRP.0rnPZoIxHSN_LNw hj6JU1.vqQhId9wTkhFcgHJVC.g0CIUt.Uh56m3od3dbHe8Pc9G9MefuZw2G .fXycM8SsvqL.GUs_vF5efV2TzkY9BAGhkLh3XojKUr9zo2oXPRZ8.9_9sru lN7Sa9aS4EAZW.dMKWBC2nFRS6Zbrj1gAglcKGYL57VX9WsWi47.3rvZAHar oGLbXjKnQGgbMeIS5nsQ1Ez5S8XoCiVKahuBhDWFWonSZln2S6yBJH3YfO8P LpVwpiRKr.T4MVPZTXlI7IeCThXxakYC65kxcCRKdRpcEExfg.8rjvNySReq H367WRWNd55CsQpwFMBp16G9dDyyNO7JWZhn31i5Y2Ev8sAkR89hHs.CZwoc JrVSg7cWyE71Ol68udsf4vtv49q8P0Jfs2qI0IGjZo6THRIGiyI8fDjYZyZ3 03PlhOLTEgJT3c4TJo5hYKMWHChfm2IEjRoBxxKTyaoVkZlRJA3RI.FvSZG6 KmEM5zJjjbOEEo1mRUGeA48bDzphBO0zGla5MVQHAu7pN0g-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Cedric Blancher References: Cc: FreeBSD Hackers From: Pedro Giffuni Message-ID: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> Date: Wed, 14 Sep 2016 14:11:35 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:11:34 -0000 On 14/09/2016 13:54, Cedric Blancher wrote: > Who was the "principal Illumos developer"? I remember some heated > discussions, mostly rooted in 'we stick with ANSI C' and because the > CTF/dwarf tools in Illumos were unable to handle VLA and no one was > interested in fixing the BUGS in their toolchain, so the cheapest > solution was done: VLA was declared persona non grata. Saves company > money. Yes, the non-accessibility of VLAs for Dtrace was the main argument. This was a private conversation with Garrett D'Amore who did some nice enhancements to our printf(1). > Typical Sun policy which was one of the reasons which sealed the > downfall of Sun Microsystems. > > But this is NO ARGUMENT for FreeBSD... Our printf(1) implementation has all their enhancements but uses a VLA instead of alloca. This said, whatever illumos wants to keep in their code is relevant as we want to make it easy to merge ZFS and Dtrace changes back and forth. Pedro. From owner-freebsd-hackers@freebsd.org Wed Sep 14 19:14:39 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410C3BD6C7C for ; Wed, 14 Sep 2016 19:14:39 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E2F13AD; Wed, 14 Sep 2016 19:14:39 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id cm16so8089880pac.0; Wed, 14 Sep 2016 12:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jIj6XG1UgqebW9PxWEfkWO9+XGEa4AIujSaBT0tCbY8=; b=cq3JcV2IEF9bRNjlu6INcqVSODDdgxqC9ZwvWoChrezIEPixb2WBuYnguIYV2b+KzV xo9T8m0CIywfmmLTWj5jaZeV5eqQA3SC/i1wOEfiEk9sIrMd/Jwx5KjYNdxXstUiPeTS upB6+HPF6zfzBstHpL0x7O3s+V7T6DQoVpm//WTeWDFqiYz+5GM/V1Kv5br9NvULrBz9 KqyOp10HCEolFPPMB3oh1dijWXHHou5EKbxB8QPG92VibT7DjXQl2ALn0NMXCsAWhDpf 97lp6dL/c8lXOO9DGfXM5R5X6axCFblNwdwtuqoCMLCGRFlDKbk9cIaLOURpt2EY9pHS WVqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jIj6XG1UgqebW9PxWEfkWO9+XGEa4AIujSaBT0tCbY8=; b=QhnGR8Cfk7wNSuGw+p7J9Zh4zqziBNNCZgbEIHRQJfWyK9cHTMG9Xyjcb7gFDLiBiX aD+iJcmhb+PoUadzTVF+bcN2Cs+Hv3pM7lsT80Lp1WrO3KF/zAmGfUUrxrjBs9JcJyol KftrlspYwb0nCeDIuf2OVdjQZrZgqPlrpBj3T4XSya6VfZJBzI/7FUfPAssNs0OeYSAt Vs+oD9FX+GmatilkFlTkbhP8SNpBhjj4+146QsRE+jl0NFWOfwi5fAgk5l+cKt8wyNga P3N5vSWG6oiglVk/rU6ex1lr8SHFyFaIC+JkFt8lWXi6HVf0wkAWQFbFuR/8HEm8Q3+Z urfQ== X-Gm-Message-State: AE9vXwOvONTs1zfmdk44VkF7/2yHCbA0v1ghjxLe8+QltYC6peu9x3LMMcJXjnid12QogoZyFQxF/g1X8naAtQ== X-Received: by 10.66.0.99 with SMTP id 3mr7365933pad.109.1473880478545; Wed, 14 Sep 2016 12:14:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.217.137 with HTTP; Wed, 14 Sep 2016 12:14:37 -0700 (PDT) In-Reply-To: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> References: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> From: Cedric Blancher Date: Wed, 14 Sep 2016 21:14:37 +0200 Message-ID: Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Pedro Giffuni Cc: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:14:39 -0000 dtrace can do VLA Are there other arguments? Ced On 14 September 2016 at 21:11, Pedro Giffuni wrote: > > > On 14/09/2016 13:54, Cedric Blancher wrote: >> >> Who was the "principal Illumos developer"? I remember some heated >> discussions, mostly rooted in 'we stick with ANSI C' and because the >> CTF/dwarf tools in Illumos were unable to handle VLA and no one was >> interested in fixing the BUGS in their toolchain, so the cheapest >> solution was done: VLA was declared persona non grata. Saves company >> money. > > > Yes, the non-accessibility of VLAs for Dtrace was the main argument. This > was a private conversation with Garrett D'Amore who did some nice > enhancements to our printf(1). > >> Typical Sun policy which was one of the reasons which sealed the >> downfall of Sun Microsystems. >> >> But this is NO ARGUMENT for FreeBSD... > > > Our printf(1) implementation has all their enhancements but uses a VLA > instead of alloca. > > This said, whatever illumos wants to keep in their code is relevant as we > want to make it easy to merge ZFS and Dtrace changes back and forth. > > Pedro. -- Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur From owner-freebsd-hackers@freebsd.org Wed Sep 14 19:15:27 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A56BD6CF6 for ; Wed, 14 Sep 2016 19:15:27 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 22E05151F for ; Wed, 14 Sep 2016 19:15:27 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u8EJFJtR047166 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 14 Sep 2016 12:15:19 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190] claimed to be yuri.doctorlan.com To: Freebsd hackers list From: Yuri Subject: System becomes unresponsive when it runs out of memory Message-ID: Date: Wed, 14 Sep 2016 12:15:18 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:15:27 -0000 I observed this several times: when the system with 24GB RAM +4GB swap runs out of memory and swap, it loses the ability to be connected to. ssh connects, but the second factor authentication (google-authenticator) fails to produce the code. This lasts for an extended period of time (~15 min), after which ssh connection eventually succeeds. My question is: isn't it supposed to kill the largest process when it runs out of memory? IMO, this is a bug that system doesn't handle memory-full condition well and hangs up like this. Another bothersome thing is that I can't really account for the consumed memory. There are several large processes with sizes ~50GB, but madvise(MADV_FREE) has been called on most of that memory by the perftools malloc library. So I don't understand why this memory-full occurred in the first place. Is it possible that madvise(MADV_FREE) doesn't discard memory? Yuri From owner-freebsd-hackers@freebsd.org Wed Sep 14 19:47:14 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E56ABDAB23 for ; Wed, 14 Sep 2016 19:47:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D3D1F22 for ; Wed, 14 Sep 2016 19:47:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473882258; bh=bAAx7L86y6LWX32JNInEcbtayS6FFG8CrB7yCQHzQDM=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=JTi/a1pIQtLB6aXAVHGWdETuodcYt27hOdhvUPYXzsKKSAV4iNL9WR0JKzj9MVUQFT8exhkIj3sxfuG7WLjMv+PmAoMu1u2uzUP8VCreYyF9KP1wilWOjIE0CAs2zHlZWK/a75cbcLDmKsUsNHhiKeiqBwGtXxlX1MMq7aQunI+jxknz+euNlxSRS2MMOqy3v7sqeAGw27VYfrp+q+zWlqm4pP3aY6MeEZ0Yk/5B+lQ8trBxWgFmq0HFxe/OMEvciIUjLMS3I+oq+dESzcbTb+LJ7/e/PmusGleimb/nI8qOYnPaxi22aMOSbXm8AJy2PlvrNtyQ29Or/UoXt26jkw== Received: from [98.139.215.140] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:44:18 -0000 Received: from [68.142.230.73] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:44:18 -0000 Received: from [127.0.0.1] by smtp230.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 19:44:18 -0000 X-Yahoo-Newman-Id: 384503.57015.bm@smtp230.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: L6OWQMUVM1nxW368upeZykzlsXkAQT6awlhAsbnVdJq1AZa Bz5h3O11x0trl.Go6IJTZSGq1l923MCE8Kbbvv6XmQjLcIuGylVhLKxK.qvn oBw32B_jZPj7hW8jIsmeJVbxb14n15G8EUAw9xm8ZEAAHndbEueBhyQgrTM3 Ds5SnZvtT07GTsa39YbgHAjlfUvjL4HRXokwgPZZUXI6GoTDHOtogeVtK5Jx 9KQtXdZY0zCsDmwIcmCDF8N0wJZnVa_3.SLdmxJ22JLPfUDNQHz1yazBLwJ2 0kyUzOUTcwSQzG_Giw6cO3.sgFgmO4AUA5Wkbjy_25q0Zu7HU1mDq8qeeWN1 IbH8JBu_tTvnxd3JdbKiKDW3W5rEKvicr9S1H2.uRI5aSyf8_jaD7b5CJTMG nSz3KqiXKBvTdm2xtd.m9loS0g2lcJipcCB7UyJhA4kdy_eIRIPDOq8Xlt75 MRXCJ216YY_G26qO9QntrrPNJWqgMTS.5Hqp1yym74zttQ9a9xmy9GAjdoaP FVW3gfcfWSdjwM6_1ynaI9ZeEH8D5fKD2coeVbDM4ZqMPGg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Cedric Blancher References: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> Cc: FreeBSD Hackers From: Pedro Giffuni Message-ID: <5cb743dd-60fd-8018-eaf7-fe10b8db211c@FreeBSD.org> Date: Wed, 14 Sep 2016 14:44:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:47:14 -0000 Hello; On 14/09/2016 14:14, Cedric Blancher wrote: > dtrace can do VLA > > Are there other arguments? It was a while ago and I don't remember other than the fact that alloca() exists on all platforms and just works fine so why bother. This was only a discussion in the context of printf(1) and as I wrote we parted different ways there. If there are other notable cases then please upstream those changes first. Pedro. > Ced > > On 14 September 2016 at 21:11, Pedro Giffuni wrote: >> >> On 14/09/2016 13:54, Cedric Blancher wrote: >>> Who was the "principal Illumos developer"? I remember some heated >>> discussions, mostly rooted in 'we stick with ANSI C' and because the >>> CTF/dwarf tools in Illumos were unable to handle VLA and no one was >>> interested in fixing the BUGS in their toolchain, so the cheapest >>> solution was done: VLA was declared persona non grata. Saves company >>> money. >> >> Yes, the non-accessibility of VLAs for Dtrace was the main argument. This >> was a private conversation with Garrett D'Amore who did some nice >> enhancements to our printf(1). >> >>> Typical Sun policy which was one of the reasons which sealed the >>> downfall of Sun Microsystems. >>> >>> But this is NO ARGUMENT for FreeBSD... >> >> Our printf(1) implementation has all their enhancements but uses a VLA >> instead of alloca. >> >> This said, whatever illumos wants to keep in their code is relevant as we >> want to make it easy to merge ZFS and Dtrace changes back and forth. >> >> Pedro. > > From owner-freebsd-hackers@freebsd.org Thu Sep 15 04:06:26 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B2FBD9677 for ; Thu, 15 Sep 2016 04:06:26 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-vk0-x22f.google.com (mail-vk0-x22f.google.com [IPv6:2607:f8b0:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A184B194C; Thu, 15 Sep 2016 04:06:26 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-vk0-x22f.google.com with SMTP id b133so9059557vka.1; Wed, 14 Sep 2016 21:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Wo6/bCXJwKxQg+ptcgfrokyZ0BxNY+BHqCTlXk5kC9o=; b=ZVb6D+KISpgbZejfmMOcJkkAWIpPYnLbAwOcyh6hMaXo1qU2fgK9OyPyWXLYYO51kc p9tC0C0OU2an5fyDreqsHx4qnVsU35r8HDxa18hHIMSQRfrCW1j96FuYAwEusvgd8h2I b96kxeCRcF39E2XUQwnnbf1wfCt5rmaCRCtr01jy6PxTedEqeqCXYc9IUqgjqdkJjEi8 NJOFx24wXpiLzrFjOnFPOMEmPiaYcrRrs33J9WzPZC1wG5HG0/t/2AtD4U06/cye/OaV 7zr+WxlUcup1+xdN3BBDIj5XIWXSvgDmsPLLXG3TdsiReel4/optDrewrX3UZoNokafT BIoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Wo6/bCXJwKxQg+ptcgfrokyZ0BxNY+BHqCTlXk5kC9o=; b=QNZ0y8hDDrfVU9qxMxQ9SUFmcO91ecQEhZHAoM1fKhjPeNOnAlutr5rtVT5yH5ClFO 1smi3cF5b3azQXCdnEjKydYfH5Z4nROTqPW5Jwk90sMOlVZ1oN0j7H//H/Ml01rET8T0 /VPkQJlAfE8wwsioYxr+cEFmaZGsWH5PCu0YXJ7WENV/ZCA/aREl8yHsbo4xtNKUyPE2 5dsJ8+izRoaBVUUYYywE9WzfGrLPswC8MiBVxcDqqFi7I92OqCRjM2GMjn4O/8uaDpP3 u/5t1ZwbzPLM78BSLVoi6rsXuuwvOs6FuIl7Qw/6Qn5rdkftmPomh2si2EJu7hl5TFiL qdfQ== X-Gm-Message-State: AE9vXwO84y6SWZaY8Ye+uv7VJm1VNBEGKG9DTewksfH/5lpEZWCm7Dog8ZjRemycAv8MiaM2d7gy4M2jmI30ew== X-Received: by 10.31.58.130 with SMTP id h124mr1338146vka.141.1473912385663; Wed, 14 Sep 2016 21:06:25 -0700 (PDT) MIME-Version: 1.0 Sender: kmacybsd@gmail.com Received: by 10.159.33.36 with HTTP; Wed, 14 Sep 2016 21:06:25 -0700 (PDT) In-Reply-To: <5cb743dd-60fd-8018-eaf7-fe10b8db211c@FreeBSD.org> References: <90f37d14-a187-06b2-6187-7a9c1890a73f@FreeBSD.org> <5cb743dd-60fd-8018-eaf7-fe10b8db211c@FreeBSD.org> From: "K. Macy" Date: Wed, 14 Sep 2016 21:06:25 -0700 X-Google-Sender-Auth: d4U-mAqA9gjwR-IdwMMlzdcjRYI Message-ID: Subject: Re: Is replacing alloca(3) where possible a good thing to do? To: Pedro Giffuni Cc: Cedric Blancher , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 04:06:26 -0000 On Wed, Sep 14, 2016 at 12:44 PM, Pedro Giffuni wrote: > Hello; > > > On 14/09/2016 14:14, Cedric Blancher wrote: >> >> dtrace can do VLA >> >> Are there other arguments? > > > It was a while ago and I don't remember other than the fact that alloca() > exists on all platforms and just works fine so why bother. What problem are we trying to solve? Is there any indication in practice of stack overruns or are we talking about fixing something that isn't broken? -M > > This was only a discussion in the context of printf(1) and as I wrote we > parted different ways there. If there are other notable cases then please > upstream those changes first. > > Pedro. > >> Ced >> >> On 14 September 2016 at 21:11, Pedro Giffuni wrote: >>> >>> >>> On 14/09/2016 13:54, Cedric Blancher wrote: >>>> >>>> Who was the "principal Illumos developer"? I remember some heated >>>> discussions, mostly rooted in 'we stick with ANSI C' and because the >>>> CTF/dwarf tools in Illumos were unable to handle VLA and no one was >>>> interested in fixing the BUGS in their toolchain, so the cheapest >>>> solution was done: VLA was declared persona non grata. Saves company >>>> money. >>> >>> >>> Yes, the non-accessibility of VLAs for Dtrace was the main argument. This >>> was a private conversation with Garrett D'Amore who did some nice >>> enhancements to our printf(1). >>> >>>> Typical Sun policy which was one of the reasons which sealed the >>>> downfall of Sun Microsystems. >>>> >>>> But this is NO ARGUMENT for FreeBSD... >>> >>> >>> Our printf(1) implementation has all their enhancements but uses a VLA >>> instead of alloca. >>> >>> This said, whatever illumos wants to keep in their code is relevant as we >>> want to make it easy to merge ZFS and Dtrace changes back and forth. >>> >>> Pedro. >> >> >> > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@freebsd.org Thu Sep 15 08:41:23 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA3FBDC764 for ; Thu, 15 Sep 2016 08:41:23 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0E5713A0; Thu, 15 Sep 2016 08:41:22 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bkSES-0003mr-QQ; Thu, 15 Sep 2016 11:41:20 +0300 Date: Thu, 15 Sep 2016 11:41:20 +0300 From: Slawa Olhovchenkov To: Warner Losh Cc: Alan Somers , "freebsd-hackers@freebsd.org" , Matthias Andree Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? Message-ID: <20160915084120.GQ2840@zxy.spb.ru> References: <20586.1473664368@critter.freebsd.dk> <69e12778-75d0-fd79-2dc4-a7727ccab522@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 08:41:23 -0000 On Wed, Sep 14, 2016 at 10:08:00AM -0700, Warner Losh wrote: > On Wed, Sep 14, 2016 at 8:05 AM, Alan Somers wrote: > > On Wed, Sep 14, 2016 at 12:03 AM, Matthias Andree wrote: > >> Am 12.09.2016 um 09:12 schrieb Poul-Henning Kamp: > >>> -------- > >>> In message , Matthias Andree > >>> writes: > >>>> Greetings, > >>>> > >>>> given an open file descriptor, do we have a system interface to inquire > >>>> about the block size of the underlying devices? In the past, we used to > >>>> deal with 512-byte blocks, but how about drives using 4096-byte blocks? > >>> DIOCGSECTORSIZE in sys/disk.h > >>> > >> Thanks Alan, Eugene, Poul-Henning. > >> > >> > >> Now for the next two interesting questions for file system utilities > >> (think sysutils/e2fsprogs) running on advanced-format (4096-block) > >> drives - many provide internal read-modify-write approaches to emulate > >> 512-byte blocks at substantial performance impact. > >> > >> Ted Y. Ts'o, the upstream e2fsprogs maintainer, asked me this question: > >> > >>> So how to fill in this matrix? > >>> > >>> HDD Linux Mac OS FreeBSD > >>> Logical Block Size 512 BLKGETSSZGET DKIOCGETBLOCKSIZE DIOCGSECTORSIZE > >>> Physical Block Size 4096 BLKGETPSZGET DKIOCGETPHYSICALBLOCKSIZE ? > >> > >> I have found one hint in the BSD forums that in certain situations the > >> DIOCGSTRIPESIZE and DIOCGSTRIPEOFFSET can contain the latter, but on > >> RAID it often does not. > > > > Correct. DIOCGSTRIPESIZE is what you want. A quick tests shows that > > it works correctly for both gmirror and zvols as well as native disks. > > > >> > >> > >> And while we're here, and for the records: > >> > >> how do we query the *erase block size* on flash (solid-state) drives? > >> It's often much bigger than a sector size. > > > > Sorry, I don't know. > > This information isn't aways easily exported. But for SD/MMC cards > where it is easy and reliable to get, we use it for the stripe size. It's report and set to 16MB? From owner-freebsd-hackers@freebsd.org Thu Sep 15 09:53:18 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D45E8BDA8AA for ; Thu, 15 Sep 2016 09:53:18 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from smtp12.openmailbox.org (smtp12.openmailbox.org [62.4.1.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B5691445 for ; Thu, 15 Sep 2016 09:53:17 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail2.openmailbox.org (Postfix, from userid 1001) id 998D71028B0; Thu, 15 Sep 2016 11:53:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473933189; bh=SrLmq5V6IBeXgLO663rqduS8Ga3pK/LS6c1dCL/jt5s=; h=To:From:Subject:Date:From; b=cEmt6rPbHP2POQJIpY8oPSfAuEJkAKD7uKY2/q6urTxmRuGqilox8LC2TH3owNbZy hZVirDcyWC6+/FbaoOcR4+cxP3OzOTIl0WWcVy81R+PUPe704h0JbZpKOWXphmzq67 ys7zSGXIiNFzX4ToVuYVADh8a8Ymy4r233k5F5Lw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h3 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 To: freebsd-hackers@FreeBSD.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473933189; bh=SrLmq5V6IBeXgLO663rqduS8Ga3pK/LS6c1dCL/jt5s=; h=To:From:Subject:Date:From; b=cEmt6rPbHP2POQJIpY8oPSfAuEJkAKD7uKY2/q6urTxmRuGqilox8LC2TH3owNbZy hZVirDcyWC6+/FbaoOcR4+cxP3OzOTIl0WWcVy81R+PUPe704h0JbZpKOWXphmzq67 ys7zSGXIiNFzX4ToVuYVADh8a8Ymy4r233k5F5Lw= From: Daniil Berendeev Subject: Multiple possible null-pointer dereferences Message-ID: <614a3aa7-a903-23f5-33b8-c367f22cd454@openmailbox.org> Date: Thu, 15 Sep 2016 09:53:30 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 09:53:18 -0000 Hello, its cppcheck guy again. I'm digging through error messages, and there are lots of them related to null pointer dereferences. But I'm not sure if those should be considered as bugs and fixed. Maybe I'm missing a point? Here are some common examples of how it looks like: 1) First snippet: static int dbd_freetds_end_transaction(apr_dbd_transaction_t *trans) { int dummy; if (trans) { // <-- Here we check whether trans is a valid pointer // skipped irrelevant code } // But here we dereference is without a fuss. return (trans->handle->err == SUCCEED) ? 0 : 1; } 2) Second snippet: static int dbd_oracle_end_transaction(apr_dbd_transaction_t *trans) { int ret = 1; /* no transaction is an error cond */ sword status; // *** We dereference the pointer *** apr_dbd_t *handle = trans->handle; if (trans) { // <-- and check if it is valid after that, lol //... 3) Third snippet // *** Again, here we dereference the pointer *** assert(stab->n_type != N_FUN || (iidescp->ii_type != II_GFUN && iidescp->ii_type != II_SFUN) || scope == 0); //... if (scope && stab->n_type != N_PSYM) { if (iidescp) // <-- and here check if it's valid iidesc_free(iidescp, NULL); And there are tons (973 to be precise) of examples like these above. Should those be considered as bugs and be fixed, or they are fine? -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. From owner-freebsd-hackers@freebsd.org Thu Sep 15 19:16:45 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9A1BDB1BD for ; Thu, 15 Sep 2016 19:16:45 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 220B48E8 for ; Thu, 15 Sep 2016 19:16:44 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190f-383ff7000000227b-5e-57daf3944135 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id E9.A7.08827.493FAD75; Thu, 15 Sep 2016 15:16:37 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id u8FJGadH003315; Thu, 15 Sep 2016 15:16:36 -0400 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id u8FJGXaD025346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 15 Sep 2016 15:16:35 -0400 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id u8FJGWoi009168; Thu, 15 Sep 2016 15:16:32 -0400 (EDT) Date: Thu, 15 Sep 2016 15:16:32 -0400 (EDT) From: Benjamin Kaduk To: Daniil Berendeev cc: freebsd-hackers@FreeBSD.org Subject: Re: Multiple possible null-pointer dereferences In-Reply-To: <614a3aa7-a903-23f5-33b8-c367f22cd454@openmailbox.org> Message-ID: References: <614a3aa7-a903-23f5-33b8-c367f22cd454@openmailbox.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsUixG6nrjv1861wg3ffGC22b/7HaHHjwgw2 ByaPGZ/ms3i8ObGULYApissmJTUnsyy1SN8ugSvj0MKDTAXbWCpeb1/N3MC4i7mLkZNDQsBE Ytv9PUA2F4eQQBuTxPTOk6wQzkZGieUnm5kgnENMEtdvzmCDcBoYJbZdngiU4eBgEdCW2Lvc C2QUm4CKxMw3G9lAbBEBQ4mnr+8wgdjMAvISZ8/dZAGxhQUsJC59OgFmcwo4S0zf/gbsDF4B B4mlm9eygthCAk4S3+5tBYuLCuhIrN4/hQWiRlDi5MwnLBAztSSWT9/GMoFRYBaS1CwkqQWM TKsYZVNyq3RzEzNzilOTdYuTE/PyUot0TfRyM0v0UlNKNzGCQpJTkn8H45wG70OMAhyMSjy8 AbNvhQuxJpYVV+YeYpTkYFIS5eXZBRTiS8pPqcxILM6ILyrNSS0+xCjBwawkwtv+CSjHm5JY WZValA+TkuZgURLn7ZpxIFxIID2xJDU7NbUgtQgmK8PBoSTBGw3SKFiUmp5akZaZU4KQZuLg BBnOAzQ8FGx4cUFibnFmOkT+FKMux4Ift9cyCbHk5eelSonzbgQpEgApyijNg5sDTiW7mVRf MYoDvSUMMYoHmIbgJr0CWsIEtGTLmusgS0oSEVJSDYxbw3Ny5U7uOBiZ8Mrp6yGf4OmMuxav Ufx3fm3Ohr7EO4uqPZYY7+z3lgnRnGEU8vuJmfVriS6mpUVSR1fVX5LeatywouBxgUVZS0qb X6+IStmhrd4JbKw3ChLMblat7FdI7RFeMENoWc75rTv2nj9m+HTFh5X3zRdfnWhe9egNz5cb 93ZJhDIqsRRnJBpqMRcVJwIAqcmgmgADAAA= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 19:16:45 -0000 On Thu, 15 Sep 2016, Daniil Berendeev wrote: > Hello, its cppcheck guy again. > > I'm digging through error messages, and there are lots of them related > to null pointer dereferences. But I'm not sure if those should be > considered as bugs and fixed. Maybe I'm missing a point? I only looked at the first one, but it looks like a bug. But, all the pasted examples looked like they were or were likely to be in contrib code, so fixing them is more tedious, as it has to go through the upstream code owner and then get imported into FreeBSD. -Ben From owner-freebsd-hackers@freebsd.org Thu Sep 15 19:42:37 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 554EDBDBAE4 for ; Thu, 15 Sep 2016 19:42:37 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: from smtp9.openmailbox.org (smtp24.openmailbox.org [62.4.1.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18041BAE for ; Thu, 15 Sep 2016 19:42:36 +0000 (UTC) (envelope-from pipfstarrd@openmailbox.org) Received: by mail.openmailbox.org (Postfix, from userid 20002) id 93EEF202B7B; Thu, 15 Sep 2016 21:35:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473968137; bh=cSU82mkskDePsspXMQbUe9FxZZ4NNQPsrN7wG7rKxA0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=Gjt+uL4B6g49nKlnXDU9MgxVlRiQQmNjlUb1CmR+tU2ZSA9HRp4etXnOziNace7Yk KnSviPsUop2Jey68fOa8dltmwzEGjzifRlx6iefSrmcz8nhTUAPtferKOZW6VtQhIf CYr92+VaLFotIxdBIJxzNhxFunYMTCSHBJch6ys4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h3 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Subject: Re: Multiple possible null-pointer dereferences DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org; s=openmailbox; t=1473968137; bh=cSU82mkskDePsspXMQbUe9FxZZ4NNQPsrN7wG7rKxA0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=Gjt+uL4B6g49nKlnXDU9MgxVlRiQQmNjlUb1CmR+tU2ZSA9HRp4etXnOziNace7Yk KnSviPsUop2Jey68fOa8dltmwzEGjzifRlx6iefSrmcz8nhTUAPtferKOZW6VtQhIf CYr92+VaLFotIxdBIJxzNhxFunYMTCSHBJch6ys4= To: Benjamin Kaduk References: <614a3aa7-a903-23f5-33b8-c367f22cd454@openmailbox.org> Cc: freebsd-hackers@FreeBSD.org From: Daniil Berendeev Message-ID: <7022fa33-8789-0ac1-fbc9-7c2780149b49@openmailbox.org> Date: Thu, 15 Sep 2016 19:36:03 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 19:42:37 -0000 > But, all the pasted examples looked like they were or were likely to be in > contrib code Yes, the pasted examples are from contrib/ code, but similar code exists in usr.sbin/, sys/, crypto/, lib/, libexec/, sbin/, just a few examples from sys: 1) sys/boot/ficl/ficl.c:274 void ficlFreeVM(FICL_VM *pVM) { // Again, we at first dereference the pointer FICL_SYSTEM *pSys = pVM->pSys; FICL_VM *pList = pSys->vmList; // And then check if it is valid assert(pVM != 0); // ... 2) sys/dev/iwn/if_iwn.c:6853 if (ss != NULL) { // we check if ss is valid if (ss->ss_ssid[0].len != 0) { // then some operations are performed over ss, // but they are all done inside the if expression. // Nothing is done in case ss == NULL. // Then, a after a bunch of lines // we do this (line 6933): if (ss->ss_nssid > 0) chan->flags |= htole32(IWN_CHAN_NPBREQS(1)); // Nothing is done with ss between the if() statement // and the dereference So, if these are actually bugs, I'd mark them as needed for fixing (as, sometimes, it's not clear what should be done in the fail case and should be better left up to the maintainer to decide) and send the patches to the mailing list (among others). -- Cheers~ PGP key fingerprint: 07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF You can retrieve my public key at pgp.mit.edu. From owner-freebsd-hackers@freebsd.org Fri Sep 16 00:38:38 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A62BDCAFF for ; Fri, 16 Sep 2016 00:38:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1602F37E for ; Fri, 16 Sep 2016 00:38:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id r192so5553311ita.0 for ; Thu, 15 Sep 2016 17:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/EmZLR+1shY7sQxub+BC2BZlfWR8qtdQ+5fb7oNP+w4=; b=p4gp/qnMATv98c4XVt4fV0KPs271L5h7xkixURSRMtN6Ac9stzrWBP0xcxgoNDSan/ MePVXu+BA5mTSXxr2kBb5qMbL1IqkFeQTBRVL28Xw57l7A/PF68MhcuoG11zAFd25nnT 8GPXaOdEX3A9tCg4b7RmLXg+L81VFE32fhZOJV0Pfn3jbu4AqrZZnqfLvgKAqOYOV5xa 2CpTFR92EDcDHBu1uO+42H7JNRnUpnaqYfSp49x0SZP6x55vYh7ZtMf/S13OhwYlUogt LwKMs19+9d6qDvLK9wv1xE23VNI9yY+kO9+uTT+iIyyL1p9nV6HqpNVUKFFbw1W7/oP0 Nk1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/EmZLR+1shY7sQxub+BC2BZlfWR8qtdQ+5fb7oNP+w4=; b=YmzHc7g9HWmEOr1Ws3A+0nroOtaKhr2vhrPngDi7NWRLrUKgkcGC2eXWmNfYHp6V2M DyuS5icyB9pdSTpTkWMgIBGTegtOb15R9qlGx1cnhgc6JPYyn1ImAKYjE4iBT5gjEC2I wqqtLtIV5bQhye3D0Guj/rY/VqKcaqitghCB9/gC/Xsg/ikfWI1MJqeqqg3ow7vaY7uZ 61Zt4PadOJ9Hg8Bl7wPh4M+Gun+3NpDoxMx/DIBVFrvKL0M8HaJvhZQc4Yi72stwTJ7i mMBuaEs698KUjhhEvrezATLGxJLV12xPaiBYrNWLZoucDRTsvgTBeYK8K4c3+EG3w4Ho zTKA== X-Gm-Message-State: AE9vXwMm36RKPHawDmrzuRrn0pWxCYJSjjsojZZe9jp/ODaRzOS454VUwMu9JtVmX7nT4kkBuk4ya7MMsbYeQw== X-Received: by 10.36.212.6 with SMTP id x6mr2722290itg.71.1473986317392; Thu, 15 Sep 2016 17:38:37 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Thu, 15 Sep 2016 17:38:36 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <7022fa33-8789-0ac1-fbc9-7c2780149b49@openmailbox.org> References: <614a3aa7-a903-23f5-33b8-c367f22cd454@openmailbox.org> <7022fa33-8789-0ac1-fbc9-7c2780149b49@openmailbox.org> From: Warner Losh Date: Thu, 15 Sep 2016 17:38:36 -0700 X-Google-Sender-Auth: kepRbIkjSyJtErua0rFzgX1ETq0 Message-ID: Subject: Re: Multiple possible null-pointer dereferences To: Daniil Berendeev Cc: Benjamin Kaduk , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 00:38:38 -0000 On Thu, Sep 15, 2016 at 12:36 PM, Daniil Berendeev wrote: > >> But, all the pasted examples looked like they were or were likely to be in >> contrib code > Yes, the pasted examples are from contrib/ code, but similar code exists > in usr.sbin/, sys/, crypto/, lib/, libexec/, sbin/, just a few examples > from sys: > > 1) sys/boot/ficl/ficl.c:274 > void ficlFreeVM(FICL_VM *pVM) > { > // Again, we at first dereference the pointer > FICL_SYSTEM *pSys = pVM->pSys; > FICL_VM *pList = pSys->vmList; > > // And then check if it is valid > assert(pVM != 0); > // ... While technically a bug, this bug would never be triggered given how the boot loader works. It's super easy to fix, so we might as well, but to be clear it will zero affect on the actual runtime performance of the code give the greater structure of the code. Warner From owner-freebsd-hackers@freebsd.org Fri Sep 16 14:37:28 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EEA0BDC2DD; Fri, 16 Sep 2016 14:37:28 +0000 (UTC) (envelope-from lex.geistesblitz@gmail.com) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1083952; Fri, 16 Sep 2016 14:37:27 +0000 (UTC) (envelope-from lex.geistesblitz@gmail.com) Received: by mail-yw0-x22a.google.com with SMTP id u82so84413696ywc.2; Fri, 16 Sep 2016 07:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=/iRsjoWQ90VFUnwQPtySOKOyqmmscwfYO0IfVUrcX3U=; b=cuMHiqadJXrxuNW7uUw9dKZPSkECjPDFGGLsYs0L6tEIq6z61rYKZLrDJ5BSWQBj5w 2b7tsERPHLqVdJMUZfCOequV+VwqO8yfyC3AydgtThgcWwUX+emtMX6sSmNFhG12SsWh iEmRIZ24ytJvgMeA4g9dq1t3v+S9AjLVyr1Yzphjo0VZ6dK4rLxvWQ7Gxh2isev744l6 bIh0Cv58zhrm2DZWr+6CSfNIYxYkPz7LCToyG0gcDXMLcKUUxsClqXKeonmsAtn7ZHqR 1k8FLotxNdPj5WEmzkK076jLII6gb7qLyn/QJ/CzBChCEuU6bN0scY4zYeqCxpqakEIz NVgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/iRsjoWQ90VFUnwQPtySOKOyqmmscwfYO0IfVUrcX3U=; b=KQkhNtjmXwtCCyjJcLURa/2OBucJHk94blAVXAPF9+ek0mL653xC7PiLofQV1Ryde4 WoUwA6qjcUUdL7PaQN6YZO/Iz7LymJYcVy4l5pHaPwBPcyYcQ+wLHqz+sITKtejfgDez PoVRnagtliWtoBq77dTkHVa/zNURRsiGDNGr9Jy4Ulq4VXqsVXJEofZaGGdmL7xqelk9 K9Hvf6Bq/oCyHxrDEBJj9vCKToZFKiaCXdhpdBlIlsGsWzQG/x901e695vGT/Aegb9d1 rpc2pyJwt/MJhDcou0JiqAivFTt9asaf/eC+TiZ0E7Y10nYhUxrYuuGwVFFPGLqkeJmH 1cEw== X-Gm-Message-State: AE9vXwM8LtFn1JBuwObwqN3R6dyc4ZqX5+S8wTxzqngcQhKxklWzBTkoqQaj5dVjrSG6pGG1asGwV3tLmoYFww== X-Received: by 10.129.72.6 with SMTP id v6mr14278021ywa.50.1474036647025; Fri, 16 Sep 2016 07:37:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.160.3 with HTTP; Fri, 16 Sep 2016 07:37:26 -0700 (PDT) From: Lex Geistesblitz Date: Fri, 16 Sep 2016 17:37:26 +0300 Message-ID: Subject: Something about the future of BSD, in general. To: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, freebsd-bugs@freebsd.org, freebsd-emulation@freebsd.org, freebsd-multimedia@freebsd.org X-Mailman-Approved-At: Fri, 16 Sep 2016 15:38:17 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 14:37:28 -0000 About the actual state of Spotify in BSD(Handbooked): New solutions, a chroot of a linux kernel as in the adobe flash case, something smarter, not wine-ing windows in unix, it's silly. You guys are too altruists, you done it freely for the mankind when others done billion of dollars from your work, now you should ask them for a little common-sense and raise the level by their kindness. For example: Sonny should give you the full implementation of their custom AMD video-driver, Apple should give you the OSX interface. They got bigger because of you, don't be fooled, free the world. You know better what you have to do but the only way is a further approach with the Linux world, they are very stupid because they are trying to get "junk-food of prestige" by splitting it into hundreds of "distributions", everyone want to be as Linus but they know nothing about programming, even though, if they would fusion their work into fewer big projects it could be something: All Debian cancer into just Debian(only the best remaining into the game), a Fusion between Arch world and Gentoo's, Slackware's world+ RHEL's and we're done. The thing is available for you too, try to build bigger teams, smarter, faster, ready to do it for the well being of anyone who deserve it. (Try to get back the NetBSD, OpenBSD&derivatives into the main FreeBSD project, there are powerful brains there. Try to expel corporatisms and cheap software sold expensive from this Planet. Thank you for taking time to read my brainstorms. I hope you can do it. At least, fully implement Spotify for BSD, ask NVIDIA, maybe they already got a trick. They are both green, maybe it works. :D Thank you ! From owner-freebsd-hackers@freebsd.org Fri Sep 16 16:08:38 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 054D1BDC924 for ; Fri, 16 Sep 2016 16:08:38 +0000 (UTC) (envelope-from trafdev@mail.ru) Received: from fallback3.mail.ru (fallback3.mail.ru [94.100.181.189]) by mx1.freebsd.org (Postfix) with ESMTP id AD0E85E0 for ; Fri, 16 Sep 2016 16:08:37 +0000 (UTC) (envelope-from trafdev@mail.ru) Received: from smtp2.mail.ru (smtp2.mail.ru [94.100.179.91]) by fallback3.mail.ru (mPOP.Fallback_MX) with ESMTP id 5008D1412E24 for ; Fri, 16 Sep 2016 18:53:54 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=Ma2TWVErEjUJSzqtX2WtY/oRzCb7rQUqeTQhFa1vXaM=; b=H9slAPjwzseQ8OSWSRAMqSbVi7lsrn+0QVcAPctXr956p8itY2XmV9KDPGgB47uFe/PcqdFJN1UbqORg9PiBVzgUTSJPUGr9MZzeqUSrEOvPlmPKVI6x920F63AltYXsOUaGQ0SrW/sOiZwSU2I3tjar5EEBfJjJINgoNYgUPPo=; Received: from c-50-156-112-176.hsd1.ca.comcast.net ([50.156.112.176]:64429 helo=[192.168.1.116]) by smtp2.mail.ru with esmtpa (envelope-from ) id 1bkvST-00076P-0d for freebsd-hackers@freebsd.org; Fri, 16 Sep 2016 18:53:45 +0300 Subject: Re: Something about the future of BSD, in general. To: freebsd-hackers@freebsd.org References: From: trafdev Message-ID: <6d14e902-5d47-a2c3-119d-511783bd5abf@mail.ru> Date: Fri, 16 Sep 2016 08:53:40 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp2.mail.ru; auth=pass smtp.auth=trafdev@mail.ru smtp.mailfrom=trafdev@mail.ru X-Mailru-Sender: CF8F31C009940187A7F35C43154C059FF42D6DC68A33316EF7F5379CBBD05BC5FC7F53C2C90BE8F28472923344694FB0 X-Mras: OK X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 16:08:38 -0000 Why not into PDP-7? On 09/16/16 07:37, Lex Geistesblitz wrote: > (Try to get back the NetBSD, OpenBSD&derivatives into the main FreeBSD > project, there are powerful brains there. > >