From owner-freebsd-arch@FreeBSD.ORG Sun Apr 4 18:30:15 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40201106566C for ; Sun, 4 Apr 2010 18:30:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B4C9A8FC13 for ; Sun, 4 Apr 2010 18:30:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o34ICXQH091413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Apr 2010 21:12:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o34ICXut087210; Sun, 4 Apr 2010 21:12:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o34ICXTV087209; Sun, 4 Apr 2010 21:12:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Apr 2010 21:12:33 +0300 From: Kostik Belousov To: Jilles Tjoelker Message-ID: <20100404181233.GH2415@deviant.kiev.zoral.com.ua> References: <20100404175140.GB40499@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ie9RhXlkjyREuElA" Content-Disposition: inline In-Reply-To: <20100404175140.GB40499@stack.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-arch@freebsd.org Subject: Re: so_rcv_sx, deadlkres, SIGSTOP X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 18:30:15 -0000 --ie9RhXlkjyREuElA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 04, 2010 at 07:51:40PM +0200, Jilles Tjoelker wrote: > The SX locks so_snd_sx and so_rcv_sx can be legitimately held for > arbitrary amounts of time, while waiting until a send or recv is > possible. Any other threads wanting to send/recv on the socket will > sleep interruptibly on the corresponding SX. If deadlkres is activated, > it may detect a deadlock even though there is no problem. >=20 > If a SIGSTOP or similar comes in while waiting until send/recv is > possible, the SX is held across the suspension and noone will be able to > send/recv on the socket until the process is resumed. On the other hand > a thread waiting for the SX can be suspended without harm. Adding PBDRY > to various sleeps may help but may also introduce other problems > (SIGSTOP disturbing the functioning of the process more, possibly with > stuff like SO_RCVTIMEO). Could you, please, elaborate on this (interaction between PBDRY and some socket timeout stuff) ? >=20 > Example (using the fact that fifos are implemented using sockets): >=20 > term1% mkfifo testfifo > term1% cat >testfifo >=20 > term2% cat testfifo >=20 > term3% cat testfifo >=20 > Letting this sit for half an hour will trigger deadlkres. >=20 > If the reader in term2 (started first) is suspended, the reader in term3 > will not get any input written to the fifo. >=20 > --=20 > Jilles Tjoelker > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" --ie9RhXlkjyREuElA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAku41pEACgkQC3+MBN1Mb4he3wCg5ANH7iJrD7n3ayYPwB7hVRbY sWwAoMyZhD+fmq1vTWpYK4bzK0kcaD56 =aQm1 -----END PGP SIGNATURE----- --ie9RhXlkjyREuElA--