From owner-freebsd-hackers@freebsd.org Sun Jan 17 02:24: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 6BFC0A6AB02 for ; Sun, 17 Jan 2016 02:24:38 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-11.server.virginmedia.net (know-smtprelay-omc-11.server.virginmedia.net [80.0.253.75]) by mx1.freebsd.org (Postfix) with ESMTP id 6195C195B for ; Sun, 17 Jan 2016 02:24:36 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-11-imp with bizsmtp id 6qPR1s00t0HtmFq01qPRXj; Sun, 17 Jan 2016 02:23:26 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=JO3GyJ+b c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=NLZqzBF-AAAA:8 a=r77TgQKjGQsHNAKrUKIA:9 a=xNf9USuDAAAA:8 a=FP58Ms26AAAA:8 a=uiCUwN4TNFpVW7ip_DUA:9 a=QEXdDO2ut3YA:10 a=ouB9RdVhKGoA:10 a=AEIrD3nfBvwBuJeGbroA:9 a=-jyEp1aiCP3pqSpG:21 a=_W_S_7VecoQA:10 References: <5698EBCD.6050603@gmail.com> Subject: Re: Removing sysV init files To: debian-devel@lists.debian.org From: Jonathan de Boyne Pollard Cc: FreeBSD Hackers Message-ID: <569AFB06.8070201@NTLWorld.com> Date: Sun, 17 Jan 2016 02:23:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5698EBCD.6050603@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 02:24:38 -0000 Michael Biebl: > I wonder if nosh could be an option for non-linux. According to its > website it supports native systemd service files. I have to admit > though, I never looked at nosh myself, so I have no idea how far that > "systemd support" goes. This caught my eye, so I thought that I'd demonstrate. Before getting to what I did, let's clear up some tangential points. Alec Leamas: > The systemd setup [for lirc] is three different services, the sysV > [setup] one. There is no systemd service directly corresponding to the > sysV one. The Debian revision log says that that's not in fact true. http://anonscm.debian.org/viewvc/pkg-lirc?view=revision&revision=521 There have been three System 5 rc scripts since May 2014; precisely so that there *is* a correspondence between service names, according to the commentary. From a Debian point of view, I suspect that the answer that you'll get from all of the Debian people who actually look into the situation is that if Debian Maintainer Stefan Lippers-Hollmann is willing to continue doing this work to maintain System 5 rc scripts for your software, you should let xem. (-: I suggest that you should probably pay more attention to the System 5 rc scripts, because your systemd units aren't up to scratch and don't do as good a job. I discovered this by running your |lircd.socket| and |lircd.service| unit files through the nosh conversion process and seeing what resulted. Your "bad gut feeling" about your System 5 rc files is, ironically, misplaced and should be about your systemd mechanisms. Yes the nosh package can take this sort of thing and convert it to native form. There's a detailed worked example of doing so on the nosh WWW pages. http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/worked-example.html For lirc it was almost as easy as: JdeBP /tmp $ fetch 'http://sourceforge.net/p/lirc/git/ci/master/tree/systemd/lircd.socket?format=raw' -o lircd.socket JdeBP /tmp $ fetch 'http://sourceforge.net/p/lirc/git/ci/master/tree/systemd/lircd.service?format=raw' -o lircd.service JdeBP /tmp $ convert-systemd-units ./lircd.socket JdeBP /tmp $ sudo system-control start /tmp/lircd What resulted was a service that didn't start. Hence "almost". JdeBP /tmp $ svstat /tmp/lircd /tmp/lircd: stopped since 2016-01-16 23:06:12 +0000; 2m 1s ago. , initially started JdeBP /tmp $ It didn't start because the service unit was wrong. A quick check of the log revealed that the service was trying to create a local-domain socket at |/run/lirc/lircd| . But there was no |/run/lirc/| directory on my system to contain that. Your systemd units didn't make one; and one doesn't appear by telepathy. (-: Stefan Lippers-Hollmann's System 5 rc scripts *do* make this directory, however. They have this near the start: [ -d "/run/lirc" ] || mkdir -p "/run/lirc" The systemd service unit file way of doing the same thing is: [Service] RuntimeDirectory=lirc So I edited that into your |lircd.service| and had another go. This time I was hit by a problem with "quirks mode" conversion (which I don't use all that often). Since your |lircd| program doesn't actually rely upon any systemd quirks as far as I can see, I simply switched to "ideal mode" conversion and converted a third time: JdeBP /tmp $ convert-systemd-units --no-systemd-quirks ./lircd.socket JdeBP /tmp $ sudo system-control start /tmp/lircd Now I was hit by the fact that you'd hardwired the pathname |/usr/sbin/lircd| into your service unit. This isn't wrong from a Linux systemd operating system perspective. But I'm doing this on FreeBSD (PC-BSD 10.2, in fact) to demonstrate that the nosh toolset very much does provide the tools for non-Linux operating systems. The FreeBSD-supplied lircd installs into |/usr/local/sbin |not |/usr/sbin|, because that's the rule for non-operating-system stuff. Fortunately, there are at least two ways around this. I took the one that uses |$PATH|. The conversion tool can be told |ExecStart=lircd| and that will make a service bundle that will just work for either |/usr/sbin/lircd| or |/usr/local/sbin/lircd| . So I edited that into your |lircd.service| and had another go. JdeBP /tmp $ convert-systemd-units --no-systemd-quirks ./lircd.socket JdeBP /tmp $ sudo system-control start /tmp/lircd And it's up and running, converted from your socket and service units into native service bundles, on nosh-managed PC-BSD 10.2. JdeBP /tmp $ svstat /tmp/lircd /tmp/lircd: running (pid 50174) since 2016-01-16 23:39:56 +0000; 6s ago. JdeBP /tmp $ There are several things that you probably should take note of here. The converted service bundle uses UCSPI-TCP tools from the toolset to set up the listening socket for lircd to inherit. Unfortunately, even though this is lirc version 0.9.0, built straight from the FreeBSD port today, it doesn't have the code that takes the socket as an already open file descriptor at program startup. So process 50174 actually has two open file descriptors for the |/run/lirc/lircd| socket, one that was set up for it with UCSPI-TCP and one that it opened itself because the FreeBSD port doesn't actually contain any |HAVE_SYSTEMD| code. Your |HAVE_SYSTEMD| approach isn't ideal, from your perspective of having lircd work on other operating systems like it does with systemd, anyway. This is because it doesn't cope with non-Linux operating systems where you might still get the listening socket passed in, already open. This is in turn because you are using the systemd developers' library. Their library doesn't do anything on non-Linux operating systems. I recommend instead looking to one of the many alternatives now available and floating around on the likes of GitHub. The alternatives don't conditionally compile out everything on non-Linux targets. Both the System 5 rc scripts and the port-supplied NetBSD rc script (in |/usr/local/etc/rc.d/lircd|) are parameterized. Your systemd unit files are not. In particular, note that the NetBSD rc script has this: command_args="-d ${lircd_device} ${lircd_config}" This means that FreeBSD/PC-BSD users can use their conventional |/etc/rc.conf.local| system to configure how the lircd daemon is invoked, by setting |lircd_device| and |lircd_config| variables. (See the rc.conf(5) manual page for details of this system.) There's even a handy |rcctl| tool in OpenBSD designed for working with these settings. This mechanism can be made to work with the nosh toolset. I adjusted your |lircd.service| yet again to now read: EnvironmentDirectory=env ExecStart=lircd --nodaemon ${device:+-d "${device}"} ${config} (To make this unit work with systemd too, note that you would have to explicitly state the invocation of the shell.) Running that through the conversion tool yielded a slightly more complex service bundle: JdeBP /tmp $ convert-systemd-units --no-systemd-quirks ./lircd.socket JdeBP /tmp $ mkdir /tmp/lircd/service/env JdeBP /tmp $ cat /tmp/lircd/service/service #!/bin/nosh #Service file generated from ./lircd.service #LIRC Infrared Signal Decoder sh -c "exec lircd --nodaemon ${device:+-d \"${device}\"} ${config}" JdeBP /tmp $ This can be manipulated with the |rcctl| shim provided in the nosh toolset: JdeBP /tmp $ rcctl get /tmp/lircd JdeBP /tmp $ rcctl set /tmp/lircd device "/run/lirc/lirc0" JdeBP /tmp $ rcctl get /tmp/lircd device=/run/lirc/lirc0 JdeBP /tmp $ sudo rcctl stop /tmp/lircd JdeBP /tmp $ sudo rcctl start /tmp/lircd JdeBP /tmp $ ps -o command -p 50260 COMMAND lircd --nodaemon -d /run/lirc/lirc0 JdeBP /tmp $ It's not necessary to use a full pathname such as |/tmp/lircd| . That's only because I chose to operate in |/tmp| which isn't a place that is searched for service bundles. I could have chosen instead to work in |/var/local/sv/|, in which case all of the commands above that have |/tmp/lircd| would have just read unadorned |lircd|. As a bonus, this would have also enabled the system configuration autoconversion feature of the nosh toolset, which would have taken any |lircd_device| setting from |/etc/rc.conf{,.local}| and applied it to the |lircd| service as its |device| setting without my having to run |rcctl| manually. All of this (apart from using the Debian equivalent of FreeBSD's |fetch| command) is pretty much exactly the same on Debian, when nosh-managed. I went through much the same steps. From owner-freebsd-hackers@freebsd.org Sun Jan 17 03:43: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 8C3ACA6A448 for ; Sun, 17 Jan 2016 03:43:23 +0000 (UTC) (envelope-from kib@kib.kiev.ua) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E95C11094; Sun, 17 Jan 2016 03:43:22 +0000 (UTC) (envelope-from kib@kib.kiev.ua) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u0H3hFuX097709 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 17 Jan 2016 05:43:16 +0200 (EET) (envelope-from kib@kib.kiev.ua) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u0H3hFuX097709 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kib.kiev.ua; s=tom; t=1453002199; bh=vh3gUg9oKo6StODkSiGZd8lfG4yv0RgNYbRcbsui6Ls=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dMRR0SyDgCu5wRDANNTkIbWEb8hXNBbzcTcONwh5UdRJ6H8kBZe+SiMcQBlYrKB34 B7nrVl3DpeDvsRVIWUxv0mKt0vX+qc3ZiCRBIMs+A/sepl4/rnppAvZ7GG6iBiB3Th sbh9DOQXAQhRnaoNUNdtWhPnknbPVGumvrCbDAdI= Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u0H3hF2q097708; Sun, 17 Jan 2016 05:43:15 +0200 (EET) (envelope-from kib@kib.kiev.ua) X-Authentication-Warning: tom.home: kostik set sender to kib@kib.kiev.ua using -f Date: Sun, 17 Jan 2016 05:43:15 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: Vijay Singh , freebsd-hackers@freebsd.org, Chagin Dmitry Subject: Re: irrelevant locking Message-ID: <20160117034315.GN3942@kib.kiev.ua> References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E13BgyNx05feLLmH" Content-Disposition: inline In-Reply-To: <20160116224312.GA1963@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-Mailman-Approved-At: Sun, 17 Jan 2016 04:41:41 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 03:43:23 -0000 --E13BgyNx05feLLmH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > On Sat, Jan 16, 2016 at 02:08:58PM -0800, Vijay Singh wrote: > > Couldn't the get & set race otherwise? >=20 > Current locking plays no role in correctness here. >=20 > Say that locking is left in place. A concurrent setgroups (or whatever) > call resulting in setting P_SUGID is also being executed. Regardless of > whether PROC_LOCK/PROC_UNLOCK pair is in place, it can set the bit > before or after it is being tested by sys_issetugid. >=20 > In principle, the very moment you drop a lock, your informatoin is > stale. Right, this is the reason why the locking is useless. >=20 > This does not matter here. It's only the process itself which can set > the bit, so it would have to race with itself. One thread in the process executing issetugid() can race with another executing setsugid(). It is legitimate. >=20 > Finally, the bit can be only unset during execve, which cannot be > executed here - if it is being executed, there is only one thread doing > work and, well, it is doing execve. >=20 > The real question is if it would make sense to add the bit to elf aux > vector to save the call as done by the loader. I once did a pass to remove (most of) sysctls executed during process startup. issetugid indeed may be treated same. --E13BgyNx05feLLmH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWmw3TAAoJEJDCuSvBvK1BDTAP/i3TRqSzLPeFoIGrWnowQCqW eQ8mza7NnCTO9NJmAGUGJCFtRhD3BBMD0IUfKrRvLxC0rk9Bzpvnhgu+Df3EWNZk OvEeAgrTyzLQNs5NQ9MY0IlC9wlM5k3Yz+dawEy1x0/CfnOcg6DDWKrb7FYwWhAb BfVq/TCZ2AMUDP3cDTgY+9awgfMcTBppCnWWjV6TJ+R6JdEoB/IKkaoFIPkHKf2e 48bqKMtVMbB+PZd61z86K4H7PeQqA3CNTiFfrJzV7hsf1G0oEeX/q+Pc6AIYrf1Q 5WzYliHZEd8fnZhFwMZV5DjS/htd+f8zOklIaaKdFk7bQeEVKVuQmDHafRIQlZE+ DsXHe7orym/H7RQTCLbY/DuGnQblQpfupE9U7Lvetwx45S1/byxMExoPFkpfX63W emgi28vPqhctD7Yg+e1wz8ITpcX7F6oUoCrIun07YeeQ715bCUqOTuv+kxiEIa0u /ghkFQyN+mHlZ0m1SpO4zmXdcw7cFEYuODRm/0Sr9TGl3B6LOvlKNUbLvGgeFTFa ToYFRp5yQ3ev5HA1/AiKMWFeJ/scSsXXOFkgWCUGNJULwAsXuy2Go9VMUvaeErj3 JRdu/udV0NZVVLWpwM7XXJuvpEqxsYcNIJ08bL1bfe/vyPGUTWt8SuXrkBW7lToP 9uQWcT/oRVmZJVldikFQ =6zii -----END PGP SIGNATURE----- --E13BgyNx05feLLmH-- From owner-freebsd-hackers@freebsd.org Sun Jan 17 08:05:24 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 3D8CBA6A172 for ; Sun, 17 Jan 2016 08:05:24 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1663718D9 for ; Sun, 17 Jan 2016 08:05:23 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0H85IPK016537 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 17 Jan 2016 08:05:20 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0H85GvA032971 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 17 Jan 2016 11:05:16 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u0H85Fpi032970; Sun, 17 Jan 2016 11:05:15 +0300 (MSK) (envelope-from dchagin) Date: Sun, 17 Jan 2016 11:05:15 +0300 From: Chagin Dmitry To: Konstantin Belousov Cc: Mateusz Guzik , Vijay Singh , freebsd-hackers@freebsd.org Subject: Re: irrelevant locking Message-ID: <20160117080515.GA32432@chd.heemeyer.club> References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160117034315.GN3942@kib.kiev.ua> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 08:05:24 -0000 On Sun, Jan 17, 2016 at 05:43:15AM +0200, Konstantin Belousov wrote: > On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > > On Sat, Jan 16, 2016 at 02:08:58PM -0800, Vijay Singh wrote: > > > Couldn't the get & set race otherwise? > > > > Current locking plays no role in correctness here. > > > > Say that locking is left in place. A concurrent setgroups (or whatever) > > call resulting in setting P_SUGID is also being executed. Regardless of > > whether PROC_LOCK/PROC_UNLOCK pair is in place, it can set the bit > > before or after it is being tested by sys_issetugid. > > > > In principle, the very moment you drop a lock, your informatoin is > > stale. > Right, this is the reason why the locking is useless. Thank you, guys, for your response. > > > > > This does not matter here. It's only the process itself which can set > > the bit, so it would have to race with itself. > One thread in the process executing issetugid() can race with another > executing setsugid(). It is legitimate. > > > > > Finally, the bit can be only unset during execve, which cannot be > > executed here - if it is being executed, there is only one thread doing > > work and, well, it is doing execve. > > > > The real question is if it would make sense to add the bit to elf aux > > vector to save the call as done by the loader. > I once did a pass to remove (most of) sysctls executed during process > startup. issetugid indeed may be treated same. like a Linux AT_SECURE? our P_SUGID bit can be changed after exec, so the result of issetugid() implementated on auxv table will be unnafected by calls to setuid(), setgid() or other such calls. From owner-freebsd-hackers@freebsd.org Sun Jan 17 08:24:44 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 507D0A6A8E6 for ; Sun, 17 Jan 2016 08:24:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 DA808115D; Sun, 17 Jan 2016 08:24:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id b14so80897728wmb.1; Sun, 17 Jan 2016 00:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=invnWqP1yO6u9TkkIYlFNyOMtwl2G4YoQlmKeuxEP5U=; b=JFJUsI80KeaU+knfTIHcHX95ZXxowtCx1lQztQaFh/R5I6TTIQOxDJEkb2dsdlr/1C dihgFDdK+eq/u2mrrfx6KCc8D8pGjCMUi8z/u07KnxmspfA4Gm5DLqlfbO4H+oGERLlZ 0kvN9XQiqdcRc8Plb7UawaxOF7+vTfgWI6H44BEHearJ6/LjpuWayL4h6/KArOPWTZq0 AVvncbNBUo+z0JueR4svqWJpL1Nxvm4Qjc9dQm+YaTQYuvrsVwegZc0LeC4jiPOpx8yB NEtEUqwkK8FChffxkIQnCOTfm1vHXVEH2bNUT9/2ZklY3nXuKwKg6iPn3dYMzvviRIbW Iztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=invnWqP1yO6u9TkkIYlFNyOMtwl2G4YoQlmKeuxEP5U=; b=YL9vQqCf25eKZAyrsOHBfJ1XOsjQI3EDUEE64JWtXUa8sh6MNKrbSdlskNbFKYXaX2 6eYZaePUQ4iI6RiOsVqqyh31IqfDZTQLy8/9wwc1XEgMKYLMUDXWgb53zMw0UEa4PqyF WZRasN+67xtvzpOgbZ0NLLtAEJeSAX7VDnBKAt3PJrsxHDgv3pgfyUssbenUWN8C7nCb URaLbQVZ4ygzYDvfg+f8IKWmAnnAkd51vHEYqfL4JDN5E4jjs22xee4vGlGReNYbyJRd 5I/FwMbRsF32RbO2+lyZeWFCucqOgkGBUhH9QsuPzkUsbibj/BttCsjobzVDmsCEUdkl Wylg== X-Gm-Message-State: AG10YOQLTqJlNUrv1TThZpb6qd3g1IJkKMq/q/FHas5veziR7tRH/uSSanOUyMojsSAQ0A== X-Received: by 10.28.35.6 with SMTP id j6mr7456273wmj.80.1453019082446; Sun, 17 Jan 2016 00:24:42 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id lx4sm18271645wjb.5.2016.01.17.00.24.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 17 Jan 2016 00:24:41 -0800 (PST) Date: Sun, 17 Jan 2016 09:24:40 +0100 From: Mateusz Guzik To: Konstantin Belousov Cc: Vijay Singh , freebsd-hackers@freebsd.org, Chagin Dmitry Subject: Re: irrelevant locking Message-ID: <20160117082439.GB1963@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org, Chagin Dmitry References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160117034315.GN3942@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 08:24:44 -0000 On Sun, Jan 17, 2016 at 05:43:15AM +0200, Konstantin Belousov wrote: > On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > > On Sat, Jan 16, 2016 at 02:08:58PM -0800, Vijay Singh wrote: > > > Couldn't the get & set race otherwise? > > > > Current locking plays no role in correctness here. > > > > Say that locking is left in place. A concurrent setgroups (or whatever) > > call resulting in setting P_SUGID is also being executed. Regardless of > > whether PROC_LOCK/PROC_UNLOCK pair is in place, it can set the bit > > before or after it is being tested by sys_issetugid. > > > > In principle, the very moment you drop a lock, your informatoin is > > stale. > Right, this is the reason why the locking is useless. > > > > > This does not matter here. It's only the process itself which can set > > the bit, so it would have to race with itself. > One thread in the process executing issetugid() can race with another > executing setsugid(). It is legitimate. > I meant threads within the process would have to race. But if there are several threads doing what they want, one needs to synchronize them in userspace as there is nothing the kernel can do in this regard. But who and why would encounter such an issue with issetugid. > > > > Finally, the bit can be only unset during execve, which cannot be > > executed here - if it is being executed, there is only one thread doing > > work and, well, it is doing execve. > > > > The real question is if it would make sense to add the bit to elf aux > > vector to save the call as done by the loader. > I once did a pass to remove (most of) sysctls executed during process > startup. issetugid indeed may be treated same. Hm, looks like the code is more hairy. I'm not touching this at least for now. By the time the vector is prepared it is not known if P_SUGID is going to be set. do_execve locks and unlocks the vnode 3 times, with the first lock being exclusive. That said, when at one point only shared locking is required the code could be reorganized to save at least one lock/unlock pair and with that reorganized it would clearer what to do with it. As a side note I think current code is buggy. VOP_CLOSE is being called with only shared lock held even for filesystems without MNTK_EXTENDED_SHARED, I don't know how harmful this really is. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Sun Jan 17 08:26: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 74552A6AA54 for ; Sun, 17 Jan 2016 08:26:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 09E4114C2; Sun, 17 Jan 2016 08:26:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id 123so17931775wmz.0; Sun, 17 Jan 2016 00:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=p+b4699Ty3jpUESemCp9XDmHLpOoV0qCt/nKG+1uHMo=; b=eaJufzRFY8O9Oto2HwQoNCwzoWcITSeVOKiaBNQ7fIEIXMaBzf/S6TM5L7JIR+VxuP 8m9SlcrLIz+FhKtus0LZYa9gQgE8CMLBy1zGK+1sXAgYXf4NNAnUCkFqSHMgVAHSEKDA 33acCV7NT8tXRPl0m+sT+Mm9AIw1Pey6dkTM4mWzWlc7O4f+Byzzo6g0rAf7YJnZTxPu 4K90/BWyXx8W7ySQWy2Dqfav1iMavIFgYcmpZ/ipfZiLevFPphGY7eRuwf6HTJswFZUj D6txm7Nv0hJU8Ls6FDON5D/Dh6AUDyp7lkeaCMCYRoFRDMh28xTOwF/4f6ih5H7669j2 VFpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=p+b4699Ty3jpUESemCp9XDmHLpOoV0qCt/nKG+1uHMo=; b=DpbgRAsLrhGxkd4FaGcJ7MbVXweXI3kCEj+/deSpKRB+cqOUkMD0nTZD119a3pc8Qy WzYdvJdEm1/WF7iYecSqVNKTrg7naNFTKJGk9RumSq5U2qdZim16cta0ySdForxBmaJL zKuw7ILc1TNZbjDbX4HbrkKplIhNkw5X6UddOquz1Ns1QgiqmkXMu7ZlpXZ3vxSVy1+8 CwcJp3c+G6aNgNQpG0AibOH/qgOEIM0Tt4gY1f15eUZKQKNMQqH0Z1LaM2YxVf+r6yDA HmhgUBofdY3lFqBKJ6dhapC0iTIFxfE3SM8hZ2//yCepF7LBvN/KxPgBYYmyKyXnELXi RDUQ== X-Gm-Message-State: AG10YORe+SQzmZzeEPbLxaWtACgk0Tmw3xkM3QM7mUBQXc4lIC6c1dVeigUfgqHQtPnAHQ== X-Received: by 10.28.97.11 with SMTP id v11mr7677094wmb.42.1453019204539; Sun, 17 Jan 2016 00:26:44 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id m143sm10191002wma.17.2016.01.17.00.26.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 17 Jan 2016 00:26:44 -0800 (PST) Date: Sun, 17 Jan 2016 09:26:42 +0100 From: Mateusz Guzik To: Chagin Dmitry Cc: Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org Subject: Re: irrelevant locking Message-ID: <20160117082642.GC1963@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Chagin Dmitry , Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> <20160117080515.GA32432@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160117080515.GA32432@chd.heemeyer.club> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 08:26:46 -0000 On Sun, Jan 17, 2016 at 11:05:15AM +0300, Chagin Dmitry wrote: > On Sun, Jan 17, 2016 at 05:43:15AM +0200, Konstantin Belousov wrote: > > On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > > > The real question is if it would make sense to add the bit to elf aux > > > vector to save the call as done by the loader. > > I once did a pass to remove (most of) sysctls executed during process > > startup. issetugid indeed may be treated same. > > like a Linux AT_SECURE? our P_SUGID bit can be changed after exec, > so the result of issetugid() implementated on auxv table will be unnafected > by calls to setuid(), setgid() or other such calls. > This is only to save issetugid call done early by the loader and it is perfectly safe at that point. This definitely is not a replacement for the syscall in general. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Sun Jan 17 12:11: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 B4B89A855F7 for ; Sun, 17 Jan 2016 12:11:58 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 55FFA1BA6 for ; Sun, 17 Jan 2016 12:11:58 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: by mail-wm0-x22f.google.com with SMTP id b14so85108410wmb.1 for ; Sun, 17 Jan 2016 04:11:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=62i0IqrLVTuXHHLzzpaOEdNUYo690ya0QzXiYYYsQ0w=; b=D2UyBE3odX99VOuaEV3U8u4YuIBgNfYQRWcbmRwMw9Wd34YDBJYz1No9sFrdGF4/cK b8UsK2Oxnx6Na4Sm5cZvAxkOImXbYFsojDflo6Y5U0qNZpPRe2LpF1aoQ19jlcH9Y+jF e7j+Vh9ijRiKKAdthY9YsDdVGrRa/SL1FBXLgMzKeGe+ond5kzRBC/4y6/oNDalAcINZ jJ/U2V0RSThfBQ7+mCuPjXNFJ7Ier/W9167rHV8WcOWokjyunX2DPvYtc/IKW6oFmerJ S6G0zjQgtbYnBg+2k5jzeNGnGWiDtdbT50Ydgip1qCvbS+Z8STBYR11qE5T9GdgQMrbn bYpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=62i0IqrLVTuXHHLzzpaOEdNUYo690ya0QzXiYYYsQ0w=; b=YARlXNGjrlC85uegs1jCFzK5I3IzOkDtqMtwsfGtY6y4GwZLCkldOj07YYpqYitbUm 9okfKiloSZ/Mx4Pmm4zdLCKeY0m78ZGszjG8u0pjT1AmzZwCVgm4vS9xQ3pamcWFKUl+ 0jJip1R/NonynzGIWQRYp5ojd7l6WS+UCbXkg/hdrJwyUZN6IwGBDtP1PDC8iUmKQiSO 6GxWebpg52/of097GAKkleaMvKe1aLA7FKYMR6oL8tfufS/B0flPvPcRIwS0ncjX3Dz3 cP29PHy0l0lG7eywVmfCjJAeUH7+vk5YBywCiZdkFaQ8yA5LR8J+3BDCQIIjv4TO9Chv BMNw== X-Gm-Message-State: ALoCoQl60NlC/U6SkcsABfD7ukyNMid5M75WGn2G2sN/eMzEN7df9ABp2D2u78DaTXORjo1gWHYa5SH+Lk3HNTFew4/ZoGCAkQ== X-Received: by 10.194.205.103 with SMTP id lf7mr18518723wjc.147.1453032715888; Sun, 17 Jan 2016 04:11:55 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id 198sm10965663wml.22.2016.01.17.04.11.54 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jan 2016 04:11:54 -0800 (PST) Subject: Re: EFI/ZFS Update: successful tests, need more complex vdevs To: freebsd-hackers@freebsd.org References: <20160116131529.GA59919@mutt-hardenedbsd> From: Steven Hartland Message-ID: <569B8521.4010906@multiplay.co.uk> Date: Sun, 17 Jan 2016 12:12:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160116131529.GA59919@mutt-hardenedbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 12:11:58 -0000 On 16/01/2016 13:15, Shawn Webb wrote: > On Sat, Jan 16, 2016 at 12:59:54PM +0000, Gabor Radnai wrote: >> Hi, >> >> I tried to check HardenedBSD for EFI + ZFS on root but the installer says >> this combo is not supported. What am I missing? > The "zfs auto install" part of bsdinstall still needs to be updated to > know about the new ZFS UEFI support. The manual partition selection > (which is called SADE) supports it, but you won't get ZFS BE support by > using that. I talked with Allan Jude a little bit about it and he > inferred that he's working on zfs auto install support (though > "inferred" doesn't mean he actually is). This is in review here: https://reviews.freebsd.org/D4960 Regards Steve From owner-freebsd-hackers@freebsd.org Sun Jan 17 08:30:13 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 D4363A6AB7C for ; Sun, 17 Jan 2016 08:30:13 +0000 (UTC) (envelope-from kib@kib.kiev.ua) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE251628; Sun, 17 Jan 2016 08:30:12 +0000 (UTC) (envelope-from kib@kib.kiev.ua) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u0H8U7iH065533 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 17 Jan 2016 10:30:08 +0200 (EET) (envelope-from kib@kib.kiev.ua) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u0H8U7iH065533 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kib.kiev.ua; s=tom; t=1453019411; bh=/WkNr7gjPwudnE5cgOVyx55G+y5puKFxyXKL6M4itsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oDHeMigqemwzUnVKIhsfA9qGgG6Du17br2bi0umfMhObHAaPPXXlvrJcbva3E3CVz XbzQ7L6Fk7bbBnR8PbiK7NCKqh2V1uCFuAiMJuCQv5yYLkGDdvrpYHOSCXCysWvttt xFZTYfP9PWxY7u7frJYYUfZqt1w7yjapog0/NQNA= Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u0H8U7vH065532; Sun, 17 Jan 2016 10:30:07 +0200 (EET) (envelope-from kib@kib.kiev.ua) X-Authentication-Warning: tom.home: kostik set sender to kib@kib.kiev.ua using -f Date: Sun, 17 Jan 2016 10:30:07 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: Vijay Singh , freebsd-hackers@freebsd.org, Chagin Dmitry Subject: Re: irrelevant locking Message-ID: <20160117083007.GQ3942@kib.kiev.ua> References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> <20160117082439.GB1963@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k4f25fnPtRuIRUb3" Content-Disposition: inline In-Reply-To: <20160117082439.GB1963@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-Mailman-Approved-At: Sun, 17 Jan 2016 12:42:44 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 08:30:13 -0000 --k4f25fnPtRuIRUb3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jan 17, 2016 at 09:24:40AM +0100, Mateusz Guzik wrote: > As a side note I think current code is buggy. VOP_CLOSE is being called > with only shared lock held even for filesystems without > MNTK_EXTENDED_SHARED, I don't know how harmful this really is. Generally LK_EXCLUSIVE for VOP_CLOSE() is only needed when closing for write. Look at the vn_close() selection of the lock mode as an example. --k4f25fnPtRuIRUb3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWm1EPAAoJEJDCuSvBvK1BYkUP/j6L/TyCEasep58e8rQfJGv/ KRnh+coSW2aui+udASebtY/DvemBG8v2M2YdYb4X/L0ejqCh1zvgrz9XKqvUp4H6 rGVE3GKNKfB2tWdFl3D0PhbAirZkaoPYdj/Jhy8rDh6MKKicNRAzaDYmej2FvpqZ ft95/ht8FCZORNUiFsyL2XnHYV4baBbQrqd0L18tTizNG/TQ3qXJziu+0YZbt/V3 krbxeHwWoeyzHeqtRYRNFeIER1WBU1guVxDHIVt3qoYe4DR6ZEEMIAk0PyPR6fEE V3QoA6sgM2G65azKqnJrn66hSz/ZF2hcTWIxOOwRveLghx5VjIMSVUhab+9soY02 YC6jNXUlQksMGgtD99pZXF3s4kPsZcPTc3SrPdCLfr+de0xIu8q73eUC3pRUvIWD BNiBqpvDbS8Pv7D/WN+YBfswLAC21aOQtP2pb8A798gpB7Q5lL2ovTmza9tarm+Y nUy5mQqu2LHASjcFSbMh/3Wtr3hD0mEKKgjMUlWNre9GTeZZF3TEglMcEi7hXjRf VQ4gEM5U85+1A5dKHZU72rH6Wjro2GiFmHgdrXxT5QyVBEGB2c231U/zbPiBcg0U z1etSYvzzkr+AEVc+pdeYBEBFs9QsklTr0N+Hhv2EVeopmDfTFhncHbZisUl79Xe nqoK56zvD3gnHqZ+63Nv =cdFW -----END PGP SIGNATURE----- --k4f25fnPtRuIRUb3-- From owner-freebsd-hackers@freebsd.org Sun Jan 17 15:07: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 98ECAA859E9 for ; Sun, 17 Jan 2016 15:07:27 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7209A10B8 for ; Sun, 17 Jan 2016 15:07:26 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0HF7Gfs017571 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 17 Jan 2016 15:07:17 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u0HF7E3u001727 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 17 Jan 2016 18:07:15 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u0HF7ExO001726; Sun, 17 Jan 2016 18:07:14 +0300 (MSK) (envelope-from dchagin) Date: Sun, 17 Jan 2016 18:07:13 +0300 From: Chagin Dmitry To: Mateusz Guzik , Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org Subject: Re: irrelevant locking Message-ID: <20160117150713.GA1688@chd.heemeyer.club> References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> <20160117080515.GA32432@chd.heemeyer.club> <20160117082642.GC1963@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160117082642.GC1963@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 15:07:27 -0000 On Sun, Jan 17, 2016 at 09:26:42AM +0100, Mateusz Guzik wrote: > On Sun, Jan 17, 2016 at 11:05:15AM +0300, Chagin Dmitry wrote: > > On Sun, Jan 17, 2016 at 05:43:15AM +0200, Konstantin Belousov wrote: > > > On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > > > > The real question is if it would make sense to add the bit to elf aux > > > > vector to save the call as done by the loader. > > > I once did a pass to remove (most of) sysctls executed during process > > > startup. issetugid indeed may be treated same. > > > > like a Linux AT_SECURE? our P_SUGID bit can be changed after exec, > > so the result of issetugid() implementated on auxv table will be unnafected > > by calls to setuid(), setgid() or other such calls. > > > > This is only to save issetugid call done early by the loader and it is > perfectly safe at that point. > > This definitely is not a replacement for the syscall in general. > ah, I understood, thanks. From owner-freebsd-hackers@freebsd.org Mon Jan 18 03:19: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 ACA8BA85DB5 for ; Mon, 18 Jan 2016 03:19:21 +0000 (UTC) (envelope-from jmaloney@pcbsd.org) Received: from barracuda.ixsystems.com (mail.ixsystems.com [69.198.165.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.ixsystems.com", Issuer "Go Daddy Secure Certificate Authority - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8561EC1 for ; Mon, 18 Jan 2016 03:19:21 +0000 (UTC) (envelope-from jmaloney@pcbsd.org) X-ASG-Debug-ID: 1453087157-08ca042abc11a20002-P5m3U7 Received: from [10.0.1.13] (ip72-209-162-1.ks.ks.cox.net [72.209.162.1]) by barracuda.ixsystems.com with ESMTP id 8B8cM32gclo9vThb (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 17 Jan 2016 19:19:19 -0800 (PST) X-Barracuda-Envelope-From: jmaloney@pcbsd.org X-Barracuda-AUTH-User: jmaloney@pcbsd.org X-Barracuda-Apparent-Source-IP: 72.209.162.1 Subject: Re: EFI/ZFS Update: successful tests, need more complex vdevs To: freebsd-hackers@freebsd.org X-ASG-Orig-Subj: Re: EFI/ZFS Update: successful tests, need more complex vdevs References: <20160116131529.GA59919@mutt-hardenedbsd> <569B8521.4010906@multiplay.co.uk> From: Joe Maloney Message-ID: <569C59B7.2020905@pcbsd.org> Date: Sun, 17 Jan 2016 21:19:19 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <569B8521.4010906@multiplay.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ip72-209-162-1.ks.ks.cox.net[72.209.162.1] X-Barracuda-Start-Time: 1453087158 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.2.0.41:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ixsystems.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26227 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 03:19:21 -0000 I can confirm the D4960 diff fixes up bsdinstall for me. Works well. Joe Maloney On 01/17/16 06:12, Steven Hartland wrote: > > > On 16/01/2016 13:15, Shawn Webb wrote: >> On Sat, Jan 16, 2016 at 12:59:54PM +0000, Gabor Radnai wrote: >>> Hi, >>> >>> I tried to check HardenedBSD for EFI + ZFS on root but the installer >>> says >>> this combo is not supported. What am I missing? >> The "zfs auto install" part of bsdinstall still needs to be updated to >> know about the new ZFS UEFI support. The manual partition selection >> (which is called SADE) supports it, but you won't get ZFS BE support by >> using that. I talked with Allan Jude a little bit about it and he >> inferred that he's working on zfs auto install support (though >> "inferred" doesn't mean he actually is). > This is in review here: https://reviews.freebsd.org/D4960 > > Regards > Steve > _______________________________________________ > 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 Mon Jan 18 09:29: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 62376A87CAE for ; Mon, 18 Jan 2016 09:29:29 +0000 (UTC) (envelope-from mmatalka@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 EED271C31 for ; Mon, 18 Jan 2016 09:29:28 +0000 (UTC) (envelope-from mmatalka@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id b14so112700066wmb.1 for ; Mon, 18 Jan 2016 01:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ep2P3l+GoiJKQXvHZwV1ynH+PFnKGWCyHk9VC6Eybpo=; b=F7GOj9eEJXCQs2hnSFxkKYOzyWYxC87YgkA68+gDeRflxOe9JR3bQefRN3GnKylzNu Y4IALFQ6jZ+/Xz1IPZSVfMW5e6cR6E2Vl3VR073fSvuH51/RbGR6D8DErOPmTYqX3/7q s3H4OFWeSrh+211IE7Aw/BARlsOW+zwjkcDNiE04/rnPHahhH+W4/n/y748QgOV5gx+l rrvJolLYK1MKMimCSjjdmd50Ub8PYMH0JxD8caSSX8gKwra8c7sEiKvX5LEYASnnKUl/ +QwI0FOf9dPjicaCWYaA8fDVrpMfMRa2Jwreqkx9li5rp5j9mqY5k4SCbrd8RkTK9baZ 1CjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ep2P3l+GoiJKQXvHZwV1ynH+PFnKGWCyHk9VC6Eybpo=; b=UG5IDDUS46sYAiunV126GZj6WR4aflYUSsteAf8N+bNbOqL3A6fo7P+ajgtY7u98Fz XzVrBSqPyRlDOawQNPMO1dpX69QMvL2N42bZvbAjr96uspg9aWPyOH4SwHhNdzsInQUe cABotaTC8vJ6tREShC3qEmYQ4+nNm28o95aotvxy6g89/CXJxhYGS/f8pebYed0CUt5h rbtkAMEXCCcGEWmPGELSlH7dhIxNlghDWFBX99tcFsnnZmOMjVUmlPOSsIC+QjhV71qf s3utypSizFWzkV2ErHP79sYNQcyNhrdX+1KDLQ2kWNQRXRKaToowP3cMkOh/hNUUEpE9 sGfA== X-Gm-Message-State: AG10YORk1W88YO6XYaTMk/J2RAClbO2dN6OxJQCKWUV+gffzCLQWsgNG16X7ISyGhHNLWg== X-Received: by 10.28.3.134 with SMTP id 128mr11312346wmd.92.1453109367457; Mon, 18 Jan 2016 01:29:27 -0800 (PST) Received: from localhost (li195-236.members.linode.com. [178.79.139.236]) by smtp.gmail.com with ESMTPSA id gl10sm22916490wjb.30.2016.01.18.01.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jan 2016 01:29:26 -0800 (PST) From: Malcolm Matalka To: Yuri Cc: "Montgomery-Smith\, Stephen" , "freebsd-hackers\@freebsd.org" Subject: Re: How to send EOF to the popen(3) pipe? References: <5699BAC9.3060407@rawbw.com> <5699C8AB.7070006@missouri.edu> <569A8508.80908@rawbw.com> Date: Mon, 18 Jan 2016 09:29:23 +0000 In-Reply-To: <569A8508.80908@rawbw.com> (yuri@rawbw.com's message of "Sat, 16 Jan 2016 09:59:36 -0800") Message-ID: <86bn8jme18.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 09:29:29 -0000 Yuri writes: > On 01/15/2016 20:35, Montgomery-Smith, Stephen wrote: >> Maybe I am displaying my ignorance. But wouldn't you do this by >> invoking the function pclose? > > No, pclose kills the process and returns the exit code. Half-closed connection though can be alive for a while, until the other side > finishes and closes the pipe. The manpage claims that pclose waits for the process to finish and returns its exit code, is this not true? """ The pclose() function waits for the associated process to terminate and returns the exit status of the command as returned by wait4(2). """ > >> My memory of using this was that this could gridlock because of >> buffering. Suppose process A popens a process B. A sends a message to > > Gridlocks are possible if reads/writes are performed in the wrong order. But this is besides the point of the original question. > > I think the answer to my question is "no". popen(3) can't send EOF. Protocol needs to support EOF signal on the application-level. > > Yuri > _______________________________________________ > 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 Mon Jan 18 15:50: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 5312BA87ED5 for ; Mon, 18 Jan 2016 15:50:23 +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 40AF71E1D for ; Mon, 18 Jan 2016 15:50:22 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u0IFoFoq044161 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 18 Jan 2016 07:50:16 -0800 (PST) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128] claimed to be yuri.doctorlan.com Subject: Re: How to send EOF to the popen(3) pipe? To: Malcolm Matalka References: <5699BAC9.3060407@rawbw.com> <5699C8AB.7070006@missouri.edu> <569A8508.80908@rawbw.com> <86bn8jme18.fsf@gmail.com> Cc: "freebsd-hackers@freebsd.org" From: Yuri Message-ID: <569D09B8.6030307@rawbw.com> Date: Mon, 18 Jan 2016 07:50:16 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <86bn8jme18.fsf@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:50:23 -0000 On 01/18/2016 01:29, Malcolm Matalka wrote: > The manpage claims that pclose waits for the process to finish and > returns its exit code, is this not true? This is true, but EOF is different. In the case of the network connection, one can send EOF (call shutdown(2)), and then keep reading from the socket. With popen(3) this isn't possible. pclose(3) just closes and finishes the pipe. Yuri From owner-freebsd-hackers@freebsd.org Tue Jan 19 17:21: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 9C594A8679C; Tue, 19 Jan 2016 17:21:59 +0000 (UTC) (envelope-from superbisquit@gmail.com) Received: from mail-vk0-x232.google.com (mail-vk0-x232.google.com [IPv6:2607:f8b0:400c:c05::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 57D471D12; Tue, 19 Jan 2016 17:21:59 +0000 (UTC) (envelope-from superbisquit@gmail.com) Received: by mail-vk0-x232.google.com with SMTP id k1so352126535vkb.2; Tue, 19 Jan 2016 09:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uig4UZEJL3qzwo5qRCeidMHRIjk/K/R67+O/0MKaaI8=; b=ETgI2O6HxaeThk9amnjrqpsNVRtvicKdqWHjKOK5iThhTlDuAwihBzFFmfKRjF3BXi kGRRlDAkC7c6D3wNPfJVTVBArtvn04kGgF/wKPJqX8VBsiRKlu9xMlf1G2+4iK8D5r/a 2lZpB8nQXo9yFa+wwSIfN0GRuG5Mwb4HdDoF5/xqrHIel6yLPxxssVi7bi3rvhbc3O/8 aLlwbo07ODV7jWfwYlUWdRn6JGQVyYdNKpGOaPArNBkutJ7qZwbYNFGL0e9ONiV2o6d0 G1jv+UIK8qGVCOTxaiXE+qrnphxeMofQBpAEPtFy4fBKs+z8ryaI3JJEyRbiyDJfCvq1 tYCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=uig4UZEJL3qzwo5qRCeidMHRIjk/K/R67+O/0MKaaI8=; b=gibwaJ17B/sLvBc4iJJXGoyJxCL7y0ybQaQM5Lir+nQLgtO+pzpPPuRMEQZ/nOEojK sIUa9zeRGnBJD2kekMkABxCgfqsZz43Hzev9LnWu9cKmvCRl7KwNL3Tg+AHUACs6VwdI TCkKda8qTZwQ4ynjd3234opStcuVzqZjWRPHiDTdcK4Lu8mrw3MRPgzeSxBbmQZEO3VG eXdtE+oOPiBa9JC3f3lkBl9z9fUAhxL/eZFHL1/12d0abi/qM9+NjI7GXer1xxiz4Mqu /biZ1PsFr5+9m/5O8yEMOLUgrvAW4dUMrycA1mRazEnWaKOuNKK40IkZN9LoGnXq8W0z aLNA== X-Gm-Message-State: ALoCoQl4H+f97pyiJLnKcJpnZRM91+/jrcC4jK+ZeGkcrOIJwkWr6vas1SZ8InoYIPVib6k8ZvJ7ZLEDeYmcgAZJv1hmmPyRXQ== MIME-Version: 1.0 X-Received: by 10.31.153.11 with SMTP id b11mr20767907vke.127.1453224118504; Tue, 19 Jan 2016 09:21:58 -0800 (PST) Received: by 10.103.37.196 with HTTP; Tue, 19 Jan 2016 09:21:58 -0800 (PST) Date: Tue, 19 Jan 2016 12:21:58 -0500 Message-ID: Subject: Now I am aware From: Joe Nosay To: FreeBSD PowerPC ML , postmaster@freebsd.org, FreeBSD Hackers , ports , Team Open Source PowerPC Notebook project , Tomasz CEDRO , Tomasz CEDRO , Michael Copeland Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 17:21:59 -0000 of how self-centered and selfish all of you are. https://forums.freebsd.org/threads/making-it-public.54392/#post-309037 From owner-freebsd-hackers@freebsd.org Tue Jan 19 17:55:02 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 7BA91A877DB; Tue, 19 Jan 2016 17:55:02 +0000 (UTC) (envelope-from jerrymc@jerrymc.net) Received: from jerrymc.net (jerrymc.net [75.75.214.34]) (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 43B2B10D8; Tue, 19 Jan 2016 17:55:01 +0000 (UTC) (envelope-from jerrymc@jerrymc.net) Received: from jerrymc.net (localhost [127.0.0.1]) by jerrymc.net (8.14.5/8.14.5) with ESMTP id u0JHmBsw017239; Tue, 19 Jan 2016 12:48:11 -0500 (EST) (envelope-from jerrymc@jerrymc.net) Received: (from jerrymc@localhost) by jerrymc.net (8.14.5/8.14.5/Submit) id u0JHmBl8017238; Tue, 19 Jan 2016 12:48:11 -0500 (EST) (envelope-from jerrymc) Date: Tue, 19 Jan 2016 12:48:11 -0500 From: Jerry McAllister To: Joe Nosay Cc: FreeBSD PowerPC ML , postmaster@freebsd.org, FreeBSD Hackers , ports , Team Open Source PowerPC Notebook project , Tomasz CEDRO , Tomasz CEDRO , Michael Copeland Subject: Re: Now I am aware Message-ID: <20160119174811.GA17229@jerrymc.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 17:55:02 -0000 On Tue, Jan 19, 2016 at 12:21:58PM -0500, Joe Nosay wrote: > of how self-centered and selfish all of you are. > This is a useless post. ////jerry > > > https://forums.freebsd.org/threads/making-it-public.54392/#post-309037 > _______________________________________________ > 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 Wed Jan 20 09:25:54 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 46875A8A318; Wed, 20 Jan 2016 09:25:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (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 19D5D111E; Wed, 20 Jan 2016 09:25:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x233.google.com with SMTP id ho8so1869196pac.2; Wed, 20 Jan 2016 01:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=JWiun5ChLJGYQSAwiDZamXfF+6ilWAZJ8h7WpmNtimk=; b=VplEy1a3h6eDbMxvZNWFnvVPr58qYJoGq9SN6SnYIoMO9Q5JPS8j5FH62mSSmycYZ9 QWxITP8n/cOGX3PiUZFxyqrkavtyRjFmP2D7OHQH4RERSbPYkLq0TrgByw/uamkJQA9+ 2mPhZtx95/7B/pAynzJCzGiWBRWz1hD7r2ALkH2Ibv2Z7jRB9cyk1bkUwMQkhWejSB3p SGDXi7vwznCPgW+o4REFUB6ruIpsF59avhT6jQR0DlEdcQlGObdelrJXbxiP0+EYAdxG 46ylLK08g13s3k+2eco4UJufn5s5FvqZdczqp70rszWzaLJ7ck5y7iaOhdjYuPZtle8G ty2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=JWiun5ChLJGYQSAwiDZamXfF+6ilWAZJ8h7WpmNtimk=; b=RmO9SNtKmHfFVjbH8ju9qv8fp8kk+4Nz/HNqVeJfYfTbvdbXwO2MvzT1NWLmtJEx+y VSRZ7+p71Aaj7/aQ7DfK7BF6Ql0sU1/TFk9x2cCOK2dxX/t9NJKcKN7PVy228aAjyeto X7zot7l62oFCPPcyZu/FJP2FSrsoHlmCA6KTrkDLwliTOkPLt9b4jqb6xjS9+1bahtBm 68hrhYICvH+3wMutFFYigFlVzcN1M/swCHCQ15v8V+eJNP3jZ+nDPA05QuRQkzJLNOAh qtOXVL1fCPa90/3Qicy5/t5OWrUx3EAXFXdmyBvHzLZ+oWbHN/RplkyY+bU09byvNk7U nf9A== X-Gm-Message-State: AG10YOQwbbMm6U/q3lnERVr+Es6TK5MLH5AtYmtOjHHynAH9KBf2QcmiBi0tUnIPryQbyQ== X-Received: by 10.66.62.195 with SMTP id a3mr33173248pas.8.1453281953695; Wed, 20 Jan 2016 01:25:53 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:ed5d:a:1763:4637? ([2601:601:800:126d:ed5d:a:1763:4637]) by smtp.gmail.com with ESMTPSA id 7sm47188562pfn.89.2016.01.20.01.25.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jan 2016 01:25:52 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Now I am aware From: NGie Cooper In-Reply-To: Date: Wed, 20 Jan 2016 01:25:51 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7A90BDBB-2311-4B9D-9C43-BD4B8A128DFA@gmail.com> References: To: Joe Nosay X-Mailer: Apple Mail (2.2104) X-Mailman-Approved-At: Wed, 20 Jan 2016 12:25:02 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 09:25:54 -0000 > On Jan 19, 2016, at 09:21, Joe Nosay wrote: >=20 > of how self-centered and selfish all of you are. (Removing @FreeBSD.org hat and also removing some of the individuals on = the mailing lists and moving the public mailing lists to BCC) Hi Joe, It=E2=80=99s difficult proposing things like you are and have = been in the past (especially when the world is very much driven by = currency). I thought that the idea was a noble social endeavor, even if = it was a bit rough planning wise to commit resources to in what you had = presented. The FreeBSD community (in and of itself) has a limited number = of resources tackling several issues on multiple fronts (many of which = might be encouraged/driven by our employers), and not all of us might = have your interests and ideas in mind for FreeBSD (diversity of = thought). My focus and interests in FreeBSD are stability, quality of = the operating system, testing, repeatability, etc. My days of tinkering = with Unix on a desktop or laptop (anything non-ChromeOS, non-OSX, or = non-Windows, e.g. FreeBSD, Linux, OpenSolaris) came to an end a couple = years ago because I=E2=80=99ve found that running Unix (in particular = X.org based Unix) is a time sink that I no longer am interested in = committing to (I=E2=80=99ve run Fedora/Gentoo Linux on desktops/laptops = with limited success as well as FreeBSD with limited success on laptops = over the years [*]), especially when other vendors (Adobe in particular) = look at Unix and decide to decommission support for their products. Outside of my =E2=80=9C9-5=E2=80=9D (in reality 10+ hour days), = I focus on friends and social and political issues that have been = impacting communities that I=E2=80=99m a part of (LGBT issues, = #blacklivesmatter issues, housing issues in Seattle, etc), as well as = myself personally (self-care is a good thing to practice to avoid = emotional, mental, and/or physical burnout). Like I recommended before in private, I think you need to find = the right audience of people who understand and have similar interests = in what you=E2=80=99re trying to achieve in order to discuss and = cultivate your ideas with, and bring it to the maturity that it needs to = be at in order to be accepted and adopted. Having a team of advocates to = work with will help with your endeavor. What you=E2=80=99ve proposed = before is not a simple undertaking: it involves several moving parts = that aren=E2=80=99t currently available as well as a vision to drive = these from design to end-result, unless you have an engineering = organization that you can fund (or lots of sports drinks and long = sleepless nights to commit to in order to achieve the work=E2=80=A6 but = beware =E2=80=94 this leads to burnout). I really hope whatever living situation you=E2=80=99re dealing = with improves. I can empathize with it having been exposed to several = friends and acquaintances who=E2=80=99ve been at the short end of the = stick lately housing wise in the Seattle area. Take care and I wish you the best, whatever the outcome. -NGie * The best laptop experience I=E2=80=99ve ever had was FreeBSD on an = ASUS Netbook 4 years ago, which (unfortunately) was completely = underpowered and underspec=E2=80=99ed (all of my other laptop = experiences have been utter failures due to proprietary drivers, lack of = suspend/resume, reliable wireless support, etc). It couldn=E2=80=99t = build FreeBSD ports reasonably, and the wired NIC port wouldn=E2=80=99t = properly reset the PHY every time I unplugged the cable on it (so once I = unplugged the CAT6 cable it would stop transmitting data). Eventually I = donated the Netbook to someone else because I had far too many computers = to split my attention between. On the bright side, I got it to do source = builds, wireless, suspend and resume (on i386 which was unheard of back = then=E2=80=A6 thanks jkim@!!), and fluxbox on a tiny 12=E2=80=9D screen = =E2=80=94 which was better than PCBSD at the time :)!= From owner-freebsd-hackers@freebsd.org Thu Jan 21 12:08:52 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 609AFA8A305 for ; Thu, 21 Jan 2016 12:08:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 563A41616; Thu, 21 Jan 2016 12:08:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA23346; Thu, 21 Jan 2016 14:08:48 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1aME2i-0007as-F0; Thu, 21 Jan 2016 14:08:48 +0200 Subject: Re: How to get anything useful out of kgdb? To: John Baldwin References: <554E41EE.2010202@ignoranthack.me> <1595419.L0rkNTMkPe@ralph.baldwin.cx> <560EF73A.8050505@FreeBSD.org> <16207260.7oBjvc4tcM@ralph.baldwin.cx> Cc: Ryan Stone , "freebsd-hackers@freebsd.org" From: Andriy Gapon Message-ID: <56A0CA17.7030204@FreeBSD.org> Date: Thu, 21 Jan 2016 14:07:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <16207260.7oBjvc4tcM@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 12:08:52 -0000 On 08/01/2016 22:05, John Baldwin wrote: > So I figured out why newer kgdb wasn't unwinding through NULL function pointer > traps yesterday. I'm not sure if the fix will help with your case as well, > but it might be worth trying. The changes are in > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206044 Thank you very much! It does help in my case: (kgdb) bt #0 doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:291 #1 0xffffffff8063453f in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:359 #2 0xffffffff80634ba4 in vpanic (fmt=, ap=) at /usr/src/sys/kern/kern_shutdown.c:635 #3 0xffffffff806348a3 in panic (fmt=) at /usr/src/sys/kern/kern_shutdown.c:568 #4 0xffffffff8041bba7 in db_panic (addr=, have_addr=, count=, modif=) at /usr/src/sys/ddb/db_command.c:473 #5 0xffffffff8041b67b in db_command (last_cmdp=, cmd_table=0x0, dopager=) at /usr/src/sys/ddb/db_command.c:440 #6 0xffffffff8041b524 in db_command_loop () at /usr/src/sys/ddb/db_command.c:493 #7 0xffffffff8041de0b in db_trap (type=, code=) at /usr/src/sys/ddb/db_main.c:251 #8 0xffffffff80669de8 in kdb_trap (type=19, code=0, tf=0xffffffff80f976d0 ) at /usr/src/sys/kern/subr_kdb.c:653 #9 0xffffffff80820d26 in trap (frame=0xffffffff80f976d0 ) at /usr/src/sys/amd64/amd64/trap.c:381 #10 #11 0xffffffff80619e1f in __mtx_assert (c=, what=, file=, line=) at /usr/src/sys/kern/kern_mutex.c:842 #12 0xffffffff807fef86 in vm_reserv_free_page (m=0xfffff80229e07cc0) at /usr/src/sys/vm/vm_reserv.c:832 #13 0xffffffff807f2b96 in vm_page_free_toq (m=0xfffff80229e07cc0) at /usr/src/sys/vm/vm_page.c:2432 #14 0xffffffff807f2e4d in vm_page_free (m=0xffffffff81129198 ) at /usr/src/sys/vm/vm_page.c:962 #15 0xffffffff821c28e2 in ttm_bo_vm_fault (vm_obj=0xfffff8021fcdeb00, offset=5304320, prot=, mres=0xfffffe02b8357050) at /usr/src/sys/modules/drm2/drm2/../../../dev/drm2/ttm/ttm_bo_vm.c:269 #16 0xffffffff807d4fd3 in dev_pager_getpages (object=0xfffff8021fcdeb00, ma=0xfffffe02b8357050, count=1, reqpage=0) at /usr/src/sys/vm/device_pager.c:321 #17 0xffffffff807f9d67 in vm_pager_get_pages (object=0xfffff8021fcdeb00, m=0xfffffe02b8357050, count=1, reqpage=0) at /usr/src/sys/vm/vm_pager.c:291 #18 0xffffffff807e0d84 in vm_fault_hold (map=0xfffff8001dd57000, vaddr=34729947136, fault_type=2 '\002', fault_flags=0, m_hold=0x0) at /usr/src/sys/vm/vm_fault.c:672 #19 0xffffffff807e05ee in vm_fault (map=0xfffff8001dd57000, vaddr=, fault_type=2 '\002', fault_flags=0) at /usr/src/sys/vm/vm_fault.c:277 #20 0xffffffff80821342 in trap_pfault (frame=0xfffffe02b8357c00, usermode=1) at /usr/src/sys/amd64/amd64/trap.c:734 #21 0xffffffff80820bda in trap (frame=0xfffffe02b8357c00) at /usr/src/sys/amd64/amd64/trap.c:326 #22 0xffffffff8082154a in trap_check (frame=0xfffffe02b8357c00) at /usr/src/sys/amd64/amd64/trap.c:628 #23 #24 0x00000008022b4046 in ?? () Backtrace stopped: Cannot access memory at address 0x7fffffffe7c8 See http://article.gmane.org/gmane.os.freebsd.devel.hackers/56410 for comparison. One small regression is that previously there was nmi_calltrap in the trace, now it's just "". -- Andriy Gapon From owner-freebsd-hackers@freebsd.org Thu Jan 21 13:35: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 97F6EA8BB7C for ; Thu, 21 Jan 2016 13:35:36 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx144.netapp.com (mx144.netapp.com [216.240.21.25]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA86189E for ; Thu, 21 Jan 2016 13:35:35 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,325,1449561600"; d="scan'208,217";a="93533852" Received: from hioexcmbx01-prd.hq.netapp.com ([10.122.105.34]) by mx144-out.netapp.com with ESMTP; 21 Jan 2016 05:34:24 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx01-prd.hq.netapp.com (10.122.105.34) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Jan 2016 05:34:24 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Thu, 21 Jan 2016 05:34:24 -0800 From: "Batutis, Ed" To: "freebsd-hackers@freebsd.org" Subject: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+w== Date: Thu, 21 Jan 2016 13:34:18 +0000 Deferred-Delivery: Thu, 21 Jan 2016 01:52:00 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 21 Jan 2016 14:47:13 +0000 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 13:35:36 -0000 Hi, I need to determine the number of open files in my process - all types of f= ile handles total - sockets, files, everything. Does this work reliably for that purpose? int num_open =3D 0; /* number of open files? */ kinfo_file *inf =3D kinfo_getfile(getpid(), &num_open); if ( inf ) { free(inf); } Thanks, =3DEd From owner-freebsd-hackers@freebsd.org Thu Jan 21 15:36:42 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 27E48A8A9DF for ; Thu, 21 Jan 2016 15:36:42 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C24E111CD for ; Thu, 21 Jan 2016 15:36:41 +0000 (UTC) (envelope-from joerg@britannica.bec.de) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQuEfXeSt/nWoxdY2dvuAIbsw5PvjGQjhWhvF+WPguU+l2DvPiI9bZgofE2TB X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (p20030057E21B0F000D66165F6FDDE357.dip0.t-ipconnect.de [IPv6:2003:57:e21b:f00:d66:165f:6fdd:e357]) by smtp.strato.de (RZmta 37.15 AUTH) with ESMTPSA id j056bcs0LFabpNI (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 21 Jan 2016 16:36:37 +0100 (CET) Date: Thu, 21 Jan 2016 16:36:36 +0100 From: Joerg Sonnenberger To: "Batutis, Ed" Cc: "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121153636.GA10961@britannica.bec.de> Mail-Followup-To: "Batutis, Ed" , "freebsd-hackers@freebsd.org" References: 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-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 15:36:42 -0000 On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote: > I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything. Use getdtablesize() to get the current largest known fd. If you want, you can afterwards loop and use fcntl with F_GETFD to check if the descriptor is still open. Joerg From owner-freebsd-hackers@freebsd.org Thu Jan 21 15:51:55 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 B92C2A8AFB9 for ; Thu, 21 Jan 2016 15:51:55 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 59BA41C28 for ; Thu, 21 Jan 2016 15:51:55 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id l65so225656015wmf.1 for ; Thu, 21 Jan 2016 07:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cy2xe29QRsXTGhgDseAEuCzyEaUrcmp3Ni7IJkx3HIk=; b=bvmG+IxYyuyyZ4TCUqVLu/OzklqVIqduTK9lffF/9BsKm29IdfVcn19BAH4gHELani YoYJYpymQxPOaacax7gkcvShFIY9ZEOLUdlpb61f2wJ7hPJ8X8nk6VSQAc7IP5KQekRF Jmjc7duGOQgitrP5bknr4oVHOp6kqUVcp7P0as9F8oC3TrQDYH5OFwXUmGvDIjsOUh5Y LlYaPPpCNa1S47ynMCP45GofWuCzGi4aCZLE6ibJnTRg98FCyDXo5wcpw3p/3IqY8z1L /GQEipg8xos+g7/iPPwhcFRqTzBOqJ+vVOTnRKiJqsxup8YTOn2qRSy0UDmDkIKy2oDH XuYA== 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:date :message-id:subject:from:to:content-type; bh=cy2xe29QRsXTGhgDseAEuCzyEaUrcmp3Ni7IJkx3HIk=; b=gT9WxbQ23Pmci+SXqOzzcxs/lxeEq/LzYyEA1myouLETVs3s11GWGunzQ2SN3AMl6a z9El8WEce+2JALkpdxaenAHOuQ/grubwT0/4ZQkI8kqMgKGqwj0WLqeOoRjhzKT8wAn7 RYa64B4oAoc4pme6TkzXdCbly7vccZQIbAxcjNuKPUPg767hi6erRvBqkenpNelAjWe7 VyHxgMPbeUqsU5zhuWzs2z4b6bmfhdpbrzI7mnwwjMgaS3WKmVdwX+WM1tcvd2jGlMRN He7VZgUvsVUWXCn3CifzfejX6LJKGQVCZd4k/N0C8o6tyG8dsKwKO1hYzJ1KAySyoU0j W9xA== X-Gm-Message-State: AG10YOTZNZnEN8LT4qtOz/GlsWI6xwuZ2BsrR1XlZdjzvWNsHkkntXX2M9Q/Prqi6m7F4dUg2sqBCV8IMGnNUg== MIME-Version: 1.0 X-Received: by 10.28.89.69 with SMTP id n66mr11668490wmb.63.1453391513216; Thu, 21 Jan 2016 07:51:53 -0800 (PST) Received: by 10.27.177.223 with HTTP; Thu, 21 Jan 2016 07:51:53 -0800 (PST) In-Reply-To: <20160121153636.GA10961@britannica.bec.de> References: <20160121153636.GA10961@britannica.bec.de> Date: Thu, 21 Jan 2016 16:51:53 +0100 Message-ID: Subject: Re: get number of open files in a process? From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= To: "Batutis, Ed" , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 15:51:55 -0000 On Thu, Jan 21, 2016 at 4:36 PM, Joerg Sonnenberger wrote: > On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote: >> I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything. > > Use getdtablesize() to get the current largest known fd. If you want, > you can afterwards loop and use fcntl with F_GETFD to check if the > descriptor is still open. I don't have a FreeBSD box in front of me right now, but don't we have this information in the sysctl tree? I remember we have the current system-wide open fd's... Cheers. > > Joerg > _______________________________________________ > 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 Jan 21 16: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 8453AA8B9E2 for ; Thu, 21 Jan 2016 16:16:45 +0000 (UTC) (envelope-from db@db.net) Received: from diana.db.net (diana.db.net [66.113.102.10]) by mx1.freebsd.org (Postfix) with ESMTP id 75D9B1C98 for ; Thu, 21 Jan 2016 16:16:45 +0000 (UTC) (envelope-from db@db.net) Received: from night.db.net (localhost [127.0.0.1]) by diana.db.net (Postfix) with ESMTP id D7A1F2AA5E7; Thu, 21 Jan 2016 09:16:14 -0700 (MST) Received: by night.db.net (Postfix, from userid 1000) id 9D1221CC4F; Thu, 21 Jan 2016 11:16:37 -0500 (EST) Date: Thu, 21 Jan 2016 11:16:37 -0500 From: Diane Bruce To: "Batutis, Ed" , "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121161637.GA83843@night.db.net> References: <20160121153636.GA10961@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160121153636.GA10961@britannica.bec.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 16:16:45 -0000 On Thu, Jan 21, 2016 at 04:36:36PM +0100, Joerg Sonnenberger wrote: > On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote: > > I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything. > > Use getdtablesize() to get the current largest known fd. If you want, > you can afterwards loop and use fcntl with F_GETFD to check if the > descriptor is still open. Better off using getrlimit(2) > > Joerg > _______________________________________________ > 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" > Diane -- - db@FreeBSD.org db@db.net http://www.db.net/~db From owner-freebsd-hackers@freebsd.org Thu Jan 21 16:20:13 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 3C37AA8BB2F for ; Thu, 21 Jan 2016 16:20:13 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 20EB41EBE for ; Thu, 21 Jan 2016 16:20:13 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 1B56AA8BB2A; Thu, 21 Jan 2016 16:20:13 +0000 (UTC) Delivered-To: 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 1AD8DA8BB29; Thu, 21 Jan 2016 16:20:13 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::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 9A6B61EBA; Thu, 21 Jan 2016 16:20:12 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id c192so29907966lfe.2; Thu, 21 Jan 2016 08:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=0u3tUkc6l4c4dzE9qbTbke+OZxXkklAyQ0828s8SXaU=; b=Z0ovXqNp8kSyUQtxRE3eEaItV+KC9vlP+xGN7WnSFc23sR0loGw/QUvEgAKYI0zg8n CusZeCJNoGp1v5SeKPlu6ogKWBv1ycflxk9uukds2h/cXz9vD+Qq7PZWSXGj0HrJU8iB XMO+WfVSj3NRFZ3xVSsLHQpwy3nhBco3fN4e4NHthuz1AvTNIvjOXzqyF0UZrVol2D5M PiJoKUNTP1Jt27wBW7XRPrzDsjmgHvbut8evUNLUKy1YJ+DS5oxeWUivqlNm3r6tOVgo iJ6qqLruOxQaCbLQHSmMkTzRpdH6x7z6DOQUgNSVEKCOWcZhWN/0DTuQrmdn9P5NNcb1 Q3IQ== 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:from:date:message-id:subject :to:content-type; bh=0u3tUkc6l4c4dzE9qbTbke+OZxXkklAyQ0828s8SXaU=; b=Uy0rbKX3sq/gwnfH4i2F3lcmNaP87PYXXCcBM4h9W4jcBL5RL7Um96iRHyCpH9fuXo 62YrSiD4OL3BSXhOlOsXTjRX/S+tMQKsfntQJv9InJ0hOC2Y4oSmGh6Hm4FTDqnkK1Qo W6OIS3tT2lehWfaqb4bn3Qwmk+/XioA+BvjVP6OJAHJzqqsZHA3BKQUlnN0BPHEw+GeA ndNneSwO/QIXTOC7zPQtRsjda+Q4ZwrAZwiCgINF/0glh10xWOb86oFaFFtd4/nBU8/y sDyHXnBgCLU/pLJJaDQTuF0IbEW8gzkJekItpqmV1HCfl5aRbBnauWNTl3bcJfje15+U 4LSQ== X-Gm-Message-State: ALoCoQlYOno0oeWdnsUO+xxG/gRFWb3a+62/Vy4WoeJHf0Q/HgVyJMt+swZEPqqbcVURBmgsv83rTGDiVvI6+tchjueP+FYSQg== X-Received: by 10.25.81.133 with SMTP id f127mr13873156lfb.141.1453393210516; Thu, 21 Jan 2016 08:20:10 -0800 (PST) MIME-Version: 1.0 Sender: mathieu.prevot@gmail.com Received: by 10.25.89.75 with HTTP; Thu, 21 Jan 2016 08:19:50 -0800 (PST) From: Mathieu Prevot Date: Thu, 21 Jan 2016 17:19:50 +0100 X-Google-Sender-Auth: VqlTYe2dw76L9mJ9VDS4Qu1__60 Message-ID: Subject: IoT OS To: current@freebsd.org, hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 16:20:13 -0000 Dear all, I would like to connect several connected object (with homogeneous or heterogenous hardare: intel edison, samsung artik, apple AX, intel core, etc) so the calculation needs, the storage/memory, the connection, etc are decoupled; hence we can reach an ecosystem with several clouds. How do you recommend to reach that ? from the kernel, a module, or eventually a software ? Thanks M From owner-freebsd-hackers@freebsd.org Thu Jan 21 16:25:31 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 4D8E0A8BE42 for ; Thu, 21 Jan 2016 16:25:31 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E547414C2 for ; Thu, 21 Jan 2016 16:25:30 +0000 (UTC) (envelope-from joerg@britannica.bec.de) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQuEfXeSt/nWoxdY2dvuAIbsw5PvjGQjhWhvF+WPguU+l2DvPiI9bZgofE2TB X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (p20030057E21B0F000D66165F6FDDE357.dip0.t-ipconnect.de [IPv6:2003:57:e21b:f00:d66:165f:6fdd:e357]) by smtp.strato.de (RZmta 37.15 AUTH) with ESMTPSA id 3058b5s0LGPS8sm (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 21 Jan 2016 17:25:28 +0100 (CET) Date: Thu, 21 Jan 2016 17:25:27 +0100 From: Joerg Sonnenberger To: Diane Bruce Cc: "Batutis, Ed" , "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121162527.GA11600@britannica.bec.de> Mail-Followup-To: Diane Bruce , "Batutis, Ed" , "freebsd-hackers@freebsd.org" References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160121161637.GA83843@night.db.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 16:25:31 -0000 On Thu, Jan 21, 2016 at 11:16:37AM -0500, Diane Bruce wrote: > On Thu, Jan 21, 2016 at 04:36:36PM +0100, Joerg Sonnenberger wrote: > > On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote: > > > I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything. > > > > Use getdtablesize() to get the current largest known fd. If you want, > > you can afterwards loop and use fcntl with F_GETFD to check if the > > descriptor is still open. > > Better off using getrlimit(2) I don't think the current process limit has any direct relation to the maximal open file descriptor. Joerg From owner-freebsd-hackers@freebsd.org Thu Jan 21 16:34: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 69512A8C1CF; Thu, 21 Jan 2016 16:34:30 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from smtp.rlwinm.de (smtp.rlwinm.de [IPv6:2a01:4f8:201:31ef::e]) (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 38DA21AA7; Thu, 21 Jan 2016 16:34:30 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from crest.local (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 31CEAF930; Thu, 21 Jan 2016 17:34:27 +0100 (CET) Subject: Re: IoT OS To: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org References: From: Jan Bramkamp Message-ID: <56A10892.2090308@rlwinm.de> Date: Thu, 21 Jan 2016 17:34:26 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 16:34:30 -0000 On 21/01/16 17:19, Mathieu Prevot wrote: > Dear all, > > I would like to connect several connected object (with homogeneous or > heterogenous hardare: intel edison, samsung artik, apple AX, intel core, > etc) so the calculation needs, the storage/memory, the connection, etc are > decoupled; hence we can reach an ecosystem with several clouds. > > How do you recommend to reach that ? from the kernel, a module, or > eventually a software ? Your message contains neither enough information nor a precise enough question for anyone to provide you a helpful answer. Please describe your problem in sufficient detail and reformulate your question. If you still think these mailing lists (current@ and hackers@) are a good audience for your question afterward ask them again. From owner-freebsd-hackers@freebsd.org Thu Jan 21 16:38: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 BD5C9A8C375; Thu, 21 Jan 2016 16:38:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com [IPv6:2607:f8b0:4003:c01::22b]) (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 83C351E5F; Thu, 21 Jan 2016 16:38:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x22b.google.com with SMTP id yo10so14306299obb.2; Thu, 21 Jan 2016 08:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KEd0q7kthVeO5mA8L9gFLv/ZlIdjHpNMSzgp+kxr4j8=; b=NhOt8Lx32rFQkRr4TOZVSAWY5BVfW5p4nGSg4kUPbXgHljhAIZi8WPCaJ4P1RY2LON +91P0CuxFVJuUhmO5MLFMlaBGp2QbmPQ0STvlcNmZFaLWk354o1bGlrEshPb6omLRV79 8hPCUerOfASZvnNfJ2LAwuzEgbkljCT+rmY8uwNmujEupGzYkKiT0KzpGQaTs6+SHRgu i4bKEP/SRk1gjl4QbXdmXtIKdu1IfzoQWehFeLsSx/dp/iyzsIeX2awyCa7jqLVz5DBU fuctmMa/Z5s4VYxI0HautFtu9hX+cnzgqAE1sqZbp7Ul1WHSDVNGZyFkOaJmOynpsEYa B/rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=KEd0q7kthVeO5mA8L9gFLv/ZlIdjHpNMSzgp+kxr4j8=; b=O/y4rJn/cM0W+toPKy8ho+rLMyelKjL/Pc1RV2GB0Q6QzL48D4nYodRdEjQcpu0zFc MCqQAjFNcO1XfdqQv/AaYICj8sZ2ggqP2RWSu3szZbx4Z5L23ueUo2a8NZ0+mISgH6aL TtEzIWcF+XDLfO3uWA81OGOpYPw480EiEE1IRwGmpVCwzgEYwSdyc7GKEGOc+EdwbBfQ 4LhgNgb6OcRRbb8WjYQY/WnseQIYRQDti1X69E5jYw0+Pywjwt99na+nsXyg8okezchS Ccv9PUY1ZsM8WddbSb1ieJhALmZbE7WbGz0DWXvBGSzTndcs+P2zO6/o3zz8JxqR6wQK iYDw== X-Gm-Message-State: ALoCoQmudsXj3XrGf/EjS/w5yqEQh48RbIhaaNpwW5r7ShlUoX7Qq85DPOyFTv4IH3J8hahUX7Oex3+zaweuevIu9A0/9Pgo+Q== X-Received: by 10.60.233.103 with SMTP id tv7mr34399696oec.13.1453394288876; Thu, 21 Jan 2016 08:38:08 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:b4e7:9c6b:5d99:23b0? ([2601:601:800:126d:b4e7:9c6b:5d99:23b0]) by smtp.gmail.com with ESMTPSA id z190sm865924oig.25.2016.01.21.08.38.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 08:38:07 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: IoT OS From: NGie Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: <56A10892.2090308@rlwinm.de> Date: Thu, 21 Jan 2016 08:38:05 -0800 Cc: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <56A10892.2090308@rlwinm.de> To: Jan Bramkamp X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 16:38:09 -0000 > On Jan 21, 2016, at 08:34, Jan Bramkamp wrote: >=20 >> On 21/01/16 17:19, Mathieu Prevot wrote: >> Dear all, >>=20 >> I would like to connect several connected object (with homogeneous or >> heterogenous hardare: intel edison, samsung artik, apple AX, intel core,= >> etc) so the calculation needs, the storage/memory, the connection, etc ar= e >> decoupled; hence we can reach an ecosystem with several clouds. >>=20 >> How do you recommend to reach that ? from the kernel, a module, or >> eventually a software ? >=20 > Your message contains neither enough information nor a precise enough ques= tion for anyone to provide you a helpful answer. >=20 > Please describe your problem in sufficient detail and reformulate your que= stion. If you still think these mailing lists (current@ and hackers@) are a g= ood audience for your question afterward ask them again. It depends on your workload and hardware requirements (there isn't a simple a= nswer to your question because you didn't describe what you needed with conc= rete requirements). I would talk to cem@. He's working on ioat(4) on head for us ($work). Thanks, -NGie= From owner-freebsd-hackers@freebsd.org Thu Jan 21 18:08: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 B55FEA8C523; Thu, 21 Jan 2016 18:08:26 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (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 21D3D1C7E; Thu, 21 Jan 2016 18:08:26 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: by mail-lb0-x229.google.com with SMTP id x4so28298161lbm.0; Thu, 21 Jan 2016 10:08:26 -0800 (PST) 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:content-type; bh=8q1TV4DIeLTyJiDk5pejvJj/6DtM7nF5GFucoIkY4xU=; b=rqBG3YQNuT0sTORCjQBdww3z7vUX27mEWqxKVCvNl9hc4mvj9cC1DnTugVVVSHDJ6a 9KnyX2/w4pMTXlRbJbiaQ1q5wz5Y9rC94p3Pfo9QHybAurG7oR2HJkguELuMBb527S8k TskY+0jZEh67dFauaJXJdZS6kYxxssYfk9hXbl4oDV9nm5l+bhBgPNy/KBEIOYydbvmi XWg2zM9CxcFLuJ0ZGKHTG1oWAfZymy3ZmRF1nbPz48D7M41DuRNVjElFB/LpvuPQoIjV WGsui0bVzHrKvMoacVfM5emFtoLTOac8/6a87a5z6JRVpr2tGcJIKuP5Jl9E1QtyhI1v 3DLg== 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:content-type; bh=8q1TV4DIeLTyJiDk5pejvJj/6DtM7nF5GFucoIkY4xU=; b=OIzKo8EOu9lP/8E+kr2Gvatl2fbxLDosybKgHedI2cCXnlEimxfXJzY2kEA18spCHg wbyBSjXaGgp+uJUBZXaTppayoGQhQfItEIwNqcyQDVZYIZmHrIyu3zXlGCrsh+eAx+po JQ64GX0xkq85gDT/vPCwRotOsGMgpqpVNBIa1d3iGAaHdSWqQdnaRSYQZ7Y7TH/y1Ptb +ZbaWnQPHXEQk/AsymII8GSHKSKoWONxdAwlSOKYmdY4RAGTTQOg0NRZ69WiNI5YmtHC dZ+8nlhkIicxRNEoyJYTCWCeha7Alu4QBEB6O5XUNqK0MW0gZ/zi+wHHpQRLnvCXfcV6 E9JQ== X-Gm-Message-State: ALoCoQmIliW41DFofE5XRSxDMZqQ7isbXgvkmt1cJB5W+c85Eibsien1+IvPsuAffYTSww19D4pCnfq/jIT73Ecul52vA/4A/A== X-Received: by 10.112.184.133 with SMTP id eu5mr12761674lbc.99.1453399702612; Thu, 21 Jan 2016 10:08:22 -0800 (PST) MIME-Version: 1.0 Sender: mathieu.prevot@gmail.com Received: by 10.25.89.75 with HTTP; Thu, 21 Jan 2016 10:08:02 -0800 (PST) In-Reply-To: References: <56A10892.2090308@rlwinm.de> From: Mathieu Prevot Date: Thu, 21 Jan 2016 19:08:02 +0100 X-Google-Sender-Auth: vCwnxy6ZDYeksTPCVSxKOVIT5AQ Message-ID: Subject: Re: IoT OS To: NGie Cooper Cc: Jan Bramkamp , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 18:08:26 -0000 2016-01-21 17:38 GMT+01:00 NGie Cooper : > > > On Jan 21, 2016, at 08:34, Jan Bramkamp wrote: > > > >> On 21/01/16 17:19, Mathieu Prevot wrote: > >> Dear all, > >> > >> I would like to connect several connected object (with homogeneous or > >> heterogenous hardare: intel edison, samsung artik, apple AX, intel > core, > >> etc) so the calculation needs, the storage/memory, the connection, etc > are > >> decoupled; hence we can reach an ecosystem with several clouds. > >> > >> How do you recommend to reach that ? from the kernel, a module, or > >> eventually a software ? > > > > Your message contains neither enough information nor a precise enough > question for anyone to provide you a helpful answer. > > > > Please describe your problem in sufficient detail and reformulate your > question. If you still think these mailing lists (current@ and hackers@) > are a good audience for your question afterward ask them again. > > It depends on your workload and hardware requirements (there isn't a > simple answer to your question because you didn't describe what you needed > with concrete requirements). > > I would talk to cem@. He's working on ioat(4) on head for us ($work). > Thanks, > -NGie > Say all objects are connected peer to peer with wifi, some of them are connected to internet through gsm network or wifi to a box. These object are moving in space, and for some reasons, connections are dynamical and can be severely impaired or lost. They have incoming local streams of data (eg HD videos, accelerometer, GPS, other wifi and gsm signals, etc). I would like to abstract the CPU layer, storage layer, and internet connection so that in realtime results of one of my objects are saved if this object dies, so that if one of the object giving internet access to the group loose its connection, the redundancy allows the group of object not to lose internet connection. Can I consider these as different load balancing layers ? Do you recommend to implement this at the kernel layer or at an API layer ? Can I see that as a lightweight cluster ? I think the API is more flexible, especially if I have an heterogeneous (by CPU, OS) set of connected object. However, working at the kernel level allows existing programs not to be rewritten. What are your thoughts ? Do you recommend another list ? Thanks From owner-freebsd-hackers@freebsd.org Thu Jan 21 18:05: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 80C6FA8C49F; Thu, 21 Jan 2016 18:05:21 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::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 090391C36; Thu, 21 Jan 2016 18:05:21 +0000 (UTC) (envelope-from mathieu.prevot@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id h129so32253549lfh.3; Thu, 21 Jan 2016 10:05:20 -0800 (PST) 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:content-type; bh=yJFKHqCUGFz2/5rDBVrd11JyQpSJvsrF53ouKvsPTLM=; b=YJda+Z8tTsmWTVev2KUXyoCx/PBZd9vCMYhhsKPq8DrIVeFKSrIPpmtV4ZMHOKHnHg yA8et4B9WgYpq+R5/e5JQDFCsgepdcUqzs/0PomU4XSb6DiV2nO+1JFkJcjmEI/p3W0h hCeZEkDNlreY2dmOx0Xp3PxaQHt3RiF7q97bNv/jtjFENQJ7XK7tQJbjBu63aZDJcO/9 CA11ufQbwgEKXWqrUJe0V8oTC2uDygznh+MMVME+Sg4xVCfwYWYCmpRyMHj1nkmsCEq7 fSMJShDvFuQkFuSgBv3pzylCnLJ/V28zCnesGFweBJesL3TMt3F5vCeWjuadVfrhf2JG wXrA== 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:content-type; bh=yJFKHqCUGFz2/5rDBVrd11JyQpSJvsrF53ouKvsPTLM=; b=asqt6l1Pj7f/Mlpd71J/R/OsgYrICds78TgoM0ktONBv7gkHYeRNHeCafH1aSh4O2v rVttbO4AwzEh0DIcrYWx6/a+5UjYIEL+81H+7FrEviMLv3fw2pwURDAX/wTsPUwWgyJZ I6YJoee9kTg4VrGdN+rSa+KCSxImkhEbTs3gj7KLH2wq9dbzfcESOwkZLA4YOsaHWAao 4cbTOZNzgsxvS8fdB8NpFPvffPXoBE3Y9mhCYnlPPP17VFJ+e1l1NG0kcwc2J4oRzkfY UFaqMvFdeCKVTMGrTzTUPonKzXzocB7J9VYV4BMdywkUIg196QDCPSHEK0ZwfSfoQjON 9rIw== X-Gm-Message-State: ALoCoQmziFiRx2yWfYH+tbhuufpH5N0SvJEXBGF+tfnJUgjOaN+bXvN7v1fWjfGxiDPDyoUfbxcfGTBMlT0Ul6YSz/4AQyQtjg== X-Received: by 10.25.170.129 with SMTP id t123mr16068606lfe.103.1453399519030; Thu, 21 Jan 2016 10:05:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.89.75 with HTTP; Thu, 21 Jan 2016 10:04:59 -0800 (PST) In-Reply-To: References: <56A10892.2090308@rlwinm.de> From: Mathieu Prevot Date: Thu, 21 Jan 2016 19:04:59 +0100 Message-ID: Subject: Re: IoT OS To: NGie Cooper Cc: Jan Bramkamp , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org X-Mailman-Approved-At: Thu, 21 Jan 2016 18:12:07 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 18:05:21 -0000 2016-01-21 17:38 GMT+01:00 NGie Cooper : > > > On Jan 21, 2016, at 08:34, Jan Bramkamp wrote: > > > >> On 21/01/16 17:19, Mathieu Prevot wrote: > >> Dear all, > >> > >> I would like to connect several connected object (with homogeneous or > >> heterogenous hardare: intel edison, samsung artik, apple AX, intel > core, > >> etc) so the calculation needs, the storage/memory, the connection, etc > are > >> decoupled; hence we can reach an ecosystem with several clouds. > >> > >> How do you recommend to reach that ? from the kernel, a module, or > >> eventually a software ? > > > > Your message contains neither enough information nor a precise enough > question for anyone to provide you a helpful answer. > > > > Please describe your problem in sufficient detail and reformulate your > question. If you still think these mailing lists (current@ and hackers@) > are a good audience for your question afterward ask them again. > > It depends on your workload and hardware requirements (there isn't a > simple answer to your question because you didn't describe what you needed > with concrete requirements). > > I would talk to cem@. He's working on ioat(4) on head for us ($work). > Thanks, > -NGie > Say all objects are connected peer to peer with wifi, some of them are connected to internet through gsm network or wifi to a box. These object are moving in space, and for some reasons, connections are dynamical and can be severely impaired or lost. They have incoming local streams of data (eg HD videos, accelerometer, GPS, other wifi and gsm signals, etc). I would like to abstract the CPU layer, storage layer, and internet connection so that in realtime results of one of my objects are saved if this object dies, so that if one of the object giving internet access to the group loose its connection, the redundancy allows the group of object not to lose internet connection. Can I consider these as different load balancing layers ? Do you recommend to implement this at the kernel layer or at an API layer ? Can I see that as a lightweight cluster ? I think the API is more flexible, especially if I have an heterogeneous (by CPU, OS) set of connected object. However, working at the kernel level allows existing programs not to be rewritten. What are your thoughts ? Do you recommend another list ? Thanks M From owner-freebsd-hackers@freebsd.org Thu Jan 21 18:48: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 C6A36A8B0DB for ; Thu, 21 Jan 2016 18:48:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1A081CEF; Thu, 21 Jan 2016 18:48:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B468BB97D; Thu, 21 Jan 2016 13:48:37 -0500 (EST) From: John Baldwin To: Andriy Gapon Cc: Ryan Stone , "freebsd-hackers@freebsd.org" Subject: Re: How to get anything useful out of kgdb? Date: Thu, 21 Jan 2016 09:18:54 -0800 Message-ID: <1668788.bFLpJ6aV8e@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <56A0CA17.7030204@FreeBSD.org> References: <554E41EE.2010202@ignoranthack.me> <16207260.7oBjvc4tcM@ralph.baldwin.cx> <56A0CA17.7030204@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 21 Jan 2016 13:48:37 -0500 (EST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 18:48:39 -0000 On Thursday, January 21, 2016 02:07:51 PM Andriy Gapon wrote: > On 08/01/2016 22:05, John Baldwin wrote: > > So I figured out why newer kgdb wasn't unwinding through NULL function pointer > > traps yesterday. I'm not sure if the fix will help with your case as well, > > but it might be worth trying. The changes are in > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206044 > > Thank you very much! > It does help in my case: > > (kgdb) bt > #0 doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:291 > #1 0xffffffff8063453f in kern_reboot (howto=260) at > /usr/src/sys/kern/kern_shutdown.c:359 > #2 0xffffffff80634ba4 in vpanic (fmt=, ap=) at > /usr/src/sys/kern/kern_shutdown.c:635 > #3 0xffffffff806348a3 in panic (fmt=) at > /usr/src/sys/kern/kern_shutdown.c:568 > #4 0xffffffff8041bba7 in db_panic (addr=, > have_addr=, count=, modif=) at > /usr/src/sys/ddb/db_command.c:473 > #5 0xffffffff8041b67b in db_command (last_cmdp=, cmd_table=0x0, > dopager=) at /usr/src/sys/ddb/db_command.c:440 > #6 0xffffffff8041b524 in db_command_loop () at /usr/src/sys/ddb/db_command.c:493 > #7 0xffffffff8041de0b in db_trap (type=, code=) at > /usr/src/sys/ddb/db_main.c:251 > #8 0xffffffff80669de8 in kdb_trap (type=19, code=0, tf=0xffffffff80f976d0 > ) at /usr/src/sys/kern/subr_kdb.c:653 > #9 0xffffffff80820d26 in trap (frame=0xffffffff80f976d0 ) at > /usr/src/sys/amd64/amd64/trap.c:381 > #10 > #11 0xffffffff80619e1f in __mtx_assert (c=, what=, > file=, line=) at /usr/src/sys/kern/kern_mutex.c:842 > #12 0xffffffff807fef86 in vm_reserv_free_page (m=0xfffff80229e07cc0) at > /usr/src/sys/vm/vm_reserv.c:832 > #13 0xffffffff807f2b96 in vm_page_free_toq (m=0xfffff80229e07cc0) at > /usr/src/sys/vm/vm_page.c:2432 > #14 0xffffffff807f2e4d in vm_page_free (m=0xffffffff81129198 > ) at /usr/src/sys/vm/vm_page.c:962 > #15 0xffffffff821c28e2 in ttm_bo_vm_fault (vm_obj=0xfffff8021fcdeb00, > offset=5304320, prot=, mres=0xfffffe02b8357050) at > /usr/src/sys/modules/drm2/drm2/../../../dev/drm2/ttm/ttm_bo_vm.c:269 > #16 0xffffffff807d4fd3 in dev_pager_getpages (object=0xfffff8021fcdeb00, > ma=0xfffffe02b8357050, count=1, reqpage=0) at /usr/src/sys/vm/device_pager.c:321 > #17 0xffffffff807f9d67 in vm_pager_get_pages (object=0xfffff8021fcdeb00, > m=0xfffffe02b8357050, count=1, reqpage=0) at /usr/src/sys/vm/vm_pager.c:291 > #18 0xffffffff807e0d84 in vm_fault_hold (map=0xfffff8001dd57000, > vaddr=34729947136, fault_type=2 '\002', fault_flags=0, m_hold=0x0) at > /usr/src/sys/vm/vm_fault.c:672 > #19 0xffffffff807e05ee in vm_fault (map=0xfffff8001dd57000, vaddr= out>, fault_type=2 '\002', fault_flags=0) at /usr/src/sys/vm/vm_fault.c:277 > #20 0xffffffff80821342 in trap_pfault (frame=0xfffffe02b8357c00, usermode=1) at > /usr/src/sys/amd64/amd64/trap.c:734 > #21 0xffffffff80820bda in trap (frame=0xfffffe02b8357c00) at > /usr/src/sys/amd64/amd64/trap.c:326 > #22 0xffffffff8082154a in trap_check (frame=0xfffffe02b8357c00) at > /usr/src/sys/amd64/amd64/trap.c:628 > #23 > #24 0x00000008022b4046 in ?? () > Backtrace stopped: Cannot access memory at address 0x7fffffffe7c8 > > See http://article.gmane.org/gmane.os.freebsd.devel.hackers/56410 for comparison. > One small regression is that previously there was nmi_calltrap in the trace, now > it's just "". Yeah, listing trapframes as that is fallout from the fix. I've thought about adding a custom frame type so I can install a custom frame printer and output things like the trap number the way ddb does, but that would be a far more invasive change that might be harder to maintain going forward. Glad that this helped though! -- John Baldwin From owner-freebsd-hackers@freebsd.org Thu Jan 21 19:00: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 F3475A8B77A for ; Thu, 21 Jan 2016 19:00:23 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx141.netapp.com (mx141.netapp.com [216.240.21.12]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEF441270 for ; Thu, 21 Jan 2016 19:00:23 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,326,1449561600"; d="scan'208";a="95646828" Received: from hioexcmbx07-prd.hq.netapp.com ([10.122.105.40]) by mx141-out.netapp.com with ESMTP; 21 Jan 2016 10:39:57 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx07-prd.hq.netapp.com (10.122.105.40) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Jan 2016 10:39:57 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Thu, 21 Jan 2016 10:39:57 -0800 From: "Batutis, Ed" To: Joerg Sonnenberger , Diane Bruce CC: "freebsd-hackers@freebsd.org" Subject: RE: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+wAzsUMAAAFlx4AAAE76gAAMyqlg Date: Thu, 21 Jan 2016 18:39:44 +0000 Deferred-Delivery: Thu, 21 Jan 2016 18:39:00 +0000 Message-ID: References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> In-Reply-To: <20160121162527.GA11600@britannica.bec.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 21 Jan 2016 19:08:26 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:00:24 -0000 > > > Use getdtablesize() to get the current largest known fd. If you > > > want, you can afterwards loop and use fcntl with F_GETFD to check if > > > the descriptor is still open. Since I need an open handle count I would have to do 2048 fcntl() calls in = my case. I'm afraid this doesn't look like a good idea, since it might happ= en a lot under certain circumstances. Looking at the source for kinfo_getfile, it seems like using this is not a = good idea because, according to a comment in bug 197695: https://www.mail-archive.com/freebsd-bugs@freebsd.org/msg21569.html the function uses a sysctl with KERN_PROC_FILEDESC which "might be slow". T= his function also does two memory allocations for data I don't need to look= at. So, I guess the answer is, for me anyway, that there is no sufficiently eff= icient way to get the number of open file handles from the system for my us= er-space application. But, if anyone has any more ideas, I'd be happy to hear them! Thanks, =3DEd From owner-freebsd-hackers@freebsd.org Thu Jan 21 19:13:13 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 35E8CA8BD9A for ; Thu, 21 Jan 2016 19:13:13 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 B7FDD1B58 for ; Thu, 21 Jan 2016 19:13:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id r129so185116627wmr.0 for ; Thu, 21 Jan 2016 11:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=niMcAM/h5apNnrDeqouhe4HANJwxmIGzdK3ZugQUm8I=; b=gT7OcNDCTphDyVjP1HK2xhcLolbSXkAYJQq5q2quy4VLcfkySFyMptvDUgc3RWw/QX rSDx/h9w9uMCdsU79lfY6Yn7Tkq5Qfv31ond/rshZJdzaMRfmww+GgOKWmfZqb2N/DSk qytKXxXgEOcUNTFH6v0zWd3e1JFFS/ZhxDpGs02CVqafQ052yJ2aJZQwg9wRXzx4iQI2 jzmm+QA3TrJYcZCQMCIPRgnrJQ3zGtiG+tUxnvhabb+CoWYQ8i8gb5Tz9gP7P2jA6xlz MAo+Dv54Li8Q1ZLUhWLHkeGtfim1XJIHTZCOLDLeIyJdjJypT3LzsqTeb1A+34Hu4Rdr U9fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=niMcAM/h5apNnrDeqouhe4HANJwxmIGzdK3ZugQUm8I=; b=PD3IRZBZR5/+OY4MTjcWWnFsO4klpwSBdBDi2eNcDeD9etu9Nnb9RgeH4fxUdPS6ge BKBf8FwzCJ7EHM/0IWc+pwunpxepQE13Bxe04NAn+/baI3DsIhi9rxehYGz35JVQH/KH OB3+WD/CpPAK1ZvgD/kITP3XijiNrqX29Uib3Rpfr3qdGaaX2YGmrdmSKE2NyEAVh0uW eJmGpR6zLVUVb3xAVgRQk+PpY76n+fMCuPXDQGqqV9v7o5bYZ5Vtb8Jy9dySY6hZGo6b HmXFkGqCUUpbPwFqsjZOst3Ar5Pr6SN+SajcRkiDB4nFZaEzkHVSZwoyyhIC9SdWuS9o bJEw== X-Gm-Message-State: ALoCoQn/TaVAzJpmdsxeRnLP7D7dqk2+vfOWelQQtEjGLRP2yXyQ9pJegf98iYVKoVxOzZZoQH2s91vHzb0cuwgS3ZpGKfJCbA== X-Received: by 10.194.117.68 with SMTP id kc4mr43570438wjb.111.1453403591293; Thu, 21 Jan 2016 11:13:11 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id k130sm4230779wmg.6.2016.01.21.11.13.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 21 Jan 2016 11:13:10 -0800 (PST) Date: Thu, 21 Jan 2016 20:13:08 +0100 From: Mateusz Guzik To: "Batutis, Ed" Cc: Joerg Sonnenberger , Diane Bruce , "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121191308.GA21869@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , "Batutis, Ed" , Joerg Sonnenberger , Diane Bruce , "freebsd-hackers@freebsd.org" References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:13:13 -0000 On Thu, Jan 21, 2016 at 06:39:44PM +0000, Batutis, Ed wrote: > > > > Use getdtablesize() to get the current largest known fd. If you > > > > want, you can afterwards loop and use fcntl with F_GETFD to check if > > > > the descriptor is still open. > > Since I need an open handle count I would have to do 2048 fcntl() calls in my case. I'm afraid this doesn't look like a good idea, since it might happen a lot under certain circumstances. > > Looking at the source for kinfo_getfile, it seems like using this is not a good idea because, according to a comment in bug 197695: > > https://www.mail-archive.com/freebsd-bugs@freebsd.org/msg21569.html > > the function uses a sysctl with KERN_PROC_FILEDESC which "might be slow". This function also does two memory allocations for data I don't need to look at. > > So, I guess the answer is, for me anyway, that there is no sufficiently efficient way to get the number of open file handles from the system for my user-space application. > > But, if anyone has any more ideas, I'd be happy to hear them! > Well, OpenBSD has getdtablecount syscall giving a cheap way to obtain this information. FreeBSD gained a sysctl providing an equivalent functionality for compatiblity reasons, but the feature is only in head. https://svnweb.freebsd.org/base/head/sys/kern/kern_descrip.c?r1=287540&r2=290473 It is trivial to backport to 10.x, but I have no plans doing so (I'm not going to prevent anyone from doing it either). However, the real question is what do you need this for. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Thu Jan 21 19:49:49 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 5D0CCA8CA09 for ; Thu, 21 Jan 2016 19:49:49 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx141.netapp.com (mx141.netapp.com [216.240.21.12]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36A541F6F for ; Thu, 21 Jan 2016 19:49:48 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,327,1449561600"; d="scan'208";a="95657579" Received: from hioexcmbx04-prd.hq.netapp.com ([10.122.105.37]) by mx141-out.netapp.com with ESMTP; 21 Jan 2016 11:44:27 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx04-prd.hq.netapp.com (10.122.105.37) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Jan 2016 11:44:27 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Thu, 21 Jan 2016 11:44:27 -0800 From: "Batutis, Ed" To: Mateusz Guzik CC: Joerg Sonnenberger , Diane Bruce , "freebsd-hackers@freebsd.org" Subject: RE: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+wAzsUMAAAFlx4AAAE76gAAMyqlg///IhACAAIMxQA== Date: Thu, 21 Jan 2016 19:44:01 +0000 Deferred-Delivery: Thu, 21 Jan 2016 19:44:00 +0000 Message-ID: <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> In-Reply-To: <20160121191308.GA21869@dft-labs.eu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 21 Jan 2016 20:08:18 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:49:49 -0000 DQo+IA0KPiBIb3dldmVyLCB0aGUgcmVhbCBxdWVzdGlvbiBpcyB3aGF0IGRvIHlvdSBuZWVkIHRo aXMgZm9yLg0KPiANCg0KSSB3b3VsZCBsaWtlIHRvIGtub3cgd2hlbiBJIGFtIGdldHRpbmcgY2xv c2UgdG8gaGl0dGluZyB0aGUgZmlsZSBoYW5kbGUgbGltaXQuIFRoaXMgaXMgdXNlZnVsIGZvciB0 d28gcmVhc29uczogMSkgaWYgSSBydW4gb3V0IG9mIGF2YWlsYWJsZSBmaWxlIGhhbmRsZXMgdGhp cyB3aWxsIG1vc3QgbGlrZWx5IGNhdXNlIG15IHByb2Nlc3MgdG8gY3Jhc2guIElmIEkgc3RhcnQg bG9nZ2luZyB3aGVuIHRoZSBjb3VudCBiZWdpbnMgdG8gZ2V0IGRhbmdlcm91c2x5IGhpZ2gsIHRo ZW4gSSBtaWdodCBhZnRlciB0aGUgZmFjdCBiZSBhYmxlIHRvIGRldGVybWluZSB3aGF0IHdhcyBn b2luZyBvbiB0byBjYXVzZSB0aGF0LiAyKSBTb21lIGhhbmRsZXMgYXJlIHVzZWQgYnkgYSB1c2Vy IGludGVyZmFjZS4gSXQgd291bGQgYmUgbmljZSBpZiB0aGUgc2VydmVyIGNvdWxkIHJlamVjdCBj b25uZWN0aW9ucyB3aGVuIHRoZSBvcGVuIGhhbmRsZSBjb3VudCBoaXQgYSBjcml0aWNhbCB0aHJl c2hvbGQgc28gdGhlIHVzZXIgaW50ZXJmYWNlIGRvZXNuJ3QgYmVjb21lIHBhcnQgb2YgdGhlIHBy b2JsZW0gLSBvYnNjdXJpbmcgdGhlIGFjdHVhbCB1bmRlcmx5aW5nIGNhdXNlLg0KDQpUaGFua3Ms DQoNCj1FZA0K From owner-freebsd-hackers@freebsd.org Thu Jan 21 21:17: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 DF514A8CCBE for ; Thu, 21 Jan 2016 21:17:25 +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 9FA4317F5 for ; Thu, 21 Jan 2016 21:17:25 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMMbX-0004oV-14; Fri, 22 Jan 2016 00:17:19 +0300 Date: Fri, 22 Jan 2016 00:17:18 +0300 From: Slawa Olhovchenkov To: "Batutis, Ed" Cc: "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121211718.GI88527@zxy.spb.ru> References: 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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 21:17:26 -0000 On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote: > Hi, > > I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything. > > Does this work reliably for that purpose? > > int num_open = 0; /* number of open files? */ > kinfo_file *inf = kinfo_getfile(getpid(), &num_open); > if ( inf ) { > free(inf); > } # limits Resource limits (current): cputime infinity secs filesize infinity kB datasize 33554432 kB stacksize 524288 kB coredumpsize infinity kB memoryuse infinity kB memorylocked infinity kB maxprocesses 8485 openfiles 116442 sbsize infinity bytes vmemoryuse infinity kB pseudo-terminals infinity swapuse infinity kB # df -ki /dev/fd/ Filesystem 1024-blocks Used Avail Capacity iused ifree %iused Mounted on fdescfs 1 1 0 100% 4 116439 0% /dev/fd ^^^^^ ^^^^^^ From owner-freebsd-hackers@freebsd.org Thu Jan 21 22:16: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 8BAA8A8CEB0 for ; Thu, 21 Jan 2016 22:16:14 +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 4ADBC15E8 for ; Thu, 21 Jan 2016 22:16:14 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aMNWV-0005x4-WC; Fri, 22 Jan 2016 01:16:12 +0300 Date: Fri, 22 Jan 2016 01:16:11 +0300 From: Slawa Olhovchenkov To: "Batutis, Ed" Cc: "freebsd-hackers@freebsd.org" Subject: Re: get number of open files in a process? Message-ID: <20160121221611.GJ88527@zxy.spb.ru> References: <20160121211718.GI88527@zxy.spb.ru> 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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 22:16:14 -0000 On Thu, Jan 21, 2016 at 10:13:21PM +0000, Batutis, Ed wrote: > > > # df -ki /dev/fd/ > > Filesystem 1024-blocks Used Avail Capacity iused ifree %iused Mounted on > > fdescfs 1 1 0 100% 4 116439 0% /dev/fd > > ^^^^^ ^^^^^^ > > Interesting. But I need this information for a process. This is for process, for current process. From owner-freebsd-hackers@freebsd.org Thu Jan 21 22:45: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 9B927A8C9AB for ; Thu, 21 Jan 2016 22:45:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (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 67C1F1A02 for ; Thu, 21 Jan 2016 22:45:16 +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 831DFB806A; Thu, 21 Jan 2016 23:45:11 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 705BB28494; Thu, 21 Jan 2016 23:45:11 +0100 (CET) Date: Thu, 21 Jan 2016 23:45:11 +0100 From: Jilles Tjoelker To: "Batutis, Ed" Cc: Mateusz Guzik , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: Re: get number of open files in a process? Message-ID: <20160121224511.GA74045@stack.nl> References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 22:45:16 -0000 On Thu, Jan 21, 2016 at 07:44:01PM +0000, Batutis, Ed wrote: > > However, the real question is what do you need this for. > I would like to know when I am getting close to hitting the file > handle limit. This is useful for two reasons: 1) if I run out of > available file handles this will most likely cause my process to > crash. If I start logging when the count begins to get dangerously > high, then I might after the fact be able to determine what was going > on to cause that. 2) Some handles are used by a user interface. It > would be nice if the server could reject connections when the open > handle count hit a critical threshold so the user interface doesn't > become part of the problem - obscuring the actual underlying cause. You can check the integer file descriptor that was just created, since if the descriptor is N, at least N other descriptors must be active at the same time. For example, if a new client's file descriptor is higher than the limit minus some safety margin, reject the connection. -- Jilles Tjoelker From owner-freebsd-hackers@freebsd.org Thu Jan 21 22:51:15 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 D78C5A8CC29 for ; Thu, 21 Jan 2016 22:51:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 6AD101C4C for ; Thu, 21 Jan 2016 22:51:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id u188so245504783wmu.1 for ; Thu, 21 Jan 2016 14:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=nIEDS3W87apFCt4Kse2RM30jgZ0MbFKEIQK2KvtKmug=; b=TgZlUWjy4xyCo/IvKlyF/UqLbCwlRUyAGio/qYMfslaSXI/fDSgn8y0FakHT4HZ5UC 9t+DjHkVnpePJNC++HIVhO6qdjuPj1p1GEPG00b1I4tKXH/3jHrAwjnYqjUq0UiU9KhJ uptuWSc3UN0B+hIMq1WVGUYT1dm/20SUNXqBbgda5cOwKR6KBd5FUoM3Oxi976waiS/6 TaGvEMef0+p+V2OvpFB4wQyjnYrFh/rZBI/q8tD5/Den6Cf/lXXNek56r25jZ0zkrO75 sxXIABwYz85bV7Pj3CzMIcB9um8iFLSd6t5Js4RvJEUH9GSMxl/hx1lES8/5ASAeU1rh IMAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=nIEDS3W87apFCt4Kse2RM30jgZ0MbFKEIQK2KvtKmug=; b=NDwsBUEzFCl9nJOHiwXnL7yYoGpXy41T9E0G4OLKYZvztnG/JGlJwReS8/H9/9oLjR JPhM+FyQtjHdnIimPNh6hke2tBhFAsx5p9sOqxWLmQNivXyz58upPdX2jyEkni0k2L3k fn2BVR2QQkwsVddx8i3jRGDxA2UDzeETeV6GWtNfE18/ox9KaLF9fXAdlZogumumSKFf xACT/XIt/y0eK4nCU/jlO53SjnGIqdn9Qs0UFU4+Kzd/4C8JfK88t6sUGF40kKQb32aN toEaCpZsjc0tqOjRhQtIAlSocAPVFh9Pr8PcOgiH+oYPxpUUAfcVHcOZtyQjcJCz53mZ CSOg== X-Gm-Message-State: ALoCoQmxf/T0b0Z/u6QY3kHDJZRar0QmUmet3Opt83P2zBfPaPrU8I6phbVu9sWrX7eZXxuqBeNnjygtXE9VO0CbFVBxP9YcXQ== X-Received: by 10.194.184.210 with SMTP id ew18mr44395954wjc.79.1453416673721; Thu, 21 Jan 2016 14:51:13 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id s2sm3312212wjs.43.2016.01.21.14.51.12 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 21 Jan 2016 14:51:13 -0800 (PST) Date: Thu, 21 Jan 2016 23:51:11 +0100 From: Mateusz Guzik To: Jilles Tjoelker Cc: "Batutis, Ed" , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: Re: get number of open files in a process? Message-ID: <20160121225111.GB21869@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Jilles Tjoelker , "Batutis, Ed" , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160121224511.GA74045@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 22:51:15 -0000 On Thu, Jan 21, 2016 at 11:45:11PM +0100, Jilles Tjoelker wrote: > On Thu, Jan 21, 2016 at 07:44:01PM +0000, Batutis, Ed wrote: > > > However, the real question is what do you need this for. > > > I would like to know when I am getting close to hitting the file > > handle limit. This is useful for two reasons: 1) if I run out of > > available file handles this will most likely cause my process to > > crash. If I start logging when the count begins to get dangerously > > high, then I might after the fact be able to determine what was going > > on to cause that. 2) Some handles are used by a user interface. It > > would be nice if the server could reject connections when the open > > handle count hit a critical threshold so the user interface doesn't > > become part of the problem - obscuring the actual underlying cause. > > You can check the integer file descriptor that was just created, since > if the descriptor is N, at least N other descriptors must be active at > the same time. For example, if a new client's file descriptor is higher > than the limit minus some safety margin, reject the connection. > This cannot work. POSIX mandates the lowest free fd is returned, so the N you see here can be extremely low, while the process is running out of fds. The sysctl I mentioned in my mail can be trivially backported to other FreeBSD versions, if this kind of feature is really needed. I'm still not convinced the approach here (of checking fds) is the right one to take - you have to have a very big reserve to not suddenly run out of fds, one would just limit amount of clients and, well, handle errors as they can pop up for reasons other than running out of fd slots. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Thu Jan 21 23: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 D8222A8A130; Thu, 21 Jan 2016 23:41:23 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward8j.cmail.yandex.net (forward8j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60789174D; Thu, 21 Jan 2016 23:41:22 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web14j.yandex.ru (web14j.yandex.ru [IPv6:2a02:6b8:0:1619::314]) by forward8j.cmail.yandex.net (Yandex) with ESMTP id CB95421BBD; Fri, 22 Jan 2016 02:41:07 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web14j.yandex.ru (Yandex) with ESMTP id E81CF28A23C8; Fri, 22 Jan 2016 02:41:06 +0300 (MSK) Received: by web14j.yandex.ru with HTTP; Fri, 22 Jan 2016 02:41:03 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: FreeBSD Net , freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Subject: projects/routing announcement/status MIME-Version: 1.0 Message-Id: <6151261453419663@web14j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 22 Jan 2016 02:41:03 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 23:41:24 -0000 I would like to introduce routing rework which started as projects/routing SVN branch. It has been around for quite a long time, some of the code has made its way to HEAD, but there hasn't been any public announcements. So, what is projects/routing about? First, it is about bringing more scalability by solving most annoying problems on packet output path. To be more specific, it eliminates 2 out of 4 locks, converts other 2 to rmlock(9) and adds infrastructure to reduce locking to single rmlock for certain traffic types. With these changes, OS is able to forward 12MPPS on 16-core box for both IPv4/IPv6 which is 6-10 times better than stock HEAD. Second, it eases hacking by avoiding direct access to route/lltable internals and providing higher level API instead. Third, it is about bringing advanced features like route multipath, and even more speed by adding modular lookup API permitting to use different route lookup algorithms based on server role. Description with graphs and links is available at: http://wiki.freebsd.org/ProjectsRoutingProposal Used API is described in http://wiki.freebsd.org/ProjectsRoutingProposal/API Current status is available at http://wiki.freebsd.org/ProjectsRoutingProposal/ConversionStatus It is probably much more convenient to read project details on wiki, however I’ll try to summarise the most important things here (wiki readers can skip till the end). Typical packet processing (forwarding for router, or output for web server) path consists of: doing routing lookup (radix read rwlock + routing entry (rte) mutex lock) (optionally) interface address (ifa) atomic refcount acquire/release doing link level entry (lle, llentry) lookup (afdata read rwlock + llentry read (or write) lock) Most annoying one is the rtentry mutex. The only goal of this mutex is to provide rtentry refcounting so consumer code can use it without the risk of rtentrry being deleted. We solve this by saving all needed data into on-stack optimised structure instead of refcounting. Additionally, we are trying to pre-calculate the data we need to pass by using special next-hop structures instead of route entries. Several different (in terms of returned info and relative overhead) functions for retrieving routing data are provided. Most of the consumers have already been switched to the new KPI. Actual output/forward path are not converted yet. It should be noted, that since individual rtentries are not returned, it is not possible to do per-ifa output packet accouting (can be observed in netstat -s). Route table lock is switched to ipfw-like dual-locking mode (read rmlock() for data path, rwlock for config changes, route export, etc..). The reasons of having rwlock are to 1) provide serialization for things in control plane not directly used for data path and 2) avoid acquiring contested/sleeping locks for rmlock. See projects/routing r287078 for an example. Lltable entry locks were eliminated in r291853, r292155. Lltable lock is also planned to be converted to dual-locking model, with the similar reasoning. However, instead of (ab)using AFDATA lock, it needs to be converted to per-lltable set of locks. Open problems: SCTP/Flowtable references rtentries directly. It is not possible to convert ip[6]_output() path without dealing with that. Brief merge plan: Discuss/merge new routing KPI for data path Discuss/merge lltable dual-lock (WIP) Discuss/merge explicit nexthop changes Discuss/merge IPv4/IPv6 output path (along with converted sctp/flowtable) Discuss/merge route table dual-lock Current outstanding reviews (I encourage you to take a look at these) D5009 (IPv4 fast forwarding conversion) D5010 (IPv6 forwarding conversion) D4794 (Deal with per-ifa output counters) D4962 (new LLE lookup functions, no sockaddrs in lltable data path) D4751 (move all lltable code to separate files) From owner-freebsd-hackers@freebsd.org Thu Jan 21 22:18: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 C38C4A8C017 for ; Thu, 21 Jan 2016 22:18:38 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx143.netapp.com (mx143.netapp.com [216.240.21.24]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A46971979 for ; Thu, 21 Jan 2016 22:18:38 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,327,1449561600"; d="scan'208";a="92382741" Received: from hioexcmbx07-prd.hq.netapp.com ([10.122.105.40]) by mx143-out.netapp.com with ESMTP; 21 Jan 2016 14:13:30 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx07-prd.hq.netapp.com (10.122.105.40) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Jan 2016 14:13:30 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Thu, 21 Jan 2016 14:13:30 -0800 From: "Batutis, Ed" To: Slawa Olhovchenkov CC: "freebsd-hackers@freebsd.org" Subject: RE: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+wA/l1sAAA8jpIA= Date: Thu, 21 Jan 2016 22:13:21 +0000 Deferred-Delivery: Thu, 21 Jan 2016 22:13:00 +0000 Message-ID: References: <20160121211718.GI88527@zxy.spb.ru> In-Reply-To: <20160121211718.GI88527@zxy.spb.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 21 Jan 2016 23:45:55 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 22:18:38 -0000 =20 > # df -ki /dev/fd/ > Filesystem 1024-blocks Used Avail Capacity iused ifree %iused Mounted o= n > fdescfs 1 1 0 100% 4 116439 0% /dev/fd > ^^^^^ ^^^^^^ Interesting. But I need this information for a process. Thanks, =3DEd From owner-freebsd-hackers@freebsd.org Thu Jan 21 23:20:05 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 DCF3DA8B6CF for ; Thu, 21 Jan 2016 23:20:05 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx143.netapp.com (mx143.netapp.com [216.240.21.24]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3F01BBD for ; Thu, 21 Jan 2016 23:20:05 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,327,1449561600"; d="scan'208";a="92393007" Received: from hioexcmbx04-prd.hq.netapp.com ([10.122.105.37]) by mx143-out.netapp.com with ESMTP; 21 Jan 2016 15:15:00 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx04-prd.hq.netapp.com (10.122.105.37) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Jan 2016 15:15:00 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Thu, 21 Jan 2016 15:15:00 -0800 From: "Batutis, Ed" To: Mateusz Guzik , Jilles Tjoelker CC: "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: RE: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+wAzsUMAAAFlx4AAAE76gAAMyqlg///IhACAAIMxQP//uA6AgAABrYCAAIRoEA== Date: Thu, 21 Jan 2016 23:14:38 +0000 Deferred-Delivery: Thu, 21 Jan 2016 23:14:00 +0000 Message-ID: <8ca419f8820c4280a81f03102c7c0372@hioexcmbx08-prd.hq.netapp.com> References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> <20160121225111.GB21869@dft-labs.eu> In-Reply-To: <20160121225111.GB21869@dft-labs.eu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 22 Jan 2016 00:07:29 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 23:20:06 -0000 PiBJJ20gc3RpbGwgbm90IGNvbnZpbmNlZCB0aGUgYXBwcm9hY2ggaGVyZSAob2YgY2hlY2tpbmcg ZmRzKSBpcyB0aGUgcmlnaHQgb25lDQo+IHRvIHRha2UgLSB5b3UgaGF2ZSB0byBoYXZlIGEgdmVy eSBiaWcgcmVzZXJ2ZSB0byBub3Qgc3VkZGVubHkgcnVuIG91dCBvZiBmZHMsDQo+IG9uZSB3b3Vs ZCBqdXN0IGxpbWl0IGFtb3VudCBvZiBjbGllbnRzIGFuZCwgd2VsbCwgaGFuZGxlIGVycm9ycyBh cyB0aGV5IGNhbg0KPiBwb3AgdXAgZm9yIHJlYXNvbnMgb3RoZXIgdGhhbiBydW5uaW5nIG91dCBv ZiBmZCBzbG90cy4NCg0KSSBoYXZlIGEgbGFyZ2UgcmVzZXJ2ZSAtIHVzdWFsbHkgbW9yZSB0aGFu IDEwMDAgZmQgc2xvdHMuIEJ1dCBvY2Nhc2lvbmFsbHkgc29tZXRoaW5nIGhhcHBlbnMgYW5kIHRo ZSBwcm9jZXNzIHJ1bnMgb3V0LiBUaGVyZSBhcmUgYSBsb3Qgb2YgZGlmZmVyZW50IHRoaW5ncyBn b2luZyBvbiBpbiB0aGUgcHJvY2VzcyBpbiB0ZXJtcyBvZiBmZCB1c2FnZS4gU28sIGZpbmRpbmcg dGhlIGlzc3VlIGNvdWxkIGJlIGVhc2llciBpZiBJIGtub3cgd2hlbiB0aGUgbnVtYmVyIHN0YXJ0 ZWQgcmlzaW5nIHRvIGFuIHVudXN1YWwgbGV2ZWwuIEFuZCBJIGNhbiBwb3NzaWJseSBmaW5kIHRo ZSByb290IGNhdXNlIG1vcmUgZWFzaWx5IGlmIEkgc3RvcCBkb2luZyBzb21lIHRoaW5ncyB3aGVu IHRoaXMgaGFwcGVucy4gSSBjYW4gbW9uaXRvciBtZW1vcnkgdXNhZ2UgYW5kIENQVSB1c2FnZSBl YXNpbHkgZW5vdWdoLCBidXQgSSBjb3VsZCBub3QgZmlndXJlIG91dCBob3cgdG8gbW9uaXRvciBm ZCB1c2FnZS4gVGhlcmUgYXJlIG90aGVyIGFwcHJvYWNoZXMsIHllcy4gQnV0IEkgd2FzIGxvb2tp bmcgZm9yIHNvbWV0aGluZyBzaW1wbGUgYnV0IHVzZWZ1bCB1bnRpbCBhZGRpdGlvbmFsIGVmZm9y dCBjb3VsZCBiZSBleHBlbmRlZCBvbiBvdGhlciBhcHByb2FjaGVzLg0KDQpUaGFua3MsDQoNCj1F ZA0KDQo= From owner-freebsd-hackers@freebsd.org Fri Jan 22 00:20:52 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 D84ADA8C671; Fri, 22 Jan 2016 00:20:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::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 637B8108D; Fri, 22 Jan 2016 00:20:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id 17so37290740lfz.1; Thu, 21 Jan 2016 16:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=K/DIjz4NnIwgYkpEtM5csnTNcQdJl+uGd7ij3sQkxcg=; b=H1LlgfI8xFeETvmTq6i9Ge5NeHycSJBagPdjss1UjBswag5fQUepgw28k4+oPLrnCm FSDLUXRxoVnbEom4CSbVHFqyT7doUp+1AUo8vULbwLCEVoIlqZQG+sA6kIRoTa19Tq4G ql2eaPL61ltuD5Aj20aP2KqNlDQ2o8cgtn3dkvL8UTv4FG/sOGVpcIGqyLtEMOBl9L2v yYHbD2MNrO4N3XSuoxLw4L9DN1J9dcHmSNuQdwjF9vRTsw4nBsfanDjVPzN8QCOLrmJT jVVNB5f+NmOyHMX/3Kt8bTTsVKAyX/8N5o/PVXBHga2iSYaJVNES0MuthL5+Ztco0y7t BaKA== 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:date :message-id:subject:from:to:cc:content-type; bh=K/DIjz4NnIwgYkpEtM5csnTNcQdJl+uGd7ij3sQkxcg=; b=eAFwLbG6KHDvV9hHDFnRBWQSVm/0bz4YmfPKNp4afE7xS5sh9apHel/g6wKCAf+Rnd Vkp108saZjV1BrRAq/DhdWerkWErLTgVkzPnLi6R5XmCuv+YgOr4avju3VqGK6tQDlCU NKlYb4lwQv7fqfVBKeL8K0IbDqpt1B7G8uE/+aEQZLLUoUJ53p0dAEm+RQeM4IBv5iyL wiGI5reCL3g4MwRfgjKE7Zgk8S/7uUNZ+oCyVcPhZEVEIOSr+1TDBjJGLZsf+r6T2yao z+yg+/ud9J7z+Mld/TlBSk1S0LsXqIlqvdpemMVl/lbmCjRKkzoLA/L/ZRQFVbB8cZal MW+w== X-Gm-Message-State: AG10YORKJyHFl3okDK4j3pWY+cY+aZavHsf4dmHGwV858YRnEXgL+Y1Nt8khfcNE16YrwrATaGwNnV3X5PbEQw== MIME-Version: 1.0 X-Received: by 10.25.155.81 with SMTP id d78mr37760lfe.77.1453422050184; Thu, 21 Jan 2016 16:20:50 -0800 (PST) Received: by 10.112.160.133 with HTTP; Thu, 21 Jan 2016 16:20:50 -0800 (PST) In-Reply-To: References: <56A10892.2090308@rlwinm.de> Date: Thu, 21 Jan 2016 16:20:50 -0800 Message-ID: Subject: Re: IoT OS From: NGie Cooper To: Jan Bramkamp Cc: FreeBSD Current , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 00:20:52 -0000 On Thu, Jan 21, 2016 at 8:38 AM, NGie Cooper wrote: ... > I would talk to cem@. He's working on ioat(4) on head for us ($work). I misunderstood the terms a bit. IoT (Internet of Things) != iaot(4) ( Intel I/O Acceleration Technology ). Thanks, -NGie From owner-freebsd-hackers@freebsd.org Fri Jan 22 10:24: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 BFA43A8D27C; Fri, 22 Jan 2016 10:24:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAFF14CF; Fri, 22 Jan 2016 10:24:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-229-231.lns20.per1.internode.on.net [121.45.229.231]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u0MAOY0b068866 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 22 Jan 2016 02:24:37 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: IoT OS To: Mathieu Prevot , NGie Cooper References: <56A10892.2090308@rlwinm.de> Cc: Jan Bramkamp , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org From: Julian Elischer Message-ID: <56A2035D.7030201@freebsd.org> Date: Fri, 22 Jan 2016 18:24:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 10:24:47 -0000 On 22/01/2016 2:08 AM, Mathieu Prevot wrote: > 2016-01-21 17:38 GMT+01:00 NGie Cooper : > >>> On Jan 21, 2016, at 08:34, Jan Bramkamp wrote: >>> >>>> On 21/01/16 17:19, Mathieu Prevot wrote: >>>> Dear all, >>>> >>>> I would like to connect several connected object (with homogeneous or >>>> heterogenous hardare: intel edison, samsung artik, apple AX, intel >> core, >>>> etc) so the calculation needs, the storage/memory, the connection, etc >> are >>>> decoupled; hence we can reach an ecosystem with several clouds. >>>> >>>> How do you recommend to reach that ? from the kernel, a module, or >>>> eventually a software ? >>> Your message contains neither enough information nor a precise enough >> question for anyone to provide you a helpful answer. >>> Please describe your problem in sufficient detail and reformulate your >> question. If you still think these mailing lists (current@ and hackers@) >> are a good audience for your question afterward ask them again. >> >> It depends on your workload and hardware requirements (there isn't a >> simple answer to your question because you didn't describe what you needed >> with concrete requirements). >> >> I would talk to cem@. He's working on ioat(4) on head for us ($work). >> Thanks, >> -NGie >> > Say all objects are connected peer to peer with wifi, some of them are > connected to internet through gsm network or wifi to a box. These object > are moving in space, and for some reasons, connections are dynamical and > can be severely impaired or lost. > > They have incoming local streams of data (eg HD videos, accelerometer, GPS, > other wifi and gsm signals, etc). > > I would like to abstract the CPU layer, storage layer, and internet > connection so that in realtime results of one of my objects are saved if > this object dies, so that if one of the object giving internet access to > the group loose its connection, the redundancy allows the group of object > not to lose internet connection. > > Can I consider these as different load balancing layers ? Do you recommend > to implement this at the kernel layer or at an API layer ? Can I see that > as a lightweight cluster ? > > I think the API is more flexible, especially if I have an heterogeneous (by > CPU, OS) set of connected object. However, working at the kernel level > allows existing programs not to be rewritten. What are your thoughts ? > > Do you recommend another list ? This is still very hard to understand. Are you planning to work with some API that is described in a document somewhere? if so please give links. > > Thanks > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Fri Jan 22 10:40:40 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 88228A8D72A for ; Fri, 22 Jan 2016 10:40:40 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from smtp.rlwinm.de (smtp.rlwinm.de [IPv6:2a01:4f8:201:31ef::e]) (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 1E6EA1E66 for ; Fri, 22 Jan 2016 10:40:40 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from crest.local (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 451B1FA4C for ; Fri, 22 Jan 2016 11:40:37 +0100 (CET) Subject: Re: IoT OS References: <56A10892.2090308@rlwinm.de> To: freebsd-hackers@freebsd.org From: Jan Bramkamp Message-ID: <56A20724.8050704@rlwinm.de> Date: Fri, 22 Jan 2016 11:40:36 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 10:40:40 -0000 On 21/01/16 19:08, Mathieu Prevot wrote: > 2016-01-21 17:38 GMT+01:00 NGie Cooper : > >> >>> On Jan 21, 2016, at 08:34, Jan Bramkamp wrote: >>> >>>> On 21/01/16 17:19, Mathieu Prevot wrote: >>>> Dear all, >>>> >>>> I would like to connect several connected object (with homogeneous or >>>> heterogenous hardare: intel edison, samsung artik, apple AX, intel >> core, >>>> etc) so the calculation needs, the storage/memory, the connection, etc >> are >>>> decoupled; hence we can reach an ecosystem with several clouds. >>>> >>>> How do you recommend to reach that ? from the kernel, a module, or >>>> eventually a software ? >>> >>> Your message contains neither enough information nor a precise enough >> question for anyone to provide you a helpful answer. >>> >>> Please describe your problem in sufficient detail and reformulate your >> question. If you still think these mailing lists (current@ and hackers@) >> are a good audience for your question afterward ask them again. >> >> It depends on your workload and hardware requirements (there isn't a >> simple answer to your question because you didn't describe what you needed >> with concrete requirements). >> >> I would talk to cem@. He's working on ioat(4) on head for us ($work). >> Thanks, >> -NGie >> > > Say all objects are connected peer to peer with wifi, some of them are > connected to internet through gsm network or wifi to a box. These object > are moving in space, and for some reasons, connections are dynamical and > can be severely impaired or lost. > > They have incoming local streams of data (eg HD videos, accelerometer, GPS, > other wifi and gsm signals, etc). There are several orders of magnitude between the bandwidth requirements for HD video and sensors samples from accelerometers and GPS receivers (both types of sensor data can be compressed even further with simple delta compression). Anything that can store a few hours of HD video can store a several years worth of your sensor data as well. > I would like to abstract the CPU layer, storage layer, and internet > connection so that in realtime results of one of my objects are saved if > this object dies, so that if one of the object giving internet access to > the group loose its connection, the redundancy allows the group of object > not to lose internet connection. You can't have reliable realtime access to your (new) sensor data without a reliable link with guaranteed bandwidth. You can only have best effort replication to multiple nodes. > Can I consider these as different load balancing layers ? Do you recommend > to implement this at the kernel layer or at an API layer ? Can I see that > as a lightweight cluster ? There is now way I can imagine to implement a sane single image cluster system on a bunch of hardware that happens to have network connectivity and sensors from time to time. The hardware requirements to just encode HD video is again multiple orders of magnitude above what your other sensors require. At this point a difference in quantity turn into a difference in quality. Your cluster won't gain throughput from the puny nodes because the potential gains are outweighed by the overhead. > I think the API is more flexible, especially if I have an heterogeneous (by > CPU, OS) set of connected object. However, working at the kernel level > allows existing programs not to be rewritten. What are your thoughts ? A simple wireless sensor node can't power a CPU and memory subsystem capable of running FreeBSD (or any other modern *nix kernel). Those kernels require something between 32MiB and 64MiB of RAM and wake up the CPU far to often. Such a system would drain its battery in hours if not minutes. This rules out a common kernel unless you want to use a lightweight RTOS on your large nodes as well. My recommendation from what I understood from your messages so far is to structure your sensor network as at least two types of nodes: - Simple sensor nodes operating as message sources (and maybe forwarders in a mesh network) - Larger nodes with enough resources (CPU, RAM, storage, power) to run a common *nix OS working as message sinks (and optionally forwarders or sources). From owner-freebsd-hackers@freebsd.org Fri Jan 22 11:27:03 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 52090A8C803 for ; Fri, 22 Jan 2016 11:27:03 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 46214126B for ; Fri, 22 Jan 2016 11:27:02 +0000 (UTC) (envelope-from bright@mu.org) Received: from Alfreds-MacBook-Pro-2.local (unknown [IPv6:2601:645:8001:cee1:3082:4808:c2a:54ab]) by elvis.mu.org (Postfix) with ESMTPSA id 229C1345A921 for ; Fri, 22 Jan 2016 03:27:02 -0800 (PST) Subject: Re: Now I am aware To: freebsd-hackers@freebsd.org References: From: Alfred Perlstein Message-ID: <56A21205.9030202@mu.org> Date: Fri, 22 Jan 2016 03:27:01 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 11:27:03 -0000 I can't access this link... what was there? On 1/19/16 9:21 AM, Joe Nosay wrote: > of how self-centered and selfish all of you are. > > > > https://forums.freebsd.org/threads/making-it-public.54392/#post-309037 > _______________________________________________ > 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 Fri Jan 22 12:09:55 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 D0771A8B17E for ; Fri, 22 Jan 2016 12:09:55 +0000 (UTC) (envelope-from mailinglists@toco-domains.de) Received: from toco-domains.de (mail.toco-domains.de [176.9.39.170]) (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 967AC1004 for ; Fri, 22 Jan 2016 12:09:55 +0000 (UTC) (envelope-from mailinglists@toco-domains.de) Received: from [0.0.0.0] (mail.toco-domains.de [IPv6:2a01:4f8:150:50a5::6]) by toco-domains.de (Postfix) with ESMTPA id CF5F31B22064; Fri, 22 Jan 2016 13:09:46 +0100 (CET) Subject: Re: Now I am aware To: Alfred Perlstein , freebsd-hackers@freebsd.org References: <56A21205.9030202@mu.org> From: Torsten Zuehlsdorff Message-ID: <56A21C0A.7060904@toco-domains.de> Date: Fri, 22 Jan 2016 13:09:46 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56A21205.9030202@mu.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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 12:09:55 -0000 You can have a look in Google-Cache: http://webcache.googleusercontent.com/search?q=cache:https://forums.freebsd.org/threads/making-it-public.54392/%23post-309037&ie=utf-8&oe=utf-8&gws_rd=cr&ei=rhuiVrbMKIOGaLvOuZAN But this will not last very long. On 22.01.2016 12:27, Alfred Perlstein wrote: > I can't access this link... what was there? > > On 1/19/16 9:21 AM, Joe Nosay wrote: >> of how self-centered and selfish all of you are. >> >> >> >> https://forums.freebsd.org/threads/making-it-public.54392/#post-309037 >> _______________________________________________ >> 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" >> > > _______________________________________________ > 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 Fri Jan 22 14:41:12 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 4AAE6A8D3A1 for ; Fri, 22 Jan 2016 14:41:12 +0000 (UTC) (envelope-from db@db.net) Received: from diana.db.net (unknown [IPv6:2620:64:0:1:223:7dff:fea2:c8f2]) by mx1.freebsd.org (Postfix) with ESMTP id 36FA715D8 for ; Fri, 22 Jan 2016 14:41:12 +0000 (UTC) (envelope-from db@db.net) Received: from night.db.net (localhost [127.0.0.1]) by diana.db.net (Postfix) with ESMTP id 647332AA45F; Fri, 22 Jan 2016 07:40:39 -0700 (MST) Received: by night.db.net (Postfix, from userid 1000) id 1A0EF1CC4F; Fri, 22 Jan 2016 09:41:02 -0500 (EST) Date: Fri, 22 Jan 2016 09:41:02 -0500 From: Diane Bruce To: Mateusz Guzik , Jilles Tjoelker , "Batutis, Ed" , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: Re: get number of open files in a process? Message-ID: <20160122144102.GA92956@night.db.net> References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> <20160121225111.GB21869@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160121225111.GB21869@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 14:41:12 -0000 On Thu, Jan 21, 2016 at 11:51:11PM +0100, Mateusz Guzik wrote: > On Thu, Jan 21, 2016 at 11:45:11PM +0100, Jilles Tjoelker wrote: > > On Thu, Jan 21, 2016 at 07:44:01PM +0000, Batutis, Ed wrote: ... > > This cannot work. POSIX mandates the lowest free fd is returned, so the > N you see here can be extremely low, while the process is running out of > fds. The hack not mentioned here of course is to (mis-)use dup2() to shuffle all your other fd's down by one as you close them. ;) (This actually was used in early versions of the IRC Daemon. ;) Not for this reason however. ) > one to take - you have to have a very big reserve to not suddenly run > out of fds, one would just limit amount of clients and, well, handle > errors as they can pop up for reasons other than running out of fd slots. I agree. > > -- > Mateusz Guzik > Diane -- - db@FreeBSD.org db@db.net http://www.db.net/~db From owner-freebsd-hackers@freebsd.org Fri Jan 22 17:08:56 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 BE081A8D12A; Fri, 22 Jan 2016 17:08:56 +0000 (UTC) (envelope-from anton.rang@isilon.com) Received: from mailuogwdur.emc.com (mailuogwdur.emc.com [128.221.224.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailuogwprd51.lss.emc.com", Issuer "RSA Corporate Server CA v2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6091539; Fri, 22 Jan 2016 17:08:56 +0000 (UTC) (envelope-from anton.rang@isilon.com) Received: from maildlpprd52.lss.emc.com (maildlpprd52.lss.emc.com [10.106.48.156]) by mailuogwprd51.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id u0MH8jPQ023465 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Jan 2016 12:08:46 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd51.lss.emc.com u0MH8jPQ023465 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=isilon.com; s=jan2013; t=1453482526; bh=oARnOmVavDJPlXFZZ37Qc5XncHU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=figiBiZKDexuWu9jSgkwCmt7fg0ngzECxuBX+R0w45XG6/SbeQsNtjEkUA1NdS0dZ bdZjydq591w6Xn+M2rIWslCUFXAsiCLmWWo0qfXnRmwyUDCFsRbSEby+lLDQzm9DKI +r12KcZx93cz+pDCnRccFFI9I8v+UPrtPOi/BN9A= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd51.lss.emc.com u0MH8jPQ023465 Received: from mailusrhubprd04.lss.emc.com (mailusrhubprd04.lss.emc.com [10.253.24.22]) by maildlpprd52.lss.emc.com (RSA Interceptor); Fri, 22 Jan 2016 12:08:25 -0500 Received: from MXHUB217.corp.emc.com (MXHUB217.corp.emc.com [10.253.68.87]) by mailusrhubprd04.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id u0MH8XOn020707 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=FAIL); Fri, 22 Jan 2016 12:08:33 -0500 Received: from MX104CL01.corp.emc.com ([169.254.7.159]) by MXHUB217.corp.emc.com ([10.253.68.87]) with mapi id 14.03.0266.001; Fri, 22 Jan 2016 12:08:32 -0500 From: "Rang, Anton" To: Mathieu Prevot , NGie Cooper CC: Jan Bramkamp , "freebsd-hackers@freebsd.org" , "freebsd-current@freebsd.org" Subject: RE: IoT OS Thread-Topic: IoT OS Thread-Index: AQHRVGer4Z6ZjBEe40iiSuO3vjQwlJ8GfjEAgAABBYCAABhHgIABKbng Date: Fri, 22 Jan 2016 17:08:32 +0000 Message-ID: References: <56A10892.2090308@rlwinm.de> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.13.55.14] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd04.lss.emc.com X-RSA-Classifications: public X-Mailman-Approved-At: Fri, 22 Jan 2016 17:13:35 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 17:08:56 -0000 >Say all objects are connected peer to peer with wifi, some of them are con= nected to internet through gsm network or wifi to a box. >These object are moving in space, and for some reasons, connections are dy= namical and can be severely impaired or lost. > >They have incoming local streams of data (eg HD videos, accelerometer, GPS= , other wifi and gsm signals, etc). > >I would like to abstract the CPU layer, storage layer, and internet connec= tion so that in realtime results of one of my objects are saved >if this object dies, so that if one of the object giving internet access t= o the group loose its connection, the redundancy allows the group of object= not to lose internet connection. > >Can I consider these as different load balancing layers ? Do you recommend= to implement this at the kernel layer or at an API layer ? >Can I see that as a lightweight cluster ? > >I think the API is more flexible, especially if I have an heterogeneous (b= y CPU, OS) set of connected object. However, working at the kernel level al= lows existing programs not to be rewritten. >What are your thoughts ? =3D=3D=3D OK, I think I understand your question now. This isn't the right list for it, though I'm not sure where the right place= to go would be -- it's not FreeBSD-specific, in any case. There are academ= ic research groups looking into this type of problem; for instance, in the = area of sensor networks (ACM Transactions on Sensor Networks covers some of= these areas). There may be USENET groups which cover this area. To cover your three areas, which I think require somewhat different solutio= ns -- (a) CPU layer. I don't really recommend trying to abstract this. You coul= d use a virtual machine to hide the underlying architecture, and checkpoint= state periodically, but this is likely to slow down execution too much to = be useful. If the issue that a service may become unavailable, I'd recomme= nd a middleware layer which can detect this and recover by starting a new i= nstance of the service. Middleware layers like ZeroMQ, and clustering softw= are, may be a useful starting point. This does mean that stateful connecti= ons (like reading a video stream) won't recover cleanly, though; the client= would need to reconnect to attach to the new instance of the service. If = you really need that, it's going to be hard. (b) Storage layer. Look into highly-available clustered storage solutions.= If you can use key-value or some other simplified storage model, do it. = There are clustered file systems but probably none freely available that wo= uld work on the scale you envision and give decent performance. There are = more alternatives if you're flexible about the format in which you're stori= ng data (e.g. replicated object stores). (c) Networking layer; or internet. If you can drop & re-establish a connect= ion, or if every node has its own IP address (IPv6), this should be pretty = straightforward; software could detect loss of connection and change the ro= uting used to go through a different system. If not, you'll be a bit limite= d since mirroring TCP state between nodes would be too slow. This is a case= where the existing operating system kernels are likely to do most of what = you need; you simply need to add a layer to detect routing problems and sel= ect a new internet gateway appropriately. I'd avoid implementing any clustering within the kernel, in part because if= you have a wide variety of objects you may not want the same kernel on all= of them, and in part because debugging & recovery is much harder. You're u= nlikely to want to run most existing software on such a system anyway (espe= cially if they have relatively weak processors); you're better off writing = to a set of clustering APIs for storage and state, at least. For networking= , as mentioned, you can likely use the existing TCP stack & just add contro= ls to redirect traffic as needed. -- Anton From owner-freebsd-hackers@freebsd.org Fri Jan 22 18:08:08 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 36A43A8C9CF for ; Fri, 22 Jan 2016 18:08:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 BDA171BD6 for ; Fri, 22 Jan 2016 18:08:07 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id l65so271188992wmf.1 for ; Fri, 22 Jan 2016 10:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=zseoMrX4tB5CnOZRCislFIEC0tQyibdhj6MFBjOJGis=; b=doeIzoY9IaTmwyDY2zrjfN5OBFP8ekFGIDljm+HAnm6yyBgdM1+22k2a/kVmBC5fG0 ES0IYeOwP36pJ4tw7gfpM+XyxG7/QxzeVQrDI0PMQemxphVfJKmTIyPb7LswXsJkgJzg 3bkUnmnTBOJGctmUgn7zkKiXMkcGhlD1yYqSXgpy/bfAogZ1uWmQr6slJzUterJdxyU/ UvrpM1j7B9h2LFRNBUnWQito+ujoR0s2WlkVWpK4AuuZqNqb/COikvQUACk2SXAlXAv1 yspFxhKiVd+jhU0uNXYVVo4ok/wtlji96mgbFL2rlFGzxvAIzbVJlDNixzFSd/qzu2fE 7fmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=zseoMrX4tB5CnOZRCislFIEC0tQyibdhj6MFBjOJGis=; b=AD1jRrm/LwqZ7ee/QVH/XvV+9AKYOLiNUL2a1HNkQPqbnU8WUBGOawwucjuiXRbgHY rkbrJmwik+UHmNkL3t5y9Wfp5qz3xBJktmUPj3iDFluzekfgLZx91ibqSHAVvrVdJ9lD DhQua+T7M+115DGBaj4kblsbqkCzOWqp0DytpWNbk/G1nX3k2+ayJ2nWuTdpwhbpoVVr Hwexi+rQEnQ0XPr7IUB4MXhCKpie+qJWyUqBrDyTuAiHEO6nTz+Gpk0MYzCzyhJfCoZY kkVkKZu0cB9lOh+/OA0nI9O95DHxPsKbI8M+D5rld9X1MKsY3uJlt7f9jyxKt+hiCT6z O20w== X-Gm-Message-State: AG10YORVuWtJaGUv7kbMi8sUpvLTJ72bLftSNcSf6ASWCIcSTjqOIf9pYiS4L+yCCB2FPw== X-Received: by 10.194.22.132 with SMTP id d4mr4614872wjf.174.1453486086263; Fri, 22 Jan 2016 10:08:06 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id m128sm3929786wma.24.2016.01.22.10.08.05 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 10:08:05 -0800 (PST) Date: Fri, 22 Jan 2016 19:08:03 +0100 From: Mateusz Guzik To: "Batutis, Ed" Cc: Jilles Tjoelker , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: Re: get number of open files in a process? Message-ID: <20160122180803.GA4476@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , "Batutis, Ed" , Jilles Tjoelker , "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> <20160121225111.GB21869@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 18:08:08 -0000 On Fri, Jan 22, 2016 at 06:02:07PM +0000, Batutis, Ed wrote: > > The sysctl I mentioned in my mail can be trivially backported to other > > FreeBSD versions, if this kind of feature is really needed. > > > > Can you point me to a patch or the code in question? > I already did earlier in the thread. https://svnweb.freebsd.org/base?view=revision&revision=290473 -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Fri Jan 22 18:36: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 A0F31A8D478 for ; Fri, 22 Jan 2016 18:36:38 +0000 (UTC) (envelope-from Mark.Martinec+freebsd@ijs.si) Received: from mail.ijs.si (mail.ijs.si [IPv6:2001:1470:ff80::25]) (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 5CC781142 for ; Fri, 22 Jan 2016 18:36:38 +0000 (UTC) (envelope-from Mark.Martinec+freebsd@ijs.si) Received: from amavis-ori.ijs.si (localhost [IPv6:::1]) by mail.ijs.si (Postfix) with ESMTP id 3pn8SM248dz1Y9 for ; Fri, 22 Jan 2016 19:36:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ijs.si; h= user-agent:message-id:references:in-reply-to:organization :subject:subject:from:from:date:date:content-transfer-encoding :content-type:content-type:mime-version:received:received :received:received; s=jakla4; t=1453487792; x=1456079793; bh=Tia BspwjhWS5C3sbbxIfZQ5p9I8K4Ko0iUnJfBCPkm4=; b=NPr9ThcThoOrrvUXAZ4 jdCFX0L3oGn0/k4+uVFlDtvdbD2TZ6AkIdwhww7gUNUX2iIIp2yc0px46e6ICneL zFVoqyq0+mY0MLSGW5Aki/9jB524GG1l7Ej41X1/CHNeBFtSnRhgdHGOyjASe23j wjUMyl6vrJsHsZ7WF1Fp3/Uw= X-Virus-Scanned: amavisd-new at ijs.si Received: from mail.ijs.si ([IPv6:::1]) by amavis-ori.ijs.si (mail.ijs.si [IPv6:::1]) (amavisd-new, port 10026) with LMTP id CRHqWUuSFxey for ; Fri, 22 Jan 2016 19:36:32 +0100 (CET) Received: from mildred.ijs.si (mailbox.ijs.si [IPv6:2001:1470:ff80::143:1]) by mail.ijs.si (Postfix) with ESMTP id 3pn8SJ2Wpgz1Y8 for ; Fri, 22 Jan 2016 19:36:30 +0100 (CET) Received: from nabiralnik.ijs.si (nabiralnik.ijs.si [IPv6:2001:1470:ff80::80:16]) by mildred.ijs.si (Postfix) with ESMTP id 3pn8SG3hZpz1Xn for ; Fri, 22 Jan 2016 19:36:30 +0100 (CET) Received: from neli.ijs.si (2001:1470:ff80:88:21c:c0ff:feb1:8c91) by webmail.ijs.si with HTTP (HTTP/1.1 POST); Fri, 22 Jan 2016 19:36:30 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 22 Jan 2016 19:36:30 +0100 From: Mark Martinec To: freebsd-hackers@freebsd.org Subject: RE: get number of open files in a process? Organization: Jozef Stefan Institute In-Reply-To: <8ca419f8820c4280a81f03102c7c0372@hioexcmbx08-prd.hq.netapp.com> References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> <20160121225111.GB21869@dft-labs.eu> <8ca419f8820c4280a81f03102c7c0372@hioexcmbx08-prd.hq.netapp.com> Message-ID: <8a32fa24128e9def077522b1ea0414e6@mailbox.ijs.si> X-Sender: Mark.Martinec+freebsd@ijs.si User-Agent: Roundcube Webmail/1.1.4 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 18:36:38 -0000 On 2016-01-22 00:14, Batutis, Ed wrote: >> I'm still not convinced the approach here (of checking fds) is the >> right one >> to take - you have to have a very big reserve to not suddenly run out >> of fds, >> one would just limit amount of clients and, well, handle errors as >> they can >> pop up for reasons other than running out of fd slots. > > I have a large reserve - usually more than 1000 fd slots. But > occasionally something happens and the process runs out. There are a > lot of different things going on in the process in terms of fd usage. > So, finding the issue could be easier if I know when the number > started rising to an unusual level. And I can possibly find the root > cause more easily if I stop doing some things when this happens. I can > monitor memory usage and CPU usage easily enough, but I could not > figure out how to monitor fd usage. There are other approaches, yes. > But I was looking for something simple but useful until additional > effort could be expended on other approaches. I imagine that instrumenting opens, closes, dups and the like with dtrace would be able to do the job: increment a count when a new fd pops up, decrement on close, and you may end up with a diagram of fd usage over time. Or track each operation dealing with file descriptors individually. Msrk From owner-freebsd-hackers@freebsd.org Fri Jan 22 18:03: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 C788FA8C68F for ; Fri, 22 Jan 2016 18:03:16 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) Received: from mx142.netapp.com (mx142.netapp.com [216.240.21.19]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mx141.netapp.com", Issuer "Symantec Class 3 Secure Server CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3A67164A for ; Fri, 22 Jan 2016 18:03:16 +0000 (UTC) (envelope-from Ed.Batutis@netapp.com) X-IronPort-AV: E=Sophos;i="5.22,332,1449561600"; d="scan'208";a="89867318" Received: from hioexcmbx01-prd.hq.netapp.com ([10.122.105.34]) by mx142-out.netapp.com with ESMTP; 22 Jan 2016 10:02:12 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by hioexcmbx01-prd.hq.netapp.com (10.122.105.34) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Fri, 22 Jan 2016 10:02:12 -0800 Received: from HIOEXCMBX08-PRD.hq.netapp.com ([::1]) by hioexcmbx08-prd.hq.netapp.com ([fe80::6575:4d3c:1907:ddb1%21]) with mapi id 15.00.1130.005; Fri, 22 Jan 2016 10:02:12 -0800 From: "Batutis, Ed" To: Mateusz Guzik , Jilles Tjoelker CC: "freebsd-hackers@freebsd.org" , Diane Bruce , Joerg Sonnenberger Subject: RE: get number of open files in a process? Thread-Topic: get number of open files in a process? Thread-Index: AdFT1cxGnzmxie9rRAaN4NJqEtku+wAzsUMAAAFlx4AAAE76gAAMyqlg///IhACAAIMxQP//uA6AgAABrYD//0ZbwA== Date: Fri, 22 Jan 2016 18:02:07 +0000 Deferred-Delivery: Fri, 22 Jan 2016 18:01:00 +0000 Message-ID: References: <20160121153636.GA10961@britannica.bec.de> <20160121161637.GA83843@night.db.net> <20160121162527.GA11600@britannica.bec.de> <20160121191308.GA21869@dft-labs.eu> <31126442b7d347c5976a57aabc2e5792@hioexcmbx08-prd.hq.netapp.com> <20160121224511.GA74045@stack.nl> <20160121225111.GB21869@dft-labs.eu> In-Reply-To: <20160121225111.GB21869@dft-labs.eu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.122.56.79] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 22 Jan 2016 18:41:25 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 18:03:16 -0000 PiBUaGUgc3lzY3RsIEkgbWVudGlvbmVkIGluIG15IG1haWwgY2FuIGJlIHRyaXZpYWxseSBiYWNr cG9ydGVkIHRvIG90aGVyDQo+IEZyZWVCU0QgdmVyc2lvbnMsIGlmIHRoaXMga2luZCBvZiBmZWF0 dXJlIGlzIHJlYWxseSBuZWVkZWQuDQo+IA0KDQpDYW4geW91IHBvaW50IG1lIHRvIGEgcGF0Y2gg b3IgdGhlIGNvZGUgaW4gcXVlc3Rpb24/DQoNClRoYW5rcywNCg0KPUVkDQo= From owner-freebsd-hackers@freebsd.org Sat Jan 23 21:17: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 6EA3FA8EE1D for ; Sat, 23 Jan 2016 21:17:39 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 04ACE1B2B for ; Sat, 23 Jan 2016 21:17:39 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id u188so23596641wmu.1 for ; Sat, 23 Jan 2016 13:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=hhOzuswoSLH1UwxyQkIcP5HYO4VG3fHDeKrpT7uJQZY=; b=fm/PEwt7BgsN+R9YAHzr3Jk0gmguZsvPVswU6JOsee9LpqBIRDf2LoUDEH+dXcdEqD l+wG5DScd51jK24UZXcCLchpx5IWhl0vRRmefkvtitlvE30S05zLUr4pGXQeKbXLp5l5 44ZmmBF+b75b/T/LDRKIwyi5wPuWQ2wBM4PSaiiP6guWvg3yI+j18I57vlHtld6f6hu7 9MXfQZKL8G3u2ukk5oMLqLzMpZrfDyfFX5jv87WFgDHdSuEJ3Bh/OCZyysAlB3LetM/L denR6enmNSz5kJ4fZ4Twg6h+6jWlYP0oUWVnsUUiOa8+YtLFgNFXYNVZsTiI2aDrXfgT SYYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=hhOzuswoSLH1UwxyQkIcP5HYO4VG3fHDeKrpT7uJQZY=; b=mu2dqr8j5gkZlqJxmJZ1huZGPpd8brjAVX6dSBLnVQ/z0DKfyo718pEY0Z4/P5TT6V BnTcXuGwtyPF/H7DLz8eHvr+StGku1Ux2nUT/pR1jrs+6NmGzsligPyqd8Y5CkAv8qNY MiPH5SLQvJPkvn+SKKthrCIv8TWf9j3dfYoEemSNPIojFDnmsbjwIemrI1R9DJ//IdI3 yvCq6d18R2y7PRSN+Tkm9mVzYVayHwkYAvg/j/T+UkWq5izm/yskcdgAUZjP2NoBeauH cMUww9G2D0xpEoN0WpnOTGDMen0UxRes+M2CroT50gzZAel/Q/wCTvNTHm8IGs4zsb/J uJxg== X-Gm-Message-State: AG10YOSJKbCpXHbgM/BkoBWiccAxEPTbamxnzjfLP781Gw2jt2USvaNAeOK6+BFm5AiHFg== X-Received: by 10.194.22.101 with SMTP id c5mr11040120wjf.151.1453583856368; Sat, 23 Jan 2016 13:17:36 -0800 (PST) Received: from azdaja.softwarehood.com ([46.240.236.6]) by smtp.gmail.com with ESMTPSA id ct2sm11816743wjb.46.2016.01.23.13.17.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jan 2016 13:17:35 -0800 (PST) To: freebsd-hackers@FreeBSD.org From: Ivan Radovanovic Subject: Unexpected (at least to me) kevent behavior on window size change when in X Message-ID: <56A3EDEE.1030400@gmail.com> Date: Sat, 23 Jan 2016 22:17:34 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 21:17:39 -0000 Hi everybody, I am using kevent(2) to monitor for file changes and I just noticed some weird behavior - if program is running within X (in MATE terminal), and if it is already blocked on kevent when I change window size kevent returns -1 and sets errno to 0. I am not monitoring anything weird - only normal file descriptors (of regular files). This is happening on 10.2-STABLE r291381 The only thing which is out of ordinary is that I am doing this from mono, but still I am directly invoking libc functions from it, so I don't think it can have anything with it. Kind regards, Ivan From owner-freebsd-hackers@freebsd.org Sat Jan 23 21:43: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 2AB1EA8F6BF for ; Sat, 23 Jan 2016 21:43:36 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::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 B526B19D4 for ; Sat, 23 Jan 2016 21:43:35 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id 123so23916922wmz.0 for ; Sat, 23 Jan 2016 13:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=WuOQ546QdAFVeJ+UAZiW2CZwPw9Q9txZ/2R7TgtXU8c=; b=Ve64ircnIYoWDLQHs+Sc6PpFoUOBGe3R7mn646O7OvLzUJUgKuBYw4sF8PBHmEuqex 7wF7Pfac2EQgPNTMvwMV6sW8hTcVkULKscPx7xzuGjZoEefVfaHfiYlBEsKxevCQu21W U8xsPWXF5nKFv3JIln58oQYYswl4+99mnAtne8OFHtCYqBaFoEKQN+9HhKmRisa6kFm1 0F0U8NeaCr46r/QoQc2E2Io/f4jBlPmGzCwILR5zXzIZTSnA2I+yytFfkDYeYFqOqkUY 8asP73XZM5pl9AJZ+ryWk4cSo8vUDgIUJTIIGfUbZ7bX3bTRu6OAupE63arG7QbOFX5O 0scg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=WuOQ546QdAFVeJ+UAZiW2CZwPw9Q9txZ/2R7TgtXU8c=; b=O/LpvCvOxdbMfbp/wvdsd+yqV9xNHnWYXL9Jza3JM2zdhuZE5HlcIpHWKRw8dbbkDX QnA/8JCVilAkBaU+o1II08kN3SbjSaOl7HE67hijYLJbA0iJx+XKFLcaDxXVDWXImebc UHb/gwJjR7T6kQz7lwkzoJdgdfpJc+29p4zVU+io2SyE3YxYDyMvcdBUoYcodKzA/T2S 0ufkS5YIZw7vfJ3y6JsJGuoF1uoFe7tZSUpUxJgPxgar6xQz+L3W12RWSg5t0TrOmNuE KxyC7LWKJ25faqsVAfXIpPB4RR/kANohhIpLdjXeWYWYRfNefB5bysRPGlicN4TS0NMj ISRw== X-Gm-Message-State: AG10YOTj3fjfW0dCtyHPHvlfVszyPif/S8HjT+5Fx6TCc+h8gg9Sv+3fVwKSDxXgowSKaQ== X-Received: by 10.194.6.37 with SMTP id x5mr11450930wjx.178.1453585413956; Sat, 23 Jan 2016 13:43:33 -0800 (PST) Received: from azdaja.softwarehood.com ([46.240.236.6]) by smtp.gmail.com with ESMTPSA id t195sm8925387wme.13.2016.01.23.13.43.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jan 2016 13:43:33 -0800 (PST) Subject: Re: Unexpected (at least to me) kevent behavior on window size change when in X To: freebsd-hackers@FreeBSD.org References: <56A3EDEE.1030400@gmail.com> From: Ivan Radovanovic Message-ID: <56A3F404.7020800@gmail.com> Date: Sat, 23 Jan 2016 22:43:32 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56A3EDEE.1030400@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 21:43:36 -0000 On 01/23/2016 22:17, Ivan Radovanovic wrote: > > The only thing which is out of ordinary is that I am doing this from > mono, but still I am directly invoking libc functions from it, so I > don't think it can have anything with it. > Definitely it is something mono specific (I would still love to hear if somebody has idea what might cause it) - I just wrote little C program to test for same thing and everything works as expected. Kind regards, Ivan From owner-freebsd-hackers@freebsd.org Sat Jan 23 21:52:41 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 8FEDAA8F92F for ; Sat, 23 Jan 2016 21:52:41 +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 4F2991F15 for ; Sat, 23 Jan 2016 21:52:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aN66h-000GIr-Nm; Sun, 24 Jan 2016 00:52:31 +0300 Date: Sun, 24 Jan 2016 00:52:31 +0300 From: Slawa Olhovchenkov To: Ivan Radovanovic Cc: freebsd-hackers@FreeBSD.org Subject: Re: Unexpected (at least to me) kevent behavior on window size change when in X Message-ID: <20160123215231.GO88527@zxy.spb.ru> References: <56A3EDEE.1030400@gmail.com> <56A3F404.7020800@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A3F404.7020800@gmail.com> 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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 21:52:41 -0000 On Sat, Jan 23, 2016 at 10:43:32PM +0100, Ivan Radovanovic wrote: > On 01/23/2016 22:17, Ivan Radovanovic wrote: > > > > The only thing which is out of ordinary is that I am doing this from > > mono, but still I am directly invoking libc functions from it, so I > > don't think it can have anything with it. > > > > Definitely it is something mono specific (I would still love to hear if > somebody has idea what might cause it) - I just wrote little C program > to test for same thing and everything works as expected. May be this is mono mapping EINTR to 0? From owner-freebsd-hackers@freebsd.org Sat Jan 23 21:57:40 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 26BB2A8FB1B for ; Sat, 23 Jan 2016 21:57:40 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::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 B303D163D for ; Sat, 23 Jan 2016 21:57:39 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id b14so29046715wmb.1 for ; Sat, 23 Jan 2016 13:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=2FEjz0se6c9cKpOJeEzfYlHSsoV9rQDhyXytJYARA+s=; b=ITm6sXvV2d3QJr7cGseLxXQ/zuJtg2AM0zkfxfrlhdBSFP+4n4NG82aNcsEvpMtcgT ExMW649RgYvLEJnoVj7RVRmi4JqOCQtyt6lCye8qPiocQMfjb/IujOPTwdFqcJHkUbUM PCf/6GYowFpnK+xSJP2fmunZhkL1m9APM36PXHWP0m9k19BlY6pYpsTPrWJYW5UV+712 jd0DwPLAtW3/dBENKKMbol293tPVa3pvvV7VLxZHBZ+0UO5S30EhYDNyDcGnLXP6wdns QIO2HVLVQzo19rLXRLlhVB8A/mgERhl2JU8QZOcKoyOxqP1CvLAuPllnrbabeWl8Y9S9 tYVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=2FEjz0se6c9cKpOJeEzfYlHSsoV9rQDhyXytJYARA+s=; b=aupEVWMGLfVk/jR94SX5Hax9ScnfJqzUsDL02UAMczkYJn7HA8ALShBmAEZkrBE7ee waTgiH20BA8qw6p0EwmE2FWkYcT2bkNz5c8uLdUkEpPAydN9y0ORrrBY/5/ZDgHcJ0cM oEqmC8GLYg5QD4jeq8gzjRYAopIXQXrigRfl99wIyngl5I4eGhGPAGWE92XdCbiH+DOh RXHatTX0KutztUZ0iXi4Spt2VwKZtlVHGnO9xL1JFkYPWjLmAvqX8vxddZCLvxiC9fKG Z2oU5ubJyRl3d9ymPgf36ALe6E0Xq09Rpy2MdEsKSdAtxz34+Z8PaQyE51pVhrPoI73U 4MiQ== X-Gm-Message-State: AG10YOTP+uaWYPmoYksRw7nYWDN5LEHc69g6lNLqg0ZUG0WUnf/JVYC9ofR982bSFK83mQ== X-Received: by 10.194.20.5 with SMTP id j5mr9535902wje.71.1453586258300; Sat, 23 Jan 2016 13:57:38 -0800 (PST) Received: from azdaja.softwarehood.com ([46.240.236.6]) by smtp.gmail.com with ESMTPSA id u4sm11946274wjz.4.2016.01.23.13.57.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jan 2016 13:57:37 -0800 (PST) Subject: Re: Unexpected (at least to me) kevent behavior on window size change when in X To: Slawa Olhovchenkov References: <56A3EDEE.1030400@gmail.com> <56A3F404.7020800@gmail.com> <20160123215231.GO88527@zxy.spb.ru> Cc: freebsd-hackers@FreeBSD.org From: Ivan Radovanovic Message-ID: <56A3F750.6060405@gmail.com> Date: Sat, 23 Jan 2016 22:57:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160123215231.GO88527@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 21:57:40 -0000 On 01/23/2016 22:52, Slawa Olhovchenkov wrote: > On Sat, Jan 23, 2016 at 10:43:32PM +0100, Ivan Radovanovic wrote: > >> On 01/23/2016 22:17, Ivan Radovanovic wrote: >>> >>> The only thing which is out of ordinary is that I am doing this from >>> mono, but still I am directly invoking libc functions from it, so I >>> don't think it can have anything with it. >>> >> >> Definitely it is something mono specific (I would still love to hear if >> somebody has idea what might cause it) - I just wrote little C program >> to test for same thing and everything works as expected. > > May be this is mono mapping EINTR to 0? > I thought something similar, but wouldn't then C also report EINTR on resize (and there is nothing coming through in C program, it just normally waits for FS event)? From owner-freebsd-hackers@freebsd.org Sat Jan 23 22:00: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 824C2A8FBED for ; Sat, 23 Jan 2016 22:00:18 +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 41E391842 for ; Sat, 23 Jan 2016 22:00:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aN6EC-000GSx-1S; Sun, 24 Jan 2016 01:00:16 +0300 Date: Sun, 24 Jan 2016 01:00:15 +0300 From: Slawa Olhovchenkov To: Ivan Radovanovic Cc: freebsd-hackers@FreeBSD.org Subject: Re: Unexpected (at least to me) kevent behavior on window size change when in X Message-ID: <20160123220015.GP88527@zxy.spb.ru> References: <56A3EDEE.1030400@gmail.com> <56A3F404.7020800@gmail.com> <20160123215231.GO88527@zxy.spb.ru> <56A3F750.6060405@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A3F750.6060405@gmail.com> 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.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 22:00:18 -0000 On Sat, Jan 23, 2016 at 10:57:36PM +0100, Ivan Radovanovic wrote: > On 01/23/2016 22:52, Slawa Olhovchenkov wrote: > > On Sat, Jan 23, 2016 at 10:43:32PM +0100, Ivan Radovanovic wrote: > > > >> On 01/23/2016 22:17, Ivan Radovanovic wrote: > >>> > >>> The only thing which is out of ordinary is that I am doing this from > >>> mono, but still I am directly invoking libc functions from it, so I > >>> don't think it can have anything with it. > >>> > >> > >> Definitely it is something mono specific (I would still love to hear if > >> somebody has idea what might cause it) - I just wrote little C program > >> to test for same thing and everything works as expected. > > > > May be this is mono mapping EINTR to 0? > > > > I thought something similar, but wouldn't then C also report EINTR on > resize (and there is nothing coming through in C program, it just > normally waits for FS event)? man signal 28 SIGWINCH discard signal Window size change From owner-freebsd-hackers@freebsd.org Sat Jan 23 22:21:13 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 3806BA8D30E for ; Sat, 23 Jan 2016 22:21:13 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::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 C356D135F for ; Sat, 23 Jan 2016 22:21:12 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id n5so29433074wmn.0 for ; Sat, 23 Jan 2016 14:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=NhWZ+i0qDOTD89qgk1WOb/NXrbxHGBZJHIw60vwwm8I=; b=cYiP1FZWRY/7PvrnuyyRGywbg9upVfOppwO6czMrYlPjcbWBD1mtJX3eT4DCaxCgX7 6ARfSf3L0jB/cMXLw9g0xw2aDo7XcgdX0jtE6G1VFUUoxyZmFAW6mNKmaXhQ4wRQyRKu gV04WCJqadAgV70PzbhdXZKTWCP04WkTfW57l80sxuo1xxhPMFC+vo0hJZKcIxsw29XM aEHbLaQY/5ErgiCw9Vq+BZL8C7+YC/V3JMzphPmsGPy/nNFJwDhdbLq9uLASjN8vx6hd UUwvi69Nglyn8wnXbqEXwnqPPIft0TQVRsYI7LwyQLTvzCUqdvwAi4emj+Gh7XAOfPBy fCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=NhWZ+i0qDOTD89qgk1WOb/NXrbxHGBZJHIw60vwwm8I=; b=Vlon5iTm+xzENPesHhaWwBNsorwi7FR8JpjMbjhA92Djutw+vlcd3oM7mfTd/ffGWs p/x2Ig1kW6uwlD3iH6PfYqZkWdBu6gaqdBi1OG4/qO1KbPxiWaa1lfCm7ZmKRKZL5tVg rjzm/5UPxXC3jy5vxkuldX3CDNP0IDf3CoDNIGKpkeQb6pjk+BZouYcJWRyu7Lk1xp6G yRAh2ryxH9j/qetRfpcIlh4nNLAFP4AUY9WQEOdwGx0TPtqKezGSUvyV+4VAMOgL0yvp rQRSXUQ1JRN5tz7y4MalGnPWA6yf+pO/mWvgcG60xZdUwPmDHXZaHghlpP1St1+Fh9sQ DWiQ== X-Gm-Message-State: AG10YOR+m+JfYfm4OwGsOWeBy8Ezs2FQwUCLIwdDHVtEtIZtSIq/EXIAxy9qzHsDNqkMUA== X-Received: by 10.194.109.231 with SMTP id hv7mr10132951wjb.46.1453587671138; Sat, 23 Jan 2016 14:21:11 -0800 (PST) Received: from azdaja.softwarehood.com ([46.240.236.6]) by smtp.gmail.com with ESMTPSA id y124sm8992216wmg.3.2016.01.23.14.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jan 2016 14:21:10 -0800 (PST) Subject: Re: Unexpected (at least to me) kevent behavior on window size change when in X To: Slawa Olhovchenkov References: <56A3EDEE.1030400@gmail.com> <56A3F404.7020800@gmail.com> <20160123215231.GO88527@zxy.spb.ru> <56A3F750.6060405@gmail.com> <20160123220015.GP88527@zxy.spb.ru> Cc: freebsd-hackers@FreeBSD.org From: Ivan Radovanovic Message-ID: <56A3FCD5.40508@gmail.com> Date: Sat, 23 Jan 2016 23:21:09 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160123220015.GP88527@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 22:21:13 -0000 On 01/23/2016 23:00, Slawa Olhovchenkov wrote: > On Sat, Jan 23, 2016 at 10:57:36PM +0100, Ivan Radovanovic wrote: > >> On 01/23/2016 22:52, Slawa Olhovchenkov wrote: >>> On Sat, Jan 23, 2016 at 10:43:32PM +0100, Ivan Radovanovic wrote: >>> >>>> On 01/23/2016 22:17, Ivan Radovanovic wrote: >>>>> >>>>> The only thing which is out of ordinary is that I am doing this from >>>>> mono, but still I am directly invoking libc functions from it, so I >>>>> don't think it can have anything with it. >>>>> >>>> >>>> Definitely it is something mono specific (I would still love to hear if >>>> somebody has idea what might cause it) - I just wrote little C program >>>> to test for same thing and everything works as expected. >>> >>> May be this is mono mapping EINTR to 0? >>> >> >> I thought something similar, but wouldn't then C also report EINTR on >> resize (and there is nothing coming through in C program, it just >> normally waits for FS event)? > > man signal > > 28 SIGWINCH discard signal Window size change > meaning they changed default action for SIGWINCH, so that cause EINTR to be set on kevent return, and they changed that EINTR to 0... I get it, thanks P.S. it would be interesting to know what else in mono might be broken this way - I can imagine all blocking system calls (probably reads/writes might behave in weird way) - makes me scared