From owner-freebsd-arch@FreeBSD.ORG Thu Dec 27 18:47:15 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02AA1EB6 for ; Thu, 27 Dec 2012 18:47:15 +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 4BE4B8FC15 for ; Thu, 27 Dec 2012 18:47:14 +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 qBRIl5wx046042; Thu, 27 Dec 2012 20:47:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.3 kib.kiev.ua qBRIl5wx046042 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBRIl4Dh046041; Thu, 27 Dec 2012 20:47:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Dec 2012 20:47:04 +0200 From: Konstantin Belousov To: Peter Wemm Subject: Re: UPDATE Re: making use of userland dtrace on FreeBSD Message-ID: <20121227184704.GK82219@kib.kiev.ua> References: <50D49DFF.3060803@ixsystems.com> <50DBC7E2.1070505@mu.org> <50DBD193.7080505@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZQs1kEQY307C4ut" Content-Disposition: inline In-Reply-To: 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" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2012 18:47:15 -0000 --YZQs1kEQY307C4ut Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 26, 2012 at 09:32:45PM -0800, Peter Wemm wrote: > I myself have killed patches that turned out to be premature > optimizations because it actually didn't make any difference. For > example, I never committed the lazy tlb shootdown to AMD64 because it > made things slower on the hardware of the day - opteron silicon had > *hardware* address space tags on their TLB and the lazy shootdown code > just added more synchronization work that just added overhead.. eg: > buildworld was around 2% slower with the patches. Recent Intel CPUs have hardware TLB tags too, but there it is explicit. I have a patch for amd64 pmap which starts using PCID, but the measured effect was non-existent. My guess was that there were two factors. One is the need to do large amount of shootdowns due to buffers creation, hopefully fixed soon. Another one is the Intel only adding instructions to shot the TLB entry in the non-current PCID starting with IvyBridge, so sandy machine which I used to benchmark had to do switch PCID; invlpg; switch PCID back to the current. > >> Of course it wouldn't be required with dwarf unwinding awareness, but > >> we don't have that. > >> > >> We have -fno-omit-frame-pointer on the amd64 kernel whenever debugging > >> is compiled in because there's no unwinder for doing stack traces. We > >> need a dwarf2+ unwinder and somebody to instrument the call frame > >> state through the remaining assembler code. > >> > > How much work is that exactly? I've only been a gdb user, not a hacker. >=20 > gdb has a stack unwinder. kdb/ddb/stack(9) do not. There's well > established GPL code to do it, as well as libunwind and variants. > Basically what this code has to do is run the dwarf2+ state machine to > find all the call/return frames instead of assuming the compiler did > it. Heck, even glibc has a dwarf2 unwinder built into it as part of > their exception processing system. Our libc also calls libgcc unwinder for cancellation. >=20 > I'm not entirely sure what more work src/lib/libelf and > src/lib/libdwarf need. It looks like its got just enough implemented > to support the ctfconvert etc and doesn't have an unwinder in it. BTW, I once sit and did the annotations for the amd64 asm. I had no time to test all the bits, and I know that my hack in siglongjmp to handle the switch to the new stack seamlessly does not work, at least for gdb. http://people.freebsd.org/~kib/misc/amd64_unwind_annotations.1.patch --YZQs1kEQY307C4ut Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ3JenAAoJEJDCuSvBvK1B0QsP/1O6QwzqydH+nN1pcztGEnvB NjXxgTzW5IXb5bN8FuJ4EUNR1zfDIVT6A+i5VYmJO+PmhQScro9B60noIp2Yzuq6 jWJPgsf/ggvcruSpaV95cqdZjGruJ7zlgoa2cf05xven+5kXymV2Wnrmc87TlnbW xWKSjtvteEgtGzKadbdF7m6+iipvX3B1G2OVh5bMO7geQUAjysLj2sT08dvGU6eW v2vGbKcMe+O20EHLGHpBOrTBts0JzwW+vXI1tCPFcUXtVpRmV9Sg2+JbJyGLUk61 9lGoKGv2k1BAjRH/5dOf4TKxqWYOKCp1xa2ZK4uEnf9giVnLgcl5WHFefdpRKA6L +fOuqHtxMnln1BI2vs8MYjtsIeQlyA2XaESK/CKTw5vG3ln3jy1a2sW1EvGEpvt8 CkaHPzaghMpj2ZBKuKSTujKIRibB+oVlFh06AnEJoZyfdHoCjqrs8SCd/IwA7PBY h0KDsNBJlcKeRR8eLaAoTTa85FkdB4yTP8PTV6F1t2TvKl0pcng7yE8i1aDcbX6U gAH5L7vLAOmkTB+WBMayxvcCd4FA7n7kwszdXaw656hKGoTXiFsnDJ1ooJaZUAnu rKihq0zt5UUmZGb2UJeuoklnkaKph7apq6k4MHFM8sCuLbN7IhVwjdG4Eha8iHKl M5V9n/W7gUAaMJPR9ZO4 =s1n7 -----END PGP SIGNATURE----- --YZQs1kEQY307C4ut--