From owner-freebsd-current@FreeBSD.ORG Tue Apr 23 20:55:40 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F2373C08 for ; Tue, 23 Apr 2013 20:55:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 698331EBA for ; Tue, 23 Apr 2013 20:55:40 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3NKtWLU085760; Tue, 23 Apr 2013 23:55:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3NKtWLU085760 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3NKtW0p085758; Tue, 23 Apr 2013 23:55:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 23 Apr 2013 23:55:32 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: sysvshm: replace Giant with a local sx lock Message-ID: <20130423205532.GE67273@kib.kiev.ua> References: <20130423203823.GA6346@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p1zxN+PsucbyOM2v" Content-Disposition: inline In-Reply-To: <20130423203823.GA6346@dft-labs.eu> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 20:55:41 -0000 --p1zxN+PsucbyOM2v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2013 at 10:38:23PM +0200, Mateusz Guzik wrote: > Hello, >=20 > I would like to replace Giant with a local sx lock in sysvshm code. > Looked really straightforward so maybe I missed something. At very least, the shmget_existing() is no longer functional. The sx is owned around tsleep(), and thus a progress cannot be made by other thread, which needs the same sx lock. Use of the SHMSEG_REMOVED in the shmget_allocate_segment() does not make any sense in your patch, since sleeping malloc allocation owns sx and prevent other threads from finding the segment. I did not looked further. --p1zxN+PsucbyOM2v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRdvVDAAoJEJDCuSvBvK1Bo7oQAJEBB6cUA37saerHX3lIIF18 en6+/VKbNLPybQiAwYuGSeq0U/t2gII/StjPXyBZYMSR6mXBbuxar0N/fyA+jcg4 BI26UM4fHP7k7CfYT6PLIoY/1kf6LIcsih7YwntuRkOgGjBLy+sT3H0p6QFOkW+I gESpPJ03ns2U82nxzClJD2q2apsxicIzOfIH4Z2y2gx9Km7juA5D8xy602B8Klt6 FkXx5e9whC6anjDhQIItEH9MXomYINu3rUh+anhXnYUo/qBq8KsiDE5VfAQT+F0G hIICpAZ+/nKx4XAht2u85poIP/NdP0jjROFbLNWzo+ztsiJB94rEq+pj0Fp+K7do IUtlE2PcVbJjY+5oIiYlnLNmsy0DGRL8Vetg2fh+t+9DLiXEA0Eqx08Hs0amaovq 88JGSepuRTrntj9KOvC7jwIjTJnBHu6XbyJk94NC687/sEJrGJ7+Po8/ru7c3hlO 6VWEtVHqwufMsY1Ktq+y3ypH4FqBcaqxr+iV6h3YBTbPWFMzJ0NFBFdzu8QW5cv+ Kd5jvtpSLwN7mX/ro6X/vwjZ2Jh7hJzqXRcI1jXzhdt7gPQUyckVQ5OboYNkTNWG /XN5eGY3Ka+jhYG87AqGTSw/6PHBMvb9UZSNTw/4p+HttJ9O6okeEPBhGRFed9EU keCb3lobU+vDHVJUDIIY =N6Qs -----END PGP SIGNATURE----- --p1zxN+PsucbyOM2v--