From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 8 00:08:47 2013 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12DA7870; Tue, 8 Jan 2013 00:08:47 +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 80799EAC; Tue, 8 Jan 2013 00:08:46 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id r0808fMG010778; Tue, 8 Jan 2013 02:08:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0808fMG010778 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id r0808e4J010777; Tue, 8 Jan 2013 02:08:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jan 2013 02:08:40 +0200 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: Fast sigblock (AKA rtld speedup) Message-ID: <20130108000840.GA82219@kib.kiev.ua> References: <20130107182235.GA65279@kib.kiev.ua> <50EB3319.6060303@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/SXoEQDAiXmUSAYo" Content-Disposition: inline In-Reply-To: <50EB3319.6060303@mu.org> 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: arch@freebsd.org, toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 00:08:47 -0000 --/SXoEQDAiXmUSAYo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 07, 2013 at 03:42:01PM -0500, Alfred Perlstein wrote: > On 1/7/13 1:22 PM, Konstantin Belousov wrote: > > Below is the forward of the patch for which I failed to obtain a private > > review. Might be, the list generates more responses. > Very cool. >=20 > Sorry for being rusty here, but is it safe to call fuword in the middle= =20 > of issignal()? >=20 > The reason I ask is because it looks like proc lock is required for this= =20 > block, and I forget it fuword(9) can fault. >=20 > If fuword(9) can fault then I don't think you can do this. >=20 > You'll need to use something like fuswintr(9) or wire the page down=20 > using vslock(9) or something. >=20 > I am probably missing something? No, you are completely right. This is a serious bug. Thank you. I was careful to code the td_sigblock_val prefetch etc, but failed to do the update properly. There is no reason to execute the update in the issignal() at all, the setting of the pending bit can be postponed to the moment after the postsig() loop was executed. I uploaded the updated but not yet tested patch at http://people.freebsd.org/~kib/misc/rtld-sigblock.1.patch --/SXoEQDAiXmUSAYo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ62OIAAoJEJDCuSvBvK1B3UwP/AtqY913PEsaOOuAuMCBfgo2 yYoBB/d4xaDzMNglQ6TxTNiqy4tN6Wd3vki38VrW4Kc4QbAmL4Yi+w08D8LkXqQ0 OuwP3PuHz6s9eoSOY+rIkHVhxG624SxnzCiKrSS6X8wT1Mky/dvYH/YsfgkXUTsH gbVJdP7P8jIkst9Rajepq6n9jjHqaWSJZ7JIMrQenVRy/x3PteidWGhL+UjIPBrw pOAXuwsvmr+NSqNhsiPCD7Q7yDOKBz3SALLjI/llc4cr1lC5j9C65bAa7gJKTHWZ Gj0jDz2+GI7CyM18TrUqMNspnh4WqXCSlAzhfsSG5LmS9Zl2FlI0T2UvOxLm9kl4 S5w4YofRVRUIjLyaXtebTGY29HE2mDripJkE6dYnU8sH0t7vShoLSfEvrHalBPNy px/Qtq8pRZWzPrnq/maFXCgqBwSfGEmuRhLX6e8EFHw35rnaN0f4p+cbqArJLpqB GIXksbN19Pre8LQfK4iNJxNqhUd0OniRqMP1qbqBU2/IrDTEmdhnT411fr1Wtvtz N1bLmEgou0Pgm5JC3h+FxbpnevvHaXgJGS01rt5L4GC/yAHmO60qf0KqbyRveMqu rxVaO7g1W+VeRpIxW9MUsk1dtyJosu/+higMc2iI063+YeZcvjRimLFOByHW7FXH BMfeFRMFZV7/ocl1IRdV =7eJr -----END PGP SIGNATURE----- --/SXoEQDAiXmUSAYo--